/* ==========================================================================
   BASE STYLES & TYPOGRAPHY (From Original)
   ========================================================================== */
body {
    font-family: "Comic Sans MS", sans-serif;
    font-size: large;
    background-color: #99FF99; /* Original Green */
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4 {
    margin-top: 0px;
    padding-top: 0px;
    text-align: center;
}

p {
    line-height: 1.4;
}

a {
    text-decoration: none;
}

/* ==========================================================================
   MAIN PAGE LAYOUT (Modernized for Mobile)
   ========================================================================== */
#wrapper {
    max-width: 1000px; 
    margin: 0; 
    background-color: #99FF99;
}

.content-row {
    display: flex; 
    min-height: 100vh;
}

.content-navbar {
    background-color: red; 
    width: 230px; 
    flex-shrink: 0;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center; 
    
    /* NEW STICKY SIDEBAR RULES */
    position: sticky;
    top: 0; /* Locks the bar to the top of the screen */
    align-self: flex-start; /* Ensures the bar doesn't stretch infinitely */
    max-height: 100vh; /* Limits the sidebar to the height of the monitor */
    overflow-y: auto; /* Adds a scrollbar to the red bar ONLY if the monitor is very short */
}

.content-data {
    flex-grow: 1;
    padding: 0 20px 10px 20px;
    text-align: justify;
    max-width: 100%;
    box-sizing: border-box;
}

/* ==========================================================================
   MODERN MASTHEAD LAYOUT (Preserving Original Colors & Heights)
   ========================================================================== */
.masthead-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: red; 
    height: 140px; 
    margin: 0;
    padding: 0 20px;
}

.masthead-img {
    width: 200px; 
    height: 100px; 
    object-fit: contain; 
}

.masthead-title h2 {
    margin: 0;
    text-align: center;
    color: black;
}

/* ==========================================================================
   FOOTER (Preserving Original Colors)
   ========================================================================== */
#footer {
    background-color: red; 
    padding: 20px;
    text-align: center; 
    clear: both;
    width: 100%;
    box-sizing: border-box;
}

#footer p {
    margin: 0;
    color: black;
    font-size: 1rem;
}

/* ==========================================================================
   NAVIGATION PILL BUTTONS (Pure CSS Replacement)
   ========================================================================== */
a.button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    min-height: 34px; 
    height: auto; 
    margin: 0 auto 8px auto; 
    padding: 5px 10px;
    box-sizing: border-box;
    text-decoration: none;
    color: #444;
    font: normal 16px arial, sans-serif;
    text-align: center;
    
    background: linear-gradient(to bottom, #ffffff 0%, #cccccc 100%);
    border: 1px solid #999;
    border-radius: 17px; 
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

a.button span {
    display: block;
    line-height: 1.2;
}

a.button:hover {
    background: linear-gradient(to bottom, #f0f0f0 0%, #bbbbbb 100%);
    cursor: pointer;
}

a.button:active {
    background: linear-gradient(to bottom, #cccccc 0%, #ffffff 100%);
    box-shadow: inset 2px 2px 4px rgba(0,0,0,0.3);
}

/* ==========================================================================
   THE NEW PHOTO GRID SYSTEM
   ========================================================================== */
.photo-block {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    grid-auto-flow: dense; 
    align-items: start; 
    gap: 20px;
    margin-bottom: 30px;
    margin-top: 20px;
}

.layout-2col {
    grid-column: span 1; 
    margin: 0;
}

.layout-2left {
    grid-column: 1; 
    margin: 0;
}

.layout-2right {
    grid-column: 2; 
    margin: 0;
}

.layout-center {
    grid-column: 1 / -1; 
    justify-self: center; 
    width: 65%; 
    margin: 0;
}

.layout-panorama {
    grid-column: 1 / -1; 
    width: 100%;
    margin: 0;
}

.layout-video {
    grid-column: 1 / -1;
    justify-self: center;
    width: 80%;
    margin: 0;
}

.photo-block img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer; 
}

.photo-block figcaption {
    font-size: 0.9em;
    color: #000;
    margin-top: 8px;
    text-align: left;
    padding: 0 15px; 
}

.layout-center figcaption, .layout-video figcaption {
    text-align: center;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS
   ========================================================================== */
@media (max-width: 800px) {
    .content-row {
        flex-direction: column;
    }

    .content-navbar {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr; 
        gap: 10px;
        padding: 15px;
        box-sizing: border-box;
        
        /* OVERRIDES STICKY ON MOBILE SO IT DOESN'T COVER THE SCREEN */
        position: relative; 
        max-height: none; 
        overflow-y: visible;
    }

    a.button {
        width: 100%;
        margin: 0;
    }

    .masthead-container {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 15px;
    }

    .masthead-img {
        height: 70px; 
        width: auto;
    }

    .photo-block {
        display: flex;
        flex-direction: column;
    }
    
    .layout-center, .layout-video {
        width: 100%;
    }
}

/* ==========================================================================
   THE LIGHTBOX OVERLAY
   ========================================================================== */
#lightbox {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); 
    z-index: 9999; 
    justify-content: center;
    align-items: center;
    cursor: pointer; 
}

#lightbox-img {
    max-width: 90vw; 
    max-height: 90vh; 
    object-fit: contain; 
    box-shadow: 0 0 25px rgba(0,0,0,0.8);
}