/* ═══ artgallery.css — редакторский монтаж ═══ */

body.ag-page {
    margin: 0;
    padding: 0;
    padding-top: 72px;
    background: #f7f5f1;
    color: #1a1713;
    font-family: 'Roboto Condensed', Arial, sans-serif;
}
@media (max-width: 927px) {
    body.ag-page { padding-top: 44px; }
}

/* ─── Hero (верхний блок) ─────────────────────────────────────── */
.ag-hero {
    background: #0d0c0b;
    color: #ece4d2;
    padding: 70px 24px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.ag-hero::before,
.ag-hero::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #a08857, transparent);
    transform: translateX(-50%);
}
.ag-hero::before { top: 46px; }
.ag-hero::after  { bottom: 50px; }

.ag-hero__inner { max-width: 820px; margin: 0 auto; }

.ag-hero__eyebrow {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 11px; font-weight: 400;
    letter-spacing: 0.6em; text-transform: uppercase;
    color: #a08857; margin-bottom: 18px; padding-left: 0.6em;
}

.ag-hero__title {
    margin: 0 0 14px;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 300;
    font-size: clamp(2.4rem, 6vw, 5rem);
    letter-spacing: 0.04em; line-height: 1;
    color: #f2ead5;
}

.ag-hero__en {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic; font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #8f8266; letter-spacing: 0.08em;
    margin-bottom: 30px;
}

.ag-hero__tags {
    font-size: 11px; letter-spacing: 0.4em; text-transform: uppercase;
    color: #c8bda0; padding-left: 0.4em; margin-bottom: 26px;
}
.ag-hero__tags span { color: #a08857; margin: 0 6px; }

.ag-hero__intro {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 400; font-style: italic;
    font-size: clamp(14px, 1.5vw, 17px);
    line-height: 1.6; color: #d8cfba;
    max-width: 560px; margin: 0 auto 36px;
}

.ag-hero__stats {
    display: flex; flex-wrap: wrap;
    justify-content: center; align-items: center;
    gap: 14px;
    font-size: 11px; letter-spacing: 0.35em;
    text-transform: uppercase; color: #ece4d2;
}
.ag-hero__stat { padding-left: 0.35em; }
.ag-hero__stat b {
    font-weight: 700; color: #f2ead5;
    font-size: 13px; letter-spacing: 0.1em; margin-right: 4px;
}
.ag-hero__dash {
    width: 16px; height: 1px;
    background: #a08857; display: inline-block;
}

/* ─── Scenes — общий каркас ──────────────────────────────────── */
.ag-scenes { background: #f7f5f1; }

.ag-scene {
    padding: 80px 32px;
    background: #f7f5f1;
    color: #1a1713;
}
.ag-scene__inner {
    max-width: 1600px;
    margin: 0 auto;
}
.ag-scene--dark { background: #0d0c0b; color: #ece4d2; }
.ag-scene--dark .ag-work__title { color: #f2ead5; }
.ag-scene--dark .ag-work__en    { color: #8f8266; }
.ag-scene--dark .ag-work__meta  { color: #a08857; }
@media (max-width: 900px) { .ag-scene { padding: 50px 16px; } }
@media (max-width: 520px) { .ag-scene { padding: 40px 12px; } }

/* ─── Общий работа-компонент ──────────────────────────────────── */
.ag-work {
    margin: 0;
    padding: 0;
}
.ag-work__link {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}
.ag-work__link:focus-visible {
    outline: 2px solid #a08857;
    outline-offset: 6px;
}
.ag-work__frame {
    display: block;
    aspect-ratio: var(--ag-ratio, 1);
    background: #ece4d2;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 12px 32px rgba(0,0,0,0.12);
    transition: box-shadow .4s ease, transform .4s ease;
}
.ag-work__frame img {
    display: block;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .7s ease;
}
.ag-work:hover .ag-work__frame {
    box-shadow: 0 2px 6px rgba(0,0,0,0.12), 0 22px 48px rgba(0,0,0,0.22);
    transform: translateY(-2px);
}
.ag-work:hover .ag-work__frame img { transform: scale(1.03); }

.ag-work__cap {
    padding: 14px 4px 0;
    font-family: 'Roboto Condensed', Arial, sans-serif;
    line-height: 1.35;
    text-align: center;
}
.ag-work__title {
    display: block;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 15px; font-weight: 400;
    color: #1a1713;
    letter-spacing: 0.01em;
    margin-bottom: 3px;
}
.ag-work__en {
    display: block;
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic; font-size: 12px;
    color: #8f8266; margin-bottom: 5px;
}
.ag-work__meta {
    display: block;
    font-size: 10px; letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #a08857; padding-left: 0.2em;
}

/* ─── Chapter — типографическая перебивка ─────────────────────── */
.ag-scene--chapter {
    padding: 120px 24px 70px;
    text-align: center;
    position: relative;
}
.ag-scene--chapter::before,
.ag-scene--chapter::after {
    content: "";
    display: block;
    width: 44px; height: 1px;
    background: #a08857;
    margin: 0 auto 30px;
}
.ag-scene--chapter::after { margin: 26px auto 0; width: 64px; }
.ag-chapter__eyebrow {
    font-size: 11px; letter-spacing: 0.55em;
    text-transform: uppercase; color: #a08857;
    padding-left: 0.55em; margin-bottom: 22px;
}
.ag-chapter__title {
    margin: 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 300; font-style: italic;
    font-size: clamp(2rem, 5.2vw, 4.4rem);
    line-height: 1.08;
    letter-spacing: 0.02em;
    color: #1a1713;
}
.ag-chapter__count {
    margin-top: 14px;
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic; font-size: 15px;
    color: #8f8266;
}

/* ─── Hero solo — одна работа в центре ────────────────────────── */
.ag-scene--hero-solo {
    padding: 110px 24px 120px;
    text-align: center;
}
.ag-scene--hero-solo .ag-work {
    display: inline-block;
    max-width: 100%;
}
.ag-scene--hero-solo .ag-work__frame {
    width: min(75vw, 1400px, calc(80vh * var(--ag-ratio, 1.3)));
    margin: 0 auto;
    box-shadow: 0 3px 8px rgba(0,0,0,0.10), 0 28px 64px rgba(0,0,0,0.20);
}
.ag-scene--hero-solo.ag-scene--dark .ag-work__frame {
    box-shadow: 0 0 0 1px rgba(200,189,160,0.08), 0 32px 80px rgba(0,0,0,0.55);
}
.ag-scene--hero-solo .ag-work__cap { margin-top: 26px; padding-top: 0; }
.ag-scene--hero-solo .ag-work__title {
    font-size: 22px; font-weight: 300;
    letter-spacing: 0.02em;
    margin-bottom: 6px;
}
.ag-scene--hero-solo .ag-work__en { font-size: 15px; margin-bottom: 8px; }
.ag-scene--hero-solo .ag-work__meta { font-size: 11px; letter-spacing: 0.3em; }
@media (max-width: 900px) {
    .ag-scene--hero-solo { padding: 60px 14px 70px; }
    .ag-scene--hero-solo .ag-work__frame { width: min(92vw, calc(78vh * var(--ag-ratio, 1))); }
}

/* ─── Wide solo — горизонтальный лидер ───────────────────────── */
.ag-scene--wide-solo {
    padding: 80px 24px 90px;
    text-align: center;
}
.ag-scene--wide-solo .ag-work { display: inline-block; max-width: 100%; }
.ag-scene--wide-solo .ag-work__frame {
    width: min(88vw, 1500px);
    margin: 0 auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.10), 0 22px 56px rgba(0,0,0,0.18);
}
.ag-scene--wide-solo .ag-work__cap { margin-top: 22px; padding-top: 0; }
.ag-scene--wide-solo .ag-work__title { font-size: 18px; font-weight: 300; }

/* ─── Diptych — пара одинаковой высоты ───────────────────────── */
.ag-scene--diptych { padding: 70px 24px; }
.ag-diptych {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 32px;
    flex-wrap: wrap;
}
.ag-diptych .ag-work {
    flex: 0 1 auto;
    max-width: 48%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ag-diptych .ag-work__frame {
    height: clamp(260px, 36vw, 540px);
    width: calc(clamp(260px, 36vw, 540px) * var(--ag-ratio, 1));
    max-width: 100%;
    aspect-ratio: var(--ag-ratio, 1);
}
@media (max-width: 720px) {
    .ag-diptych { gap: 20px; }
    .ag-diptych .ag-work { max-width: 100%; flex: 1 1 100%; }
    .ag-diptych .ag-work__frame {
        height: auto;
        width: 92%;
        aspect-ratio: var(--ag-ratio, 1);
    }
}

/* ─── Triptych — 3 работы одной высоты ───────────────────────── */
.ag-scene--triptych { padding: 70px 24px; }
.ag-triptych {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
}
.ag-triptych .ag-work {
    flex: 0 1 auto;
    max-width: 32%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ag-triptych .ag-work__frame {
    height: clamp(300px, 42vw, 580px);
    width: calc(clamp(300px, 42vw, 580px) * var(--ag-ratio, 1));
    max-width: 100%;
    aspect-ratio: var(--ag-ratio, 1);
}
@media (max-width: 900px) {
    .ag-triptych .ag-work { max-width: 46%; }
    .ag-triptych .ag-work__frame {
        height: clamp(220px, 40vw, 360px);
        width: calc(clamp(220px, 40vw, 360px) * var(--ag-ratio, 1));
    }
}
@media (max-width: 520px) {
    .ag-triptych .ag-work { max-width: 100%; flex: 1 1 100%; }
    .ag-triptych .ag-work__frame {
        height: auto;
        width: 88%;
        aspect-ratio: var(--ag-ratio, 1);
    }
}

/* ─── Grid 2×2 — квадратный квартет ───────────────────────────── */
.ag-scene--grid4 { padding: 70px 24px; }
.ag-grid4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    max-width: 1100px;
    margin: 0 auto;
}
.ag-grid4 .ag-work__frame { width: 100%; }
@media (max-width: 620px) {
    .ag-grid4 { grid-template-columns: 1fr; max-width: 480px; gap: 20px; }
}

/* ─── Mosaic — 1 большая + 4 малых ────────────────────────────── */
.ag-scene--mosaic { padding: 70px 24px; }
.ag-mosaic {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    max-width: 1600px;
    margin: 0 auto;
}
.ag-mosaic__lead .ag-work__frame { width: 100%; }
.ag-mosaic__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
    gap: 16px;
}
.ag-mosaic__grid .ag-work__frame { width: 100%; }
@media (max-width: 800px) {
    .ag-mosaic { grid-template-columns: 1fr; gap: 20px; }
    .ag-mosaic__grid { gap: 14px; }
}

/* ─── Split — 1 крупная + 3 в колонке ─────────────────────────── */
.ag-scene--split { padding: 70px 24px; }
.ag-split {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    max-width: 1600px;
    margin: 0 auto;
}
.ag-split__main .ag-work__frame { width: 100%; }
.ag-split__side {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.ag-split__side .ag-work__frame { width: 100%; }
@media (max-width: 900px) {
    .ag-split { grid-template-columns: 1fr; gap: 22px; }
    .ag-split__side { flex-direction: row; flex-wrap: wrap; }
    .ag-split__side .ag-work { flex: 1 1 30%; }
}
@media (max-width: 520px) {
    .ag-split__side { flex-direction: column; }
    .ag-split__side .ag-work { flex: 1 1 100%; }
}

/* ─── Footer ──────────────────────────────────────────────────── */
.ag-foot {
    background: #f7f5f1;
    padding: 60px 24px 90px;
    text-align: center;
    color: #5d5146;
}
.ag-foot__inner { max-width: 640px; margin: 0 auto; }
.ag-foot__rule {
    width: 60px; height: 1px;
    background: #a08857;
    margin: 0 auto 28px;
}
.ag-foot__line {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic; font-size: 15px; line-height: 1.6;
}
.ag-foot__line a {
    color: #1a1713;
    border-bottom: 1px solid #a08857;
    text-decoration: none;
    padding-bottom: 1px;
}
.ag-foot__line a:hover { color: #a08857; }

/* ─── Artwork view ───────────────────────────────────────────────── */
.ag-view[hidden] { display: none !important; }

.ag-artwork {
    max-width: 1320px;
    margin: 0 auto;
    padding: 40px 24px 100px;
    font-family: Georgia, 'Times New Roman', serif;
    color: #1a1713;
}
.ag-artwork__back {
    display: inline-block;
    margin-bottom: 28px;
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #8f8266;
    text-decoration: none;
    padding: 6px 2px;
    border-bottom: 1px solid transparent;
    transition: color .2s, border-color .2s;
}
.ag-artwork__back:hover {
    color: #1a1713;
    border-bottom-color: #a08857;
}

.ag-artwork__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    gap: 56px;
    align-items: start;
}

.ag-artwork__media {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.ag-artwork__frame {
    display: block;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: min(100%, calc(78vh * var(--ag-ratio, 1)));
    aspect-ratio: var(--ag-ratio, 1);
    background: #ece4d2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10), 0 28px 70px rgba(0,0,0,0.22);
    overflow: hidden;
    cursor: zoom-in;
    transition: box-shadow .4s ease, transform .4s ease;
}
.ag-artwork__frame:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12), 0 34px 80px rgba(0,0,0,0.28);
    transform: translateY(-2px);
}
.ag-artwork__frame:focus-visible {
    outline: 2px solid #a08857;
    outline-offset: 6px;
}
.ag-artwork__frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ag-artwork__credit {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #8f8266;
    align-self: flex-start;
    padding-top: 6px;
}

.ag-artwork__info {
    position: sticky;
    top: 28px;
    padding-top: 6px;
}
.ag-artwork__eyebrow {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #a08857;
    margin-bottom: 18px;
}
.ag-artwork__title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(26px, 3.4vw, 40px);
    font-weight: 400;
    line-height: 1.15;
    margin: 0 0 10px;
    letter-spacing: 0.005em;
}
.ag-artwork__en {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 17px;
    color: #8f8266;
    margin-bottom: 14px;
    line-height: 1.4;
}
.ag-artwork__year {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 14px;
    letter-spacing: 0.08em;
    color: #5d5146;
    margin-bottom: 20px;
}
.ag-artwork__artist {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
    margin-bottom: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid #d9cfbc;
}
.ag-artwork__artist a {
    color: #1a1713;
    text-decoration: none;
    border-bottom: 1px solid #a08857;
    padding-bottom: 1px;
}
.ag-artwork__artist a:hover { color: #a08857; }
.ag-artwork__artist-en {
    color: #8f8266;
    font-style: italic;
    margin-left: 6px;
}

.ag-artwork__meta {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 10px 16px;
    margin: 0 0 26px;
    font-family: 'Roboto Condensed', Arial, sans-serif;
}
.ag-artwork__meta dt {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #a08857;
    padding-top: 2px;
}
.ag-artwork__meta dd {
    margin: 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 15px;
    color: #1a1713;
    line-height: 1.45;
}

.ag-artwork__status {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #8f8266;
    padding-top: 20px;
    border-top: 1px solid #d9cfbc;
}

@media (max-width: 900px) {
    .ag-artwork { padding: 24px 16px 70px; }
    .ag-artwork__layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .ag-artwork__info { position: static; }
    .ag-artwork__title { font-size: clamp(24px, 6vw, 32px); }
    .ag-artwork__back { margin-bottom: 18px; }
    .ag-artwork__frame { max-width: 100%; }
}
@media (max-width: 520px) {
    .ag-artwork { padding: 20px 12px 60px; }
    .ag-artwork__meta { grid-template-columns: 84px 1fr; gap: 8px 12px; }
}

/* ─── Lightbox (fullscreen viewer + loupe) ──────────────────────── */
.ag-lightbox {
    position: fixed;
    inset: 0;
    background: #0a0907;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pinch-zoom;
    opacity: 0;
    transition: opacity .22s ease;
}
.ag-lightbox.is-open { opacity: 1; }
.ag-lightbox__img {
    display: block;
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    cursor: zoom-in;
    touch-action: pinch-zoom;
}
.ag-lightbox.has-loupe .ag-lightbox__img { cursor: zoom-out; }
.ag-lightbox__close {
    position: fixed;
    top: 18px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    transition: background .2s;
    z-index: 2;
}
.ag-lightbox__close:hover { background: rgba(255,255,255,0.22); }
.ag-lightbox__close:focus-visible {
    outline: 2px solid #a08857;
    outline-offset: 3px;
}
.ag-lightbox__close svg { width: 18px; height: 18px; }

.ag-lightbox__loupe {
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.85);
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
    pointer-events: none;
    background-repeat: no-repeat;
    background-color: #0a0907;
    opacity: 0;
    transition: opacity .18s;
    will-change: transform, background-position;
}
.ag-lightbox.has-loupe .ag-lightbox__loupe { opacity: 1; }

@media (max-width: 600px) {
    .ag-lightbox__loupe { width: 200px; height: 200px; }
    .ag-lightbox__close { top: 12px; right: 12px; width: 40px; height: 40px; }
}
