/* =========================
   HERO SECTION
========================= */
.page-hero {
    background: #2f3f5f;
    padding: 80px 0 60px;
    text-align: center;
    color: #fff;
}

    .page-hero h1 {
        font-size: 48px;
        font-weight: 700;
        margin-bottom: 15px;
    }

    .page-hero .breadcrumb {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        font-size: 16px;
    }

        .page-hero .breadcrumb a {
            color: #d0d6e2;
            text-decoration: none;
        }

            .page-hero .breadcrumb a:hover {
                color: #ff6a2f;
            }

        .page-hero .breadcrumb .active {
            color: #ff6a2f;
            font-weight: 500;
        }

        .page-hero .breadcrumb span {
            color: #d0d6e2;
        }

/* Long album titles are truncated in the hero breadcrumb; the full title is the heading below. */
.page-hero .breadcrumb .gallery-breadcrumb-current {
    display: inline-block;
    max-width: min(60vw, 26rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}


/* =========================
   PAGE
========================= */
.gallery-page {
    padding: 60px 0 70px;
    overflow-x: hidden;
}

.gallery-intro {
    text-align: center;
    margin-bottom: 30px;
}

.gallery-title {
    font-size: 36px;
    font-weight: 700;
    color: #0f2d5c;
}

.gallery-subtitle {
    margin: 10px auto 0;
    max-width: 600px;
    color: #555;
}

.gallery-section__header {
    max-width: 920px;
    margin-bottom: 1.4rem;
}

/* The album grid heading on the Gallery page, centred under the page intro. */
.gallery-section__header--albums {
    max-width: none;
    margin: 2.5rem 0 1.75rem;
    text-align: center;
}

.gallery-section__eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0.55rem;
    color: #ff6b35;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gallery-section__title {
    margin: 0;
    color: #0f2d5c;
    font-size: clamp(1.55rem, 3vw, 2.3rem);
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.gallery-album-meta {
    margin: 0.55rem 0 0;
    color: #6b7280;
    font-size: 0.95rem;
}


/* =========================
   PHOTO GRID
========================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.gallery-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(15, 45, 92, 0.1);
    border-radius: 12px;
    background: #f2f4f8;
    box-shadow: 0 10px 24px rgba(15, 45, 92, 0.08);
    cursor: pointer;
}

    /* "contain" keeps every photo whole - result posters and portraits are never cropped - while
       the fixed ratio keeps the grid even. The lightbox shows the full image. */
    .gallery-card img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
        transition: transform 300ms ease;
    }

.gallery-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.65rem;
    background: rgba(15, 45, 92, 0);
    opacity: 0;
    transition: opacity 250ms ease, background-color 250ms ease;
}

.gallery-card:hover img,
.gallery-card:focus-visible img {
    transform: scale(1.04);
}

.gallery-card:hover .gallery-card__overlay,
.gallery-card:focus-visible .gallery-card__overlay {
    background: rgba(15, 45, 92, 0.42);
    opacity: 1;
}

.gallery-card:focus-visible {
    outline: 3px solid #ff6b35;
    outline-offset: 3px;
}

/* Cards waiting behind "Load More". */
.gallery-card[hidden] {
    display: none;
}


/* =========================
   ALBUM CARDS
========================= */
.gallery-album-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.gallery-album-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(15, 45, 92, 0.1);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 45, 92, 0.08);
    color: inherit;
    text-decoration: none;
    transition: transform 250ms ease, box-shadow 250ms ease;
}

    .gallery-album-card:hover,
    .gallery-album-card:focus-visible {
        transform: translateY(-4px);
        box-shadow: 0 18px 34px rgba(15, 45, 92, 0.15);
        color: inherit;
    }

    .gallery-album-card:focus-visible {
        outline: 3px solid #ff6b35;
        outline-offset: 3px;
    }

.gallery-album-card__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f2f4f8;
}

    /* Covers fill the card like the reference site's cards. Anchored to the top so a portrait
       poster keeps its headline. */
    .gallery-album-card__media img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center top;
        transition: transform 300ms ease;
    }

.gallery-album-card:hover .gallery-album-card__media img,
.gallery-album-card:focus-visible .gallery-album-card__media img {
    transform: scale(1.05);
}

.gallery-album-card__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 3.25rem;
    background: linear-gradient(135deg, #1f3557, #2f3f5f);
}

.gallery-album-card__count {
    position: absolute;
    left: 0.75rem;
    bottom: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(15, 45, 92, 0.82);
}

.gallery-album-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.1rem 1.2rem 1.25rem;
}

.gallery-album-card__title {
    display: -webkit-box;
    overflow: hidden;
    color: #0f2d5c;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.gallery-album-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
    color: #ff6b35;
    font-size: 0.92rem;
    font-weight: 700;
}


/* =========================
   ALBUM PAGE
========================= */
.gallery-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    color: #1f3557;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 200ms ease;
}

    .gallery-back-link:hover,
    .gallery-back-link:focus-visible {
        color: #ff6b35;
    }

.gallery-load-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    margin-top: 2.25rem;
}

.gallery-load-more__status {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Matches the site's orange pill buttons (see .send-btn on the Contact page). */
.gallery-load-more__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 14px 30px;
    border-radius: 30px;
    color: #ffffff;
    background: #ff6b35;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 200ms ease;
}

    .gallery-load-more__button:hover,
    .gallery-load-more__button:focus-visible {
        color: #ffffff;
        background: #e85a26;
    }


/* =========================
   VIDEO CARDS
========================= */

/* Videos play inline, so these tiles are wider than the photo tiles. */
.gallery-grid--video {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.gallery-grid + .gallery-grid--video {
    margin-top: 2rem;
}

.gallery-video-card {
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 10px 24px rgba(15, 45, 92, 0.08);
}

    .gallery-video-card iframe,
    .gallery-video-card video {
        display: block;
        width: 100%;
        aspect-ratio: 16 / 9;
        border: 0;
        background: #000;
    }


/* =========================
   LIGHTBOX
========================= */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000; /* above the fixed header (1000) and the mobile menu (1200) */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

    .gallery-lightbox.is-open {
        display: flex;
    }

.gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(8, 16, 32, 0.9);
    cursor: zoom-out;
}

.gallery-lightbox__dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    width: min(1120px, 100%);
    gap: 0.85rem;
}

.gallery-lightbox__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    margin: 0;
}

.gallery-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: 82vh;
    border-radius: 10px;
    object-fit: contain;
    background: #0f1a2e;
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.38);
}

.gallery-lightbox__caption {
    margin-top: 0.8rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.9rem;
    text-align: center;
}

.gallery-lightbox__close,
.gallery-lightbox__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.9rem;
    height: 2.9rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: background-color 200ms ease, transform 200ms ease;
}

.gallery-lightbox__close {
    position: absolute;
    top: -3.4rem;
    right: 0;
}

    .gallery-lightbox__close i,
    .gallery-lightbox__nav i {
        font-size: 1.3rem;
        line-height: 1;
    }

    .gallery-lightbox__close:hover,
    .gallery-lightbox__close:focus-visible,
    .gallery-lightbox__nav:hover,
    .gallery-lightbox__nav:focus-visible {
        background: #ff6b35;
        border-color: #ff6b35;
        transform: translateY(-1px);
        outline: 0;
    }

body.gallery-lightbox-open {
    overflow: hidden;
}


/* =========================
   RESPONSIVE
========================= */

/* Tablet */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .gallery-album-grid,
    .gallery-grid--video {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .gallery-page {
        padding: 40px 0 50px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .gallery-card {
        border-radius: 10px;
    }

    .gallery-section__header--albums {
        margin-top: 2rem;
    }

    .gallery-lightbox {
        padding: 0.85rem;
    }

    .gallery-lightbox__dialog {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .gallery-lightbox__image {
        max-height: 74vh;
    }

    .gallery-lightbox__nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }

        .gallery-lightbox__nav:hover,
        .gallery-lightbox__nav:focus-visible {
            transform: translateY(-50%);
        }

    .gallery-lightbox__nav--prev {
        left: 0.5rem;
    }

    .gallery-lightbox__nav--next {
        right: 0.5rem;
    }

    .gallery-lightbox__close {
        top: 0.5rem;
        right: 0.5rem;
        z-index: 1;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .page-hero {
        padding: 60px 15px 40px;
    }

        .page-hero h1 {
            font-size: 32px;
        }

        .page-hero .breadcrumb {
            font-size: 14px;
        }

    .gallery-title {
        font-size: 28px;
    }

    .gallery-album-grid,
    .gallery-grid--video {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}
