body {
    background-color: #cfbfbf;
    font-family: 'Cormorant Garamond', serif;
}

/* ---- Gallery hero header ---- */
@keyframes hero-focus {
    from { filter: blur(12px); transform: scale(1.04); }
    to   { filter: blur(0);    transform: scale(1); }
}

@keyframes title-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

#gallery-hero {
    position: relative;
    width: 100vw;
    height: 55vh;
    background-image: url('assets/gallery header.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    overflow: hidden;
    animation: hero-focus 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

#gallery-hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

#gallery-hero-title {
    position: absolute;
    bottom: 3rem;
    right: 4rem;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: white;
    margin: 0;
    line-height: 1;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
    animation: title-fade-in 1.2s ease 0.6s both;
}

/* ---- Gallery page layout ---- */
#gallery-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 3rem;
    padding-bottom: 4rem;
    box-sizing: border-box;
}

/* ---- Toggle ---- */
#gallery-toggle {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.toggle-btn {
    background: none;
    border: none;
    border-bottom: 1px solid transparent;
    cursor: pointer;
    color: #654242;
    font-size: 1rem;
    font-family: "Antic Didone", serif;
    font-weight: bold;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    padding: 4px 0;
    opacity: 0.45;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.toggle-btn.active {
    opacity: 1;
    border-bottom-color: #654242;
}

.toggle-btn:hover {
    opacity: 0.85;
}

.toggle-divider {
    color: #654242;
    opacity: 0.4;
    font-size: 0.85rem;
    user-select: none;
}

/* ---- Carousel container ---- */
#carousel-container {
    width: 90vw;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    transition: opacity 0.32s ease;
}

/* ---- Main image ---- */
#main-display {
    width: 100%;
    position: relative;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
}

#main-img {
    width: 100%;
    max-height: 68vh;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

#main-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
    color: white;
    text-align: center;
    padding: 2rem 1rem 0.8rem;
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

#main-display:hover #main-caption {
    opacity: 1;
}

/* ---- Carousel navigation arrows ---- */
#carousel-prev,
#carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: white;
    font-size: 1.6rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    z-index: 10;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    line-height: 1;
}

#carousel-prev { left: 1rem; }
#carousel-next { right: 1rem; }

#main-display:hover #carousel-prev,
#main-display:hover #carousel-next {
    opacity: 1;
}

#carousel-prev:hover,
#carousel-next:hover {
    background: rgba(255, 255, 255, 0.32);
}

/* ---- Thumbnail strip ---- */
#thumb-strip-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #a08080 transparent;
    padding-bottom: 4px;
}

#thumb-strip-wrapper::-webkit-scrollbar {
    height: 4px;
}

#thumb-strip-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

#thumb-strip-wrapper::-webkit-scrollbar-thumb {
    background-color: #a08080;
    border-radius: 2px;
}

#thumb-strip {
    display: flex;
    gap: 0.6rem;
    padding: 0.25rem;
    width: max-content;
}

.thumb-item {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 3px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.18s ease;
}

.thumb-item img {
    display: block;
    height: 88px;
    width: auto;
    object-fit: cover;
}

.thumb-item.active {
    border-color: #654242;
}

.thumb-item:hover {
    transform: scale(1.05);
}

/* ---- Lightbox ---- */
#lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#lightbox.open {
    opacity: 1;
    pointer-events: all;
}

#lightbox-inner {
    max-width: 94vw;
    max-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lightbox-img {
    max-width: 94vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 3px;
    display: block;
}

#lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.75rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 2.4rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

#lightbox-close:hover {
    color: white;
    transform: scale(1.15);
}

/* ---- Responsive ---- */

/* iPad (768px – 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    #gallery-hero {
        height: 45vh;
    }

    #gallery-hero-title {
        font-size: 6rem;
        bottom: 1.5rem;
        right: 2rem;
    }

    .toggle-btn {
        font-size: 0.85rem;
        letter-spacing: 0.25em;
    }

    #gallery-page {
        padding-top: 2.5rem;
        padding-bottom: 3rem;
    }

    #carousel-container {
        width: 94vw;
    }
}

/* Mobile phone (up to 767px) */
@media (max-width: 767px) {
    #gallery-hero {
        height: 40vh;
        background-image: url('assets/gallery-header-mobile.jpg');
    }

    #gallery-hero-title {
        font-size: 3.5rem;
        bottom: 1.25rem;
        right: 1.25rem;
        letter-spacing: 0.08em;
    }

    .toggle-btn {
        font-size: 0.7rem;
        letter-spacing: 0.2em;
    }

    .toggle-divider {
        font-size: 0.75rem;
    }

    #gallery-toggle {
        gap: 0.85rem;
        margin-bottom: 1.75rem;
    }

    #gallery-page {
        padding-top: 1.5rem;
        padding-bottom: 3rem;
    }

    #carousel-container {
        width: 96vw;
    }

    .thumb-item img {
        height: 64px;
    }

    #main-img {
        max-height: 55vw;
    }

    #carousel-prev,
    #carousel-next {
        width: 34px;
        height: 34px;
        font-size: 1.3rem;
        opacity: 0.75;
    }
}