/* HP Cairo gallery/about
   File: assets/css/gallery-about.css
   Version: 0.1.41
*/

html.hpc-gallery-lock,
html.hpc-gallery-lock body {
    overflow: hidden;
}

.hpc-gallery-about {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin-top: 0;
    background:
        radial-gradient(circle at 50% 0%, rgba(226, 181, 104, 0.06), transparent 34%),
        linear-gradient(180deg, #090403 0%, #0c0705 48%, #050303 100%);
    color: #fff6e5;
    padding: clamp(58px, 6vw, 92px) 0 clamp(72px, 7vw, 108px);
    border-top: 1px solid rgba(232, 190, 115, 0.08);
}

.hpc-gallery-about::before {
    content: "CAIRO";
    position: absolute;
    z-index: -2;
    right: -0.08em;
    top: 10px;
    color: rgba(255, 226, 162, 0.016);
    -webkit-text-stroke: 1px rgba(255, 226, 162, 0.026);
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
    font-size: clamp(96px, 18vw, 280px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.04em;
    pointer-events: none;
}

.hpc-gallery-about__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 0%, rgba(232, 190, 115, 0.10), transparent 28%),
        radial-gradient(circle at 14% 22%, rgba(232, 190, 115, 0.08), transparent 24%),
        radial-gradient(circle at 90% 72%, rgba(232, 190, 115, 0.06), transparent 30%),
        linear-gradient(90deg, rgba(232, 190, 115, 0.05), transparent 20%, transparent 80%, rgba(232, 190, 115, 0.05));
}

.hpc-gallery-about__inner {
    width: min(100% - 72px, 1500px);
    margin: 0 auto;
}

.hpc-gallery-about__head {
    position: relative;
    display: grid;
    justify-items: center;
    text-align: center;
    max-width: 1120px;
    margin: 0 auto 30px;
    padding: 0 clamp(12px, 2vw, 34px);
}

.hpc-gallery-about__head::before {
    content: "";
    display: block;
    width: min(520px, 58vw);
    height: 1px;
    margin: 0 auto 22px;
    background: linear-gradient(90deg, transparent, rgba(232, 190, 115, 0.42), transparent);
    opacity: 0.75;
}

.hpc-gallery-about__kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 14px;
    border: 1px solid rgba(232, 190, 115, 0.18);
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.24);
    color: rgba(255, 226, 162, 0.84);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hpc-gallery-about__title {
    position: relative;
    display: inline-block;
    margin: 0;
    padding-bottom: 14px;
    color: #fffaf0;
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
    font-size: clamp(38px, 3.65vw, 58px);
    font-weight: 750;
    line-height: 1.04;
    letter-spacing: -0.042em;
    text-wrap: balance;
    text-shadow:
        0 5px 28px rgba(0, 0, 0, 0.85),
        0 0 28px rgba(232, 190, 115, 0.10);
}

.hpc-gallery-about__title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: min(360px, 62%);
    height: 1px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, transparent, rgba(255, 226, 162, 0.62), transparent);
}

.hpc-gallery-about__statement {
    position: relative;
    width: min(100%, 820px);
    margin: 18px auto 0;
    display: grid;
    gap: 8px;
    padding: 16px clamp(18px, 3vw, 34px);
    border: 0;
    border-top: 1px solid rgba(232, 190, 115, 0.18);
    border-bottom: 1px solid rgba(232, 190, 115, 0.14);
    border-radius: 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(232, 190, 115, 0.08), transparent 72%),
        linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.24) 18%, rgba(0, 0, 0, 0.24) 82%, transparent);
    box-shadow: none;
}

.hpc-gallery-about__eyebrow {
    color: #f1d39a;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hpc-gallery-about__statement.is-changing {
    animation: hpcGalleryStatementFade 0.22s ease both;
}

@keyframes hpcGalleryStatementFade {
    0% { opacity: 0.45; transform: translateY(3px); }
    100% { opacity: 1; transform: translateY(0); }
}

.hpc-gallery-about__statement p {
    margin: 0;
    color: rgba(255, 244, 223, 0.86);
    font-size: clamp(15px, 1.18vw, 18px);
    font-weight: 600;
    line-height: 1.55;
    text-wrap: balance;
}

.hpc-gallery-about__tabs {
    width: fit-content;
    max-width: 100%;
    margin: 24px auto 0;
    display: flex;
    justify-content: center;
    gap: 9px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.hpc-gallery-about__tabs::-webkit-scrollbar {
    display: none;
}

.hpc-gallery-tab {
    position: relative;
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid rgba(232, 190, 115, 0.13);
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.18);
    color: rgba(255, 244, 223, 0.72);
    font-size: 12.5px;
    font-weight: 850;
    letter-spacing: 0.075em;
    text-transform: uppercase;
    cursor: pointer;
    overflow: hidden;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.hpc-gallery-tab::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 7px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 226, 162, 0.7), transparent);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.hpc-gallery-tab:hover,
.hpc-gallery-tab.is-active {
    color: #fff7df;
    border-color: rgba(255, 226, 162, 0.42);
    background:
        linear-gradient(180deg, rgba(232, 190, 115, 0.13), rgba(232, 190, 115, 0.04)),
        rgba(0, 0, 0, 0.24);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 0 24px rgba(232, 190, 115, 0.10);
}

.hpc-gallery-tab.is-active::after {
    transform: scaleX(1);
}

.hpc-gallery-about__stage {
    position: relative;
    margin-top: clamp(22px, 2.4vw, 34px);
}

.hpc-gallery-panel {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.hpc-gallery-panel.is-active {
    opacity: 1;
    transform: translateY(0);
}

.hpc-gallery-panel__viewport {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.hpc-gallery-panel__track {
    display: flex;
    width: 100%;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.hpc-gallery-page {
    flex: 0 0 100%;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: clamp(390px, 26.2vw, 500px);
    gap: 14px;
    align-items: stretch;
}

.hpc-gallery-card {
    position: relative;
    display: block;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    grid-column: span 4;
    border: 1px solid rgba(232, 190, 115, 0.18);
    border-radius: 4px;
    padding: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 50%, rgba(232, 190, 115, 0.08), transparent 62%),
        linear-gradient(135deg, rgba(232, 190, 115, 0.10), rgba(255, 255, 255, 0.018)),
        rgba(0, 0, 0, 0.32);
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.045),
        0 18px 36px rgba(0, 0, 0, 0.24);
    transform: translateZ(0);
}

.hpc-gallery-card--large,
.hpc-gallery-card--wide,
.hpc-gallery-card--landscape,
.hpc-gallery-card.is-photo-landscape,
.hpc-gallery-card--slot-l6 {
    grid-column: span 6;
}

.hpc-gallery-card--tall,
.hpc-gallery-card--portrait,
.hpc-gallery-card.is-photo-portrait,
.hpc-gallery-card--slot-p3 {
    grid-column: span 3;
}

.hpc-gallery-card--slot-p4 {
    grid-column: span 4;
}

.hpc-gallery-card--square,
.hpc-gallery-card.is-photo-square {
    grid-column: span 4;
}

.hpc-gallery-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background:
        radial-gradient(circle at 50% 50%, rgba(232, 190, 115, 0.06), transparent 68%),
        linear-gradient(180deg, rgba(255, 226, 162, 0.018), rgba(0, 0, 0, 0.06)),
        #0b0706;
    opacity: 0;
    transform: scale(1.035);
    transition: opacity 0.45s ease, transform 0.75s ease;
}

.hpc-gallery-card.is-loaded img {
    opacity: 1;
}

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

.hpc-gallery-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, transparent 42%, rgba(0, 0, 0, 0.58)),
        radial-gradient(circle at 50% 0%, rgba(255, 226, 162, 0.10), transparent 42%);
    opacity: 0.78;
    transition: opacity 0.24s ease;
}

.hpc-gallery-card:hover::before {
    opacity: 0.92;
}

.hpc-gallery-card__loader {
    position: absolute;
    z-index: 0;
    inset: 0;
    background:
        linear-gradient(115deg, transparent 0%, rgba(255, 226, 162, 0.08) 38%, transparent 74%),
        rgba(255, 255, 255, 0.025);
    transform: translateX(-100%);
    animation: hpcGalleryShimmer 1.7s infinite;
}

@keyframes hpcGalleryShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.hpc-gallery-card.is-loaded .hpc-gallery-card__loader,
.hpc-gallery-card.is-error .hpc-gallery-card__loader {
    display: none;
}

.hpc-gallery-card.is-error::after {
    content: "Фото временно недоступно";
    position: absolute;
    z-index: 2;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    color: rgba(255, 244, 223, 0.72);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
    background: rgba(0, 0, 0, 0.24);
}

.hpc-gallery-card__caption {
    position: absolute;
    z-index: 2;
    left: 14px;
    right: 14px;
    bottom: 13px;
    display: flex;
    justify-content: flex-start;
    pointer-events: none;
}

.hpc-gallery-card__caption span {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 0 10px;
    border: 1px solid rgba(255, 226, 162, 0.20);
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.34);
    color: rgba(255, 244, 223, 0.86);
    font-size: 12px;
    font-weight: 850;
    line-height: 1.15;
    text-align: left;
}

.hpc-gallery-panel__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.hpc-gallery-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 40px;
    border: 1px solid rgba(232, 190, 115, 0.22);
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.26);
    color: #f1d39a;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.hpc-gallery-arrow svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.hpc-gallery-arrow:hover {
    color: #fff3d6;
    border-color: rgba(255, 226, 162, 0.52);
    background: rgba(232, 190, 115, 0.08);
}

.hpc-gallery-arrow:disabled {
    opacity: 0.38;
    cursor: default;
}

.hpc-gallery-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    height: 40px;
    color: rgba(255, 244, 223, 0.76);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.hpc-gallery-lightbox {
    position: fixed;
    z-index: 2147483000;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    display: grid;
    place-items: center;
    padding: 34px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 50%, rgba(232, 190, 115, 0.08), transparent 38%),
        rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
    touch-action: manipulation;
}

.hpc-gallery-lightbox[hidden] {
    display: none;
}

.hpc-gallery-lightbox__figure {
    position: relative;
    z-index: 1;
    width: min(100%, 1180px);
    max-height: min(86vh, 820px);
    margin: 0;
    display: grid;
    gap: 14px;
    justify-items: center;
}

.hpc-gallery-lightbox__figure img {
    display: block;
    max-width: 100%;
    max-height: calc(86vh - 70px);
    width: auto;
    height: auto;
    object-fit: contain;
    border: 1px solid rgba(232, 190, 115, 0.24);
    border-radius: 4px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.52);
}

.hpc-gallery-lightbox__figure figcaption {
    color: rgba(255, 244, 223, 0.84);
    font-size: 14px;
    font-weight: 800;
    text-align: center;
}

.hpc-gallery-lightbox__close,
.hpc-gallery-lightbox__arrow {
    position: fixed;
    z-index: 2147483100;
    visibility: visible;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(232, 190, 115, 0.32);
    border-radius: 4px;
    background: rgba(5, 3, 2, 0.72);
    color: #f1d39a;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.hpc-gallery-lightbox__close:hover,
.hpc-gallery-lightbox__arrow:hover {
    color: #fff3d6;
    border-color: rgba(255, 226, 162, 0.58);
    background: rgba(232, 190, 115, 0.10);
}

.hpc-gallery-lightbox__close {
    top: max(18px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));
    width: 48px;
    height: 48px;
}

.hpc-gallery-lightbox__close-icon {
    display: block;
    font-size: 34px;
    font-weight: 300;
    line-height: 1;
    transform: translateY(-1px);
    pointer-events: none;
}

.hpc-gallery-lightbox__arrow {
    top: 50%;
    width: 56px;
    height: 64px;
    transform: translateY(-50%);
}

.hpc-gallery-lightbox__arrow-icon {
    display: block;
    font-size: 46px;
    font-weight: 300;
    line-height: 1;
    transform: translateY(-2px);
    pointer-events: none;
}

.hpc-gallery-lightbox__arrow--prev {
    left: max(18px, env(safe-area-inset-left));
}

.hpc-gallery-lightbox__arrow--next {
    right: max(18px, env(safe-area-inset-right));
}

@media (max-width: 1020px) {
    .hpc-gallery-about__inner {
        width: min(100% - 40px, 980px);
    }

    .hpc-gallery-page {
        grid-template-columns: repeat(8, minmax(0, 1fr));
        gap: 12px;
    }

    .hpc-gallery-card,
    .hpc-gallery-card.is-photo-square {
        grid-column: span 4;
    }

    .hpc-gallery-card--large,
    .hpc-gallery-card--wide,
    .hpc-gallery-card.is-photo-landscape {
        grid-column: span 8;
    }

    .hpc-gallery-card--tall,
    .hpc-gallery-card.is-photo-portrait {
        grid-column: span 4;
    }

    .hpc-gallery-page--variant-a .hpc-gallery-card:nth-child(1),
    .hpc-gallery-page--variant-a .hpc-gallery-card:nth-child(3),
    .hpc-gallery-page--variant-a .hpc-gallery-card:nth-child(5),
    .hpc-gallery-page--variant-a .hpc-gallery-card:nth-child(6),
    .hpc-gallery-page--variant-b .hpc-gallery-card:nth-child(2),
    .hpc-gallery-page--variant-b .hpc-gallery-card:nth-child(3),
    .hpc-gallery-page--variant-b .hpc-gallery-card:nth-child(4),
    .hpc-gallery-page--variant-b .hpc-gallery-card:nth-child(6) {
        aspect-ratio: 3 / 4.1;
        grid-column: span 2;
    }

    .hpc-gallery-page--variant-a .hpc-gallery-card:nth-child(2),
    .hpc-gallery-page--variant-a .hpc-gallery-card:nth-child(4),
    .hpc-gallery-page--variant-b .hpc-gallery-card:nth-child(1),
    .hpc-gallery-page--variant-b .hpc-gallery-card:nth-child(5) {
        aspect-ratio: 1920 / 1281;
        grid-column: span 4;
    }
}

@media (max-width: 640px) {
    .hpc-gallery-about {
        margin-top: 0;
        padding: 48px 0 76px;
    }

    .hpc-gallery-about__inner {
        width: min(100% - 28px, 560px);
    }

    .hpc-gallery-about__head {
        margin-bottom: 20px;
        padding: 0;
    }

    .hpc-gallery-about__head::before {
        width: min(300px, 72vw);
        margin-bottom: 16px;
    }

    .hpc-gallery-about__kicker {
        font-size: 10.5px;
        letter-spacing: 0.11em;
    }

    .hpc-gallery-about__title {
        font-size: clamp(30px, 8.4vw, 40px);
        letter-spacing: -0.045em;
        padding-bottom: 12px;
    }

    .hpc-gallery-about__statement {
        margin-top: 16px;
        gap: 8px;
        padding: 14px 12px 16px;
        background: radial-gradient(ellipse at 50% 0%, rgba(232, 190, 115, 0.08), transparent 76%);
    }

    .hpc-gallery-about__eyebrow {
        font-size: 11px;
    }

    .hpc-gallery-about__statement p {
        font-size: 14px;
        line-height: 1.5;
    }

    .hpc-gallery-about__tabs {
        width: 100%;
        justify-content: flex-start;
        margin-top: 20px;
        padding: 0 0 4px;
    }

    .hpc-gallery-tab {
        min-height: 40px;
        padding: 0 14px;
        font-size: 11.5px;
    }

    .hpc-gallery-page {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .hpc-gallery-card,
    .hpc-gallery-card--tall,
    .hpc-gallery-card.is-photo-portrait,
    .hpc-gallery-card.is-photo-square {
        grid-column: span 1;
    }

    .hpc-gallery-card--large,
    .hpc-gallery-card--wide,
    .hpc-gallery-card.is-photo-landscape {
        grid-column: span 2;
    }

    .hpc-gallery-page--variant-a .hpc-gallery-card:nth-child(1),
    .hpc-gallery-page--variant-a .hpc-gallery-card:nth-child(3),
    .hpc-gallery-page--variant-a .hpc-gallery-card:nth-child(5),
    .hpc-gallery-page--variant-a .hpc-gallery-card:nth-child(6),
    .hpc-gallery-page--variant-b .hpc-gallery-card:nth-child(2),
    .hpc-gallery-page--variant-b .hpc-gallery-card:nth-child(3),
    .hpc-gallery-page--variant-b .hpc-gallery-card:nth-child(4),
    .hpc-gallery-page--variant-b .hpc-gallery-card:nth-child(6) {
        aspect-ratio: 3 / 4.1;
        grid-column: span 1;
    }

    .hpc-gallery-page--variant-a .hpc-gallery-card:nth-child(2),
    .hpc-gallery-page--variant-a .hpc-gallery-card:nth-child(4),
    .hpc-gallery-page--variant-b .hpc-gallery-card:nth-child(1),
    .hpc-gallery-page--variant-b .hpc-gallery-card:nth-child(5) {
        aspect-ratio: 1920 / 1281;
        grid-column: span 2;
    }

    .hpc-gallery-card__caption {
        left: 9px;
        right: 9px;
        bottom: 9px;
    }

    .hpc-gallery-card__caption span {
        min-height: 28px;
        padding: 0 8px;
        font-size: 11px;
    }

    .hpc-gallery-lightbox {
        padding: 18px 18px 76px;
    }

    .hpc-gallery-lightbox__figure img {
        max-height: calc(86vh - 76px);
    }

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

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

    .hpc-gallery-lightbox__arrow--prev {
        left: max(18px, env(safe-area-inset-left));
    }

    .hpc-gallery-lightbox__arrow--next {
        right: max(18px, env(safe-area-inset-right));
    }
}


@media (max-width: 420px) {
    .hpc-gallery-page {
        gap: 8px;
    }

    .hpc-gallery-card__caption span {
        min-height: 26px;
        font-size: 10.5px;
    }

    .hpc-gallery-panel__controls {
        margin-top: 16px;
    }
}


/* v0.1.42: adaptive 2-row gallery patterns. Cards fill rows by slot classes, not by fixed nth-child positions. */
@media (min-width: 1021px) {
    .hpc-gallery-page {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        grid-auto-rows: clamp(390px, 26.2vw, 500px);
    }

    .hpc-gallery-card--slot-l6 {
        grid-column: span 6 !important;
    }

    .hpc-gallery-card--slot-p3 {
        grid-column: span 3 !important;
    }

    .hpc-gallery-card--slot-p4 {
        grid-column: span 4 !important;
    }
}

@media (max-width: 1020px) {
    .hpc-gallery-page {
        grid-template-columns: repeat(8, minmax(0, 1fr));
        grid-auto-rows: clamp(250px, 42vw, 410px);
    }

    .hpc-gallery-card--slot-l6 {
        grid-column: span 8 !important;
    }

    .hpc-gallery-card--slot-p3,
    .hpc-gallery-card--slot-p4 {
        grid-column: span 4 !important;
    }
}

@media (max-width: 640px) {
    .hpc-gallery-page {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: clamp(190px, 58vw, 300px);
    }

    .hpc-gallery-card--slot-l6 {
        grid-column: span 2 !important;
    }

    .hpc-gallery-card--slot-p3,
    .hpc-gallery-card--slot-p4 {
        grid-column: span 1 !important;
    }
}

/* v0.1.70: stable two-row gallery without square slots. */
@media (min-width: 1021px) {
    .hpc-gallery-page {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        grid-template-rows: repeat(2, clamp(280px, 20vw, 390px));
        grid-auto-rows: clamp(280px, 20vw, 390px);
        align-content: start;
        overflow: hidden;
    }

    .hpc-gallery-card--slot-l6 {
        grid-column: span 6 !important;
    }

    .hpc-gallery-card--slot-p3,
    .hpc-gallery-card--slot-p4 {
        grid-column: span 3 !important;
    }

    .hpc-gallery-card--square:not(.hpc-gallery-card--slot-l6):not(.hpc-gallery-card--slot-p3),
    .hpc-gallery-card.is-photo-square:not(.hpc-gallery-card--slot-l6):not(.hpc-gallery-card--slot-p3) {
        grid-column: span 3;
    }
}

@media (max-width: 1020px) {
    .hpc-gallery-page {
        align-content: start;
        overflow: hidden;
    }
}


/* v0.1.71: preserve original photo orientation and remove square-looking slots. */
@media (min-width: 1021px) {
    .hpc-gallery-page {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        grid-template-rows: none !important;
        grid-auto-rows: auto !important;
        align-items: start;
        align-content: start;
        overflow: visible;
    }

    .hpc-gallery-card--slot-l6 {
        grid-column: span 6 !important;
        aspect-ratio: 1600 / 1067;
    }

    .hpc-gallery-card--slot-p3,
    .hpc-gallery-card--slot-p4 {
        grid-column: span 3 !important;
        aspect-ratio: 1200 / 1600;
    }

    .hpc-gallery-card--landscape,
    .hpc-gallery-card.is-photo-landscape {
        aspect-ratio: 1600 / 1067;
    }

    .hpc-gallery-card--portrait,
    .hpc-gallery-card.is-photo-portrait {
        aspect-ratio: 1200 / 1600;
    }
}

.hpc-gallery-card img {
    object-fit: cover;
    background: #0b0706;
}

@media (max-width: 1020px) {
    .hpc-gallery-page {
        grid-template-rows: none !important;
        grid-auto-rows: auto !important;
        align-items: start;
        align-content: start;
        overflow: visible;
    }

    .hpc-gallery-card--slot-l6 {
        aspect-ratio: 1600 / 1067;
    }

    .hpc-gallery-card--slot-p3,
    .hpc-gallery-card--slot-p4 {
        aspect-ratio: 1200 / 1600;
    }
}


@media (max-width: 640px) {
    .hpc-gallery-lightbox__arrow-icon {
        font-size: 40px;
    }

    .hpc-gallery-lightbox__close-icon {
        font-size: 32px;
    }
}


/* v0.1.77: mobile lightbox controls moved to a bottom centered dock */
@media (max-width: 640px) {
    .hpc-gallery-lightbox {
        padding: 18px 14px 96px;
        align-items: center;
    }

    .hpc-gallery-lightbox__figure {
        width: min(100%, 94vw);
        max-height: calc(100dvh - 170px);
        gap: 12px;
    }

    .hpc-gallery-lightbox__figure img {
        max-height: calc(100dvh - 240px);
    }

    .hpc-gallery-lightbox__figure figcaption {
        padding: 0 10px;
        font-size: 13px;
        line-height: 1.35;
    }

    .hpc-gallery-lightbox__close {
        top: max(14px, env(safe-area-inset-top));
        right: max(14px, env(safe-area-inset-right));
        width: 44px;
        height: 44px;
    }

    .hpc-gallery-lightbox__arrow {
        top: auto !important;
        bottom: max(14px, calc(env(safe-area-inset-bottom) + 8px)) !important;
        width: 52px;
        height: 52px;
        transform: none !important;
        border-radius: 6px;
        background: rgba(5, 3, 2, 0.82);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
    }

    .hpc-gallery-lightbox__arrow--prev {
        left: calc(50% - 62px) !important;
        right: auto !important;
    }

    .hpc-gallery-lightbox__arrow--next {
        right: calc(50% - 62px) !important;
        left: auto !important;
    }

    .hpc-gallery-lightbox__arrow-icon {
        font-size: 34px;
        transform: translateY(-1px);
    }
}

/* v0.1.75: robust fixed controls for body-level lightbox */
.hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__close,
.hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__arrow {
    position: fixed !important;
    z-index: 2147483600 !important;
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__close {
    top: 18px !important;
    right: 18px !important;
    left: auto !important;
    bottom: auto !important;
}

.hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__arrow--prev {
    top: 50% !important;
    left: 18px !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
}

.hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__arrow--next {
    top: 50% !important;
    right: 18px !important;
    left: auto !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
}

@media (max-width: 640px) {
    .hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__arrow--prev {
        top: auto !important;
        left: 18px !important;
        right: auto !important;
        bottom: 18px !important;
        transform: none !important;
    }

    .hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__arrow--next {
        top: auto !important;
        right: 18px !important;
        left: auto !important;
        bottom: 18px !important;
        transform: none !important;
    }
}

/* v0.1.76: every gallery screen is limited to two rows; only the last screen may be incomplete. */
@media (min-width: 1021px) {
    .hpc-gallery-page {
        grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
        grid-auto-flow: dense !important;
        grid-auto-rows: auto !important;
        align-items: start !important;
        align-content: start !important;
        overflow: visible !important;
    }

    .hpc-gallery-card--slot-l6 {
        grid-column: span 6 !important;
        aspect-ratio: 1600 / 1067 !important;
    }

    .hpc-gallery-card--slot-p3,
    .hpc-gallery-card--slot-p4 {
        grid-column: span 3 !important;
        aspect-ratio: 1200 / 1600 !important;
    }
}


/* v0.1.78: viewport-pixel fallback for gallery lightbox controls.
   Right controls are positioned from the left edge, not by right:..., so they cannot disappear because of parent/body width conflicts. */
.hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__close {
    top: 18px !important;
    left: calc(100vw - 66px) !important;
    right: auto !important;
    bottom: auto !important;
    width: 48px !important;
    height: 48px !important;
    transform: none !important;
}

.hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__arrow--prev {
    top: calc(50vh - 32px) !important;
    left: 18px !important;
    right: auto !important;
    bottom: auto !important;
    width: 56px !important;
    height: 64px !important;
    transform: none !important;
}

.hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__arrow--next {
    top: calc(50vh - 32px) !important;
    left: calc(100vw - 74px) !important;
    right: auto !important;
    bottom: auto !important;
    width: 56px !important;
    height: 64px !important;
    transform: none !important;
}

@media (max-width: 640px) {
    .hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__close {
        top: 14px !important;
        left: calc(100vw - 60px) !important;
        width: 46px !important;
        height: 46px !important;
    }

    .hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__arrow--prev {
        top: calc(50vh - 28px) !important;
        left: 14px !important;
        bottom: auto !important;
        width: 50px !important;
        height: 56px !important;
    }

    .hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__arrow--next {
        top: calc(50vh - 28px) !important;
        left: calc(100vw - 64px) !important;
        bottom: auto !important;
        width: 50px !important;
        height: 56px !important;
    }
}


/* v0.1.79: mobile gallery lightbox becomes swipe-first, without arrows */
@media (max-width: 640px) {
    .hpc-gallery-lightbox {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100vw !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        padding: max(66px, calc(env(safe-area-inset-top) + 58px)) 14px max(34px, calc(env(safe-area-inset-bottom) + 22px)) !important;
        overflow: hidden !important;
        touch-action: pan-y !important;
    }

    .hpc-gallery-lightbox__figure {
        width: 100% !important;
        max-width: 94vw !important;
        max-height: calc(100dvh - 118px) !important;
        margin: 0 auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 12px !important;
        transform: none !important;
    }

    .hpc-gallery-lightbox__figure img {
        display: block !important;
        width: auto !important;
        height: auto !important;
        max-width: 94vw !important;
        max-height: calc(100dvh - 184px) !important;
        margin: 0 auto !important;
        object-fit: contain !important;
        object-position: center !important;
    }

    .hpc-gallery-lightbox__figure figcaption {
        width: 100% !important;
        padding: 0 12px !important;
        color: rgba(255, 244, 223, 0.88) !important;
        font-size: 13px !important;
        line-height: 1.35 !important;
        text-align: center !important;
    }

    .hpc-gallery-lightbox__close {
        top: max(14px, env(safe-area-inset-top)) !important;
        left: auto !important;
        right: max(14px, env(safe-area-inset-right)) !important;
        bottom: auto !important;
        width: 44px !important;
        height: 44px !important;
        transform: none !important;
    }

    .hpc-gallery-lightbox__arrow,
    .hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__arrow,
    .hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__arrow--prev,
    .hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__arrow--next {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .hpc-gallery-lightbox::after {
        content: "Свайпайте фото влево или вправо";
        position: fixed;
        left: 50%;
        bottom: max(12px, calc(env(safe-area-inset-bottom) + 8px));
        z-index: 2147483200;
        transform: translateX(-50%);
        width: max-content;
        max-width: calc(100vw - 32px);
        padding: 7px 12px;
        border: 1px solid rgba(232, 190, 115, 0.12);
        border-radius: 999px;
        background: rgba(5, 3, 2, 0.58);
        color: rgba(255, 244, 223, 0.58);
        font-size: 11px;
        font-weight: 700;
        line-height: 1;
        letter-spacing: 0.02em;
        pointer-events: none;
    }
}



/* v0.1.80: mobile lightbox centered image + visible bottom arrows + hard hidden protection */
@media (max-width: 640px) {
    .hpc-gallery-lightbox {
        display: grid !important;
        place-items: center !important;
        width: 100vw !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        padding: max(54px, calc(env(safe-area-inset-top) + 40px)) 14px max(82px, calc(env(safe-area-inset-bottom) + 68px)) !important;
        overflow: hidden !important;
    }

    .hpc-gallery-lightbox__figure {
        width: min(92vw, 480px) !important;
        max-width: 92vw !important;
        max-height: calc(100dvh - 156px) !important;
        margin: 0 auto !important;
        display: grid !important;
        align-items: center !important;
        justify-items: center !important;
        align-content: center !important;
        gap: 10px !important;
    }

    .hpc-gallery-lightbox__figure img {
        display: block !important;
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: calc(100dvh - 250px) !important;
        margin: 0 auto !important;
        object-fit: contain !important;
        object-position: center center !important;
    }

    .hpc-gallery-lightbox__figure figcaption {
        width: min(92vw, 460px) !important;
        margin: 0 auto !important;
        padding: 0 8px !important;
        font-size: 13px !important;
        line-height: 1.32 !important;
        text-align: center !important;
    }

    .hpc-gallery-lightbox__close {
        top: max(14px, env(safe-area-inset-top)) !important;
        right: max(14px, env(safe-area-inset-right)) !important;
        left: auto !important;
        bottom: auto !important;
        width: 44px !important;
        height: 44px !important;
        transform: none !important;
    }

    .hpc-gallery-lightbox__arrow,
    .hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__arrow,
    .hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__arrow--prev,
    .hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__arrow--next {
        display: grid !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        top: auto !important;
        bottom: max(14px, calc(env(safe-area-inset-bottom) + 12px)) !important;
        width: 48px !important;
        height: 44px !important;
        border-radius: 6px !important;
        background: rgba(5, 3, 2, 0.84) !important;
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34) !important;
        transform: none !important;
    }

    .hpc-gallery-lightbox__arrow--prev,
    .hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__arrow--prev {
        left: calc(50% - 58px) !important;
        right: auto !important;
    }

    .hpc-gallery-lightbox__arrow--next,
    .hpc-gallery-lightbox:not([hidden]) .hpc-gallery-lightbox__arrow--next {
        left: calc(50% + 10px) !important;
        right: auto !important;
    }

    .hpc-gallery-lightbox__arrow-icon {
        font-size: 32px !important;
        line-height: 1 !important;
        transform: translateY(-1px) !important;
    }

    .hpc-gallery-lightbox::after {
        content: "Свайпайте фото или используйте стрелки" !important;
        position: fixed;
        left: 50%;
        bottom: max(64px, calc(env(safe-area-inset-bottom) + 58px));
        z-index: 2147483200;
        transform: translateX(-50%);
        width: max-content;
        max-width: calc(100vw - 32px);
        padding: 7px 12px;
        border: 1px solid rgba(232, 190, 115, 0.12);
        border-radius: 999px;
        background: rgba(5, 3, 2, 0.56);
        color: rgba(255, 244, 223, 0.56);
        font-size: 11px;
        font-weight: 700;
        line-height: 1;
        letter-spacing: 0.02em;
        pointer-events: none;
    }
}

.hpc-gallery-lightbox[hidden],
.hpc-gallery-lightbox[aria-hidden="true"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}


/* v0.1.81: force mobile lightbox image to use full available width and stay centered */
@media (max-width: 640px) {
    .hpc-gallery-lightbox {
        padding-left: 0 !important;
        padding-right: 0 !important;
        justify-items: stretch !important;
    }

    .hpc-gallery-lightbox__figure {
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 100vw !important;
        margin: 0 auto !important;
        padding: 0 12px !important;
        box-sizing: border-box !important;
        justify-items: center !important;
        align-items: center !important;
        overflow: visible !important;
    }

    .hpc-gallery-lightbox__figure img {
        display: block !important;
        width: 100% !important;
        max-width: calc(100vw - 24px) !important;
        height: auto !important;
        max-height: calc(100dvh - 250px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        object-fit: contain !important;
        object-position: center center !important;
    }

    .hpc-gallery-lightbox__figure figcaption {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
    }
}
