/* Catalog style "demo6" — a contents ledger in heavy Schibsted Grotesk on pale green-grey, with a deep green bar that peeks its style list open and a pinned cover on the post page. Mirrors /demo6/. */
@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;
    --line: #c9cfc5;
    --deep: #0f2a1a;
    --on-deep: #f1f3ee;
    --on-deep-soft: #c9d3cb;
    --green: #2f7d43;
    --yellow: #ffb500;
    --font: "Schibsted Grotesk", "Lato", system-ui, sans-serif;
    --edge: clamp(16px, 3vw, 48px);
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 17px/1.55 var(--font); }
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; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 30; padding: 10px 16px; background: var(--yellow); color: var(--ink); font-weight: 700; border-radius: 999px; }
.skip:focus { left: 16px; }
.deco { display: none; }

.page { max-width: 1720px; margin: 0 auto; padding: 0 var(--edge); }

/* masthead: the deep green field the site header sits on, full bleed */
.masthead {
    position: relative; padding: 18px 0 20px; background: var(--deep); color: var(--on-deep);
    box-shadow: 0 0 0 100vmax var(--deep); clip-path: inset(0 -100vmax);
}
.masthead__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 32px; }
.brand { display: inline-flex; align-items: baseline; gap: 14px; text-decoration: none; }
.brand__mark { font-size: 34px; font-weight: 900; letter-spacing: -0.05em; line-height: 1; color: var(--on-deep); }
.brand__name { font-size: 15px; font-weight: 700; color: var(--yellow); }
.masthead__tagline { flex: 1 1 360px; margin: 0; color: var(--on-deep-soft); font-size: 15px; }
.masthead__count { margin: 0; color: var(--on-deep-soft); font-size: 15px; }
.masthead__num { color: var(--on-deep); font-weight: 900; }

/* style bar: sticky under the top; the URL row always shows, the list peeks open on hover/focus */
.stylebar {
    position: sticky; top: 0; z-index: 20; color: var(--on-deep); background: var(--deep);
    box-shadow: 0 0 0 100vmax var(--deep); clip-path: inset(0 -100vmax -40px);
    border-top: 1px solid rgb(255 255 255 / 0.1);
}
.stylebar::after {
    content: ""; position: absolute; left: 50%; bottom: -10px; width: 64px; height: 10px; translate: -50% 0;
    background: var(--deep); border-radius: 0 0 10px 10px;
}
.stylebar__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 0 12px; }
.stylebar__label { font-size: 15px; font-weight: 700; color: var(--yellow); }
.stylebar__value {
    flex: 1 1 260px; min-width: 0; padding: 8px 14px; overflow-x: auto; white-space: nowrap;
    background: rgb(255 255 255 / 0.08); border-radius: 999px; color: var(--on-deep);
}
.stylebar__copy {
    min-height: 40px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--yellow); color: var(--ink);
    font: 700 15px/1 var(--font); cursor: pointer; transition: background 200ms ease, transform 150ms ease;
}
.stylebar__copy:hover { background: #fff; }
.stylebar__copy:active { transform: scale(0.97); }
.stylebar__copy.is-done { background: var(--on-deep); }
.stylebar__copy:focus-visible, .stylebar a:focus-visible { outline-color: var(--yellow); }
.stylebar__list {
    display: flex; flex-wrap: wrap; gap: 4px 6px; width: 100%; max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height 420ms cubic-bezier(.2, .7, .2, 1), opacity 300ms ease, padding 300ms ease;
}
.stylebar:hover .stylebar__list, .stylebar:focus-within .stylebar__list { max-height: 240px; padding: 4px 0 6px; opacity: 1; }
.stylebar__item { padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--on-deep-soft); text-decoration: none; transition: background 200ms ease, color 200ms ease; }
.stylebar__item:hover { color: var(--yellow); }
.stylebar__item.is-active { background: var(--yellow); color: var(--ink); }
@media (hover: none) {
    .stylebar { position: relative; }
    .stylebar::after { display: none; }
    .stylebar__list { max-height: none; opacity: 1; padding-bottom: 6px; }
}

/* categories: one line of words, the current one underlined in green */
.categories { margin: clamp(40px, 6vw, 88px) 0 0; }
.categories__list { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0; padding: 0; list-style: none; }
.categories__link {
    display: inline-flex; align-items: baseline; gap: 6px; min-height: 44px; padding-top: 8px; font-size: 18px; font-weight: 700;
    text-decoration: none; transition: color 200ms ease;
}
.categories__link:hover { color: var(--green); }
.categories__link.is-active { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 8px; text-decoration-color: var(--green); }
.categories__count { font-size: 14px; font-weight: 500; color: var(--soft); font-variant-numeric: tabular-nums; }

/* listing */
.content { padding: 24px 0 clamp(72px, 9vw, 140px); }
.listing__header { margin-bottom: clamp(24px, 3vw, 40px); }
.listing__title { margin: 0; font-size: clamp(56px, 9vw, 150px); font-weight: 900; line-height: 0.88; letter-spacing: -0.055em; }
.listing__intro { max-width: 52ch; margin: 18px 0 0; color: var(--soft); font-size: 19px; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-top: 28px; color: var(--soft); font-size: 15px; }
.toolbar p { margin: 0; }
.toolbar__view { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.toolbar__label { margin-right: 8px; }
.toolbar__opt { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; border-radius: 999px; font-weight: 700; color: var(--ink); text-decoration: none; }
.toolbar__opt:hover { background: var(--paper); }
.toolbar__opt.is-active { background: var(--ink); color: var(--paper); }

/* the ledger: one post per row — number, headline and words, picture */
.listing { border-top: 3px solid var(--ink); }
.post--card {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 34%); grid-template-areas: "body media";
    gap: 20px clamp(24px, 4vw, 72px); padding: clamp(28px, 3.4vw, 48px) 0; border-bottom: 1px solid var(--line);
}
.post--card .post__media { grid-area: media; display: block; align-self: start; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: #cfd4cb; }
.post__thumb { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 900ms cubic-bezier(.2, .7, .2, 1); }
.post--card:hover .post__thumb { transform: scale(1.04); }
.post--card .post__body { grid-area: body; display: grid; grid-template-columns: clamp(96px, 10vw, 160px) minmax(0, 1fr); column-gap: 20px; align-content: start; }
.post--card .post__meta { display: contents; }
.post--card .post__num {
    grid-column: 1; grid-row: 1 / span 4; color: var(--ink); white-space: nowrap;
    font-size: clamp(30px, 3vw, 50px); font-weight: 900; letter-spacing: -0.05em; line-height: 0.9; font-variant-numeric: tabular-nums;
}
.post--card .post__cat, .post--card .post__date { grid-column: 2; }
.post__meta { margin: 0 0 12px; color: var(--soft); font-size: 15px; }
.post__num { color: var(--green); font-weight: 900; }
.post__cat { color: var(--green); font-weight: 700; text-decoration: none; }
.post__cat:hover { text-decoration: underline; text-underline-offset: 4px; }
.post__date { color: var(--soft); }
.post--card .post__cat { margin-right: auto; }
.post__title { margin: 8px 0 14px; font-size: clamp(36px, 4.4vw, 76px); font-weight: 900; line-height: 0.95; letter-spacing: -0.045em; text-wrap: balance; }
.post__title a { text-decoration: none; }
.post__title a:hover { color: var(--green); }
.post--card .post__title, .post--card .post__excerpt, .post--card .post__actions { grid-column: 2; }
.post__excerpt { max-width: 56ch; margin: 0 0 22px; color: var(--soft); font-size: 18px; }
.post__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin: 0; }

.btn {
    display: inline-flex; align-items: center; gap: 8px; min-height: 48px; font: 700 16px/1.2 var(--font);
    text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--green);
    transition: color 200ms ease, background 200ms ease, transform 150ms ease;
}
.btn:hover { color: var(--green); }
.btn--primary { padding: 0 26px; border-radius: 999px; background: var(--ink); color: var(--paper); text-decoration: none; }
.btn--primary:hover { background: var(--green); color: #fff; }
.btn--primary:active { transform: scale(0.97); }

.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: clamp(40px, 5vw, 72px); }
.pager__link {
    display: inline-grid; place-items: center; min-width: 48px; min-height: 48px; padding: 0 14px; border-radius: 999px;
    font-size: 18px; font-weight: 700; text-decoration: none;
}
.pager__link:hover { background: var(--paper); }
.pager__link.is-active { background: var(--ink); color: var(--paper); }
.pager__link--prev, .pager__link--next { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--green); }
.pager__link--next { margin-left: auto; }

/* one post: words on the left, the screenshot pinned on the right like the cover */
.post--full {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 40%); gap: 0 clamp(32px, 5vw, 96px);
    align-items: start;
}
.post--full .post__header { grid-column: 1; grid-row: 1; padding: 8px 0 clamp(32px, 4vw, 56px); }
.post--full .post__shot { grid-column: 2; grid-row: 1 / span 4; position: sticky; top: 92px; margin: 8px 0 0; }
.post--full .post__doc { grid-column: 1; grid-row: 2; }
.post--full .post__tags { grid-column: 1; grid-row: 3; }
.post--full .post__nav { grid-column: 1 / -1; grid-row: 5; }
.post--full .post__meta { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.post--full .post__title { font-size: clamp(52px, 7.4vw, 136px); line-height: 0.88; letter-spacing: -0.055em; margin: 10px 0 22px; }
.post--full .post__excerpt { font-size: 20px; color: var(--ink); }
.post__zoom {
    position: relative; display: block; aspect-ratio: 2 / 3; max-height: calc(100svh - 150px); overflow: hidden;
    border-radius: 4px; background: #cfd4cb; cursor: zoom-in;
}
.post__zoom img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 900ms cubic-bezier(.2, .7, .2, 1); }
.post__zoom:hover img { transform: scale(1.03); }
.post__caption { margin-top: 12px; color: var(--soft); font-size: 14px; }

.doc { overflow-wrap: anywhere; max-width: 70ch; font-size: 18px; }
.doc h2, .doc h3 { margin: 56px 0 14px; padding-top: 18px; border-top: 3px solid var(--ink); font-size: clamp(30px, 3vw, 44px); font-weight: 900; line-height: 1; letter-spacing: -0.04em; }
.doc > h2:first-child { margin-top: 0; }
.doc h4, .doc h5, .doc h6 { margin: 28px 0 8px; font-size: 20px; font-weight: 700; }
.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: 4px; }
.doc a:hover { color: var(--ink); }
.doc strong { font-weight: 700; }
.doc code { padding: 1px 6px; background: var(--paper); border-radius: 4px; overflow-wrap: anywhere; }
.doc pre { margin: 0 0 20px; padding: 18px 20px; overflow-x: auto; background: var(--deep); color: var(--on-deep); border-radius: 6px; }
.doc pre code { padding: 0; background: none; overflow-wrap: normal; }
.doc blockquote { margin: 0 0 20px; padding: 18px 22px; background: var(--paper); border-left: 4px solid var(--yellow); border-radius: 0 6px 6px 0; }
.doc blockquote p:last-child { margin-bottom: 0; }
.doc hr { margin: 40px 0; border: 0; border-top: 1px solid var(--line); }
.doc img { border-radius: 4px; }
.doc-table { margin: 0 0 20px; overflow-x: auto; }
.doc table { width: 100%; border-collapse: collapse; font-size: 16px; }
.doc th, .doc td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc th { border-bottom: 2px solid var(--ink); font-weight: 900; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0 0; padding: 0; list-style: none; }
.tags__item { padding: 4px 14px; border-radius: 999px; background: var(--paper); font-size: 15px; font-weight: 500; }
.post__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin-top: clamp(56px, 7vw, 104px); border-top: 3px solid var(--ink); }
.post__nav-link { padding: 22px 0; font-size: clamp(24px, 2.6vw, 40px); font-weight: 900; letter-spacing: -0.035em; line-height: 1; text-decoration: none; transition: color 200ms ease; }
.post__nav-link:hover { color: var(--green); }
.post__nav-link--older { grid-column: 2; text-align: right; }
.post__nav-label { display: block; margin-bottom: 8px; color: var(--soft); font-size: 15px; font-weight: 500; letter-spacing: 0; }

.notice { max-width: 60ch; padding: 24px 28px; background: var(--paper); border-left: 4px solid var(--green); font-size: 18px; }
.notice p { margin: 0; }
.notice a { color: var(--green); font-weight: 700; }
.notice--error { border-left-color: #b3261e; color: #7d1a14; }

.colophon {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding: 28px 0 36px;
    background: var(--deep); color: var(--on-deep-soft); font-size: 14px;
    box-shadow: 0 0 0 100vmax var(--deep); clip-path: inset(0 -100vmax);
}
.colophon p { margin: 0; }
.colophon a { color: var(--on-deep); text-decoration-color: var(--yellow); text-underline-offset: 4px; }
.colophon a:focus-visible { outline-color: var(--yellow); }

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

@media (max-width: 1000px) {
    .post--full { grid-template-columns: minmax(0, 1fr); }
    .post--full .post__header, .post--full .post__shot, .post--full .post__doc, .post--full .post__tags, .post--full .post__nav { grid-column: 1; grid-row: auto; }
    .post--full .post__shot { position: static; margin: 0 0 40px; }
    .post__zoom { aspect-ratio: 4 / 5; max-height: 80svh; }
}
@media (max-width: 760px) {
    .post--card { grid-template-columns: minmax(0, 1fr); grid-template-areas: "media" "body"; }
    .post--card .post__body { grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; }
    .post--card .post__num { grid-row: 1 / span 2; font-size: 40px; }
    .post--card .post__title, .post--card .post__excerpt, .post--card .post__actions { grid-column: 1 / -1; }
    .masthead__tagline { flex-basis: 100%; }
}
@media (max-width: 520px) {
    body { font-size: 16px; }
    .stylebar__copy { flex: 1 0 100%; }
    .post__excerpt { font-size: 17px; }
    .post__nav { grid-template-columns: 1fr; }
    .post__nav-link--older { grid-column: auto; text-align: left; border-top: 1px solid var(--line); }
}
@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%; }
