/* /assets/css/gallery.css */
.page--gallery .site-main {
    padding: 20px;
    box-sizing: border-box;
}

.gallery-page {
    display: grid;
    gap: 24px;
    width: min(100%, 1280px);
    margin: 0 auto;
}

.gallery-page__intro,
.gallery-section {
    position: relative;
    overflow: hidden;
    padding: 28px;
    border: 1px solid rgba(212, 166, 58, 0.16);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(27, 36, 25, 0.84), rgba(10, 13, 10, 0.94)),
        url("/assets/images/header_background.png");
    background-position: center top;
    background-repeat: repeat;
    background-size: 720px auto;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 18px 34px rgba(0, 0, 0, 0.16);
}

.gallery-page__intro::before,
.gallery-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 0%, rgba(212, 166, 58, 0.08), transparent 42%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.18));
    pointer-events: none;
}

.gallery-page__intro > *,
.gallery-section > * {
    position: relative;
    z-index: 1;
}

.gallery-page__eyebrow,
.gallery-section__eyebrow,
.gallery-category__eyebrow {
    margin: 0 0 10px;
    color: #d7b85a;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.24em;
    line-height: 1.2;
    text-transform: uppercase;
}

.gallery-page__title,
.gallery-section__title,
.gallery-category__title {
    margin: 0;
    color: #fff8ea;
    font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    font-weight: 700;
    line-height: 0.98;
}

.gallery-page__title {
    font-size: clamp(2.2rem, 4vw, 3.8rem);
}

.gallery-section__title {
    font-size: clamp(2rem, 3.4vw, 3.5rem);
}

.gallery-category__title {
    font-size: clamp(1.95rem, 3vw, 3rem);
}

.gallery-page__summary,
.gallery-section__summary,
.gallery-section__empty {
    max-width: 720px;
    margin: 14px 0 0;
    color: rgba(247, 233, 205, 0.86);
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.65;
}

.gallery-section__head {
    margin-bottom: 26px;
}

.gallery-category-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 26px;
}

.gallery-category-nav__link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 10px 20px;
    border: 1px solid rgba(212, 166, 58, 0.20);
    border-radius: 999px;
    background: rgba(6, 11, 8, 0.52);
    color: #f3f1e8;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 1rem;
    font-weight: 850;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 10px 20px rgba(0, 0, 0, 0.12);
    transition:
        border-color 180ms ease,
        background 180ms ease,
        color 180ms ease,
        transform 180ms ease;
}

.gallery-category-nav__link:hover,
.gallery-category-nav__link:focus {
    border-color: rgba(212, 166, 58, 0.46);
    background: rgba(45, 47, 24, 0.66);
    color: #fff8ea;
    transform: translateY(-1px);
}

.gallery-category-list {
    display: grid;
    gap: 42px;
}

.gallery-category {
    position: relative;
    padding-top: 34px;
    border-top: 1px solid rgba(212, 166, 58, 0.14);
    scroll-margin-top: 120px;
}

.gallery-category:first-child {
    padding-top: 0;
    border-top: 0;
}

.gallery-category__head {
    display: grid;
    gap: 10px;
    margin-bottom: 22px;
}

.gallery-category__count {
    display: inline-flex;
    width: fit-content;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    margin: 2px 0 0;
    padding: 0 18px;
    border: 1px solid rgba(212, 166, 58, 0.16);
    border-radius: 999px;
    background: rgba(6, 11, 8, 0.50);
    color: #f3f1e8;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 0.92rem;
    font-weight: 850;
    line-height: 1;
}

.gallery-viewer {
    display: grid;
    gap: 14px;
}

.gallery-viewer__hero {
    position: relative;
    width: 100%;
    height: 520px;
    min-height: 520px;
    max-height: 520px;
    border: 1px solid rgba(212, 166, 58, 0.14);
    border-radius: 22px;
    background: rgba(2, 4, 3, 0.86);
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 16px 30px rgba(0, 0, 0, 0.14);
}

.gallery-viewer__hero-open {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.gallery-viewer__hero-frame {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(2, 4, 3, 0.88);
}

.gallery-viewer__hero-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: rgba(2, 4, 3, 0.88);
    opacity: 1;
    transform: scale(1);
    transition:
        opacity 220ms ease,
        transform 220ms ease;
}

.gallery-viewer__hero-image.is-changing {
    opacity: 0.25;
    transform: scale(1.01);
}

.gallery-viewer__hero-overlay {
    position: absolute;
    right: 16px;
    bottom: 16px;
    padding: 8px 13px;
    border: 1px solid rgba(212, 166, 58, 0.24);
    border-radius: 999px;
    background: rgba(12, 13, 9, 0.78);
    color: #f8efdc;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    backdrop-filter: blur(10px);
    pointer-events: none;
}

.gallery-viewer__hero-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid rgba(212, 166, 58, 0.22);
    border-radius: 999px;
    background: rgba(24, 17, 13, 0.82);
    color: #f8efdc;
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
    opacity: 0.96;
    transform: translateY(-50%);
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        background 180ms ease,
        opacity 180ms ease;
}

.gallery-viewer__hero-nav:hover,
.gallery-viewer__hero-nav:focus {
    border-color: rgba(212, 166, 58, 0.42);
    background: rgba(34, 24, 18, 0.92);
    opacity: 1;
}

.gallery-viewer__hero-nav--prev {
    left: 16px;
}

.gallery-viewer__hero-nav--next {
    right: 16px;
}

.gallery-viewer__thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 166, 58, 0.28) rgba(255, 255, 255, 0.04);
    scroll-snap-type: x proximity;
    cursor: grab;
    user-select: none;
}

.gallery-viewer__thumbs.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}

.gallery-viewer__thumbs::-webkit-scrollbar {
    height: 8px;
}

.gallery-viewer__thumbs::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.gallery-viewer__thumbs::-webkit-scrollbar-thumb {
    background: rgba(212, 166, 58, 0.26);
    border-radius: 999px;
}

.gallery-thumb {
    flex: 0 0 auto;
    width: 112px;
    height: 82px;
    padding: 0;
    border: 1px solid rgba(212, 166, 58, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
    cursor: pointer;
    scroll-snap-align: start;
    opacity: 0.80;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        opacity 180ms ease;
}

.gallery-thumb:hover,
.gallery-thumb.is-active {
    opacity: 1;
    border-color: rgba(212, 166, 58, 0.42);
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.16);
}

.gallery-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background: #120d0a;
    pointer-events: none;
}

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

.gallery-grid > .gallery-section {
    height: auto;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    padding: clamp(10px, 2vw, 22px);
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    background: rgba(8, 6, 5, 0.72);
    backdrop-filter: blur(7px);
}

.gallery-lightbox__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 6, 5, 0.72);
}

.gallery-lightbox__dialog {
    position: relative;
    z-index: 1;
    min-height: calc(100dvh - clamp(20px, 4vw, 44px));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 72px 74px;
    box-sizing: border-box;
    touch-action: pan-y;
}

.gallery-lightbox__image-wrap {
    width: min(100%, 1480px);
    min-height: 58dvh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox__image {
    display: block;
    width: auto;
    height: auto;
    max-width: min(96vw, 1480px);
    max-height: 82dvh;
    border-radius: 18px;
    object-fit: contain;
    object-position: center;
    background: #120d0a;
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.34);
}

.gallery-lightbox.is-fullscreen {
    padding: 0;
}

.gallery-lightbox.is-fullscreen .gallery-lightbox__dialog {
    min-height: 100dvh;
    padding: 62px 56px;
}

.gallery-lightbox.is-fullscreen .gallery-lightbox__image-wrap {
    width: 100%;
    min-height: calc(100dvh - 124px);
}

.gallery-lightbox.is-fullscreen .gallery-lightbox__image {
    max-width: 100vw;
    max-height: calc(100dvh - 88px);
    border-radius: 10px;
}

.gallery-lightbox__close,
.gallery-lightbox__full {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    z-index: 3;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(212, 166, 58, 0.28);
    border-radius: 999px;
    background: rgba(24, 17, 13, 0.88);
    color: #f8efdc;
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.24);
}

.gallery-lightbox__close {
    right: max(14px, env(safe-area-inset-right));
}

.gallery-lightbox__full {
    right: calc(max(14px, env(safe-area-inset-right)) + 54px);
    width: auto;
    min-width: 132px;
    height: 44px;
    padding: 0 18px;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.gallery-lightbox__nav {
    position: fixed;
    top: 50%;
    z-index: 2;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid rgba(212, 166, 58, 0.28);
    border-radius: 999px;
    background: rgba(24, 17, 13, 0.88);
    color: #f8efdc;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    transform: translateY(-50%);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.24);
}

.gallery-lightbox__nav--prev {
    left: max(12px, env(safe-area-inset-left));
}

.gallery-lightbox__nav--next {
    right: max(12px, env(safe-area-inset-right));
}

@media (max-width: 980px) {
    .page--gallery .site-main {
        padding: 16px;
    }

    .gallery-page {
        gap: 18px;
    }

    .gallery-page__intro,
    .gallery-section {
        padding: 22px;
        border-radius: 20px;
    }

    .gallery-category-nav {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 22px;
    }

    .gallery-category-nav__link {
        min-height: 54px;
        padding: 10px 16px;
    }

    .gallery-category-list {
        gap: 34px;
    }

    .gallery-category {
        padding-top: 28px;
    }

    .gallery-viewer__hero {
        height: 380px;
        min-height: 380px;
        max-height: 380px;
        border-radius: 20px;
    }

    .gallery-viewer__hero-nav {
        width: 46px;
        height: 46px;
        font-size: 1.15rem;
    }

    .gallery-viewer__hero-nav--prev {
        left: 12px;
    }

    .gallery-viewer__hero-nav--next {
        right: 12px;
    }

    .gallery-lightbox__dialog {
        inset: 12px;
        padding: 12px 48px;
    }

    .gallery-lightbox__backdrop {
        border-radius: 20px;
    }
}

@media (max-width: 640px) {
    .page--gallery .site-main {
        padding: 14px;
    }

    .gallery-page {
        gap: 16px;
    }

    .gallery-page__intro,
    .gallery-section {
        padding: 20px;
        border-radius: 18px;
    }

    .gallery-page__title,
    .gallery-section__title {
        font-size: clamp(2.1rem, 10vw, 3rem);
    }

    .gallery-page__summary,
    .gallery-section__summary,
    .gallery-section__empty {
        font-size: 1rem;
        line-height: 1.62;
    }

    .gallery-category-nav {
        gap: 10px;
        margin-top: 22px;
    }

    .gallery-category-nav__link {
        min-height: 54px;
        padding: 10px 14px;
        font-size: 0.98rem;
        line-height: 1.2;
    }

    .gallery-category-list {
        gap: 32px;
    }

    .gallery-category__title {
        font-size: clamp(2.05rem, 10vw, 3rem);
    }

    .gallery-category__count {
        min-height: 40px;
        padding: 0 16px;
        font-size: 0.9rem;
    }

    .gallery-viewer__hero {
        height: 330px;
        min-height: 330px;
        max-height: 330px;
        border-radius: 18px;
    }

    .gallery-viewer__hero-overlay {
        display: none;
    }

    .gallery-viewer__hero-nav {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .gallery-thumb {
        width: 88px;
        height: 66px;
        border-radius: 12px;
    }

    .gallery-lightbox__dialog {
        padding: 10px 44px;
    }

    .gallery-lightbox__nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .gallery-lightbox__nav--prev {
        left: 3px;
    }

    .gallery-lightbox__nav--next {
        right: 3px;
    }
}

@media (max-width: 420px) {
    .page--gallery .site-main {
        padding: 12px;
    }

    .gallery-page__intro,
    .gallery-section {
        padding: 18px;
        border-radius: 18px;
    }

    .gallery-viewer__hero {
        height: 300px;
        min-height: 300px;
        max-height: 300px;
    }

    .gallery-category-nav__link {
        font-size: 0.94rem;
    }
}

/* 2026-05-25: gallery category tabs show one category at a time */
.gallery-category-nav__link {
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer !important;
}

.gallery-category-nav__link.is-active {
    border-color: rgba(212, 166, 58, 0.58) !important;
    background:
        linear-gradient(180deg, rgba(110, 93, 34, 0.72), rgba(40, 36, 18, 0.72)) !important;
    color: #fff8ea !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 12px 24px rgba(0, 0, 0, 0.18) !important;
}

.gallery-category-list {
    position: relative !important;
    display: block !important;
    min-height: 260px !important;
}

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

.gallery-category {
    border-top: 0 !important;
    padding-top: 0 !important;
    opacity: 0 !important;
    transform: translateY(10px) !important;
    transition:
        opacity 180ms ease,
        transform 180ms ease !important;
}

.gallery-category.is-active {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.gallery-category.is-leaving {
    opacity: 0 !important;
    transform: translateY(6px) !important;
}

.gallery-category-list.is-switching {
    pointer-events: none !important;
}

@media (max-width: 700px) {
    .gallery-category-nav {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .gallery-category-nav__link {
        min-height: 54px !important;
        padding: 10px 16px !important;
    }
}


@media (max-width: 700px) {
    .gallery-lightbox {
        padding: 8px;
    }

    .gallery-lightbox__dialog {
        min-height: calc(100dvh - 16px);
        padding: 66px 18px 76px;
    }

    .gallery-lightbox__image-wrap {
        min-height: 62dvh;
    }

    .gallery-lightbox__image {
        max-width: 96vw;
        max-height: 78dvh;
        border-radius: 16px;
    }

    .gallery-lightbox.is-fullscreen .gallery-lightbox__dialog {
        padding: 60px 8px 70px;
    }

    .gallery-lightbox.is-fullscreen .gallery-lightbox__image {
        max-width: 100vw;
        max-height: calc(100dvh - 82px);
    }

    .gallery-lightbox__close,
    .gallery-lightbox__full {
        width: 42px;
        height: 42px;
    }

    .gallery-lightbox__full {
        right: calc(max(12px, env(safe-area-inset-right)) + 50px);
    }

    .gallery-lightbox__nav {
        top: auto;
        bottom: max(14px, env(safe-area-inset-bottom));
        width: 46px;
        height: 46px;
        transform: none;
    }

    .gallery-lightbox__nav--prev {
        left: 18px;
    }

    .gallery-lightbox__nav--next {
        right: 18px;
    }
}

/* 2026-05-31: true browser fullscreen image viewer */
.gallery-lightbox.is-browser-fullscreen,
.gallery-lightbox:fullscreen,
.gallery-lightbox:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #000 !important;
    backdrop-filter: none !important;
}

.gallery-lightbox.is-browser-fullscreen .gallery-lightbox__backdrop,
.gallery-lightbox:fullscreen .gallery-lightbox__backdrop,
.gallery-lightbox:-webkit-full-screen .gallery-lightbox__backdrop {
    background: #000 !important;
}

.gallery-lightbox.is-browser-fullscreen .gallery-lightbox__dialog,
.gallery-lightbox:fullscreen .gallery-lightbox__dialog,
.gallery-lightbox:-webkit-full-screen .gallery-lightbox__dialog {
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    padding: max(54px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)) !important;
}

.gallery-lightbox.is-browser-fullscreen .gallery-lightbox__image-wrap,
.gallery-lightbox:fullscreen .gallery-lightbox__image-wrap,
.gallery-lightbox:-webkit-full-screen .gallery-lightbox__image-wrap {
    width: 100% !important;
    min-height: calc(100vh - 64px) !important;
}

.gallery-lightbox.is-browser-fullscreen .gallery-lightbox__image,
.gallery-lightbox:fullscreen .gallery-lightbox__image,
.gallery-lightbox:-webkit-full-screen .gallery-lightbox__image {
    max-width: 100vw !important;
    max-height: calc(100vh - 64px) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
}

.gallery-lightbox.is-browser-fullscreen .gallery-lightbox__close,
.gallery-lightbox.is-browser-fullscreen .gallery-lightbox__full,
.gallery-lightbox:fullscreen .gallery-lightbox__close,
.gallery-lightbox:fullscreen .gallery-lightbox__full,
.gallery-lightbox:-webkit-full-screen .gallery-lightbox__close,
.gallery-lightbox:-webkit-full-screen .gallery-lightbox__full {
    top: max(8px, env(safe-area-inset-top)) !important;
}

.gallery-lightbox.is-browser-fullscreen .gallery-lightbox__nav--prev,
.gallery-lightbox:fullscreen .gallery-lightbox__nav--prev,
.gallery-lightbox:-webkit-full-screen .gallery-lightbox__nav--prev {
    left: max(8px, env(safe-area-inset-left)) !important;
}

.gallery-lightbox.is-browser-fullscreen .gallery-lightbox__nav--next,
.gallery-lightbox:fullscreen .gallery-lightbox__nav--next,
.gallery-lightbox:-webkit-full-screen .gallery-lightbox__nav--next {
    right: max(8px, env(safe-area-inset-right)) !important;
}
