/* ==========================================================================
   Tovarek – a quiet travel photography theme for Publii
   Rules: 0 px corners, no shadows, no filters, photos never scaled above 1,
   only opacity and translate are animated.
   ========================================================================== */

/* ---------- Fonts (self-hosted, see assets/fonts/README.md) ---------- */

@font-face {
    font-family: "Space Grotesk";
    src: url("../fonts/space-grotesk-latin-wght.woff2") format("woff2");
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Archivo Black";
    src: url("../fonts/archivo-black-latin-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
    --bg: #FAFAF8;
    --fg: #0A0A0A;
    --muted: #5C5C58;
    --line: rgba(10, 10, 10, .14);
    --on-photo: #FFFFFF;

    --font-text: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-display: "Archivo Black", "Arial Black", "Helvetica Neue", Arial, sans-serif;

    --gutter: clamp(16px, 3vw, 40px);
    --header-h: 64px;
    --ui-h: 76px;
    --gap: clamp(12px, 1.6vw, 24px);
    /* Desktop strip photo height. helpers.js computes sizes with 85vh. */
    --strip-h: min(85vh, calc(100vh - var(--header-h) - var(--ui-h)));
    --ease: cubic-bezier(.2, .7, .2, 1);

    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #0E0E0E;
    --fg: #F2F2EE;
    --muted: #A3A39E;
    --line: rgba(242, 242, 238, .16);

    color-scheme: dark;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
    border-radius: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-text);
    font-size: 1rem;
    line-height: 1.55;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: .2em;
}

button {
    font: inherit;
    color: inherit;
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 400;
}

p {
    margin: 0 0 1em;
}

:focus-visible {
    outline: 2px solid var(--fg);
    outline-offset: 3px;
}

.label {
    margin: 0 0 .75rem;
    font-size: .75rem;
    line-height: 1.4;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -100px;
    z-index: 100;
    padding: 12px 16px;
    background: var(--fg);
    color: var(--bg);
}

.skip-link:focus {
    top: 12px;
}

.link-arrow {
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}

/* ---------- Header & navigation ---------- */

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    padding: 0 var(--gutter);
    background: var(--bg);
    color: var(--fg);
    transition: background-color .3s var(--ease), color .3s var(--ease);
}

.site-header--over:not(.is-solid) {
    background: transparent;
    color: var(--on-photo);
}

.t-home:not(.has-hero) .site-header--over {
    background: var(--bg);
    color: var(--fg);
}

.site-header__logo {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: .02em;
    text-transform: uppercase;
    text-decoration: none;
}

.site-header__logo img {
    max-height: 32px;
    width: auto;
}

.site-nav__list {
    display: flex;
    gap: clamp(20px, 3vw, 40px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav__list a {
    font-size: .8125rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    text-decoration: none;
}

.site-nav__list a:hover,
.site-nav__list .active > a {
    text-decoration: underline;
}

.site-header__toggle {
    display: none;
    padding: 10px 0;
    border: 0;
    background: none;
    font-size: .8125rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    cursor: pointer;
}

.site-header__toggle-close {
    display: none;
}

@media (max-width: 767px) {
    .site-header__toggle,
    .site-header__logo {
        position: relative;
        z-index: 2;
    }

    .site-header__toggle {
        display: block;
    }

    .site-nav {
        position: fixed;
        inset: 0;
        z-index: 1;
        display: flex;
        align-items: flex-end;
        padding: calc(var(--header-h) + 24px) var(--gutter) 48px;
        background: var(--bg);
        color: var(--fg);
        opacity: 0;
        visibility: hidden;
        transition: opacity .3s var(--ease), visibility 0s linear .3s;
    }

    .site-nav__list {
        flex-direction: column;
        gap: 8px;
    }

    .site-nav__list a {
        font-family: var(--font-display);
        font-size: clamp(2.5rem, 13vw, 4rem);
        line-height: 1.05;
        letter-spacing: 0;
    }

    .nav-open {
        overflow: hidden;
    }

    .nav-open .site-header {
        background: var(--bg);
        color: var(--fg);
    }

    .nav-open .site-nav {
        opacity: 1;
        visibility: visible;
        transition: opacity .3s var(--ease);
    }

    .nav-open .site-header__toggle-open {
        display: none;
    }

    .nav-open .site-header__toggle-close {
        display: inline;
    }
}

/* ---------- Hero ---------- */

.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--header-h) + 32px) var(--gutter) clamp(24px, 4vw, 48px);
    overflow: hidden;
}

.hero__media,
.hero__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero__media img {
    object-fit: cover;
}

/* Legibility band for the name, an overlay – the photo itself is untouched */
.has-hero .hero::after {
    content: "";
    position: absolute;
    inset: 45% 0 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .42));
    pointer-events: none;
}

.hero__text,
.hero__cue {
    position: relative;
    z-index: 1;
}

.has-hero .hero__text,
.has-hero .hero__cue {
    color: var(--on-photo);
}

.hero__name {
    font-family: var(--font-display);
    font-size: clamp(3rem, 12vw, 11rem);
    line-height: .88;
    letter-spacing: -.01em;
    text-transform: uppercase;
}

.hero__line {
    max-width: 34ch;
    margin: clamp(16px, 2vw, 28px) 0 0;
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    line-height: 1.45;
}

.hero__cue {
    align-self: flex-end;
    margin-top: clamp(24px, 4vw, 40px);
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    text-decoration: none;
}

.hero__cue span {
    display: inline-block;
}

@media (prefers-reduced-motion: no-preference) {
    .hero__cue span {
        animation: nudge 2.4s var(--ease) infinite;
    }
}

@keyframes nudge {
    0%, 60%, 100% { transform: translate3d(0, 0, 0); }
    30% { transform: translate3d(6px, 0, 0); }
}

/* ---------- Sections ---------- */

.work,
.quote,
.about {
    padding: clamp(72px, 12vw, 168px) var(--gutter);
}

.work--tag {
    padding-top: calc(var(--header-h) + clamp(48px, 8vw, 120px));
}

.section-head {
    max-width: 60rem;
    margin-bottom: clamp(48px, 8vw, 112px);
}

.section-head__title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 7vw, 6.5rem);
    line-height: .95;
    text-transform: uppercase;
}

.section-head__intro {
    max-width: 38ch;
    margin: 24px 0 0;
    font-size: clamp(1rem, 1.3vw, 1.1875rem);
    color: var(--muted);
}

/* ---------- Chapters (series cards) ---------- */

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

.chapter {
    min-width: 0;
}

@media (min-width: 768px) {
    .chapters {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: calc(var(--gutter) * 2);
        row-gap: clamp(96px, 10vw, 160px);
        align-items: start;
    }

    .chapter:nth-child(even) {
        margin-top: clamp(64px, 12vw, 200px);
    }
}

.chapter__link {
    display: block;
    text-decoration: none;
}

.chapter__media {
    position: relative;
    margin: 0 0 24px;
    background: var(--line);
}

.chapter__media img {
    width: 100%;
}

.chapter__meta {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.chapter__number {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 4.4vw, 4rem);
    line-height: .85;
    font-variant-numeric: tabular-nums;
}

.chapter__title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.4vw, 2.25rem);
    line-height: 1;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.chapter__lead {
    max-width: 44ch;
    margin: 12px 0 16px;
    color: var(--muted);
}

.chapter__cta {
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    border-bottom: 1px solid currentColor;
}

.chapter__cta span {
    display: inline-block;
    transition: transform .3s var(--ease);
}

.chapter__link:hover .chapter__cta span,
.chapter__link:focus-visible .chapter__cta span {
    transform: translate3d(4px, 0, 0);
}

/* Viewfinder frame on hover: corner brackets + crosshair + REC */

.viewfinder {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity .35s var(--ease);
    color: var(--on-photo);
}

.viewfinder i {
    position: absolute;
    width: clamp(20px, 3vw, 36px);
    height: clamp(20px, 3vw, 36px);
    border: 0 solid currentColor;
    transition: transform .45s var(--ease);
}

.viewfinder i:nth-child(1) { top: 16px; left: 16px; border-width: 2px 0 0 2px; transform: translate3d(-8px, -8px, 0); }
.viewfinder i:nth-child(2) { top: 16px; right: 16px; border-width: 2px 2px 0 0; transform: translate3d(8px, -8px, 0); }
.viewfinder i:nth-child(3) { bottom: 16px; left: 16px; border-width: 0 0 2px 2px; transform: translate3d(-8px, 8px, 0); }
.viewfinder i:nth-child(4) { bottom: 16px; right: 16px; border-width: 0 2px 2px 0; transform: translate3d(8px, 8px, 0); }

.viewfinder::before,
.viewfinder::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: currentColor;
}

.viewfinder::before {
    width: 24px;
    height: 1px;
    margin: 0 0 0 -12px;
}

.viewfinder::after {
    width: 1px;
    height: 24px;
    margin: -12px 0 0;
}

.viewfinder__rec {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translate3d(-50%, 0, 0);
    font-family: var(--font-text);
    font-size: .6875rem;
    font-weight: 500;
    letter-spacing: .18em;
}

.viewfinder__rec::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 8px;
    background: #E5352B;
    vertical-align: 1px;
}

.chapter__link:hover .viewfinder,
.chapter__link:focus-visible .viewfinder {
    opacity: 1;
}

.chapter__link:hover .viewfinder i,
.chapter__link:focus-visible .viewfinder i {
    transform: translate3d(0, 0, 0);
}

/* ---------- Quote ---------- */

.quote figure {
    max-width: 64rem;
    margin: 0;
}

.quote blockquote {
    margin: 0;
}

.quote blockquote p {
    margin: 0;
    font-size: clamp(1.75rem, 4.2vw, 3.75rem);
    line-height: 1.12;
    font-weight: 500;
    letter-spacing: -.015em;
    text-indent: -.45em;
}

.quote blockquote p::before { content: "“"; }
.quote blockquote p::after { content: "”"; }

.quote figcaption {
    margin-top: 28px;
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- About ---------- */

.about {
    display: grid;
    gap: 40px;
    border-top: 1px solid var(--line);
}

@media (min-width: 768px) {
    .about {
        grid-template-columns: 5fr 7fr;
        gap: calc(var(--gutter) * 2);
        align-items: end;
    }
}

.about__media {
    margin: 0;
}

.about__title {
    margin-bottom: 24px;
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.5vw, 4rem);
    line-height: .95;
    text-transform: uppercase;
}

.about__text {
    max-width: 40rem;
    font-size: clamp(1rem, 1.3vw, 1.1875rem);
}

/* ---------- Footer / contact ---------- */

.site-footer {
    padding: clamp(72px, 12vw, 168px) var(--gutter) 32px;
    border-top: 1px solid var(--line);
}

.site-footer__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.5vw, 3.75rem);
    line-height: .95;
    text-transform: uppercase;
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 40px;
    margin: clamp(24px, 3vw, 40px) 0 0;
    padding: 0;
    list-style: none;
    font-size: clamp(1.125rem, 1.8vw, 1.5rem);
    font-weight: 500;
}

.site-footer__commercial {
    margin: 32px 0 0;
    color: var(--muted);
}

.site-footer__commercial a {
    color: var(--fg);
}

.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 32px;
    margin-top: clamp(72px, 10vw, 140px);
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: .8125rem;
    color: var(--muted);
}

.site-footer__bottom p {
    margin: 0;
}

/* ---------- Series: horizontal strip ----------
   Base = mobile and no-JS: a native horizontal scroller with scroll-snap.
   JS adds .is-pinned on desktop: sticky viewport + translate3d by scrollY.
   ------------------------------------------------ */

.strip {
    position: relative;
    padding-top: var(--header-h);
}

.strip:focus {
    outline: none;
}

.strip__track {
    display: flex;
    align-items: center;
    gap: var(--gap);
    padding: 24px var(--gutter);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
}

.strip__track > * {
    flex: 0 0 auto;
    scroll-snap-align: center;
}

.strip__item {
    position: relative;
    margin: 0;
    width: min(calc(100vw - 2 * var(--gutter)), calc(70vh * var(--r, 1.5)), var(--w, 100vw));
    width: min(calc(100vw - 2 * var(--gutter)), calc(70svh * var(--r, 1.5)), var(--w, 100vw));
    background: var(--line);
}

.strip__link {
    display: block;
    cursor: zoom-in;
}

.strip__item img {
    width: 100%;
    height: 100%;
}

.strip__item figcaption {
    position: absolute;
    left: 0;
    top: 100%;
    padding-top: 8px;
    font-size: .75rem;
    color: var(--muted);
}

.strip__intro,
.strip__text,
.strip__end {
    width: min(28rem, calc(100vw - 2 * var(--gutter)));
}

.strip__intro {
    scroll-snap-align: start;
    padding-right: clamp(0px, 3vw, 48px);
}

.strip__title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    line-height: .9;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.strip__story,
.strip__text {
    font-size: 1.0625rem;
    line-height: 1.6;
}

.strip__story {
    margin-top: clamp(20px, 2.5vw, 32px);
}

.strip__text {
    width: min(24rem, calc(100vw - 2 * var(--gutter)));
}

.strip__text h2,
.strip__text h3 {
    margin: 0 0 12px;
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

.strip__text p:last-child,
.strip__story p:last-child {
    margin-bottom: 0;
}

.strip__hint {
    margin: 32px 0 0;
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

.strip__hint b {
    font-weight: inherit;
}

.strip__hint span {
    display: inline-block;
}

@media (max-width: 767px) {
    .strip__hint-desktop {
        display: none;
    }
}

@media (min-width: 768px) {
    .strip__hint-mobile {
        display: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .strip__hint span {
        animation: nudge 2.4s var(--ease) infinite;
    }
}

.strip__end {
    width: min(22rem, calc(100vw - 2 * var(--gutter)));
}

.strip__next {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.75rem);
    line-height: 1;
    text-transform: uppercase;
    text-decoration: none;
}

.strip__next:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.strip__ui {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2vw, 32px);
    height: var(--ui-h);
    padding: 0 var(--gutter);
}

.strip__counter {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.strip__progress {
    position: relative;
    flex: 1;
    height: 1px;
    background: var(--line);
    overflow: hidden;
}

.strip__progress span {
    position: absolute;
    inset: 0;
    background: var(--fg);
    transform-origin: 0 50%;
    transform: scaleX(var(--p, 0));
}

.strip__buttons {
    display: flex;
    gap: 8px;
}

.strip__buttons button {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    background: transparent;
    font-size: 1.125rem;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}

.strip__buttons button:hover {
    background: var(--fg);
    color: var(--bg);
}

.strip__buttons button:disabled {
    opacity: .3;
    cursor: default;
    background: transparent;
    color: var(--fg);
}

@media (max-width: 767px) {
    /* Let the first photo peek in from the right */
    .strip__intro,
    .strip__text {
        width: min(28rem, 80vw);
    }

    .strip__track {
        scrollbar-width: none;
    }

    .strip__track::-webkit-scrollbar {
        display: none;
    }

    .strip__buttons {
        display: none;
    }
}

/* Desktop, JS on: pinned strip driven by the page scroll */
@media (min-width: 768px) {
    .strip__item {
        width: min(calc(var(--strip-h) * var(--r, 1.5)), calc(100vw - 2 * var(--gutter)), var(--w, 100vw));
    }

    .strip.is-pinned {
        padding-top: 0;
    }

    .strip.is-pinned .strip__viewport {
        position: sticky;
        top: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        height: 100vh;
        padding-top: var(--header-h);
        overflow: hidden;
    }

    .strip.is-pinned .strip__track {
        flex: 1;
        width: max-content;
        padding-block: 0;
        overflow: visible;
        scroll-snap-type: none;
        will-change: transform;
        user-select: none;
        -webkit-user-select: none;
    }

    .strip.is-pinned .strip__track img {
        -webkit-user-drag: none;
    }

    .strip.is-pinned.is-dragging .strip__link {
        cursor: grabbing;
    }
}

/* Custom "Drag →" cursor */

.drag-cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    padding: 8px 12px;
    background: var(--fg);
    color: var(--bg);
    font-size: .6875rem;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
    will-change: transform;
}

.drag-cursor.is-visible {
    opacity: 1;
}

/* ---------- Lightbox ---------- */

.lightbox {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #0A0A0A;
    color: #F2F2EE;
    overflow: hidden;
}

.lightbox::backdrop {
    background: #0A0A0A;
}

.lightbox[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox img {
    width: auto;
    height: auto;
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
}

.lightbox button {
    position: absolute;
    z-index: 1;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(242, 242, 238, .3);
    background: #0A0A0A;
    color: #F2F2EE;
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    cursor: pointer;
}

.lightbox button:focus-visible {
    outline-color: #F2F2EE;
}

.lightbox__close { top: 16px; right: 16px; }
.lightbox__prev { left: 16px; top: 50%; transform: translate3d(0, -50%, 0); }
.lightbox__next { right: 16px; top: 50%; transform: translate3d(0, -50%, 0); }

.lightbox__count {
    position: absolute;
    left: 16px;
    top: 16px;
    margin: 0;
    font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
}

/* ---------- Pages ---------- */

.page {
    padding: calc(var(--header-h) + clamp(48px, 8vw, 120px)) var(--gutter) clamp(72px, 10vw, 140px);
}

/* Pages are one centred column: title, photo and text on the same axis */

.page__article {
    max-width: 44rem;
    margin: 0 auto;
}

.page__head {
    max-width: 60rem;
    margin: 0 auto clamp(32px, 5vw, 64px);
    text-align: center;
}

.page__title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 7rem);
    line-height: .9;
    text-transform: uppercase;
}

.page__media {
    margin: 0 auto clamp(32px, 5vw, 64px);
}

.page__media img {
    margin: 0 auto;
}

.page__media figcaption,
.prose figcaption {
    margin-top: 12px;
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    text-align: center;
    color: var(--muted);
}

.prose {
    max-width: 38rem;
    margin: 0 auto;
    font-size: clamp(1rem, 1.25vw, 1.125rem);
    line-height: 1.65;
    text-align: center;
}

.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose table {
    text-align: left;
}

.prose h2,
.prose h3 {
    margin: 2em 0 .75em;
    font-weight: 500;
}

.prose figure {
    margin: clamp(24px, 4vw, 48px) auto;
}

.prose .post__image img {
    width: min(100%, 26rem);
    margin: 0 auto;
}

/* Galleries break out of the text column, still centred */
.prose .gallery-wrapper {
    position: relative;
    left: 50%;
    width: min(64rem, calc(100vw - 2 * var(--gutter)));
    margin: clamp(32px, 5vw, 64px) 0;
    transform: translate3d(-50%, 0, 0);
}

.prose .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--gap);
}

.prose .gallery__item {
    margin: 0;
}

.prose .gallery__item img {
    width: 100%;
}

.tag-list {
    max-width: 60rem;
    margin: 0 auto;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.tag-list a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
}

.tag-list__name {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    text-transform: uppercase;
}

.pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 96px;
    font-weight: 500;
}

/* ---------- Gentle motion (JS adds .js on <html>) ---------- */

@media (prefers-reduced-motion: no-preference) {
    .js .reveal {
        opacity: 0;
        transform: translate3d(0, 24px, 0);
        transition: opacity .8s var(--ease), transform .8s var(--ease);
    }

    .js .reveal.is-in {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }

    .js img[loading="lazy"] {
        opacity: 0;
        transition: opacity .6s var(--ease);
    }

    .js img[loading="lazy"].is-loaded {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
