/* =========================================================
   THE ARC RESIDENCE — GALLERY PAGE
   Dedicated gallery layout + filters + fullscreen lightbox.
========================================================= */
/* =========================================================
   ОБЩИЕ НАСТРОЙКИ СТРАНИЦЫ
========================================================= */
.gallery-page {
    background: radial-gradient(circle at 91% 12%, rgba(189, 139, 54, .045), transparent 26rem), linear-gradient(180deg, #fffefa 0%, #fcf8f2 52%, #fffefa 100%);
}

.gallery-page .desktop-nav a.is-current, .gallery-page .mobile-menu nav a.is-current {
    color: var(--gold2);
}

.gallery-page .desktop-nav a.is-current::after {
    transform: scaleX(1);
}

/* ---------------------------------------------------------
HERO
--------------------------------------------------------- */
/* =========================================================
   HERO — ПЕРВЫЙ ЭКРАН
========================================================= */
.gallery-hero {
    position: relative;
    isolation: isolate;
    width: min(calc(100% - 48px), 1760px);
    min-height: clamp(330px, 27vw, 455px);
    margin: 24px auto 0;
    overflow: hidden;
    border: 1px solid rgba(157, 111, 39, .15);
    border-radius: 22px;
    background: #9b8b7a;
    box-shadow: 0 24px 62px rgba(45, 34, 24, .10);
}

.gallery-hero__image {
    position: absolute;
    inset: 0;
    z-index: -3;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 52%;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    transform: scale(1.012);
}

.gallery-hero__shade {
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(22, 18, 14, .74) 0%, rgba(22, 18, 14, .46) 34%, rgba(22, 18, 14, .11) 72%, rgba(22, 18, 14, .16) 100%), linear-gradient(180deg, rgba(20, 16, 13, .08), rgba(20, 16, 13, .19));
}

.gallery-hero__inner {
    min-height: inherit;
    padding: clamp(55px, 5vw, 82px) clamp(38px, 5.3vw, 92px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.gallery-breadcrumb {
    display: flex;
    align-items: center;
    gap: 13px;
    color: rgba(255, 255, 255, .82);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.gallery-breadcrumb span {
    width: 38px;
    height: 1px;
    background: rgba(231, 201, 141, .80);
}

.gallery-breadcrumb strong {
    color: #ead09a;
    font: inherit;
}

.gallery-hero h1 {
    margin-top: 18px;
    color: #fff;
    font: 500 clamp(56px, 5.8vw, 92px) / .95 "Playfair Display", "Noto Serif SC", serif;
    letter-spacing: -.035em;
}

.gallery-hero__inner > p {
    max-width: 470px;
    margin-top: 18px;
    color: rgba(255, 255, 255, .86);
    font-size: 13px;
    line-height: 1.72;
}

/* ---------------------------------------------------------
GALLERY SHOWCASE
--------------------------------------------------------- */
/* =========================================================
   ОСНОВНАЯ ГАЛЕРЕЯ
========================================================= */
.gallery-showcase {
    position: relative;
    isolation: isolate;
    padding: clamp(84px, 7vw, 118px) 0 clamp(92px, 7vw, 126px);
    overflow: hidden;
}

.gallery-showcase::before {
    content: "GALLERY";
    position: absolute;
    left: 50%;
    bottom: -0.14em;
    z-index: -1;
    transform: translateX(-50%);
    color: rgba(189, 139, 54, .035);
    font: 500 clamp(120px, 18vw, 310px) / 1 "Playfair Display", serif;
    letter-spacing: .08em;
    white-space: nowrap;
    pointer-events: none;
}

.gallery-showcase__inner {
    position: relative;
    z-index: 2;
}

.gallery-showcase__head {
    display: grid;
    grid-template-columns: minmax(400px, .78fr) minmax(620px, 1.22fr);
    gap: clamp(52px, 6vw, 105px);
    align-items: end;
}

.gallery-showcase__intro {
    max-width: 620px;
}

.gallery-showcase__intro h2 {
    max-width: 560px;
    margin-top: 16px;
    color: #2d2721;
    font: 500 clamp(48px, 4.4vw, 72px) / 1 "Playfair Display", "Noto Serif SC", serif;
    letter-spacing: -.032em;
}

.gallery-showcase__intro p {
    max-width: 580px;
    margin-top: 19px;
    color: #6d6359;
    font-size: 12px;
    line-height: 1.78;
}

.gallery-filters {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.gallery-filters button {
    min-width: 126px;
    min-height: 43px;
    padding: 0 18px;
    border: 1px solid rgba(157, 111, 39, .18);
    border-radius: 999px;
    color: #62584f;
    background: rgba(255, 254, 250, .76);
    font-size: 9px;
    font-weight: 500;
    white-space: nowrap;
    transition: color .25s ease, background .25s ease, border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.gallery-filters button:hover {
    color: var(--gold2);
    border-color: rgba(189, 139, 54, .42);
    transform: translateY(-1px);
}

.gallery-filters button.active {
    color: #fff;
    border-color: #bd8b36;
    background: linear-gradient(135deg, #c4933f, #ad752b);
    box-shadow: 0 10px 24px rgba(157, 111, 39, .13);
}

/* ---------------------------------------------------------
MOSAIC
--------------------------------------------------------- */
.gallery-mosaic {
    margin-top: clamp(42px, 4.6vw, 68px);
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: 115px;
    grid-auto-flow: dense;
    gap: 12px;
}

.gallery-card {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(157, 111, 39, .14);
    border-radius: 16px;
    background: #eee5d9;
    box-shadow: 0 17px 42px rgba(53, 40, 27, .08);
    cursor: pointer;
    animation: galleryCardIn .52s cubic-bezier(.22, 1, .36, 1) both;
}

.gallery-card:nth-child(8n + 1) {
    grid-column: span 4;
    grid-row: span 4;
}

.gallery-card:nth-child(8n + 2) {
    grid-column: span 3;
    grid-row: span 2;
}

.gallery-card:nth-child(8n + 3) {
    grid-column: span 3;
    grid-row: span 4;
}

.gallery-card:nth-child(8n + 4) {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-card:nth-child(8n + 5) {
    grid-column: span 3;
    grid-row: span 2;
}

.gallery-card:nth-child(8n + 6) {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-card:nth-child(8n + 7) {
    grid-column: span 4;
    grid-row: span 3;
}

.gallery-card:nth-child(8n + 8) {
    grid-column: span 4;
    grid-row: span 3;
}

@keyframes galleryCardIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(.988);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    transition: transform .8s cubic-bezier(.22, 1, .36, 1), filter .4s ease;
}

.gallery-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: .58;
    background: linear-gradient(180deg, transparent 50%, rgba(21, 17, 13, .64));
    transition: opacity .3s ease;
    pointer-events: none;
}

.gallery-card::after {
    content: "";
    position: absolute;
    inset: 10px;
    z-index: 1;
    opacity: 0;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 10px;
    transition: opacity .3s ease;
    pointer-events: none;
}

.gallery-card:hover img {
    transform: scale(1.035);
}

.gallery-card:hover::before {
    opacity: .73;
}

.gallery-card:hover::after {
    opacity: 1;
}

.gallery-card__meta {
    position: absolute;
    left: 17px;
    right: 17px;
    bottom: 15px;
    z-index: 3;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    color: #fff;
    pointer-events: none;
}

.gallery-card__meta > span {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.gallery-card__meta small {
    color: #ead09a;
    font-size: 7px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.gallery-card__meta strong {
    max-width: 250px;
    overflow: hidden;
    font: 500 clamp(13px, 1vw, 17px) / 1.2 "Playfair Display", "Noto Serif SC", serif;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-card__zoom {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 50%;
    background: rgba(27, 22, 17, .18);
    backdrop-filter: blur(7px);
}

.gallery-card__zoom svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #fff;
    stroke-width: 1.45;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gallery-showcase__bottom {
    margin-top: 20px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 28px;
}

.gallery-more {
    min-width: 178px;
    min-height: 44px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 1px solid rgba(189, 139, 54, .48);
    border-radius: 999px;
    color: var(--gold2);
    background: rgba(255, 254, 250, .72);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .04em;
    transition: color .25s ease, background .25s ease, transform .25s ease;
}

.gallery-more:hover {
    color: #fff;
    background: #bd8b36;
    transform: translateY(-1px);
}

.gallery-more svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.45;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gallery-more.is-expanded svg {
    transform: rotate(180deg);
}

.gallery-fullscreen-note {
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #83786e;
    font-size: 9px;
    line-height: 1.5;
}

.gallery-fullscreen-note svg {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    fill: none;
    stroke: #b57a28;
    stroke-width: 1.3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------------------------------------------------------
CTA
--------------------------------------------------------- */
/* =========================================================
   CTA НА БРОНИРОВАНИЕ
========================================================= */
.gallery-booking-cta {
    position: relative;
    isolation: isolate;
    padding: 72px 0 82px;
    overflow: hidden;
    border-top: 1px solid rgba(157, 111, 39, .10);
    border-bottom: 1px solid rgba(157, 111, 39, .10);
    background: radial-gradient(circle at 90% 35%, rgba(189, 139, 54, .055), transparent 30rem), linear-gradient(135deg, #fbf6ee, #fffefa);
}

.gallery-booking-cta__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 60px;
    align-items: center;
}

.gallery-booking-cta__inner > div {
    max-width: 850px;
}

.gallery-booking-cta h2 {
    max-width: 800px;
    margin-top: 14px;
    color: #302a25;
    font: 500 clamp(36px, 3.2vw, 54px) / 1.08 "Playfair Display", "Noto Serif SC", serif;
    letter-spacing: -.025em;
}

.gallery-booking-cta p {
    max-width: 670px;
    margin-top: 15px;
    color: #6c6259;
    font-size: 12px;
    line-height: 1.75;
}

.gallery-booking-cta__button {
    min-width: 205px;
    min-height: 54px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid #bd8b36;
    color: #fff;
    background: linear-gradient(135deg, #c4933f, #aa7127);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    box-shadow: 0 13px 27px rgba(157, 111, 39, .14);
    transition: transform .25s ease, box-shadow .25s ease;
}

.gallery-booking-cta__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 33px rgba(157, 111, 39, .19);
}

/* ---------------------------------------------------------
LIGHTBOX
--------------------------------------------------------- */
/* =========================================================
   LIGHTBOX ГАЛЕРЕИ
========================================================= */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 4000;
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s ease, visibility .28s ease;
}

.gallery-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 15, 12, .88);
    backdrop-filter: blur(12px);
}

.gallery-lightbox__panel {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

.gallery-lightbox__figure {
    position: relative;
    width: min(1320px, calc(100% - 180px));
    max-height: calc(100dvh - 80px);
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(231, 201, 141, .25);
    border-radius: 10px;
    background: #17130f;
    box-shadow: 0 35px 100px rgba(0, 0, 0, .42);
    transform: translateY(15px) scale(.985);
    transition: transform .35s cubic-bezier(.22, 1, .36, 1);
}

.gallery-lightbox.active .gallery-lightbox__figure {
    transform: none;
}

.gallery-lightbox__figure > img {
    width: 100%;
    height: min(76dvh, 820px);
    object-fit: contain;
    background: #17130f;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.gallery-lightbox__figure figcaption {
    min-height: 74px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid rgba(231, 201, 141, .16);
    color: #fff;
    background: #201a15;
}

.gallery-lightbox__figure figcaption > div {
    display: grid;
    gap: 5px;
}

.gallery-lightbox__figure figcaption > div span {
    color: #d7b576;
    font-size: 7px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.gallery-lightbox__figure figcaption strong {
    font: 500 18px / 1.2 "Playfair Display", "Noto Serif SC", serif;
}

.gallery-lightbox__figure figcaption > p {
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, .78);
    font: 500 12px "Manrope", sans-serif;
}

.gallery-lightbox__figure figcaption > p i {
    width: 24px;
    height: 1px;
    background: rgba(231, 201, 141, .55);
}

.gallery-lightbox__close, .gallery-lightbox__nav {
    position: absolute;
    z-index: 7;
    display: grid;
    place-items: center;
    border: 1px solid rgba(231, 201, 141, .34);
    border-radius: 50%;
    color: #fff;
    background: rgba(32, 26, 21, .66);
    backdrop-filter: blur(10px);
    transition: color .22s ease, background .22s ease, border-color .22s ease, transform .22s ease;
}

.gallery-lightbox__close:hover, .gallery-lightbox__nav:hover {
    color: #2a221a;
    border-color: #e7c98d;
    background: #e7c98d;
}

.gallery-lightbox__close {
    top: 24px;
    right: 26px;
    width: 46px;
    height: 46px;
}

.gallery-lightbox__nav {
    top: 50%;
    width: 54px;
    height: 54px;
    transform: translateY(-50%);
}

.gallery-lightbox__nav:hover {
    transform: translateY(-50%) scale(1.04);
}

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

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

.gallery-lightbox__close svg, .gallery-lightbox__nav svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.45;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Booking popup: 4 apartment types on desktop. */
.gallery-page .booking-apartment-types {
    grid-template-columns: repeat(4, 1fr);
}

.gallery-page .rental-switch label.is-disabled {
    opacity: .42;
    pointer-events: none;
}

.gallery-page .rental-switch label.is-disabled span {
    color: #9b9187 !important;
    border-color: rgba(157, 111, 39, .13) !important;
    background: #f3eee6 !important;
}

.gallery-page .booking-summary__image img {
    object-fit: cover;
}

/* ---------------------------------------------------------
RESPONSIVE
--------------------------------------------------------- */
@media (max-width: 1280px) {
    .gallery-showcase__head {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .gallery-filters {
        justify-content: flex-start;
    }
    .gallery-mosaic {
        grid-auto-rows: 96px;
    }
    .gallery-page .booking-apartment-types {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 980px) {
    .gallery-hero {
        width: calc(100% - 28px);
        margin-top: 14px;
        min-height: 380px;
    }
    .gallery-mosaic {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        grid-auto-rows: 105px;
    }
    .gallery-card:nth-child(n) {
        grid-column: span 3;
        grid-row: span 3;
    }
    .gallery-card:nth-child(5n + 1) {
        grid-column: span 6;
        grid-row: span 4;
    }
    .gallery-booking-cta__inner {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .gallery-booking-cta__button {
        width: min(100%, 260px);
    }
    .gallery-lightbox__figure {
        width: calc(100% - 112px);
    }
    .gallery-lightbox__nav--prev {
        left: 18px;
    }
    .gallery-lightbox__nav--next {
        right: 18px;
    }
}

@media (max-width: 700px) {
    .gallery-hero {
        width: calc(100% - 18px);
        min-height: 410px;
        border-radius: 15px;
    }
    .gallery-hero__image {
        object-position: 42% center;
    }
    .gallery-hero__inner {
        padding: 46px 24px;
        justify-content: flex-end;
    }
    .gallery-hero h1 {
        font-size: clamp(54px, 18vw, 72px);
    }
    .gallery-hero__inner > p {
        max-width: 330px;
        font-size: 11px;
    }
    .gallery-showcase {
        padding: 68px 0 76px;
    }
    .gallery-showcase__intro h2 {
        font-size: clamp(42px, 13vw, 58px);
    }
    .gallery-showcase__intro p {
        font-size: 11px;
        line-height: 1.72;
    }
    .gallery-filters {
        margin-right: calc(var(--pad) * -1);
        padding-right: var(--pad);
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }
    .gallery-filters::-webkit-scrollbar {
        display: none;
    }
    .gallery-filters button {
        min-width: 128px;
        flex: 0 0 auto;
    }
    .gallery-mosaic {
        margin-top: 34px;
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 150px;
        gap: 8px;
    }
    .gallery-card:nth-child(n) {
        grid-column: span 1;
        grid-row: span 2;
        border-radius: 12px;
    }
    .gallery-card:nth-child(4n + 1) {
        grid-column: 1 / -1;
        grid-row: span 2;
    }
    .gallery-card__meta {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
    .gallery-card__meta strong {
        max-width: 150px;
        font-size: 13px;
    }
    .gallery-card__zoom {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }
    .gallery-showcase__bottom {
        grid-template-columns: 1fr;
        gap: 17px;
    }
    .gallery-more {
        width: 100%;
    }
    .gallery-fullscreen-note {
        align-items: flex-start;
    }
    .gallery-booking-cta {
        padding: 60px 0 66px;
    }
    .gallery-booking-cta h2 {
        font-size: 38px;
    }
    .gallery-booking-cta__button {
        width: 100%;
    }
    .gallery-lightbox__figure {
        width: calc(100% - 18px);
        max-height: calc(100dvh - 18px);
    }
    .gallery-lightbox__figure > img {
        height: 70dvh;
    }
    .gallery-lightbox__figure figcaption {
        min-height: 84px;
        padding: 13px 14px;
    }
    .gallery-lightbox__figure figcaption strong {
        font-size: 15px;
    }
    .gallery-lightbox__nav {
        top: auto;
        bottom: 104px;
        width: 42px;
        height: 42px;
    }
    .gallery-lightbox__nav:hover {
        transform: none;
    }
    .gallery-lightbox__nav--prev {
        left: 16px;
    }
    .gallery-lightbox__nav--next {
        right: 16px;
    }
    .gallery-lightbox__close {
        top: 14px;
        right: 14px;
        width: 42px;
        height: 42px;
    }
    .gallery-page .booking-apartment-types {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 430px) {
    .gallery-mosaic {
        grid-auto-rows: 126px;
    }
    .gallery-card:nth-child(n) {
        grid-row: span 2;
    }
    .gallery-card:nth-child(4n + 1) {
        grid-row: span 2;
    }
    .gallery-lightbox__figure figcaption > p {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-card, .gallery-card img, .gallery-lightbox, .gallery-lightbox__figure, .gallery-filters button, .gallery-more, .gallery-booking-cta__button {
        animation: none !important;
        transition: none !important;
    }
}

/* =========================================================
   GALLERY V2 — FULLSCREEN CINEMATIC HERO + LIGHTBOX FIX
========================================================= */
/*
Hero now uses the exact same shared .hero--intro / .hero-intro
system as Main / About / Apartments / Infrastructure.
*/
.gallery-page .gallery-cinematic-hero {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.gallery-page .gallery-cinematic-hero .hero__image {
    object-position: center 52%;
}

.gallery-page .gallery-cinematic-hero + .gallery-showcase {
    border-top: 0;
}

.gallery-page .hero-intro__phrase {
    max-width: min(840px, 78vw);
}

html[lang="zh"] .gallery-page .hero-intro__phrase, html[lang="zh-CN"] .gallery-page .hero-intro__phrase {
    font-family: "Noto Serif SC", serif;
    font-style: normal;
    line-height: 1.12;
    letter-spacing: -.03em;
}

/* ---------------------------------------------------------
LIGHTBOX — FIX
Explicit stacking contexts prevent backdrop-filter from
covering/blurring the actual opened photograph.
--------------------------------------------------------- */
.gallery-lightbox {
    isolation: isolate;
}

.gallery-lightbox__backdrop {
    z-index: 0;
}

.gallery-lightbox__panel {
    z-index: 2;
}

.gallery-lightbox__figure {
    z-index: 3;
    width: min(1320px, calc(100% - 180px));
    height: min(90dvh, 920px);
    max-height: calc(100dvh - 46px);
    grid-template-rows: minmax(0, 1fr) auto;
    background: #15120f;
}

.gallery-lightbox__figure > img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    object-position: center;
    opacity: 1;
    visibility: visible;
    background: #15120f;
}

.gallery-lightbox__figure > img.is-error {
    background: radial-gradient(circle at 50% 50%, rgba(189,139,54,.08), transparent 28rem), #15120f;
}

.gallery-lightbox__figure figcaption {
    position: relative;
    z-index: 2;
}

.gallery-lightbox__close, .gallery-lightbox__nav {
    z-index: 8;
}

/* Tablet */
@media (max-width: 980px) {
    .gallery-page .gallery-cinematic-hero .hero__image {
        object-position: center center;
    }
    .gallery-lightbox__figure {
        width: calc(100% - 108px);
        height: min(88dvh, 860px);
    }
}

/* Mobile */
@media (max-width: 700px) {
    .gallery-page .gallery-cinematic-hero {
        height: 100svh;
        min-height: 560px;
    }
    .gallery-page .gallery-cinematic-hero .hero__image {
        object-position: 50% center;
    }
    .gallery-page .hero-intro__phrase {
        max-width: 94vw;
    }
    .gallery-lightbox__figure {
        width: calc(100% - 14px);
        height: calc(100dvh - 14px);
        max-height: calc(100dvh - 14px);
        border-radius: 8px;
    }
    .gallery-lightbox__figure > img {
        height: 100%;
        min-height: 0;
    }
    .gallery-lightbox__figure figcaption {
        min-height: 82px;
    }
}

/* =========================================================
   GALLERY V3 — HARD LIGHTBOX LAYOUT RESET
   Fixes conflict with gallery-lightbox rules from main.css.
========================================================= */
/*
IMPORTANT:
main.css already contains another .gallery-lightbox__panel layout
with 3 grid columns for the homepage gallery. Because gallery.html
also loads main.css, those columns remained active and squeezed
this page's lightbox into the left side.
Here we fully reset that inherited layout.
*/
.gallery-page .gallery-lightbox__panel {
    position: absolute;
    inset: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    padding: 30px 92px !important;
    overflow: hidden;
}

.gallery-page .gallery-lightbox__figure {
    position: relative;
    z-index: 4;
    flex: 0 1 auto;
    width: min(1320px, calc(100vw - 184px)) !important;
    max-width: none !important;
    height: min(900px, calc(100dvh - 60px)) !important;
    max-height: none !important;
    margin: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
    overflow: hidden;
    background: #15120f;
}

.gallery-page .gallery-lightbox__figure > img {
    position: relative;
    z-index: 1;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    align-self: stretch;
    justify-self: stretch;
    object-fit: contain !important;
    object-position: center center !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: #15120f;
}

.gallery-page .gallery-lightbox__figure figcaption {
    position: relative;
    z-index: 3;
    width: 100%;
    flex: none;
    box-sizing: border-box;
}

.gallery-page .gallery-lightbox__backdrop {
    z-index: 0;
}

.gallery-page .gallery-lightbox__panel {
    z-index: 2;
}

.gallery-page .gallery-lightbox__close, .gallery-page .gallery-lightbox__nav {
    position: absolute;
    z-index: 10;
}

/* Laptop / tablet */
@media (max-width: 1100px) {
    .gallery-page .gallery-lightbox__panel {
        padding: 24px 68px !important;
    }
    .gallery-page .gallery-lightbox__figure {
        width: calc(100vw - 136px) !important;
        height: calc(100dvh - 48px) !important;
    }
}

/* Phone */
@media (max-width: 700px) {
    .gallery-page .gallery-lightbox__panel {
        display: flex !important;
        padding: max(64px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)) 8px !important;
        align-items: stretch;
        justify-content: stretch;
    }
    .gallery-page .gallery-lightbox__figure {
        flex: 1 1 auto;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        min-width: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        border-radius: 8px;
    }
    .gallery-page .gallery-lightbox__figure > img {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        min-width: 0 !important;
        min-height: 0 !important;
        object-fit: contain !important;
        object-position: center center !important;
    }
    .gallery-page .gallery-lightbox__figure figcaption {
        min-height: 74px;
        padding: 11px 13px;
    }
    .gallery-page .gallery-lightbox__nav {
        top: 50% !important;
        bottom: auto !important;
        width: 42px;
        height: 42px;
        transform: translateY(-50%) !important;
    }
    .gallery-page .gallery-lightbox__nav--prev {
        left: 12px !important;
    }
    .gallery-page .gallery-lightbox__nav--next {
        right: 12px !important;
    }
    .gallery-page .gallery-lightbox__close {
        top: max(12px, env(safe-area-inset-top)) !important;
        right: 12px !important;
    }
}

/* Very small phones */
@media (max-width: 430px) {
    .gallery-page .gallery-lightbox__panel {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
    .gallery-page .gallery-lightbox__figure {
        width: 100% !important;
        max-width: 100% !important;
    }
    .gallery-page .gallery-lightbox__figure figcaption {
        min-height: 68px;
    }
}

/* =========================================================
   MOBILE ADAPTATION — GALLERY PAGE
========================================================= */
@media (max-width: 760px) {
    /* ---------- Hero ---------- */
    .gallery-page .gallery-cinematic-hero {
        min-height: 590px;
    }
    .gallery-page .gallery-cinematic-hero .hero-intro__phrase {
        font-size: clamp(36px, 11vw, 52px);
        line-height: 1.03;
    }
    /* ---------- Showcase heading ---------- */
    .gallery-page .gallery-showcase {
        padding: 66px 0 72px;
    }
    .gallery-page .gallery-showcase__head {
        gap: 24px;
    }
    .gallery-page .gallery-showcase__intro h2 {
        font-size: clamp(38px, 11.5vw, 50px);
    }
    .gallery-page .gallery-showcase__intro p {
        font-size: 12px;
        line-height: 1.78;
    }
    /* ---------- Filters ---------- */
    .gallery-page .gallery-filters {
        width: calc(100% + var(--pad));
        margin-right: calc(var(--pad) * -1);
        padding-right: var(--pad);
        gap: 7px;
    }
    .gallery-page .gallery-filters button {
        min-width: auto;
        min-height: 42px;
        padding: 0 16px;
    }
    /* ---------- Mosaic ---------- */
    .gallery-page .gallery-mosaic {
        margin-top: 30px;
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 145px;
        gap: 7px;
    }
    .gallery-page .gallery-card:nth-child(n) {
        min-width: 0;
        border-radius: 10px;
    }
    .gallery-page .gallery-card__meta strong {
        max-width: 130px;
        font-size: 12px;
    }
    /* ---------- Booking CTA ---------- */
    .gallery-page .gallery-booking-cta {
        padding: 62px 0 68px;
    }
    .gallery-page .gallery-booking-cta h2 {
        font-size: clamp(36px, 10.5vw, 46px);
    }
    .gallery-page .gallery-booking-cta__button {
        min-height: 50px;
    }
    /* ---------- Gallery lightbox ---------- */
    .gallery-page .gallery-lightbox__panel {
        padding: max(58px, env(safe-area-inset-top)) 6px max(6px, env(safe-area-inset-bottom)) !important;
    }
    .gallery-page .gallery-lightbox__figure {
        border-radius: 10px;
    }
    .gallery-page .gallery-lightbox__nav {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 430px) {
    /* ---------- Compact phones ---------- */
    .gallery-page .gallery-mosaic {
        grid-template-columns: 1fr;
        grid-auto-rows: 245px;
    }
    .gallery-page .gallery-card:nth-child(n), .gallery-page .gallery-card:nth-child(4n + 1) {
        grid-column: auto;
        grid-row: auto;
        height: 245px;
    }
    .gallery-page .gallery-card__meta strong {
        max-width: 220px;
    }
}

/* Хлебные крошки на светлом фасаде баннера */
.x-hero__crumbs { text-shadow: 0 1px 10px rgba(18, 16, 13, .75); }
