.gallery-page {
    background: #111;
    color: #fff;
}

.gallery-hero,
.gallery-archive {
    padding: 48px max(18px, calc((100vw - var(--bkm-container)) / 2));
}

.gallery-hero {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(120deg, rgba(17, 17, 17, 0.88), rgba(17, 17, 17, 0.68)),
        url("/static/images/photo1.jpg") center/cover no-repeat;
}

.gallery-hero::before,
.gallery-archive::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 8px;
    background: var(--sdg-spectrum);
}

.gallery-breadcrumb {
    display: flex;
    gap: 10px;
    margin-bottom: 34px;
    color: rgba(255, 255, 255, 0.56);
    font-size: 13px;
    font-weight: 800;
}

.gallery-breadcrumb a {
    color: #fff;
}

.gallery-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(340px, 0.58fr);
    gap: 22px;
    align-items: stretch;
}

.gallery-hero__copy {
    min-height: 440px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gallery-hero__copy > span,
.gallery-feature__body > span {
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gallery-hero h1 {
    max-width: 980px;
    margin: 18px 0 24px;
    color: #fff;
    font-size: clamp(2.9rem, 5.35vw, 5.9rem);
    line-height: 0.94;
    letter-spacing: -0.045em;
}

.gallery-hero__copy p {
    max-width: 680px;
    margin: 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: 1.05rem;
    line-height: 1.7;
}

.gallery-hero__meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 150px));
    gap: 10px;
    margin-top: 34px;
}

.gallery-hero__meta div {
    min-height: 96px;
    padding: 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.gallery-hero__meta div:nth-child(1) { box-shadow: inset 0 5px 0 var(--sdg-4); }
.gallery-hero__meta div:nth-child(2) { box-shadow: inset 0 5px 0 var(--sdg-7); }
.gallery-hero__meta div:nth-child(3) { box-shadow: inset 0 5px 0 var(--sdg-14); }

.gallery-hero__meta strong {
    display: block;
    font-size: 2rem;
    line-height: 0.9;
}

.gallery-hero__meta small {
    display: block;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.gallery-feature {
    min-width: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.gallery-feature__media {
    min-height: 380px;
    background: #202020;
}

.gallery-feature__media.is-video {
    min-height: 430px;
    display: grid;
    place-items: center;
    padding: 18px;
    background:
        radial-gradient(circle at 50% 20%, rgba(38, 189, 226, 0.16), transparent 36%),
        #0b0d12;
}

.gallery-feature__media img,
.gallery-feature__media video {
    width: 100%;
    height: 100%;
    min-height: 380px;
    object-fit: cover;
    display: block;
}

.gallery-feature__media.is-video video {
    width: auto;
    height: min(54vh, 480px);
    min-height: 0;
    max-width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.gallery-feature__body {
    padding: 22px;
}

.gallery-feature h2 {
    margin: 12px 0 12px;
    color: #fff;
    font-size: clamp(1.55rem, 2.6vw, 3rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.gallery-feature p {
    margin: 0;
    color: rgba(255, 255, 255, 0.66);
    line-height: 1.65;
}

.gallery-feature a {
    width: fit-content;
    margin-top: 22px;
    padding: 12px 18px;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-weight: 850;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.gallery-archive {
    position: relative;
    background: #f4f6f8;
    color: #111;
}

.gallery-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.gallery-toolbar button {
    height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(17, 17, 17, 0.14);
    background: #fff;
    color: #111;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
}

.gallery-toolbar button.is-active {
    background: #111;
    color: #fff;
}

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

.gallery-card {
    min-width: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(17, 17, 17, 0.1);
    box-shadow: 0 22px 70px rgba(17, 24, 39, 0.08);
    display: flex;
    flex-direction: column;
}

.gallery-card__media {
    position: relative;
    min-height: 300px;
    background: #202020;
    overflow: hidden;
    display: block;
}

.gallery-card__media::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    z-index: 2;
    height: 7px;
    background: var(--sdg-spectrum);
}

.gallery-card__media img {
    width: 100%;
    height: 100%;
    min-height: 300px;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

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

.gallery-card__badge {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 3;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.84);
    color: #fff;
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
    backdrop-filter: blur(12px);
}

.gallery-card__body {
    flex: 1;
    padding: 22px;
}

.gallery-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: rgba(17, 17, 17, 0.45);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.gallery-card h3 {
    margin: 18px 0 10px;
    color: #111;
    font-size: clamp(1.3rem, 1.8vw, 2rem);
    line-height: 1;
    letter-spacing: -0.05em;
}

.gallery-card p {
    margin: 0;
    color: rgba(17, 17, 17, 0.62);
    line-height: 1.65;
}

.gallery-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 28px;
    border-radius: 8px;
    background: #fff;
    color: rgba(17, 17, 17, 0.62);
}

.gallery-detail-page {
    background:
        radial-gradient(circle at 8% 10%, rgba(38, 189, 226, 0.16), transparent 28%),
        radial-gradient(circle at 92% 14%, rgba(252, 195, 11, 0.14), transparent 24%),
        #f4f6f8;
    color: #111;
}

.gallery-detail-shell,
.gallery-related {
    padding: 52px max(18px, calc((100vw - var(--bkm-container)) / 2));
}

.gallery-breadcrumb--dark {
    color: rgba(17, 17, 17, 0.48);
}

.gallery-breadcrumb--dark a {
    color: #111;
}

.gallery-detail-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.32fr);
    gap: 24px;
    align-items: end;
    padding: 32px;
    border-radius: 8px;
    background: #111;
    color: #fff;
}

.gallery-detail-hero::before,
.gallery-detail-body::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 7px;
    background: var(--sdg-spectrum);
}

.gallery-detail-hero span,
.gallery-detail-body > span,
.gallery-toolbar--static span {
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gallery-detail-hero h1 {
    max-width: 940px;
    margin: 16px 0 18px;
    color: #fff;
    font-size: clamp(2.7rem, 6.6vw, 7rem);
    line-height: 0.9;
    letter-spacing: -0.07em;
    overflow-wrap: anywhere;
}

.gallery-detail-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.72;
}

.gallery-detail-hero aside {
    display: grid;
    gap: 12px;
}

.gallery-detail-hero aside strong {
    display: block;
    padding: 14px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.gallery-detail-hero aside a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-weight: 850;
    text-decoration: none;
}

.gallery-detail-media {
    margin-top: 18px;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 26px 80px rgba(17, 24, 39, 0.18);
}

.gallery-detail-media img,
.gallery-detail-media video {
    width: 100%;
    max-height: 760px;
    object-fit: contain;
    display: block;
    background: #111;
}

.gallery-detail-body {
    position: relative;
    margin-top: 18px;
    padding: clamp(24px, 4vw, 44px);
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(17, 17, 17, 0.1);
    box-shadow: 0 18px 54px rgba(17, 24, 39, 0.08);
    color: rgba(17, 17, 17, 0.74);
    line-height: 1.78;
}

.gallery-detail-body > span {
    color: rgba(17, 17, 17, 0.48);
}

.gallery-detail-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.gallery-related {
    background: #f4f6f8;
}

.gallery-toolbar--static {
    margin-bottom: 18px;
}

.gallery-toolbar--static span {
    color: rgba(17, 17, 17, 0.52);
}

html[lang="ru"] .gallery-hero h1,
html[lang="ru"] .gallery-feature h2,
html[lang="ru"] .gallery-card h3,
html[lang="ru"] .gallery-detail-hero h1,
html[lang="kk"] .gallery-hero h1,
html[lang="kk"] .gallery-feature h2,
html[lang="kk"] .gallery-card h3,
html[lang="kk"] .gallery-detail-hero h1 {
    letter-spacing: 0;
    line-height: 1;
}

@media (max-width: 1100px) {
    .gallery-hero__grid,
    .gallery-grid,
    .gallery-detail-hero {
        grid-template-columns: 1fr;
    }

    .gallery-hero__copy {
        min-height: 330px;
    }

    .gallery-feature__media,
    .gallery-feature__media img,
    .gallery-feature__media video {
        min-height: 360px;
    }

    .gallery-feature__media.is-video {
        min-height: 440px;
    }
}

@media (max-width: 640px) {
    .gallery-hero,
    .gallery-archive,
    .gallery-detail-shell,
    .gallery-related {
        padding: 42px 16px;
    }

    .gallery-hero h1,
    .gallery-detail-hero h1 {
        font-size: clamp(2.55rem, 11vw, 3.75rem);
        line-height: 0.98;
        letter-spacing: -0.035em;
        overflow-wrap: anywhere;
    }

    .gallery-detail-hero {
        padding: 22px;
    }

    .gallery-hero__meta {
        grid-template-columns: 1fr;
    }

    .gallery-card__media,
    .gallery-card__media img {
        min-height: 260px;
    }

    .gallery-feature__media.is-video {
        min-height: 410px;
        padding: 14px;
    }

    .gallery-feature__media.is-video video {
        height: min(62vh, 470px);
    }
}

/* Light mode */
html[data-theme="light"] .gallery-page {
    background: #f4f6f8;
    color: #111827;
}

html[data-theme="light"] .gallery-hero {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 246, 248, 0.96)),
        url("/static/images/photo1.jpg") center/cover no-repeat;
    color: #111827;
}

html[data-theme="light"] .gallery-breadcrumb,
html[data-theme="light"] .gallery-hero__copy > span,
html[data-theme="light"] .gallery-feature__body > span {
    color: rgba(17, 24, 39, 0.52);
}

html[data-theme="light"] .gallery-breadcrumb a,
html[data-theme="light"] .gallery-hero h1,
html[data-theme="light"] .gallery-feature h2 {
    color: #111827;
}

html[data-theme="light"] .gallery-hero__copy p,
html[data-theme="light"] .gallery-feature p {
    color: rgba(17, 24, 39, 0.66);
}

html[data-theme="light"] .gallery-hero__meta div,
html[data-theme="light"] .gallery-feature {
    background: #fff;
    border-color: rgba(17, 24, 39, 0.1);
    box-shadow: 0 18px 54px rgba(17, 24, 39, 0.08);
}

html[data-theme="light"] .gallery-hero__meta small {
    color: rgba(17, 24, 39, 0.58);
}

html[data-theme="light"] .gallery-feature__body {
    background: #fff;
}

html[data-theme="light"] .gallery-feature a {
    background: #111827;
    color: #fff;
}

html[data-theme="light"] .gallery-detail-hero {
    background: #fff;
    color: #111827;
    border: 1px solid rgba(17, 24, 39, 0.1);
    box-shadow: 0 18px 54px rgba(17, 24, 39, 0.08);
}

html[data-theme="light"] .gallery-detail-hero span {
    color: rgba(17, 24, 39, 0.52);
}

html[data-theme="light"] .gallery-detail-hero h1,
html[data-theme="light"] .gallery-detail-hero aside strong {
    color: #111827;
}

html[data-theme="light"] .gallery-detail-hero p {
    color: rgba(17, 24, 39, 0.66);
}

html[data-theme="light"] .gallery-detail-hero aside strong {
    background: #f4f6f8;
}

html[data-theme="light"] .gallery-detail-hero aside a {
    background: #111827;
    color: #fff;
}
