/*
 * @nera-static/theme-ansitz — look "Ansitz", for people whose pictures do
 * the talking. A near-black page, warm white text, one amber for links,
 * marks and year numerals; titles in Instrument Serif at display sizes,
 * text in Instrument Sans (ROADMAP-themes §S13). No JavaScript, no
 * third-party request; the webfonts below are served from this site
 * (§S11.2).
 */

/* Fonts: SIL Open Font License 1.1, see ../fonts/ansitz/OFL-*.txt. From
   @fontsource/instrument-serif and @fontsource-variable/{instrument-sans,
   jetbrains-mono} 5.3.0. */
@font-face {
    font-family: 'Instrument Serif';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url('../fonts/ansitz/instrument-serif-latin-ext-400-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Instrument Serif';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url('../fonts/ansitz/instrument-serif-latin-400-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Instrument Serif';
    font-style: italic;
    font-display: swap;
    font-weight: 400;
    src: url('../fonts/ansitz/instrument-serif-latin-ext-400-italic.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Instrument Serif';
    font-style: italic;
    font-display: swap;
    font-weight: 400;
    src: url('../fonts/ansitz/instrument-serif-latin-400-italic.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Instrument Sans';
    font-style: normal;
    font-display: swap;
    font-weight: 400 700;
    src: url('../fonts/ansitz/instrument-sans-latin-ext-wght-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Instrument Sans';
    font-style: normal;
    font-display: swap;
    font-weight: 400 700;
    src: url('../fonts/ansitz/instrument-sans-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-display: swap;
    font-weight: 100 800;
    src: url('../fonts/ansitz/jetbrains-mono-latin-ext-wght-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-display: swap;
    font-weight: 100 800;
    src: url('../fonts/ansitz/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Every token read once, with its default (§S11.3), plus the few fixed
   colours of the look that are not tokens. */
:root {
    --bg: var(--theme-color-bg, #0f0f0e);
    --surface: var(--theme-color-surface, #191917);
    --text: var(--theme-color-text, #efede6);
    --muted: var(--theme-color-muted, #a8a59b);
    --accent: var(--theme-color-accent, #e8b04a);
    --accent-text: var(--theme-color-accent-text, #0f0f0e);
    --border: var(--theme-color-border, #2e2d29);
    --focus: var(--theme-color-focus, #e8b04a);
    --font-body: var(--theme-font-body, 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
    --font-heading: var(--theme-font-heading, 'Instrument Serif', Georgia, 'Times New Roman', serif);
    --font-mono: var(--theme-font-mono, 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace);
    --base: var(--theme-size-base, 1.0625rem);
    --measure: var(--theme-size-measure, 40rem);
    --width: var(--theme-size-width, 78rem);
    --radius: var(--theme-size-radius, 0);
    --space: var(--theme-size-space, 1.5rem);

    /* light text a step below `text`: captions on pictures, running text */
    --soft: #dcd9cf;
    --prose: #e3e0d7;
    --quiet: #d5d2c8;
    /* the contact sheet: film base, frame and sprocket holes */
    --sheet: #070707;
    --film: #141413;
    --sprocket: #2b2a27;
    --shade: 15, 15, 14;
    --gutter: 40px;
}

/* ---------- base ---------- */

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
}

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

a {
    color: inherit;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
    margin: 0;
}

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

.skip-link {
    position: absolute;
    left: 12px;
    top: -100px;
    z-index: 10;
    padding: 10px 18px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--accent);
    font-weight: 600;
}

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

/* A band's inner element carries the page width and gutter (§S12: no
   generic wrapper class). */
.site-header__inner,
.site-footer__inner,
.home-hero__inner,
.home-statement,
.site-main > .post-list,
.site-main > .page__header,
.post__header,
.tag-overview,
.post__footer {
    width: 100%;
    max-width: calc(var(--width) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* ---------- header ---------- */

/* On a page that opens with a picture (the home hero, a post with an
   image) the header lies on it; elsewhere it sits on a hairline. */
.site-header {
    border-bottom: 1px solid var(--border);
}

body:has(.home-hero__image, .post__media) .site-header {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 2;
    border-bottom: 0;
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 36px;
    min-height: 88px;
    padding-block: 14px;
}

.site-header__brand {
    margin-right: auto;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 34px;
    line-height: 1;
    text-decoration: none;
}

.site-header__nav .nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0 34px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 15px;
    font-weight: 500;
}

.site-header__nav .nav__link {
    display: inline-block;
    padding: 12px 0;
    color: var(--soft);
    text-decoration: none;
}

.site-header__nav .nav__link:hover,
.site-header__nav .nav__link--active,
.site-header__nav .nav__link--active-path {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 8px;
}

.lang-switch__list {
    display: flex;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
}

.lang-switch__link {
    display: inline-block;
    padding: 12px 0;
    color: var(--soft);
    text-underline-offset: 6px;
}

span.lang-switch__link {
    color: var(--muted);
}

/* ---------- buttons: a pill with a hairline ---------- */

.button {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 26px;
    border: 1px solid var(--text);
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
}

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

.button--primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text);
}

/* ---------- home: hero, the newest picture edge to edge ---------- */

.home-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 860px;
    isolation: isolate;
}

.home-hero__image,
.home-hero__image picture,
.home-hero__image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.home-hero__image {
    z-index: -2;
    background: var(--surface);
}

.home-hero__image img {
    object-fit: cover;
}

/* dark at the top for the header, dark at the bottom for the title */
.home-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(var(--shade), 0.55) 0, rgba(var(--shade), 0) 22%, rgba(var(--shade), 0) 42%, rgba(var(--shade), 0.92) 100%);
}

.home-hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 40px;
    align-items: end;
    padding-block: 160px 56px;
}

.home-hero__title {
    max-width: 11em;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: clamp(54px, 8.6vw, 132px);
    line-height: 0.92;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.home-hero__title a {
    text-decoration: none;
}

.home-hero__lead {
    max-width: 30em;
    margin-top: 26px;
    font-size: 20px;
    line-height: 1.5;
    color: var(--soft);
}

.home-hero__actions {
    margin-top: 26px;
}

/* place and exposure data, bottom right */
.home-hero__aside {
    display: grid;
    gap: 4px;
    justify-items: end;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--soft);
    text-align: right;
}

.home-hero__aside b {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

/* ---------- home: statement (the page body) ---------- */

.home-statement {
    padding-block: 120px 40px;
}

.home-statement p {
    max-width: 36em;
    font-size: 18px;
    line-height: 1.6;
    color: var(--muted);
}

.home-statement > p:first-child {
    max-width: 22em;
    font-family: var(--font-heading);
    font-size: clamp(34px, 4.4vw, 62px);
    line-height: 1.08;
    letter-spacing: -0.01em;
    text-wrap: balance;
    color: var(--text);
}

.home-statement > p:first-child em {
    color: var(--accent);
}

.home-statement p + p {
    margin-top: 32px;
}

.home-statement a {
    text-decoration-color: var(--accent);
    text-underline-offset: 5px;
}

/* ---------- post lists: a wall of pictures in different sizes ---------- */

.post-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    padding-top: 96px;
}

.post-list__title,
.post-list__more {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.post-list__title {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 56px;
    line-height: 1;
}

.post-list__more {
    justify-self: stretch;
    padding-left: 16px;
    font-size: 15px;
    font-weight: 600;
    text-align: right;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

.post-list__items {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 64px 32px;
    padding: 0;
    list-style: none;
}

/* the wall's rhythm, repeated every seven cards: 7+5, 5+7, 4+4+4 */
.post-list__item {
    display: flex;
    grid-column: span 4;
}

.post-list__item:nth-child(7n + 1),
.post-list__item:nth-child(7n + 4) {
    grid-column: span 7;
}

.post-list__item:nth-child(7n + 2),
.post-list__item:nth-child(7n + 3) {
    grid-column: span 5;
}

.post-list__item:nth-child(7n + 3) {
    align-self: end;
}

.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.post-card__media {
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: var(--surface);
    border-radius: var(--radius);
}

.post-list__item:nth-child(7n + 1) .post-card__media,
.post-list__item:nth-child(7n + 4) .post-card__media {
    aspect-ratio: 3 / 2;
}

.post-list__item:nth-child(7n + 2) .post-card__media {
    aspect-ratio: 4 / 5;
}

.post-list__item:nth-child(7n + 3) .post-card__media {
    aspect-ratio: 4 / 3;
}

.post-card__media picture,
.post-card__media img {
    width: 100%;
    height: 100%;
}

.post-card__media img {
    object-fit: cover;
}

.post-card__title {
    margin-top: 20px;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 34px;
    line-height: 1.05;
}

.post-list__item:nth-child(7n + 5) .post-card__title,
.post-list__item:nth-child(7n + 6) .post-card__title,
.post-list__item:nth-child(7n) .post-card__title {
    font-size: 28px;
}

.post-card__link {
    text-decoration: none;
}

/* the whole card is the link's target */
.post-card__link::after {
    content: '';
    position: absolute;
    inset: 0;
}

.post-card:hover .post-card__link {
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

/* a post without a picture: its description on a raised panel */
.post-card__body:first-child {
    padding: 28px;
    background: var(--surface);
}

.post-card__body:first-child .post-card__title {
    margin-top: 0;
}

.post-card__excerpt {
    margin-top: 12px;
    color: var(--quiet);
}

.post-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 18px;
    margin-top: 8px;
    font-size: 14.5px;
    color: var(--muted);
}

/* ---------- home: highlight strip, a contact sheet ---------- */

.home-highlight {
    margin-top: 112px;
    padding: 56px max(var(--gutter), calc((100% - var(--width)) / 2)) 64px;
    background: var(--sheet);
    border-block: 1px solid var(--border);
}

.home-highlight h2 {
    margin-bottom: 36px;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 44px;
    line-height: 1;
}

.home-highlight ol {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 0;
    padding: 26px 0;
    list-style: none;
    counter-reset: frame 20;
    background:
        repeating-linear-gradient(90deg, transparent 0 14px, var(--sprocket) 14px 30px) top / 100% 12px no-repeat,
        repeating-linear-gradient(90deg, transparent 0 14px, var(--sprocket) 14px 30px) bottom / 100% 12px no-repeat,
        var(--film);
}

.home-highlight a {
    position: relative;
    display: block;
    padding: 0 7px;
    text-decoration: none;
}

.home-highlight img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

/* frame numbers under the pictures, as on a contact sheet */
.home-highlight li {
    counter-increment: frame;
}

.home-highlight a::after {
    content: counter(frame);
    position: absolute;
    left: 14px;
    bottom: -21px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.04em;
    color: var(--accent);
}

/* the titles are the links' text, hidden behind the pictures */
.home-highlight a span,
.home-series li a span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* a post without a picture keeps its frame and shows its title in it;
   overflow stays visible, so a long title grows the frame instead of being cut */
.home-highlight li:not(:has(img)) a span,
.home-series li:not(:has(img)) a span {
    position: static;
    display: flex;
    align-items: flex-end;
    width: auto;
    height: auto;
    padding: 12px 14px;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    overflow-wrap: anywhere;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-heading);
    font-size: 20px;
    line-height: 1.1;
}

.home-highlight li:not(:has(img)) a span {
    aspect-ratio: 3 / 2;
}

/* no underline, as in the highlight strip, whose links set none */
.home-series li:not(:has(img)) a {
    text-decoration: none;
}

.home-series li:first-child:not(:has(img)) a span {
    aspect-ratio: 16 / 10;
    padding: 24px 28px;
    font-size: 40px;
}

.home-series li:nth-child(n + 2):not(:has(img)) a span {
    aspect-ratio: 1;
    padding: 10px;
    font-size: 15px;
}

/* ---------- home: featured series, one large picture, three small ---------- */

.home-series {
    display: grid;
    grid-template-columns: minmax(0, 6fr) repeat(3, minmax(0, 1fr));
    grid-template-rows: 1fr auto auto auto;
    column-gap: 10px;
    width: min(var(--width), 100% - 2 * var(--gutter));
    margin: 96px auto 0;
}

.home-series > div,
.home-series > ol {
    display: contents;
}

.home-series li {
    list-style: none;
}

.home-series li:first-child {
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: end;
    margin-right: 38px;
}

.home-series li:first-child img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.home-series li:nth-child(n + 2) {
    grid-row: 3;
    margin-top: 28px;
}

.home-series li:nth-child(2) {
    grid-column: 2;
}

.home-series li:nth-child(3) {
    grid-column: 3;
}

.home-series li:nth-child(4) {
    grid-column: 4;
}

.home-series li:nth-child(n + 5) {
    display: none;
}

.home-series li:nth-child(n + 2) img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.home-series li a {
    position: relative;
    display: block;
    background: var(--surface);
}

.home-series p {
    grid-column: 2 / -1;
    grid-row: 1;
    align-self: end;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

.home-series h2 {
    grid-column: 2 / -1;
    grid-row: 2;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 64px;
    line-height: 0.95;
}

.home-series .button {
    grid-column: 2 / -1;
    grid-row: 4;
    justify-self: start;
    margin-top: 26px;
}

/* ---------- home: about ---------- */

.home-about {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 32px;
    width: min(var(--width), 100% - 2 * var(--gutter));
    margin: 96px auto 0;
    padding-top: 56px;
    border-top: 1px solid var(--border);
}

/* the initials, a quiet seal in the margin */
.home-about__mark {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 30px;
    color: var(--accent);
}

.home-about > div > p:first-child {
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

.home-about h2 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 56px;
    line-height: 1;
}

.home-about h2 + p {
    max-width: 34em;
    margin-top: 22px;
    font-size: 19px;
    color: var(--quiet);
}

.home-about__links {
    grid-column: 2;
    margin-top: 26px;
}

/* ---------- post: the header, on the picture when there is one ---------- */

.post {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.post__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 40px;
    align-items: end;
    align-content: end;
    padding-block: 88px 56px;
}

/* with a picture: the header and the picture share the first row */
.post:has(> .post__media) > .post__header,
.post > .post__media {
    grid-area: 1 / 1;
}

.post:has(> .post__media) > .post__header {
    z-index: 1;
    padding-block: 160px 56px;
}

.post__media {
    position: relative;
    min-height: 780px;
    background: var(--surface);
}

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

.post__media img {
    object-fit: cover;
}

.post__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(var(--shade), 0.55) 0, rgba(var(--shade), 0) 22%, rgba(var(--shade), 0) 42%, rgba(var(--shade), 0.92) 100%);
}

.post__series {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

.post__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 22px;
    margin-bottom: 22px;
    font-size: 15px;
    color: var(--soft);
}

.post-author {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.post-author__mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 16px;
    color: var(--accent);
}

.post-author__name {
    font-weight: 600;
    color: var(--text);
}

.post__title {
    max-width: 12em;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: clamp(48px, 7.4vw, 112px);
    line-height: 0.92;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.post__lead {
    max-width: 30em;
    margin-top: 26px;
    font-size: 20px;
    line-height: 1.5;
    color: var(--soft);
}

/* place and exposure data, bottom right */
.post__header > div + div {
    display: grid;
    gap: 4px;
    justify-items: end;
    text-align: right;
}

.post__location {
    font-weight: 600;
    font-size: 15px;
}

.post__image-note {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--soft);
}

.post__body {
    padding-top: 88px;
}

.post:not(:has(> .post__media)) .post__body {
    padding-top: 32px;
}

/* ---------- post: facts, a row of large figures after the text ---------- */

.post-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(1000px, 100% - 48px);
    margin: 88px auto 0;
    border-block: 1px solid var(--border);
}

.post-facts__item {
    padding: 28px 24px 28px 0;
}

.post-facts__item + .post-facts__item {
    padding-left: 24px;
    border-left: 1px solid var(--border);
}

.post-facts__label {
    font-size: 14px;
    color: var(--muted);
}

.post-facts__value {
    margin-top: 6px;
    font-family: var(--font-heading);
    font-size: 38px;
    line-height: 1;
}

/* ---------- post footer: tags, series, previous / next ---------- */

.post__footer {
    display: grid;
    gap: 48px;
    margin-top: 72px;
}

.post__tags,
.post-series {
    width: min(var(--measure), 100%);
    margin-inline: auto;
}

.post__tags:empty,
.post__pagination:empty {
    display: none;
}

.tag-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-links__item {
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 14px;
    text-decoration: none;
}

.tag-links__item:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.post-series {
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.post-series__title {
    margin-bottom: 12px;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 30px;
    line-height: 1.05;
}

.post-series__list {
    padding: 0;
    list-style: none;
}

.post-series__item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 10px 0;
    border-top: 1px solid var(--border);
    font-size: 16px;
}

.post-series__item span {
    padding-top: 3px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
}

.post-series__item a {
    text-decoration: none;
}

.post-series__item a:hover {
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 5px;
}

.post-series__item--current span,
.post-series__item--current a {
    color: var(--accent);
}

/* previous and next: two text links, arrows in amber */
.post__pagination {
    margin-top: 64px;
}

.page-pagination {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
}

.page-pagination__link {
    display: block;
    padding: 28px 0;
    border-top: 1px solid var(--border);
    font-family: var(--font-heading);
    font-size: 38px;
    line-height: 1.02;
    text-decoration: none;
}

.page-pagination__link:hover {
    color: var(--accent);
}

.page-pagination__link::before,
.page-pagination__link::after {
    font-family: var(--font-body);
    font-size: 20px;
    color: var(--accent);
}

.page-pagination__link--previous::before {
    content: '← ';
}

.page-pagination__link--next {
    grid-column: 2;
    text-align: right;
}

.page-pagination__link--next::after {
    content: ' →';
}

/* ---------- pages: header ---------- */

.page__header {
    padding-block: 88px 56px;
}

.page__title {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: clamp(56px, 8.4vw, 128px);
    line-height: 0.92;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.page__lead {
    max-width: 32em;
    margin-top: 24px;
    font-size: 20px;
    color: var(--muted);
}

/* ---------- archive: years in amber italics, rows with a picture ---------- */

.post-archive__year {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 40px;
    width: min(var(--width), 100% - 2 * var(--gutter));
    margin-inline: auto;
    padding-block: 40px;
    border-top: 1px solid var(--border);
}

.post-archive__year h2 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-style: italic;
    font-size: 88px;
    line-height: 0.8;
    color: var(--accent);
}

.post-archive__count {
    display: block;
    margin-top: 18px;
    font-family: var(--font-body);
    font-style: normal;
    font-size: 14px;
    line-height: 1.4;
    color: var(--muted);
}

.post-archive__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.post-archive__item {
    position: relative;
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr) auto;
    grid-template-areas: 'media title date';
    gap: 28px;
    align-items: center;
    padding-block: 14px;
    border-top: 1px solid var(--border);
}

.post-archive__item:first-child {
    padding-top: 0;
    border-top: 0;
}

/* a row without a picture: no empty media column, the title starts at the edge */
.post-archive__item:not(:has(> div)) {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 'title date';
}

.post-archive__item > div {
    grid-area: media;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--surface);
}

.post-archive__item > div img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-archive__item > p {
    grid-area: title;
}

.post-archive__item a {
    font-family: var(--font-heading);
    font-size: 32px;
    line-height: 1.05;
    text-decoration: none;
}

/* the whole row is the link's target */
.post-archive__item a::after {
    content: '';
    position: absolute;
    inset: 0;
}

.post-archive__item:hover a {
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

.post-archive__item span {
    display: block;
    margin-top: 4px;
    font-size: 14.5px;
    color: var(--muted);
}

.post-archive__item time {
    grid-area: date;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
}

/* the tags at the end of the archive: a band of pills */
.site-main > .tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: min(var(--width), 100% - 2 * var(--gutter));
    margin: 0 auto;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.tag-cloud__item {
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 14px;
    text-decoration: none;
}

.tag-cloud__item:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---------- tag page (plugin-tags' tag overview) ---------- */

.tag-overview__header {
    padding-block: 88px 56px;
}

.tag-overview__title {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: clamp(56px, 8.4vw, 128px);
    line-height: 0.92;
    letter-spacing: -0.02em;
}

.tag-overview__image {
    margin-top: 32px;
}

.tag-overview__item {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 6px 40px;
    padding-block: 36px;
    border-top: 1px solid var(--border);
}

.tag-overview__item:last-child {
    border-bottom: 1px solid var(--border);
}

.tag-overview__item > * {
    grid-column: 2;
}

.tag-overview__item-title {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 44px;
    line-height: 1.02;
}

.tag-overview__item-date {
    grid-column: 1;
    grid-row: 1;
    padding-top: 14px;
    font-size: 15px;
    color: var(--muted);
}

.tag-overview__item-description {
    max-width: 36em;
    font-size: 18px;
    color: var(--quiet);
}

.tag-overview__item-link {
    justify-self: start;
    margin-top: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

/* the plugin-free default of the seam: the page title and body */
.tag-page > .page__title {
    width: min(var(--width), 100% - 2 * var(--gutter));
    margin: 88px auto 56px;
}

/* ---------- search (plugin-search, an optional peer) ---------- */

/* The site renders the plugin's input and list on a page type of its own;
   the plugin's script fills the list with the matches and leaves it empty
   when nothing matches, so an empty list takes no space. Every rule is
   scoped under .search. */
.site-main > .search {
    width: min(var(--width), 100% - 2 * var(--gutter));
    margin-inline: auto;
}

.search .search__input {
    display: block;
    width: 100%;
    padding: 18px 20px;
    border: 0;
    /* muted, not border: the input's one edge needs 3:1 (WCAG 1.4.11) */
    border-bottom: 1px solid var(--muted);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 22px;
    line-height: 1.3;
    appearance: none;
    /* the browser's own clear button, drawn for a dark page */
    color-scheme: dark;
}

.search .search__input:hover,
.search .search__input:focus {
    border-bottom-color: var(--accent);
}

.search .search__input:focus-visible {
    outline-offset: 2px;
}

.search .search__results {
    margin: 40px 0 0;
    padding: 0;
    list-style: none;
}

.search .search__results:empty {
    display: none;
}

/* the matches as rows, like the archive's */
.search .search__item {
    position: relative;
    padding-block: 16px;
    border-top: 1px solid var(--border);
}

.search .search__item:first-child {
    padding-top: 0;
    border-top: 0;
}

.search .search__link {
    font-family: var(--font-heading);
    font-size: 32px;
    line-height: 1.05;
    text-decoration: none;
}

/* the whole row is the link's target */
.search .search__link::after {
    content: '';
    position: absolute;
    inset: 0;
}

.search .search__item:hover .search__link {
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

.search .search__description {
    max-width: var(--measure);
    margin-top: 6px;
    font-size: 14.5px;
    color: var(--muted);
}

.search .search__highlight {
    color: var(--accent);
    font-weight: 600;
}

/* ---------- links that open a new tab ---------- */

/* A site that opens external links in a new tab (plugin-link-attributes in
   content, plugin-social-media-links' open_in_new_tab) gets them marked with
   an arrow, so the change of context is announced visually (WCAG 3.2.5). */
a[target='_blank']::after {
    content: '\00a0\2197';
    display: inline-block;
    text-decoration: none;
}

/* ---------- footer ---------- */

.site-footer {
    margin-top: 120px;
    border-top: 1px solid var(--border);
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 32px;
    padding-block: 32px;
    font-size: 14px;
    color: var(--muted);
}

.site-footer a {
    text-underline-offset: 4px;
}

.site-footer .social-media-links__list,
.site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer .social-media-links__icon:empty {
    display: none;
}

.site-footer__copy {
    margin-left: auto;
}

/* ---------- running text (posts and pages) ---------- */

/* Every block sits at the measure, centred; pictures and the pull quote
   break out of it. */
.post__body,
.page__body {
    font-size: 20px;
    line-height: 1.7;
    color: var(--prose);
}

.post__body > *,
.page__body > * {
    width: min(var(--measure), 100% - 48px);
    margin-inline: auto;
}

.post__body > * + *,
.page__body > * + * {
    margin-top: calc(var(--space) * 7 / 6);
}

/* a drop cap on the first paragraph of a post */
.post__body > p:first-child::first-letter {
    float: left;
    margin: 10px 14px 0 0;
    font-family: var(--font-heading);
    font-size: 104px;
    line-height: 0.72;
    color: var(--accent);
}

.post__body h2,
.page__body h2 {
    margin-top: 64px;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 46px;
    line-height: 1.02;
    color: var(--text);
}

.post__body h3,
.page__body h3 {
    margin-top: 48px;
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 32px;
    line-height: 1.1;
    color: var(--text);
}

.post__body a,
.page__body a {
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
}

.post__body ul,
.page__body ul {
    padding-left: 1.2em;
    list-style: disc;
}

.post__body ol,
.page__body ol {
    padding-left: 1.4em;
}

.post__body li + li,
.page__body li + li {
    margin-top: 8px;
}

.post__body li::marker,
.page__body li::marker {
    color: var(--accent);
}

.post__body :not(pre) > code,
.page__body :not(pre) > code {
    padding: 0.1em 0.35em;
    background: var(--surface);
    font-family: var(--font-mono);
    font-size: 0.82em;
}

.post__body pre,
.page__body pre {
    overflow-x: auto;
    padding: 20px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 15px;
    line-height: 1.6;
}

.post__body hr,
.page__body hr {
    height: 1px;
    background: var(--border);
    border: 0;
}

/* A Markdown image with a title: plugin-images makes it a figure, which
   runs nearly edge to edge. */
.post__body > .nera-image,
.page__body > .nera-image {
    width: min(var(--width), 100% - 80px);
    margin-block: 88px;
}

.post__body > .nera-image img,
.page__body > .nera-image img {
    width: 100%;
    max-height: 720px;
    object-fit: cover;
    border-radius: var(--radius);
}

.page__body > .nera-image:first-child {
    margin-top: 0;
}

.nera-image__caption {
    margin-top: 14px;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--muted);
}

/* Two pictures in one paragraph stand side by side, the first upright. */
.post__body > p:has(> picture + picture),
.post__body > p:has(> img + img),
.page__body > p:has(> picture + picture),
.page__body > p:has(> img + img) {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 32px;
    align-items: end;
    width: min(var(--width), 100% - 80px);
    margin-block: 88px 20px;
}

.post__body > p:has(> picture + picture) img,
.post__body > p:has(> img + img) img,
.page__body > p:has(> picture + picture) img,
.page__body > p:has(> img + img) img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: var(--radius);
}

.post__body > p:has(> picture + picture) > :first-child img,
.post__body > p:has(> img + img) > img:first-child,
.page__body > p:has(> picture + picture) > :first-child img,
.page__body > p:has(> img + img) > img:first-child {
    aspect-ratio: 4 / 5;
}

/* the blockquote is the theme's one emphasised box: a pull quote */
.post__body > blockquote,
.page__body > blockquote {
    width: min(1000px, 100% - 48px);
    margin-block: 96px;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: clamp(34px, 4.6vw, 64px);
    line-height: 1.08;
    text-align: center;
    text-wrap: balance;
    color: var(--text);
}

.post__body > blockquote p + p,
.page__body > blockquote p + p {
    margin-top: 0.4em;
}

/* a Markdown table: hairlines, a small header row; cells wrap on a phone */
.post__body table,
.page__body table {
    border-collapse: collapse;
    font-size: 16px;
    line-height: 1.5;
}

.post__body th,
.page__body th {
    padding: 10px 16px 10px 0;
    border-bottom: 1px solid var(--muted);
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-align: left;
}

.post__body td,
.page__body td {
    padding: 12px 16px 12px 0;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

/* ---------- motion: only for those who do not mind it ---------- */

@media (prefers-reduced-motion: no-preference) {
    .button,
    .site-header__nav .nav__link {
        transition: background-color 0.15s ease, color 0.15s ease;
    }

    .tag-links__item,
    .tag-cloud__item,
    .page-pagination__link {
        transition: color 0.15s ease, border-color 0.15s ease;
    }
}

/* ---------- one column below 900px ---------- */

@media (max-width: 900px) {
    :root {
        --gutter: 20px;
    }

    .site-header__inner {
        min-height: 0;
    }

    .site-header__brand {
        font-size: 30px;
    }

    .site-header__nav {
        width: 100%;
        order: 3;
    }

    .site-header__nav .nav {
        gap: 0 24px;
    }

    .home-hero {
        min-height: 740px;
    }

    /* the picture fills the top 58 % and fades into the page, so the title
       never sits on the subject */
    .home-hero__image {
        bottom: auto;
        height: 58%;
    }

    .home-hero__image img {
        object-position: 74% 50%;
    }

    .home-hero::after {
        background: linear-gradient(180deg, rgba(var(--shade), 0.55) 0, rgba(var(--shade), 0) 14%, rgba(var(--shade), 0) 34%, rgb(var(--shade)) 58%);
    }

    .home-hero__inner {
        grid-template-columns: minmax(0, 1fr);
        padding-bottom: 36px;
    }

    .home-hero__aside {
        justify-items: start;
        text-align: left;
    }

    .home-statement {
        padding-block: 72px 16px;
    }

    .post-list {
        padding-top: 64px;
    }

    .post-list__title {
        font-size: 42px;
    }

    .post-list__items {
        gap: 44px 0;
    }

    .post-list__item:nth-child(n) {
        grid-column: 1 / -1;
    }

    .post-list__item:nth-child(n) .post-card__media {
        aspect-ratio: 3 / 2;
    }

    .post-list__item:nth-child(n) .post-card__title {
        font-size: 30px;
    }

    .home-highlight {
        margin-top: 72px;
    }

    .home-highlight ol {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 34px;
    }

    .home-highlight li:not(:has(img)) a span {
        padding: 8px;
        font-size: 15px;
    }

    .home-series li:first-child:not(:has(img)) a span {
        padding: 16px 18px;
        font-size: 28px;
    }

    .home-series {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: none;
        margin-top: 64px;
    }

    .home-series li:first-child {
        grid-column: 1 / -1;
        grid-row: 1;
        margin: 0 0 36px;
    }

    .home-series p,
    .home-series h2,
    .home-series .button {
        grid-column: 1 / -1;
    }

    .home-series p {
        grid-row: 2;
    }

    .home-series h2 {
        grid-row: 3;
    }

    .home-series h2 {
        font-size: 46px;
    }

    .home-series li:nth-child(n + 2) {
        grid-row: 4;
    }

    .home-series li:nth-child(2) {
        grid-column: 1;
    }

    .home-series li:nth-child(3) {
        grid-column: 2;
    }

    .home-series li:nth-child(4) {
        grid-column: 3;
    }

    .home-series .button {
        grid-row: 5;
    }

    .home-about {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 28px;
    }

    .home-about h2 {
        font-size: 46px;
    }

    .home-about__links {
        grid-column: 1;
    }

    .post__body,
    .page__body {
        font-size: 18.5px;
    }

    .page__header,
    .tag-overview__header {
        padding-block: 48px 32px;
    }

    .post-archive__year {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
        padding-block: 28px;
    }

    .post-archive__year h2 {
        font-size: 64px;
    }

    .post-archive__item {
        grid-template-columns: 92px minmax(0, 1fr);
        grid-template-areas: 'media title';
        gap: 16px;
    }

    .post-archive__item:not(:has(> div)) {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: 'title';
    }

    .post-archive__item a {
        font-size: 24px;
    }

    .post-archive__item time {
        display: none;
    }

    .tag-overview__item {
        grid-template-columns: minmax(0, 1fr);
    }

    .tag-overview__item > *,
    .tag-overview__item-date {
        grid-column: 1;
    }

    .tag-overview__item-date {
        grid-row: auto;
        padding-top: 0;
    }

    .tag-overview__item-title {
        font-size: 34px;
    }

    .tag-page > .page__title {
        margin-block: 48px 32px;
    }

    .search .search__input {
        font-size: 19px;
    }

    .search .search__results {
        margin-top: 28px;
    }

    .search .search__link {
        font-size: 24px;
    }

    .post__header {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
        padding-block: 48px 32px;
    }

    .post:has(> .post__media) > .post__header {
        padding-bottom: 36px;
    }

    .post__media {
        min-height: 700px;
    }

    /* the picture (or a bare img) takes the top 58 %; the img inside a
       picture fills it */
    .post__media > picture,
    .post__media > img {
        bottom: auto;
        height: 58%;
    }

    .post__media img {
        object-position: 74% 50%;
    }

    .post__media::after {
        background: linear-gradient(180deg, rgba(var(--shade), 0.55) 0, rgba(var(--shade), 0) 14%, rgba(var(--shade), 0) 34%, rgb(var(--shade)) 58%);
    }

    .post__header > div + div {
        justify-items: start;
        text-align: left;
    }

    .post__body {
        padding-top: 56px;
    }

    .post-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: calc(100% - 40px);
    }

    .post-facts__item:nth-child(3) {
        padding-left: 0;
        border-left: 0;
    }

    .post-facts__item:nth-child(n + 3) {
        border-top: 1px solid var(--border);
    }

    .page-pagination {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .page-pagination__link {
        font-size: 30px;
    }

    .page-pagination__link--next {
        grid-column: 1;
    }

    .post__body > *,
    .page__body > * {
        width: calc(100% - 40px);
    }

    .post__body h2,
    .page__body h2 {
        font-size: 38px;
    }

    .post__body > .nera-image,
    .page__body > .nera-image {
        width: 100%;
        margin-block: 56px;
    }

    .nera-image__caption {
        padding-inline: 20px;
    }

    .post__body > p:has(> picture + picture),
    .post__body > p:has(> img + img),
    .page__body > p:has(> picture + picture),
    .page__body > p:has(> img + img) {
        grid-template-columns: minmax(0, 1fr);
        width: calc(100% - 40px);
        margin-block: 56px 16px;
    }

    .post__body > p:has(> picture + picture) > :first-child img,
    .post__body > p:has(> img + img) > img:first-child,
    .page__body > p:has(> picture + picture) > :first-child img,
    .page__body > p:has(> img + img) > img:first-child {
        aspect-ratio: 3 / 2;
    }

    .post__body > blockquote,
    .page__body > blockquote {
        margin-block: 64px;
    }

    .post__body table,
    .page__body table {
        font-size: 15px;
    }
}
