body {
    margin: 0;
    /* Reset default margin */
    min-height: 100vh;
    /* Ensure body takes full viewport height */
    display: flex;
    flex-direction: column;
    /* Stack children vertically */
    align-items: center;
    /* Center children horizontally */
}

header {
    width: 100%;
    /* Ensure header takes full width */
}

#imageViewerContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    /* Allow the container to take remaining space */
    width: 100%;
    max-width: 1400px;
    /* Nearly full width, capped so it doesn't get absurd on ultrawide screens */
    margin: 0 auto;
    height: 100%;
    /* Full height */
}

#imageViewer {
    position: relative;
    /* Positioning context for the overlapping wrappers below */
    width: 100%;
    /* Full width of container */
    height: 60vh;
    /* Fixed height - every wrapper below sizes off this, so images never
       jump around in size depending on each photo's own aspect ratio */
    overflow: hidden;
    /* Prevent overflow issues */
    padding: 0 10px;
    /* Small padding for edge screens */
}

#imageViewer .imageWrapper {
    position: absolute;
    top: 50%;
    transition: all 0.3s ease;
    /* Smooth transition for image changes */
    cursor: pointer;
    /* Indicate clickability */
    overflow: hidden;
    border-radius: var(--radius, 12px);
    background-color: var(--color-sand-dark, #EFE6D8);
    /* Fills the letterboxing gap left by object-fit: contain below */
}

#imageViewer .imageWrapper.current {
    width: 74%;
    height: 100%;
    left: 13%;
    transform: translateY(-50%);
    z-index: 2;
    /* On top */
    opacity: 1;
    /* Fully visible */
    box-shadow: var(--shadow-soft, 0 6px 24px rgba(0, 0, 0, 0.15));
}

#imageViewer .imageWrapper.previous,
#imageViewer .imageWrapper.next {
    /* Always exactly 70% of the current image's box, in both directions */
    width: 51.8%;
    height: 70%;
    z-index: 1;
    /* Behind current image */
    opacity: 0.45;
    /* Faded "shadow" effect */
    transform: translateY(-50%);
}

#imageViewer .imageWrapper.previous {
    left: -1%;
}

#imageViewer .imageWrapper.next {
    left: 49.2%;
}

/* Click affordance arrows, anchored to the viewer itself so they always sit
   at its edges regardless of how the peeking wrapper underneath is placed */
#imageViewer::before,
#imageViewer::after {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9);
    z-index: 3;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 50%;
}

#imageViewer::before {
    content: '<';
    left: 14px;
}

#imageViewer::after {
    content: '>';
    right: 14px;
}

#previousImage,
#currentImage,
#nextImage {
    display: block;
    width: 100%;
    height: 100%;
    /* Wrapper box itself stays a fixed size - only how the photo fits inside changes */
    margin: 0;
    /* Remove margin to prevent extra spacing */
    object-fit: contain;
    /* Show the whole photo uncropped, letterboxed if its aspect ratio doesn't match the box */
}

#currentDescription {
    margin-top: 10px;
    /* Space above description */
    margin-bottom: 10px;
    /* Space below description */
    text-align: center;
}

#imageProgress {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    /* Space between circles */
    margin-top: 24px;
    /* Push it down a bit below the image viewer */
}

#imageProgress .progressDot {
    width: 10px;
    height: 10px;
    background-color: #a0a0a0;
    /* Light grey for inactive */
    border-radius: 50%;
    /* Circular shape */
    cursor: pointer;
    /* Indicate clickability */
    transition: all 0.3s ease;
    /* Smooth transition */
}

#imageProgress .progressDot.active {
    width: 15px;
    /* Larger for current */
    height: 15px;
    background-color: #404040;
    /* Darker grey for active */
}

#buttonContainer {
    display: flex;
    justify-content: center;
    /* Center buttons horizontally */
    gap: 10px;
    /* Space between buttons */
    margin-top: 20px;
    /* Space above buttons */
    width: 100%;
    /* Full width */
    padding: 0 10px;
    /* Small padding for edge screens */
}

button {
    padding: 10px 20px;
    font-family: var(--font-body, inherit);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    background-color: var(--color-ocean, #4A7B90);
    /* Match headernav.css theme */
    color: white;
    border: none;
    border-radius: var(--radius, 8px);
    transition: background-color 0.2s ease;
}

button:hover:not(:disabled) {
    background-color: var(--color-ocean-dark, #345A6E);
    /* Match headernav.css hover theme */
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Media Queries for Responsiveness */
@media (max-width: 1024px) {

    #imageViewer::before,
    #imageViewer::after {
        font-size: 2rem;
    }

    #imageProgress .progressDot {
        width: 8px;
        height: 8px;
    }

    #imageProgress .progressDot.active {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 768px) {
    #imageViewer .imageWrapper.current {
        width: 78%;
        left: 11%;
        /* Leaves enough of a peek on each side to comfortably tap */
    }

    #imageViewer .imageWrapper.previous,
    #imageViewer .imageWrapper.next {
        /* 70% of the current image's 78% width */
        width: 54.6%;
    }

    #imageViewer .imageWrapper.previous {
        left: -6%;
    }

    #imageViewer .imageWrapper.next {
        left: 51.4%;
    }

    #imageViewer::before,
    #imageViewer::after {
        font-size: 1.5rem;
    }

    #imageProgress .progressDot {
        width: 6px;
        height: 6px;
    }

    #imageProgress .progressDot.active {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    #imageViewer .imageWrapper.current {
        width: 74%;
        left: 13%;
        /* Leaves ~44px+ of tappable peek on each side, even on narrow phones */
    }

    #imageViewer .imageWrapper.previous,
    #imageViewer .imageWrapper.next {
        /* 70% of the current image's 74% width */
        width: 51.8%;
    }

    #imageViewer .imageWrapper.previous {
        left: -4%;
    }

    #imageViewer .imageWrapper.next {
        left: 52.2%;
    }

    #imageViewer::before,
    #imageViewer::after {
        font-size: 1.2rem;
    }

    #imageProgress .progressDot {
        width: 5px;
        height: 5px;
    }

    #imageProgress .progressDot.active {
        width: 8px;
        height: 8px;
    }
}