/* Catalog style "demo18" — the album as a deck of slides under a fixed deep green header: posts glide sideways in one track, the categories ride in a pill at the bottom. Mirrors /demo18/. */
@import url("https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@400;500;700;900&display=swap");

:root {
    --ground: #e8ebe4;
    --paper: #f4f6f1;
    --ink: #121612;
    --soft: #4a524b;
    --deep: #0f2a1a;
    --green: #2f7d43;
    --yellow: #ffb500;
    --on-deep: #c9d3cb;
    --font: "Schibsted Grotesk", system-ui, sans-serif;
    --edge: clamp(16px, 3vw, 48px);
    --hdr: 72px;
    --ease: cubic-bezier(.76, 0, .18, 1);
    color-scheme: light;
}
@media (max-width: 960px) { :root { --hdr: 60px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--hdr) + 16px); }
body { margin: 0; overflow-x: hidden; background: var(--ground); color: var(--ink); font: 400 17px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
code { font: 500 0.86em/1.4 ui-monospace, "SF Mono", Menlo, monospace; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
:where(.masthead, .stylebar, .post--even, .post__nav, .colophon, .zoom, .post--full .post__header) :focus-visible { outline-color: var(--yellow); }

.skip { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 16px; border-radius: 6px; background: var(--yellow); color: var(--ink); transform: translateY(-200%); }
.skip:focus { transform: none; }
.deco { display: none; }

.page { padding: var(--hdr) 0 120px; }

/* ── masthead: the fixed header that never moves ──────────────────────────────────────────── */
.masthead { position: fixed; inset: 0 0 auto; z-index: 40; height: var(--hdr); background: var(--deep); color: #f1f3ee; }
.masthead__inner { display: flex; align-items: center; gap: 24px; height: 100%; max-width: 1720px; margin: 0 auto; padding: 0 var(--edge); }
.brand { display: flex; align-items: center; gap: 12px; flex: none; text-decoration: none; }
.brand::before { content: ""; width: calc(var(--hdr) - 18px); aspect-ratio: 300 / 212; background: url("/_img/site/logo/logo.png") center / contain no-repeat; }
.brand__mark { font: 900 26px/1 var(--font); letter-spacing: -0.03em; }
.brand__name { font: 500 13px/1 var(--font); color: #9fb3a5; }
.masthead__tagline { flex: 1; min-width: 0; margin: 0; overflow: hidden; color: var(--on-deep); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.masthead__count { flex: none; margin: 0 0 0 auto; padding: 9px 16px; border-radius: 999px; background: var(--yellow); color: var(--ink); font: 700 14px/1 var(--font); }
.masthead__num { font-weight: 900; }

/* ── style bar ────────────────────────────────────────────────────────────────────────────── */
.stylebar { max-width: 1720px; margin: 0 auto; padding: 18px var(--edge) 0; }
.stylebar__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 14px 16px; border-radius: 16px; background: var(--paper); box-shadow: 0 1px 0 rgb(18 22 18 / 0.06); }
.stylebar__label { font: 700 14px/1 var(--font); }
.stylebar__value { flex: 1 1 260px; min-width: 0; padding: 9px 14px; overflow-x: auto; white-space: nowrap; border-radius: 10px; background: var(--ground); }
.stylebar__copy { min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: 700 15px/1 var(--font); cursor: pointer; transition: background 250ms ease; }
.stylebar__copy:hover { background: var(--green); }
.stylebar__copy.is-done { background: var(--yellow); color: var(--ink); }
.stylebar__list { display: flex; flex-wrap: wrap; gap: 4px 2px; width: 100%; }
.stylebar__item { padding: 5px 10px; border-radius: 999px; font: 500 13px/1 var(--font); color: var(--soft); text-decoration: none; }
.stylebar__item:hover { color: var(--ink); background: var(--ground); }
.stylebar__item.is-active { background: var(--deep); color: #fff; }

/* ── categories: the deck pill at the bottom of the screen ────────────────────────────────── */
.categories { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30; translate: -50% 0; max-width: calc(100vw - 24px); }
.categories__list {
    display: flex; gap: 2px; margin: 0; padding: 4px; list-style: none; overflow-x: auto; scrollbar-width: none;
    border-radius: 999px; background: rgb(15 42 26 / 0.92); box-shadow: 0 10px 30px rgb(0 0 0 / 0.2);
}
.categories__link { display: flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 16px; border-radius: 999px; font: 500 14px/1 var(--font); color: var(--on-deep); text-decoration: none; white-space: nowrap; transition: background 250ms ease, color 250ms ease; }
.categories__link:hover { color: #fff; }
.categories__link.is-active { background: var(--yellow); color: var(--ink); }
.categories__count { font-size: 12px; opacity: 0.75; }
.categories__link:focus-visible { outline-color: var(--yellow); outline-offset: -3px; }

/* ── listing header: the hero of the deck ─────────────────────────────────────────────────── */
.content { max-width: 1720px; margin: 0 auto; padding: clamp(36px, 6vw, 80px) var(--edge) 0; }
.listing__header { margin-bottom: 28px; }
.listing__title { max-width: 12ch; margin: 0; font: 900 clamp(56px, 8.4vw, 132px)/0.86 var(--font); letter-spacing: -0.055em; }
.listing__intro { max-width: 46ch; margin: 18px 0 0; color: var(--soft); font-size: 19px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 28px; color: var(--soft); font-size: 15px; }
.toolbar p { margin: 0; }
.toolbar::after { content: "Scroll or swipe the deck sideways →"; margin-left: auto; font-weight: 700; color: var(--green); }
.toolbar__view { display: flex; align-items: center; gap: 4px; }
.toolbar__label { margin-right: 8px; }
.toolbar__opt { min-width: 40px; padding: 8px 10px; border-radius: 999px; font-weight: 700; text-align: center; text-decoration: none; }
.toolbar__opt:hover { background: var(--paper); }
.toolbar__opt.is-active { background: var(--deep); color: #fff; }

/* ── the deck: one horizontal track of slides ─────────────────────────────────────────────── */
.listing {
    display: grid; grid-auto-flow: column; grid-auto-columns: min(82vw, 1180px); gap: clamp(16px, 2vw, 28px);
    margin: 0 calc(-1 * var(--edge)); padding: 8px var(--edge) 28px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--edge);
    scrollbar-color: var(--deep) transparent;
}
.post--card {
    display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); overflow: hidden; scroll-snap-align: start;
    border-radius: 22px; background: var(--paper); box-shadow: 0 24px 50px -30px rgb(15 42 26 / 0.45);
}
.post--even { background: var(--deep); color: #f1f3ee; }
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        /* slides outside the middle of the track step back, as the deck does between pages */
        .post--card { animation: step-back linear both; animation-timeline: view(inline); }
        @keyframes step-back {
            0% { opacity: 0.4; scale: 0.92; filter: saturate(0.4); }
            30%, 70% { opacity: 1; scale: 1; filter: none; }
            100% { opacity: 0.4; scale: 0.92; filter: saturate(0.4); }
        }
    }
}
.post__media { display: block; min-height: 100%; background: #d5dbd2; overflow: hidden; }
.post__thumb { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; transition: transform 900ms var(--ease); }
.post--card:hover .post__thumb { transform: scale(1.035); }
.post__body { display: flex; flex-direction: column; padding: clamp(24px, 3vw, 44px); }
.post__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 14px; font: 700 13px/1.3 var(--font); color: var(--green); }
.post--even .post__meta { color: var(--yellow); }
.post__num { padding: 5px 10px; border-radius: 999px; background: var(--yellow); color: var(--ink); }
.post__cat { text-decoration: none; }
.post__cat:hover { text-decoration: underline; text-underline-offset: 3px; }
.post__date { font-weight: 500; color: var(--soft); }
.post--even .post__date { color: #9fb3a5; }
.post__title { margin: 0 0 14px; font: 900 clamp(32px, 3.4vw, 56px)/0.92 var(--font); letter-spacing: -0.045em; text-wrap: balance; }
.post__title a { text-decoration: none; }
.post__title a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.post__excerpt { margin: 0 0 24px; color: var(--soft); text-wrap: pretty; }
.post--even .post__excerpt { color: var(--on-deep); }
.post__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: auto 0 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 999px; font: 700 15px/1 var(--font); text-decoration: none; transition: background 250ms ease, color 250ms ease; }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: var(--green); }
.post--even .btn--primary { background: var(--yellow); color: var(--ink); }
.post--even .btn--primary:hover { background: #fff; }
.post__more { padding: 0; min-height: 44px; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.post__more:hover { text-decoration-color: var(--yellow); }

/* ── pager ────────────────────────────────────────────────────────────────────────────────── */
.pager { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 20px; }
.pager__link { min-width: 44px; padding: 11px 14px; border-radius: 999px; font: 700 15px/1 var(--font); text-align: center; text-decoration: none; }
.pager__link:hover { background: var(--paper); }
.pager__link.is-active { background: var(--deep); color: #fff; }
.pager__link--prev, .pager__link--next { background: var(--paper); }

/* ── one post: a page that has slid in ────────────────────────────────────────────────────── */
.catalog--post .content { padding-top: 0; }
.post--full { max-width: 1280px; margin: 0 auto; }
.post--full .post__header {
    position: relative; margin: 0 calc(-1 * var(--edge)); padding: clamp(40px, 7vw, 96px) var(--edge) clamp(40px, 6vw, 72px);
    background: var(--deep); color: #f1f3ee; box-shadow: 0 0 0 100vmax var(--deep); clip-path: inset(0 -100vmax);
}
.post--full .post__meta { color: var(--yellow); }
.post--full .post__date { color: #9fb3a5; }
.post--full .post__title { max-width: 14ch; margin-bottom: 22px; font-size: clamp(56px, 9vw, 140px); line-height: 0.86; letter-spacing: -0.055em; }
.post--full .post__excerpt { max-width: 56ch; color: var(--on-deep); font-size: 20px; }
.post--full .btn--primary { background: var(--yellow); color: var(--ink); }
.post--full .btn--primary:hover { background: #fff; }
.post--full .post__back { box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.4); }
.post--full .post__back:hover { background: #fff; color: var(--ink); }

.post__shot { margin: clamp(-48px, -3vw, -24px) 0 56px; position: relative; }
.post__zoom { display: block; max-height: 760px; overflow: hidden; border-radius: 22px; cursor: zoom-in; box-shadow: 0 40px 80px -40px rgb(15 42 26 / 0.6); }
.post__zoom img { width: 100%; }
.post__caption { margin-top: 12px; color: var(--soft); font-size: 14px; }

.doc { max-width: 860px; font-size: 18px; }
/* docs write "## Section", which the renderer prints as <h3>: h2 and h3 are both section heads */
.doc h2, .doc h3 { margin: 56px 0 14px; font: 900 clamp(32px, 3.6vw, 52px)/0.95 var(--font); letter-spacing: -0.045em; }
.doc h2:first-child, .doc h3:first-child { margin-top: 0; }
.doc h4 { margin: 30px 0 8px; font: 700 21px/1.2 var(--font); }
.doc h5, .doc h6 { margin: 22px 0 6px; font: 700 17px/1.3 var(--font); }
.doc p, .doc ul, .doc ol { margin: 0 0 16px; }
.doc li { margin-bottom: 6px; }
.doc li::marker { color: var(--green); }
.doc a { color: var(--green); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.doc a:hover { color: var(--ink); }
.doc code { padding: 2px 6px; border-radius: 6px; background: #dce1d8; overflow-wrap: anywhere; }
.doc pre { margin: 0 0 20px; padding: 18px 20px; overflow-x: auto; border-radius: 16px; background: var(--deep); color: #e8efe9; }
.doc pre code { padding: 0; background: none; overflow-wrap: normal; }
.doc blockquote { margin: 0 0 20px; padding: 18px 22px; border-radius: 16px; background: var(--paper); border-left: 6px solid var(--yellow); }
.doc blockquote p:last-child { margin-bottom: 0; }
.doc hr { margin: 40px 0; border: 0; border-top: 2px solid #d3d9d0; }
.doc-table { margin: 0 0 20px; overflow-x: auto; border-radius: 16px; background: var(--paper); }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc th, .doc td { padding: 11px 14px; border-bottom: 1px solid #dfe4dc; text-align: left; vertical-align: top; }
.doc th { background: var(--deep); color: #f1f3ee; font-weight: 700; }
.doc tbody tr:last-child td { border-bottom: 0; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; max-width: 860px; margin: 40px 0 0; padding: 0; list-style: none; }
.tags__item { padding: 6px 13px; border-radius: 999px; background: var(--deep); color: #f1f3ee; font: 500 14px/1.2 var(--font); }

.post__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; }
.post__nav-link { display: block; padding: 22px 26px; border-radius: 22px; background: var(--paper); font: 900 clamp(22px, 2.4vw, 32px)/1 var(--font); letter-spacing: -0.035em; text-decoration: none; transition: background 250ms ease, color 250ms ease; }
.post__nav-link:hover { background: var(--deep); color: #fff; }
.post__nav-link--older { grid-column: 2; text-align: right; }
.post__nav-label { display: block; margin-bottom: 8px; font: 500 14px/1 var(--font); letter-spacing: 0; color: var(--green); }
.post__nav-link:hover .post__nav-label { color: var(--yellow); }
.post__nav-link--newer .post__nav-label::before { content: "← "; }
.post__nav-link--older .post__nav-label::after { content: " →"; }

/* ── notice, colophon ─────────────────────────────────────────────────────────────────────── */
.notice { max-width: 680px; padding: 26px 28px; border-radius: 22px; background: var(--paper); font-size: 19px; }
.notice p { margin: 0; }
.notice a { color: var(--green); }
.notice--error { background: #fbe9e7; color: #8e2a1f; }

.colophon { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; max-width: 1720px; margin: 64px auto 0; padding: 24px var(--edge) 0; border-top: 1px solid #d3d9d0; color: var(--soft); font-size: 14px; }
.colophon p { margin: 0; }
.colophon a { color: var(--green); }

/* ── screenshot dialog ────────────────────────────────────────────────────────────────────── */
.zoom { width: min(1480px, 96vw); max-width: none; height: 94vh; max-height: none; padding: 0; border: 0; border-radius: 22px; background: var(--deep); color: #fff; }
.zoom::backdrop { background: rgb(15 42 26 / 0.7); backdrop-filter: blur(6px); }
.zoom__bar { position: sticky; top: 0; display: flex; justify-content: flex-end; padding: 10px; background: var(--deep); }
.zoom__close { min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--yellow); color: var(--ink); font: 700 15px/1 var(--font); cursor: pointer; }
.zoom__scroll { height: calc(94vh - 64px); overflow: auto; }
.zoom__img { width: 100%; }

@media (max-width: 1100px) { .masthead__tagline { display: none; } }
@media (max-width: 860px) {
    .listing { grid-auto-columns: 86vw; }
    .post--card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .post__media { min-height: 0; }
    .toolbar::after { width: 100%; margin-left: 0; }
    .post__nav { grid-template-columns: 1fr; }
    .post__nav-link--older { grid-column: auto; }
}
@media (max-width: 480px) {
    .brand__name { display: none; }
    .masthead__count { padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* long words and URLs in the doc and comments wrap instead of widening the page */
.doc p, .doc li, .doc blockquote, .doc td, .doc th, .comment__body { overflow-wrap: anywhere; }
.doc pre, .doc-table { max-width: 100%; }
