
/* =========================================
   MAX BORN FORUM — GALLERY PAGE
========================================= */

.gallery-page {
    --gallery-bg: #f3f0e9;
    --gallery-text: #1f2925;
    --gallery-muted: #56615a;
    --gallery-gold: #a97b42;
    --gallery-border: #d8d4cb;

    width: 100%;
    padding: 15px 0 110px;

    background: var(--gallery-bg);
    color: var(--gallery-text);
}

.gallery-page__container {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;

    padding-inline: clamp(24px, 5.5vw, 100px);
}

/* =========================================
   BREADCRUMBS
========================================= */

.gallery-page__breadcrumbs ol {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;

    margin: 0;
    padding: 0;

    list-style: none;

    font-family: "Inter", sans-serif;
    font-size: 12px;
}

.gallery-page__breadcrumbs a {
    color: var(--gallery-muted);
    text-decoration: none;
}

.gallery-page__breadcrumbs a:hover {
    color: var(--gallery-gold);
}

/* =========================================
   PAGE HEADER
========================================= */

.gallery-page__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 40px;

    margin: 70px 0 48px;
}

.gallery-page__eyebrow {
    color: var(--gallery-gold);

    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.18em;
}

.gallery-page__title {
    margin: 0;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 60px;
    font-weight: 400;
    line-height: 0.98;
    letter-spacing: -0.03em;
    margin-top: 28px;
}

.gallery-page__description {
    margin: 30px 0 0;

    color: var(--gallery-muted);
    font-family: "Inter", sans-serif;
    font-size: 16px;
    line-height: 1.65;
}

/* NAVIGATION */

.gallery-page__navigation {
    display: flex;
    align-items: center;
    gap: 36px;

    padding-bottom: 10px;
}

.gallery-page__nav-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    padding-bottom: 7px;
    border-bottom: 1px solid currentColor;

    color: var(--gallery-text);
    font-family: "Inter", sans-serif;
    font-size: 14px;
    text-decoration: none;

    transition: color 0.25s ease;
}

.gallery-page__nav-link:hover {
    color: var(--gallery-gold);
}

.gallery-page__nav-count {
    color: var(--gallery-gold);
    font-size: 12px;
}

/* =========================================
   VIDEO GRID
========================================= */

.gallery-page__videos,
.gallery-page__photos {
    scroll-margin-top: var(--header-height, 90px);
}

.gallery-page__videos-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.gallery-page__video {
    position: relative;

    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;

    overflow: hidden;
    background: #27312c;
    color: #fff;

    text-decoration: none;
    cursor: pointer;
}

.gallery-page__video-image {
    display: block;
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform 0.6s ease;
}

.gallery-page__video:hover .gallery-page__video-image {
    transform: scale(1.04);
}

.gallery-page__video-overlay {
    position: absolute;
    inset: 0;

    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.55),
        transparent 45%
    );

    pointer-events: none;
}

.gallery-page__video-index {
    position: absolute;
    top: 24px;
    left: 26px;

    font-family: "Inter", sans-serif;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.gallery-page__video-play {
    position: absolute;
    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    display: flex;
    align-items: center;
    justify-content: center;

    width: 68px;
    height: 68px;

    border-radius: 50%;
    background: #f7f4ee;
    color: #1f2925;

    transition:
        transform 0.25s ease,
        background-color 0.25s ease;
}

.gallery-page__video-play svg {
    width: 26px;
    height: 26px;
    margin-left: 3px;
}

.gallery-page__video:hover .gallery-page__video-play {
    transform: translate(-50%, -50%) scale(1.1);
    background: #fff;
}

.gallery-page__video-title {
    position: absolute;
    left: 26px;
    bottom: 25px;

    color: #fff;
    font-family: "Inter", sans-serif;
    font-size: 17px;
    font-weight: 500;
}

/* =========================================
   PHOTO SECTION
========================================= */

.gallery-page__photos {
    margin-top: 52px;
    padding-top: 52px;

    border-top: 1px solid var(--gallery-border);
}

/* DYNAMIC GRID */

.gallery-page__photos-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));

    column-gap: 22px;
    row-gap: 42px;
}

.gallery-page__photo {
    min-width: 0;
    margin: 0;
}

/* IMAGE */

.gallery-page__photo-link {
    position: relative;

    display: block;
    width: 100%;
    aspect-ratio: 1.48 / 1;

    overflow: hidden;
    background: #dedbd4;

    cursor: zoom-in;
}

.gallery-page__photo-image {
    display: block;
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform 0.5s ease;
}

.gallery-page__photo-link:hover .gallery-page__photo-image {
    transform: scale(1.055);
}

/* ZOOM BUTTON */

.gallery-page__photo-zoom {
    position: absolute;
    right: 12px;
    bottom: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    border-radius: 50%;
    background: #f7f4ee;
    color: #1f2925;

    transition:
        background-color 0.25s ease,
        color 0.25s ease;
}

.gallery-page__photo-zoom svg {
    width: 20px;
    height: 20px;
}

.gallery-page__photo-link:hover .gallery-page__photo-zoom {
    background: #1d2724;
    color: #fff;
}

/* CAPTION */

.gallery-page__photo-caption {
    display: flex;
    align-items: baseline;
    gap: 16px;

    margin-top: 14px;
}

.gallery-page__photo-number {
    flex-shrink: 0;

    color: var(--gallery-gold);
    font-family: "Inter", sans-serif;
    font-size: 11px;
    letter-spacing: 0.12em;
}

.gallery-page__photo-name {
    color: var(--gallery-text);
    font-family: "Inter", sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* EMPTY FOLDERS */

.gallery-page__empty {
    padding: 40px 0;
    color: var(--gallery-muted);
    font-family: "Inter", sans-serif;
    font-size: 14px;
}

/* =========================================
   LIGHTBOX
========================================= */

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

.gallery-page__lightbox {
    width: min(1440px, calc(100vw - 40px));
    max-width: none;
    max-height: calc(100dvh - 40px);

    padding: 0;
    border: 0;

    background: #f7f4ee;
    color: #1f2925;

    overflow: auto;
}

.gallery-page__lightbox::backdrop {
    background: rgba(12, 17, 15, 0.92);
    backdrop-filter: blur(5px);
}

.gallery-page__lightbox-inner {
    padding: 10px 20px;
}

.gallery-page__lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;

    margin-bottom: 20px;
}

.gallery-page__lightbox-title {
    margin: 0;

    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(28px, 3vw, 46px);
    font-weight: 400;
    line-height: 1.1;
}

.gallery-page__lightbox-close {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;
    flex-shrink: 0;

    border: 1px solid #d8d4cb;
    background: transparent;
    color: #1f2925;

    font-size: 30px;
    cursor: pointer;
    margin-left: auto;
}

.gallery-page__lightbox-close:hover {
    background: #1d2724;
    color: #fff;
}

/* IMAGE / VIDEO */

.gallery-page__lightbox-media {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    background: #fff;
}

.gallery-page__lightbox-image {
    display: block;

    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100dvh - 200px);

    object-fit: contain;
}

.gallery-page__lightbox-video {
    display: block;

    width: 100%;
    max-height: calc(100dvh - 160px);
    aspect-ratio: 16 / 9;

    background: #000;
}

.gallery-page__lightbox [hidden] {
    display: none !important;
}

/* LIGHTBOX NAVIGATION */

.gallery-page__lightbox-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    padding-top: 20px;
}

.gallery-page__lightbox-arrow {
    width: 54px;
    height: 42px;

    border: 1px solid #d8d4cb;
    background: transparent;
    color: #1f2925;

    font-size: 24px;
    cursor: pointer;
}

.gallery-page__lightbox-arrow:hover {
    background: #1d2724;
    color: #fff;
}

.gallery-page__lightbox-counter {
    color: #56615a;
    font-family: "Inter", sans-serif;
    font-size: 13px;
    letter-spacing: 0.12em;
}

/* ACCESSIBILITY */

.gallery-page a:focus-visible,
.gallery-page button:focus-visible {
    outline: 2px solid #a97b42;
    outline-offset: 4px;
}

/* =========================================
   TABLET — MAX 1024PX
========================================= */

@media (max-width: 1024px) {

    .gallery-page {
        padding-bottom: 80px;
    }

    .gallery-page__header {
        margin-top: 55px;
    }

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

    .gallery-page__video-play {
        width: 58px;
        height: 58px;
    }
}

/* =========================================
   MOBILE — MAX 740PX
========================================= */

@media (max-width: 740px) {

    .gallery-page {
        padding: 20px 0 64px;
    }

    .gallery-page__container {
        padding-inline: 20px;
    }

    .gallery-page__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 30px;

        margin: 50px 0 36px;
    }

    .gallery-page__eyebrow {
        font-size: 10px;
    }

    .gallery-page__title {
        margin-top: 20px;
        font-size: clamp(60px, 13vw, 85px);
    }

    .gallery-page__description {
        margin-top: 20px;
        font-size: 16px;
    }

    .gallery-page__navigation {
        gap: 24px;
    }

    /* VIDEOS */

    .gallery-page__videos-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gallery-page__video-index {
        top: 16px;
        left: 18px;
    }

    .gallery-page__video-title {
        left: 18px;
        bottom: 18px;
        font-size: 15px;
    }

    /* PHOTOS */

    .gallery-page__photos {
        margin-top: 38px;
        padding-top: 38px;
    }

    .gallery-page__photos-grid {
        column-gap: 14px;
        row-gap: 28px;
    }

    .gallery-page__photo-caption {
        gap: 10px;
    }

    .gallery-page__photo-name {
        font-size: 13px;
    }

    .gallery-page__photo-zoom {
        width: 32px;
        height: 32px;
        right: 8px;
        bottom: 8px;
    }

    /* LIGHTBOX */

    .gallery-page__lightbox {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
    }

    .gallery-page__lightbox-inner {
        padding: 14px;
    }

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

    .gallery-page__lightbox-image {
        max-height: calc(100dvh - 175px);
    }
}

/* =========================================
   SMALL MOBILE — MAX 560PX
========================================= */

@media (max-width: 560px) {

    .gallery-page__photos-grid {
        grid-template-columns: 1fr;
        row-gap: 30px;
    }

    .gallery-page__photo-link {
        aspect-ratio: 1.5 / 1;
    }

    .gallery-page__photo-name {
        font-size: 15px;
    }
}

/* REDUCED MOTION */

@media (prefers-reduced-motion: reduce) {

    .gallery-page__video-image,
    .gallery-page__video-play,
    .gallery-page__photo-image,
    .gallery-page__photo-zoom {
        transition: none;
    }
}
