/* --- 1. UNIVERSAL BOX SIZING --- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: rgb(0,0,0);
    background-color: rgb(255,255,255);
    background-image: url(images/background.jpg); 
}

/* --- GLOBAL THEME --- */
.mstheme {
    nav-banner-image: url(images/banner.gif);
    separator-image: url(images/divider.gif);
    list-style-image: url(images/bullet1.gif);
    navbutton-home-normal: url(images/global.gif);
    navbutton-home-hovered: url(images/home.gif);
}

h1, h2, h3, h4, h5, h6 {
    font-family: Arial, Helvetica, sans-serif;
    color: rgb(0,0,0);
}

a:link { color: rgb(52,107,48); }
a:visited { color: rgb(128,128,128); }
a:active { color: rgb(138,187,119); }

/* --- 2. THE FLEXBOX "CANVAS" ENGINE (The Magic Fix) --- */
/* We tell the table to stop acting like a table and act like a Block */
.layout-table, tbody {
    display: block;
    width: 100%;
}

/* ROW 1: The Header Banner */
.layout-table tr:first-child {
    display: block;
    width: 100%;
}

/* ROW 2: The Main Canvas (Sidebar + Content) */
.layout-table tr:nth-child(2) {
    display: flex;           /* This activates the Modern Layout Engine */
    align-items: flex-start; /* Aligns sidebar and content to the top */
    width: 100%;
}

/* The Sidebar: Rigid, never moves, never shrinks */
.sidebar-cell {
    display: block;
    width: 180px;
    min-width: 180px;       /* FORCE it to stay 180px */
    vertical-align: top;
    background-color: #f4f4f4; 
    padding: 10px;
    flex-shrink: 0;         /* Do not let it shrink */
}

/* The Canvas: Takes all remaining space */
.content-cell {
    display: block;
    flex-grow: 1;           /* Grow to fill the screen */
    
    /* CRITICAL: These two lines fix the "Disappearing Images" bug */
    width: 0;               
    min-width: 0;           
    
    vertical-align: top;
    padding: 20px;
}


/* --- IMAGES --- */
img, video {
    max-width: 100%;
    height: auto;
}

/* --- HEADER BANNER --- */
.header-banner {
    background-image: url(images/banner.gif);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% 100%;
    height: 60px;
    display: block; /* Ensure it behaves as a block */
    text-align: center;
    /* Center the text vertically using line-height instead of table-cell alignment */
    line-height: 60px; 
}

.header-banner h1 {
    margin: 0;
    padding: 0;
    color: white !important;
    font-size: 24px;
    text-shadow: 2px 2px 2px #000000;
    line-height: 60px; /* Match container height */
    display: inline-block; /* Fixes centering */
}

/* --- FOOTER LINKS --- */
.footer-links {
    padding: 15px 0 5px 0;
    font-family: Arial, sans-serif;
    font-size: 14px;
}
.footer-links a {
    text-decoration: none;
    color: #4CAF50;
    font-weight: bold;
    margin: 0 10px;
}
.footer-links a:hover {
    text-decoration: underline;
    color: #2E7D32;
}
.separator { color: #ccc; }


/* --- GALLERY ENGINE STYLES --- */

/* 1. MASONRY GRID */
.masonry-grid {
    column-count: 3;           
    column-gap: 15px;          
    width: 100%;
}

.masonry-item {
    break-inside: avoid;       
    margin-bottom: 15px;
    text-align: center; 
}

.masonry-item img {
    width: 100%;
    max-width: 500px; /* Cap size for aesthetics */
    height: auto;              
    border-radius: 6px;
    display: block;
    margin: 0 auto;
    cursor: zoom-in;           
}

/* Tablet Adjustment */
@media (max-width: 1000px) {
    .masonry-grid {
        column-count: 2;
    }
}

/* Mobile Adjustment - Still side-by-side, but 1 column of photos */
@media (max-width: 700px) {
    .masonry-grid {
        column-count: 1;
    }
    .content-cell {
        padding: 10px; /* Less padding on small screens */
    }
}

/* 2. SWIPER SLIDESHOW */
.swiper {
    width: 100%;
    max-width: 800px; /* Limit max width */
    aspect-ratio: 4 / 3; 
    margin: 20px auto;
    background: #000; /* Ensure black background is visible */
}

.swiper-slide {
    text-align: center;
    background: #000;         
    display: flex;            
    justify-content: center;
    align-items: center;
}

.swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;      
}
/* --- SIDEBAR MENU STYLES --- */

/* The Headers (2004, 2005, etc.) */
.menu-year {
    font-weight: bold;
    color: #333;
    margin-top: 15px;      /* Space above the header */
    margin-bottom: 5px;    /* Space below the header */
    border-bottom: 2px solid #ddd; /* A nice dividing line */
    padding-left: 0;
    list-style: none;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 1px;
}

/* The Sub-Links (Aunt Alice, etc.) */
.sub-link a {
    font-size: 0.9em;      /* Slightly smaller text */
    color: #555 !important;
    padding-left: 10px;    /* Indent them */
}

/* Hover effect for sub-links */
.sub-link a:hover {
    color: #2E7D32 !important; /* Green hover */
    text-decoration: underline;
}