/*
 * ITkutak — public site.
 *
 * Hand-written, no framework (UI-7). One text face for reading (Literata, self-hosted), the
 * system sans-serif for headings and interface. Colours derive from the two the site has
 * always used: #004b6a and #49c2eb (UI-4).
 */

/* --- Fonts (UI-3, UI-9): split by script, so a page only fetches what it uses --------------- */

@font-face {
    font-family: "Literata";
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url("../fonts/literata-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: "Literata";
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url("../fonts/literata-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+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: "Literata";
    font-style: italic;
    font-weight: 200 900;
    font-display: swap;
    src: url("../fonts/literata-latin-wght-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: "Literata";
    font-style: italic;
    font-weight: 200 900;
    font-display: swap;
    src: url("../fonts/literata-latin-ext-wght-italic.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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;
}

/* Many old comments are written in Cyrillic. */
@font-face {
    font-family: "Literata";
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url("../fonts/literata-cyrillic-wght-normal.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

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

:root {
    --brand: #004b6a;
    --brand-deep: #003a52;
    --accent: #49c2eb;

    --bg: #ffffff;
    --surface: #f2f7f9;
    --text: #1a2830;
    --muted: #51626c;
    --border: #d3dfe5;
    --heading: #003f5a;
    --link: #00597d;
    --link-hover: #002f43;
    --button-bg: #004b6a;
    --button-text: #ffffff;
    --focus: #0b79a8;
    --ok-bg: #e5f5ea;
    --ok-text: #14532d;
    --error-bg: #fdecec;
    --error-text: #8a1c1c;
    --note-bg: #fff6d9;
    --note-text: #5c4400;

    --font-text: "Literata", Georgia, "Times New Roman", serif;
    --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;

    --wrap: 64rem;
    --gutter: clamp(1rem, 4vw, 2rem);
    --radius: 6px;
}

/* UI-5: the visitor's system preference decides. */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e181e;
        --surface: #15242c;
        --text: #e2ebef;
        --muted: #a3b5bf;
        --border: #2b3f4a;
        --heading: #f0f6f8;
        --link: #74d2f3;
        --link-hover: #b4e7f9;
        --button-bg: #49c2eb;
        --button-text: #06212c;
        --focus: #8bdcf7;
        --ok-bg: #12331f;
        --ok-text: #b6eac6;
        --error-bg: #3b1616;
        --error-text: #ffc9c9;
        --note-bg: #3a2f0c;
        --note-text: #ffe9a8;
    }
}

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

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: 1rem;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-text);
    font-size: 1.0625rem; /* 17px, the minimum of UI-1; 18px from tablet width up */
    line-height: 1.7;
    overflow-wrap: break-word;
}

@media (min-width: 40em) {
    body {
        font-size: 1.125rem;
    }
}

h1,
h2,
h3,
h4 {
    margin: 2em 0 0.5em;
    color: var(--heading);
    font-family: var(--font-ui);
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: -0.011em;
    text-wrap: balance;
}

h1 {
    margin-top: 0;
    font-size: clamp(1.75rem, 1.35rem + 1.9vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.45rem;
}

h3 {
    font-size: 1.2rem;
}

p,
ul,
ol,
blockquote,
pre {
    margin: 0 0 1.15em;
}

a {
    color: var(--link);
    text-decoration-thickness: 0.07em;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--link-hover);
    text-decoration-thickness: 0.12em;
}

/* UI-6: a focus indicator that is always visible. */
:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 2px;
}

#content:focus {
    outline: none;
}

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

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 0.5rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    background: var(--bg);
    color: var(--link);
    font-family: var(--font-ui);
    font-weight: 600;
    border-radius: var(--radius);
}

.skip-link:focus {
    top: 0.5rem;
}

.wrap {
    width: 100%;
    max-width: calc(var(--wrap) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.meta {
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 0.875rem;
    line-height: 1.5;
}

.meta a {
    color: inherit;
}

.count {
    color: var(--muted);
    font-weight: 400;
}

/* --- Header and navigation ------------------------------------------------------------------ */

.site-header {
    background: var(--brand);
    color: #ffffff;
    font-family: var(--font-ui);
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem 2rem;
    padding-block: 1.15rem;
}

.brand {
    display: flex;
    flex-direction: column;
    color: #ffffff;
    text-decoration: none;
}

.brand:hover {
    color: #ffffff;
}

.brand__name {
    font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.1rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.brand__tagline {
    margin-top: 0.2rem;
    color: #c5e9f7;
    font-size: 0.9rem;
    line-height: 1.35;
}

.site-header :focus-visible {
    outline-color: #ffffff;
}

.search {
    display: flex;
    gap: 0.4rem;
    font-family: var(--font-ui);
}

.search input {
    width: 100%;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
}

.search button,
.button,
.consent button {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--button-bg);
    color: var(--button-text);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
}

.button:hover,
.search button:hover {
    color: var(--button-text);
    filter: brightness(1.12);
}

.site-header .search {
    flex: 1 1 15rem;
    max-width: 21rem;
}

.site-header .search input {
    border-color: transparent;
    background: #ffffff;
    color: #1a2830;
}

.site-header .search button {
    background: var(--accent);
    color: #06212c;
}

.site-nav {
    background: var(--brand-deep);
}

.site-nav__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.25rem;
    margin-block: 0;
    padding-block: 0;
    list-style: none;
}

.site-nav__list li {
    margin-left: -0.75rem;
    margin-right: 0.75rem;
}

.site-nav a {
    display: block;
    padding: 0.7rem 0.75rem;
    border-bottom: 3px solid transparent;
    color: #e6f5fb;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
}

.site-nav a:hover {
    color: #ffffff;
    border-bottom-color: rgb(255 255 255 / 45%);
}

.site-nav a[aria-current] {
    color: #ffffff;
    border-bottom-color: var(--accent);
}

.site-nav .count {
    color: #c5e9f7;
}

.admin-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    padding: 0.35rem var(--gutter);
    background: #111b21;
    color: #d5e2e8;
    font-family: var(--font-ui);
    font-size: 0.85rem;
}

.admin-bar a {
    color: #8bdcf7;
}

/* --- Layout: one reading column, the sidebar beside it on wide screens (UI-1, UI-2) ---------- */

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 3rem;
    padding-block: 2rem 4rem;
}

@media (min-width: 62em) {
    .layout {
        grid-template-columns: minmax(0, 41rem) minmax(15rem, 1fr);
        gap: 3.5rem;
    }
}

.content {
    min-width: 0;
}

.breadcrumbs {
    margin-bottom: 1.5rem;
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 0.875rem;
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.breadcrumbs li + li::before {
    content: "›";
    margin-right: 0.5rem;
    color: var(--muted);
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    margin-bottom: 0.3em;
}

.page-header__lead {
    margin: 0;
    color: var(--muted);
    font-size: 1.1em;
}

.page-kicker {
    margin: 0 0 1.75rem;
    padding-bottom: 0.6rem;
    border-bottom: 3px solid var(--accent);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-title {
    margin: 3rem 0 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 1.15rem;
}

/* --- Teasers: homepage tiers and category listings ------------------------------------------ */

.teaser {
    min-width: 0;
}

.teaser__title {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
}

.teaser__title a {
    color: var(--heading);
    text-decoration: none;
}

.teaser__title a:hover {
    color: var(--link);
    text-decoration: underline;
}

.teaser .meta {
    margin-bottom: 0.75rem;
}

.teaser__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    margin: 1rem 0 0;
    font-family: var(--font-ui);
    font-size: 0.9rem;
}

.comment-count {
    color: var(--muted);
}

.teaser--lead {
    margin-bottom: 2.75rem;
    padding-bottom: 2.25rem;
    border-bottom: 1px solid var(--border);
}

.teaser--lead .teaser__title {
    font-size: clamp(1.7rem, 1.35rem + 1.7vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.teaser--listed {
    margin-bottom: 2.25rem;
    padding-bottom: 2.25rem;
    border-bottom: 1px solid var(--border);
}

.teaser--listed .teaser__title {
    font-size: 1.55rem;
}

.teaser-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.25rem 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 40em) {
    .teaser-grid--two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .teaser-grid--three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem 1.25rem;
    }
}

.teaser-grid--two .prose {
    font-size: 0.95em;
}

.teaser--title-only {
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    background: var(--surface);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
}

.teaser--title-only a {
    color: var(--heading);
    text-decoration: none;
}

.teaser--title-only a:hover {
    text-decoration: underline;
}

/* --- Article text. Also has to carry markup written in 2007-2018 (UI-10) --------------------- */

.article__header {
    margin-bottom: 1.75rem;
}

.article__header h1 {
    margin-bottom: 0.4em;
}

.prose {
    display: flow-root; /* contains floated images */
}

.prose > :first-child {
    margin-top: 0;
}

.prose > :last-child {
    margin-bottom: 0;
}

.prose li {
    margin-bottom: 0.35em;
}

.prose blockquote {
    margin-inline: 0;
    padding: 0.2rem 0 0.2rem 1.25rem;
    border-left: 4px solid var(--accent);
    color: var(--muted);
    font-style: italic;
}

.prose pre,
.prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.88em;
}

.prose pre {
    padding: 1rem;
    overflow-x: auto;
    border-radius: var(--radius);
    background: var(--surface);
    line-height: 1.5;
}

.prose :not(pre) > code {
    padding: 0.1em 0.3em;
    border-radius: 3px;
    background: var(--surface);
}

.prose table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    font-family: var(--font-ui);
    font-size: 0.92em;
}

.prose th,
.prose td {
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.prose img {
    border-radius: 3px;
}

/* The old editor aligned images with attributes. Keep the intent, with modern spacing. */
.prose img[align="left"],
.prose img[style*="float: left"],
.prose img[style*="float:left"] {
    float: left;
    max-width: 48%;
    margin: 0.35em 1.25em 0.6em 0;
}

.prose img[align="right"],
.prose img[style*="float: right"],
.prose img[style*="float:right"] {
    float: right;
    max-width: 48%;
    margin: 0.35em 0 0.6em 1.25em;
}

@media (max-width: 30em) {
    .prose img[align="left"],
    .prose img[align="right"] {
        float: none;
        display: block;
        max-width: 100%;
        margin: 0.5em auto 1em;
    }
}

.prose img[align="top"] {
    vertical-align: top;
}

.prose img[align="middle"] {
    vertical-align: middle;
}

/* Fully justified text without hyphenation reads badly on screens. */
.prose [align="justify"] {
    text-align: start;
}

.prose [align="center"] {
    text-align: center;
}

/* Old content may ask for its own typeface; the site's face wins. */
.prose [style*="font-family"],
.prose font {
    font-family: inherit !important;
}

.prose iframe,
.prose embed,
.prose object,
.prose video {
    max-width: 100%;
    border: 0;
}

.prose iframe[src*="youtube"] {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

.prose--excerpt img[align="left"],
.prose--excerpt img[align="right"] {
    max-width: 40%;
}

/* Colours typed into old articles assume a white page. */
@media (prefers-color-scheme: dark) {
    .prose [style*="color"],
    .prose font[color] {
        color: inherit !important;
    }

    .prose img {
        background: #ffffff;
    }
}

/* --- Share links, comments ------------------------------------------------------------------- */

.share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.6rem;
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-family: var(--font-ui);
    font-size: 0.9rem;
}

.share__label {
    margin-right: 0.3rem;
    color: var(--muted);
}

.share a {
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--link);
    font-weight: 600;
    text-decoration: none;
}

.share a:hover {
    border-color: var(--link);
}

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

.comment {
    padding: 1.25rem 0;
    border-top: 1px solid var(--border);
    scroll-margin-top: 1rem;
}

.comment:target {
    margin-inline: -1rem;
    padding-inline: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
}

.comment__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.9rem;
    margin: 0 0 0.5rem;
    font-family: var(--font-ui);
    font-size: 0.875rem;
}

.comment__author {
    color: var(--heading);
    font-size: 1rem;
    font-weight: 700;
}

.comment__date,
.edit-link,
.edit-link a {
    color: var(--muted);
}

.comment__body {
    font-size: 0.97em;
}

.comment__body > :last-child {
    margin-bottom: 0;
}

.comments__closed {
    margin-top: 1.5rem;
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 0.9rem;
}

/* --- Pagination ------------------------------------------------------------------------------ */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    font-family: var(--font-ui);
    font-size: 0.9rem;
}

.pagination a,
.pagination span {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
}

.pagination a {
    font-weight: 600;
}

.pagination a:hover {
    border-color: var(--link);
}

.pagination .is-disabled {
    color: var(--muted);
    opacity: 0.65;
}

.pagination__status {
    border-color: transparent !important;
    color: var(--muted);
}

/* --- Lists of links: archive, sitemap, search, 404 ------------------------------------------- */

.link-list,
.result-list {
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
}

.link-list li,
.result-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
    line-height: 1.45;
}

.result-list li {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.7rem 0;
}

.result-list a {
    font-family: var(--font-ui);
    font-weight: 600;
}

.archive-month__title,
.sitemap-group h3 {
    margin: 2rem 0 0.4rem;
    font-size: 1.1rem;
}

.sitemap-group h3 a {
    color: var(--heading);
}

.search--page {
    display: block;
    margin-bottom: 1.5rem;
}

.search--page label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.search__row {
    display: flex;
    gap: 0.4rem;
    max-width: 30rem;
}

.search-count {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    color: var(--muted);
}

/* --- Forms and notices ----------------------------------------------------------------------- */

.form {
    max-width: 34rem;
    font-family: var(--font-ui);
    font-size: 1rem;
}

.form__field {
    margin-bottom: 1.15rem;
}

.form label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.form input,
.form textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--muted);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.form textarea {
    resize: vertical;
    line-height: 1.5;
}

.form [aria-invalid="true"] {
    border-color: var(--error-text);
    border-width: 2px;
}

.form__error {
    margin: 0.3rem 0 0;
    color: var(--error-text);
    font-size: 0.9rem;
    font-weight: 600;
}

.form__trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.notice {
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    background: var(--surface);
    font-family: var(--font-ui);
    font-size: 0.95rem;
}

.notice--success {
    background: var(--ok-bg);
    color: var(--ok-text);
}

.notice--error {
    background: var(--error-bg);
    color: var(--error-text);
}

.notice--preview {
    background: var(--note-bg);
    color: var(--note-text);
    font-weight: 600;
}

/* --- Sidebar and footer ---------------------------------------------------------------------- */

.sidebar {
    min-width: 0;
    font-family: var(--font-ui);
    font-size: 0.94rem;
    line-height: 1.55;
}

@media (max-width: 61.99em) {
    .sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
        gap: 0 2.5rem;
        padding-top: 2rem;
        border-top: 1px solid var(--border);
    }
}

.widget {
    margin-bottom: 2.25rem;
}

.widget__title {
    margin: 0 0 0.8rem;
    padding-bottom: 0.45rem;
    border-bottom: 3px solid var(--accent);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.widget ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.widget li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

.widget__list a {
    color: var(--heading);
    font-weight: 600;
    text-decoration: none;
}

.widget__list a:hover {
    color: var(--link);
    text-decoration: underline;
}

.widget__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}

.widget .widget__links li {
    padding: 0;
    border: 0;
}

.edit-link {
    margin: 0.5rem 0 0;
    font-family: var(--font-ui);
    font-size: 0.8rem;
}

.site-footer {
    padding-block: 2.25rem 2.75rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-family: var(--font-ui);
    font-size: 0.875rem;
    line-height: 1.6;
}

.site-footer__text {
    max-width: 46rem;
}

.site-footer__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    margin: 0.75rem 0 0;
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--link);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 0.18em;
    cursor: pointer;
}

/* --- Consent notice (UI-17): a slim bar over the bottom edge. Not a modal, no layout shift. --- */

.consent {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    padding: 0.6rem var(--gutter);
    border-top: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 -2px 12px rgb(0 0 0 / 12%);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    line-height: 1.4;
}

.consent[hidden] {
    display: none;
}

.consent__text {
    margin: 0;
}

.consent__actions {
    display: flex;
    gap: 0.5rem;
}

/* Two buttons of equal weight: same size, same colours. */
.consent button {
    min-width: 6.5rem;
    padding: 0.35rem 0.9rem;
    border-color: var(--link);
    background: var(--bg);
    color: var(--link);
}

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

/* --- Motion and print (UI-11) ---------------------------------------------------------------- */

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

@media print {
    :root {
        --bg: #ffffff;
        --text: #000000;
        --heading: #000000;
        --muted: #333333;
        --link: #000000;
        --border: #999999;
    }

    body {
        font-size: 11pt;
        line-height: 1.5;
    }

    .site-header .search,
    .site-nav,
    .admin-bar,
    .breadcrumbs,
    .sidebar,
    .share,
    .pagination,
    .consent,
    .skip-link,
    .edit-link,
    .site-footer__meta button {
        display: none !important;
    }

    .site-header {
        background: none;
        color: #000000;
        border-bottom: 1pt solid #000000;
    }

    .brand,
    .brand__tagline {
        color: #000000;
    }

    .layout {
        display: block;
        padding: 1rem 0 0;
    }

    .site-footer {
        background: none;
    }

    .prose a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        word-break: break-all;
    }

    h1,
    h2,
    h3 {
        break-after: avoid;
    }

    img,
    blockquote,
    pre {
        break-inside: avoid;
    }
}
