/* ==========================================================================
   Denuo v2
   1. Fonts
   2. Tokens: admin base colours (defaults here, overridden inline by the theme),
      derived tokens, mode-specific tokens
   3. Base: small reset (the theme uses no CSS framework), type, focus, scrollbars
   4. Primitives: layout, pills, buttons, tags, cards; content classes from plugins
   5. Header and navigation
   6. Dialogs (search, lightbox)
   7. Pagination and breadcrumbs
   8. Article content
   9. Footer
   ========================================================================== */

/* 1. Fonts -------------------------------------------------------------- */

@font-face {
    font-family: 'Open Sans';
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/open-sans-v40-latin_latin-ext-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Open Sans';
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/open-sans-v44-latin_latin-ext-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Open Sans';
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/open-sans-v40-latin_latin-ext-700.woff2') format('woff2');
}

@font-face {
    font-family: 'Open Sans';
    font-weight: 800;
    font-display: swap;
    src: url('../fonts/open-sans-v44-latin_latin-ext-800.woff2') format('woff2');
}

/* 2. Tokens ------------------------------------------------------------- */

/* Base colours. denuo_tokens() prints the admin's values after this file;
   these defaults keep the page readable if that output is missing. */
:root {
    --c-bg-start: #E3EAFF;
    --c-bg-middle: #F2ECFA;
    --c-bg-end: #E8F2FB;
    --c-surface: #FFFFFF;
    --c-text: #2B2D45;
    --c-primary: #5B3FD9;
    --c-accent: #D6E4FF;
    --c-on-primary: #FFFFFF;
    --c-pole: #000000;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --c-bg-start: #0B0D1A;
    --c-bg-middle: #11132A;
    --c-bg-end: #0D1424;
    --c-surface: #161A33;
    --c-text: #E6E8FF;
    --c-primary: #8B6CFF;
    --c-accent: #2A2F66;
    --c-on-primary: #14152A;
    --c-pole: #FFFFFF;
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] {
        --c-bg-start: #0B0D1A;
        --c-bg-middle: #11132A;
        --c-bg-end: #0D1424;
        --c-surface: #161A33;
        --c-text: #E6E8FF;
        --c-primary: #8B6CFF;
        --c-accent: #2A2F66;
        --c-on-primary: #14152A;
        --c-pole: #FFFFFF;
        color-scheme: dark;
    }
}

/* Derived tokens. Components use only these, never the base colours directly.
   --c-pole is black in light mode and white in dark mode, so "towards the pole"
   always means "more contrast against the background". */
:root {
    --bg-gradient: linear-gradient(165deg, var(--c-bg-start) 0, var(--c-bg-middle) 50%, var(--c-bg-end) 100%);
    --surface: var(--c-surface);
    --text: var(--c-text);
    --heading: color-mix(in oklab, var(--c-text) 82%, var(--c-pole));
    --muted: color-mix(in oklab, var(--c-text) 76%, var(--c-surface));
    --border: color-mix(in oklab, var(--c-primary) 10%, color-mix(in oklab, var(--c-text) 9%, var(--c-surface)));
    /* Tables: tinted towards the primary from the surface, so both modes follow the admin colours. */
    --table-head-bg: color-mix(in oklab, var(--c-primary) 8%, var(--c-surface));
    --table-stripe-bg: color-mix(in oklab, var(--c-primary) 3%, var(--c-surface));
    --table-hover-bg: color-mix(in oklab, var(--c-primary) 6%, var(--c-surface));
    --primary: var(--c-primary);
    --primary-hover: color-mix(in oklab, var(--c-primary) 84%, var(--c-pole));
    --on-primary: var(--c-on-primary);
    --link: color-mix(in oklab, var(--c-primary) 82%, var(--c-pole));
    --link-hover: color-mix(in oklab, var(--c-primary) 62%, var(--c-pole));
    --accent: var(--c-accent);
    --on-accent: color-mix(in oklab, var(--c-primary) 55%, var(--c-pole));
    --accent-hover: color-mix(in oklab, var(--c-accent) 85%, var(--c-primary));
    --focus: var(--link);

    /* Mode-specific, not admin-editable (light values) */
    --shadow-card: 0 1px 2px color-mix(in srgb, var(--c-text) 6%, transparent),
                   0 8px 28px color-mix(in srgb, var(--c-text) 10%, transparent);
    --shadow-pill: 0 4px 16px color-mix(in srgb, var(--c-text) 8%, transparent);
    --shadow-raised: 0 12px 36px color-mix(in srgb, var(--c-text) 16%, transparent);
    --card-border: color-mix(in srgb, var(--c-text) 4%, transparent);
    --footer-bg: color-mix(in oklab, var(--c-text) 86%, #000);
    --footer-text: #C9CCE4;
    --footer-heading: #FFFFFF;
    --callout-bg: #FFF3D6;
    --callout-text: #5A4210;
    --callout-border: #F1D58C;
    --success-bg: color-mix(in oklab, #2E9E6B 14%, var(--c-surface));
    --success-text: color-mix(in oklab, #2E9E6B 55%, var(--c-pole));
    --success-border: color-mix(in oklab, #2E9E6B 35%, var(--c-surface));
    --danger-bg: color-mix(in oklab, #D9485F 12%, var(--c-surface));
    --danger-text: color-mix(in oklab, #D9485F 55%, var(--c-pole));
    --danger-border: color-mix(in oklab, #D9485F 35%, var(--c-surface));
    --backdrop: rgb(20 22 40 / 70%);

    /* Type and shape */
    --font: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --radius-card: 22px;
    --radius-thumb: 14px;
    --radius-box: 16px;
    --wrap: 1200px;
    --gutter: clamp(16px, 4vw, 48px);
    --header-height: 84px;
}

:root[data-theme="dark"] {
    --shadow-card: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 28px rgb(0 0 0 / 28%);
    --shadow-pill: 0 4px 16px rgb(0 0 0 / 28%);
    --shadow-raised: 0 12px 36px rgb(0 0 0 / 40%);
    --card-border: var(--border);
    --footer-bg: color-mix(in oklab, var(--c-bg-start) 70%, #000);
    --callout-bg: color-mix(in oklab, #F5B83D 14%, var(--c-surface));
    --callout-text: #F6D896;
    --callout-border: color-mix(in oklab, #F5B83D 35%, var(--c-surface));
    --backdrop: rgb(0 0 0 / 75%);
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] {
        --shadow-card: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 28px rgb(0 0 0 / 28%);
        --shadow-pill: 0 4px 16px rgb(0 0 0 / 28%);
        --shadow-raised: 0 12px 36px rgb(0 0 0 / 40%);
        --card-border: var(--border);
        --footer-bg: color-mix(in oklab, var(--c-bg-start) 70%, #000);
        --callout-bg: color-mix(in oklab, #F5B83D 14%, var(--c-surface));
        --callout-text: #F6D896;
        --callout-border: color-mix(in oklab, #F5B83D 35%, var(--c-surface));
        --backdrop: rgb(0 0 0 / 75%);
    }
}

/* 3. Base --------------------------------------------------------------- */

/* Reset: the few things a framework used to provide. */
*,
*::before,
*::after { box-sizing: border-box; }

h1, h2, h3, h4, h5, h6 { margin-top: 0; margin-bottom: .5rem; }
p, ul, ol, dl, pre, blockquote, figure, table { margin-top: 0; margin-bottom: 1rem; }
ul, ol { padding-left: 2rem; }
li > ul, li > ol { margin-bottom: 0; }
b, strong { font-weight: 700; }
small { font-size: .875em; }
img, svg, video, canvas { vertical-align: middle; }
iframe { border: 0; max-width: 100%; }
table { border-collapse: collapse; caption-side: bottom; }
th { text-align: inherit; }
hr { margin: 2rem 0; border: 0; border-top: 1px solid var(--border); }
code, kbd, pre, samp { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .875em; }
button, input, select, textarea { margin: 0; font: inherit; color: inherit; letter-spacing: inherit; }
button:not(:disabled) { cursor: pointer; }
label { display: inline-block; }
dialog { color: var(--text); }
[hidden] { display: none !important; }

.visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Selected text: a primary tint with heading-coloured text, so it reads in both modes and
   follows the admin colours (replaces the teal selection from the old Bootstrap build). */
::selection {
    background-color: color-mix(in oklab, var(--c-primary) 30%, var(--c-surface));
    color: var(--heading);
}

/* An open modal dialog (menu, search, image preview) stops the page behind it from scrolling. */
html:has(dialog[open]) { overflow: hidden; }

html {
    touch-action: manipulation;
    -webkit-tap-highlight-color: color-mix(in srgb, var(--c-primary) 18%, transparent);
    scroll-padding-top: calc(var(--header-height) + 16px);
}

@media (pointer: fine) {
    html { overscroll-behavior: none; }
}

/* Scrollbars use the primary colour, like the reading-progress bar. This replaces the teal
   gradient thumb baked into the Bootstrap build. scrollbar-color is inherited, so the TOC and
   table scrollers follow; the ::-webkit rules cover browsers without scrollbar-color. */
:root {
    --scrollbar-track: color-mix(in oklab, var(--c-bg-start) 70%, var(--c-surface));
    scrollbar-color: var(--primary) var(--scrollbar-track);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
    background-color: var(--scrollbar-track);
}

::-webkit-scrollbar-track {
    background-color: var(--scrollbar-track);
    border-radius: 10px;
    -webkit-box-shadow: none;
    box-shadow: none;
}

::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    background-image: none;
    border: 2px solid var(--scrollbar-track);
    border-radius: 10px;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--c-bg-start);
    background-image: var(--bg-gradient);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading);
    font-weight: 800;
    line-height: 1.2;
    text-wrap: balance;
    scroll-margin-top: calc(var(--header-height) + 16px);
}

a {
    color: var(--link);
    text-underline-offset: .16em;
    text-decoration-thickness: .08em;
}

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

.text-muted,
.text-body-secondary { color: var(--muted) !important; }

time,
.d2-meta { font-variant-numeric: tabular-nums; }

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

.denuo-skip {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1100;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 700;
}

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

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 4. Primitives --------------------------------------------------------- */

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

.d2-pill {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow-pill);
}

/* Buttons ----------------------------------------------------------------
   One variant system in the shadcn manner, drawn in the owner's pill + pastel look.
     variants: (default = primary) | --secondary | --outline | --ghost | --destructive | --link
     sizes:    --sm | (default) | --lg | --icon
   The Bootstrap class names that plugins and older articles emit map onto the same rules:
   .btn-primary = default, other .btn = outline, .btn-secondary/-light/-info = secondary,
   .btn-danger = destructive, .btn-link = link, .btn-sm / .btn-lg = sizes. */

.d2-btn,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 22px;
    border: 1.5px solid var(--primary);
    border-radius: 999px;
    background: var(--primary);
    color: var(--on-primary);
    font: 700 1rem/1.2 var(--font);
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.d2-btn svg,
.btn svg { flex: none; width: 1.125em; height: 1.125em; }

.d2-btn:hover,
.btn-primary:hover {
    border-color: var(--primary-hover);
    background: var(--primary-hover);
    color: var(--on-primary);
}

.d2-btn:active,
.btn:active { transform: translateY(1px); }

/* secondary: soft accent fill */
.d2-btn--secondary,
.btn-secondary,
.btn-light,
.btn-info {
    border-color: transparent;
    background: var(--accent);
    color: var(--on-accent);
}

.d2-btn--secondary:hover,
.btn-secondary:hover,
.btn-light:hover,
.btn-info:hover {
    border-color: transparent;
    background: var(--accent-hover);
    color: var(--on-accent);
}

/* outline: white with the primary border (the brief's secondary button) */
.d2-btn--outline,
.btn:not(.btn-primary, .btn-secondary, .btn-light, .btn-info, .btn-danger, .btn-link) {
    border-color: var(--primary);
    background: var(--surface);
    color: var(--link);
}

.d2-btn--outline:hover,
.btn:not(.btn-primary, .btn-secondary, .btn-light, .btn-info, .btn-danger, .btn-link):hover {
    border-color: var(--primary);
    background: var(--accent);
    color: var(--on-accent);
}

/* ghost: no fill until hover */
.d2-btn--ghost {
    border-color: transparent;
    background: transparent;
    color: var(--text);
}

.d2-btn--ghost:hover {
    border-color: transparent;
    background: color-mix(in oklab, var(--accent) 70%, var(--surface));
    color: var(--heading);
}

/* destructive: soft danger fill */
.d2-btn--destructive,
.btn-danger {
    border-color: var(--danger-border);
    background: var(--danger-bg);
    color: var(--danger-text);
}

.d2-btn--destructive:hover,
.btn-danger:hover {
    border-color: var(--danger-text);
    background: var(--danger-bg);
    color: var(--danger-text);
}

/* link: looks like a link, keeps the button hit area */
.d2-btn--link,
.btn-link {
    padding-inline: 4px;
    border-color: transparent;
    background: transparent;
    color: var(--link);
    text-decoration: underline;
    text-decoration-thickness: .08em;
    text-underline-offset: .2em;
}

.d2-btn--link:hover,
.btn-link:hover {
    border-color: transparent;
    background: transparent;
    color: var(--link-hover);
}

/* sizes */
.d2-btn--sm,
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .875rem; }

.d2-btn--lg,
.btn-lg { min-height: 48px; padding: 0 26px; font-size: 1.0625rem; }

.d2-btn--icon { width: 44px; padding: 0; }
.d2-btn--icon.d2-btn--sm { width: 36px; }
.d2-btn--icon.d2-btn--lg { width: 48px; }

/* Touch screens: small buttons still get a 44px target. */
@media (pointer: coarse) {
    .d2-btn--sm,
    .btn-sm { min-height: 44px; }
    .d2-btn--icon.d2-btn--sm { width: 44px; }
}

/* disabled */
.d2-btn:disabled,
.d2-btn[aria-disabled="true"],
.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: .5;
    pointer-events: none;
}

/* Badges ------------------------------------------------------------------
   .d2-tag (theme) and .badge (formatter plugin) share one look.
     variants: (default = accent) | --solid | --outline | --success | --destructive */

.d2-tag,
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: none;
    vertical-align: baseline;
    white-space: nowrap;
}

.badge { padding: .2em .75em; font-size: .75em; }

.d2-tag--solid { background: var(--primary); color: var(--on-primary); }
.d2-tag--outline { border-color: var(--border); background: transparent; color: var(--text); }
.d2-tag--success { border-color: var(--success-border); background: var(--success-bg); color: var(--success-text); }
.d2-tag--destructive { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger-text); }

.rounded-pill { border-radius: 999px !important; }

/* Status colours: success green, warning amber, danger red; the rest use the accent. */
.text-bg-primary { background: var(--primary) !important; color: var(--on-primary) !important; }
.text-bg-success { background: var(--success-bg) !important; color: var(--success-text) !important; }
.text-bg-warning { background: var(--callout-bg) !important; color: var(--callout-text) !important; }
.text-bg-danger { background: var(--danger-bg) !important; color: var(--danger-text) !important; }
.text-bg-dark { background: var(--heading) !important; color: var(--surface) !important; }
.text-bg-info,
.text-bg-light,
.text-bg-secondary { background: var(--accent) !important; color: var(--on-accent) !important; }

.alert {
    position: relative;
    margin-block: 24px;
    padding: 18px 22px;
    border: 1px solid transparent;
    border-radius: var(--radius-box);
    background: var(--accent);
    color: var(--on-accent);
    font-size: 1rem;
}

.alert a { color: inherit; font-weight: 700; }
.alert > :last-child { margin-bottom: 0; }
.alert-success { border-color: var(--success-border); background: var(--success-bg); color: var(--success-text); }
.alert-warning { border-color: var(--callout-border); background: var(--callout-bg); color: var(--callout-text); }
.alert-danger { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger-text); }

.lead { font-size: 1.125rem; }
.text-center { text-align: center !important; }
.fw-bold { font-weight: 700 !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.align-items-center { align-items: center !important; }
.justify-content-center { justify-content: center !important; }

.d2-meta {
    font-size: .8125rem;
    color: var(--muted);
}

.d2-card {
    display: block;
    padding: 12px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    color: inherit;
}

.d2-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-thumb);
    background: var(--accent);
}

/* Card component (partials/card.html.twig) ------------------------------ */

.d2-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 640px) {
    .d2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 992px) {
    .d2-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.d2-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform .2s ease, box-shadow .2s ease;
}

.d2-card-media { flex: none; }

.d2-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    padding: 14px 10px 8px;
}

.d2-card-title {
    margin: 10px 0 8px;
    color: var(--heading);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.3;
    text-wrap: pretty;
    overflow-wrap: anywhere;
}

.d2-card-link {
    color: inherit;
    text-decoration: none;
}

/* The title link stretches over the whole card: one link, whole card clickable. */
.d2-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.d2-card-link:focus-visible { outline: none; }

.d2-card:has(.d2-card-link:focus-visible) {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.d2-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-raised);
}

.d2-card:hover .d2-card-link {
    color: var(--heading);
    text-decoration: underline;
    text-decoration-thickness: .08em;
    text-underline-offset: .16em;
}

.d2-card-excerpt {
    display: -webkit-box;
    margin: 0 0 12px;
    overflow: hidden;
    color: color-mix(in oklab, var(--text) 88%, var(--surface));
    font-size: .9375rem;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.d2-card .d2-meta {
    margin: auto 0 0;
}

@media (min-width: 768px) {
    .d2-card--featured {
        display: grid;
        grid-template-columns: 1.1fr 1fr;
        align-items: center;
        gap: 24px;
    }

    .d2-card--featured .d2-card-body { padding: 16px 20px 16px 0; }

    .d2-card--featured .d2-card-title {
        margin-block: 12px;
        font-size: clamp(1.5rem, 1rem + 1.2vw, 1.75rem);
        line-height: 1.2;
    }

    .d2-card--featured .d2-card-excerpt {
        font-size: 1rem;
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }

    .d2-card--featured .d2-meta { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .d2-card:hover { transform: none; }
}

/* Sections, chips and Home ---------------------------------------------- */

.d2-section { margin-top: clamp(56px, 6vw, 80px); }

.d2-section-title {
    margin: 0 0 24px;
    font-size: clamp(1.625rem, 1.3rem + 1vw, 1.875rem);
}

.d2-eyebrow {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.d2-empty {
    padding: 24px;
    border-radius: var(--radius-card);
    background: var(--surface);
    color: var(--muted);
}

.d2-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.d2-chip {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.d2-chip:hover {
    border-color: color-mix(in oklab, var(--border) 50%, var(--c-primary));
    background: color-mix(in oklab, var(--accent) 55%, var(--surface));
    color: var(--heading);
}

.d2-chip[aria-current] {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--on-primary);
}

.d2-hero {
    display: grid;
    gap: 32px;
    align-items: center;
    padding-top: clamp(16px, 4vw, 48px);
}

.d2-hero h1 {
    margin: 18px 0;
    font-size: clamp(2.125rem, 1.1rem + 3.4vw, 3.375rem);
    line-height: 1.08;
    letter-spacing: -.01em;
}

.d2-hero-lead {
    max-width: 34em;
    margin: 0 0 28px;
    color: color-mix(in oklab, var(--text) 90%, var(--surface));
    font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem);
    line-height: 1.55;
}

.d2-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.d2-hero-media { justify-self: center; }

/* Shown at most at its intrinsic size, never stretched. */
.d2-hero-media img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 24px;
    box-shadow: var(--shadow-raised);
}

.d2-topics { margin-top: clamp(32px, 4vw, 48px); }

@media (min-width: 900px) {
    .d2-hero {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 56px;
    }
}

@media (max-width: 899.98px) {
    .d2-hero-media img { max-height: 320px; width: auto; }
}

/* Breadcrumb and category ----------------------------------------------- */

.d2-breadcrumb { padding-top: clamp(12px, 3vw, 32px); }

.d2-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: .8125rem;
}

.d2-breadcrumb li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.d2-breadcrumb li + li::before {
    content: "/";
    color: var(--muted);
}

.d2-breadcrumb a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: var(--muted);
}

.d2-breadcrumb a:hover { color: var(--link); }

/* The current page can be a long article title: one line, ellipsis. */
.d2-breadcrumb [aria-current] {
    max-width: min(60ch, 70vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.d2-page-head h1 {
    margin: 6px 0 12px;
    font-size: clamp(2rem, 1.2rem + 2.6vw, 3rem);
    line-height: 1.1;
    letter-spacing: -.01em;
}

/* Category with an illustration: text left, picture right (like the Home hero). */
.d2-page-head--media {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 24px 48px;
}

.d2-page-head-media img {
    display: block;
    width: 100%;
    max-width: 260px;
    height: auto;
    border-radius: 24px;
    box-shadow: var(--shadow-raised);
}

/* Decorative: on phones the articles come first. */
@media (max-width: 639.98px) {
    .d2-page-head-media { display: none; }
}

@media (min-width: 640px) {
    .d2-page-head--media { grid-template-columns: minmax(0, 1fr) auto; }
    .d2-page-head-media img { max-width: clamp(180px, 22vw, 260px); }
}

.d2-page-intro {
    max-width: 680px;
    margin: 0 0 24px;
    color: color-mix(in oklab, var(--text) 90%, var(--surface));
    font-size: clamp(1.0625rem, 1rem + .2vw, 1.125rem);
}

.d2-filter { margin-bottom: 8px; }

.d2-featured { margin-top: 32px; }

.d2-page-head + .d2-grid,
.d2-featured + .d2-grid,
.d2-page-head + .d2-empty { margin-top: 32px; }

.d2-empty p { margin: 0 0 16px; }
.d2-empty p:last-child { margin-bottom: 0; }

.denuo-pagination { margin-top: 40px; }

/* 5. Header and navigation ----------------------------------------------
   Logo pill left, menu pill centred, round search right (owner decision).
   Below 992px the menu moves into a native <dialog> drawer (#site-drawer). */

.denuo-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: transparent;
}

/* Soft band so scrolled content does not show between the pills. */
.denuo-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: color-mix(in srgb, var(--c-bg-start) 78%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
}

.denuo-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: var(--header-height);
    padding-block: 12px;
}

.denuo-brand,
.denuo-nav-control,
.denuo-nav-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow-pill);
}

.denuo-brand {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 10px;
    min-height: 44px;
    min-width: 0;
    max-width: 100%;
    padding: 5px 20px 5px 8px;
    color: var(--heading);
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
}

.denuo-brand img {
    display: block;
    flex: none;
}

/* No logo configured: the name alone, centred in the pill. */
.denuo-brand:not(:has(img)) { padding-inline: 20px; }

.denuo-brand span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.denuo-brand:hover {
    color: var(--heading);
    border-color: color-mix(in oklab, var(--border) 60%, var(--c-primary));
}

.denuo-nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: end;
}

.denuo-nav-control {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--text);
}

.denuo-nav-control:hover {
    background: var(--accent);
    color: var(--on-accent);
}

.denuo-nav-list,
.denuo-nav-subtree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.denuo-nav-item {
    display: flex;
    align-items: stretch;
    border-radius: 999px;
}

.denuo-nav-link,
.denuo-nav-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding-inline: 18px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
}

/* Split item ("Windows OS"): the link and its caret read as one pill. */
.denuo-nav-item.has-children > .denuo-nav-link { padding-inline-end: 4px; }
.denuo-nav-link + .denuo-nav-toggle { padding-inline: 4px 14px; }

.denuo-nav-chevron {
    flex: none;
    transition: transform .15s ease;
}

.denuo-nav-toggle[aria-expanded="true"] .denuo-nav-chevron { transform: rotate(180deg); }

.denuo-nav-link:hover,
.denuo-nav-toggle:hover {
    background: color-mix(in oklab, var(--accent) 55%, var(--surface));
    color: var(--heading);
}

/* Active section: light accent pill (owner decision), bolder text as a second cue. */
.denuo-nav-item.is-active {
    background: var(--accent);
}

.denuo-nav-item.is-active > .denuo-nav-link,
.denuo-nav-item.is-active > .denuo-nav-toggle {
    color: var(--on-accent);
    font-weight: 700;
}

.denuo-nav-item.is-active > :is(.denuo-nav-link, .denuo-nav-toggle):hover {
    background: var(--accent-hover);
}

/* Split items ("Windows OS" + caret) highlight as one pill, on hover and while the submenu is
   open, the same way they look when active; each part keeps its own focus ring. */
.denuo-nav-desktop .denuo-nav-item.has-children:hover,
.denuo-nav-desktop .denuo-nav-item.has-children:has(> [aria-expanded="true"]) {
    background: color-mix(in oklab, var(--accent) 55%, var(--surface));
}

.denuo-nav-desktop .denuo-nav-item.has-children > :is(.denuo-nav-link, .denuo-nav-toggle):hover {
    background: transparent;
    color: var(--heading);
}

.denuo-nav-desktop .denuo-nav-item.is-active.has-children:hover,
.denuo-nav-desktop .denuo-nav-item.is-active.has-children:has(> [aria-expanded="true"]) {
    background: var(--accent-hover);
}

.denuo-nav-desktop .denuo-nav-item.is-active.has-children > :is(.denuo-nav-link, .denuo-nav-toggle):hover {
    background: transparent;
    color: var(--on-accent);
}

.denuo-nav-item.has-children { position: relative; }

/* Desktop submenu panel */
.denuo-nav-desktop .denuo-submenu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1030;
    width: 19rem;
    max-width: calc(100vw - 2rem);
    margin: 0;
    padding: 6px;
    list-style: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-box);
    background: var(--surface);
    box-shadow: var(--shadow-raised);
}

.denuo-submenu-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 6px 12px;
    border-radius: 10px;
    color: var(--text);
    font-size: .875rem;
    text-decoration: none;
}

.denuo-submenu-link:hover,
.denuo-submenu-link:focus-visible {
    background: color-mix(in oklab, var(--accent) 55%, var(--surface));
    color: var(--heading);
}

.denuo-submenu-link[aria-current="page"] {
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
}

.denuo-submenu-heading {
    display: block;
    padding: 8px 12px 4px;
    color: var(--muted);
    font-size: .8125rem;
    font-weight: 700;
}

.denuo-nav-subtree {
    margin: 0 0 0 10px;
    padding: 0 0 0 6px;
    list-style: none;
    border-inline-start: 1px solid var(--border);
}


.pageprogress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    background: var(--primary);
}

@media (max-width: 991.98px) {
    .denuo-nav-desktop { display: none; }
}

@media (min-width: 992px) {
    .denuo-nav {
        grid-template-columns: minmax(max-content, 1fr) auto minmax(44px, 1fr);
    }

    .denuo-nav .denuo-menu-trigger { display: none; }

    .denuo-nav-desktop .denuo-nav-list {
        display: flex;
        gap: 4px;
        padding: 5px;
    }

    .denuo-nav-desktop .denuo-nav-list > li { flex-shrink: 0; }
}

/* Tight desktop widths: keep all six sections on one line. */
@media (min-width: 992px) and (max-width: 1139.98px) {
    .denuo-nav-link,
    .denuo-nav-toggle { padding-inline: 12px; }
    .denuo-nav-link + .denuo-nav-toggle { padding-inline: 2px 10px; }
}

@media (max-width: 991.98px) {
    :root { --header-height: 68px; }

    .denuo-nav { padding-block: 10px; }
}

/* Mobile drawer: a modal <dialog> sliding in from the right. */
.d2-drawer {
    inset: 0 0 0 auto;
    width: min(24rem, calc(100vw - 2rem));
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0 0 calc(16px + env(safe-area-inset-bottom));
    border: 0;
    background: var(--surface);
    box-shadow: var(--shadow-raised);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.d2-drawer[open] { animation: d2-drawer-in .2s ease-out; }

@keyframes d2-drawer-in {
    from { transform: translateX(100%); }
    to { transform: none; }
}

.d2-drawer::backdrop { background: var(--backdrop); }

.d2-drawer .d2-dialog-head {
    padding: 12px 12px 12px 20px;
    border-bottom: 1px solid var(--border);
}

.denuo-nav-drawer { padding: 12px 12px 0; }

.denuo-nav-drawer .denuo-nav-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.denuo-nav-drawer .denuo-nav-item {
    flex-wrap: wrap;
    border-radius: 14px;
}

.denuo-nav-drawer .denuo-nav-link {
    flex: 1;
    font-size: 1rem;
    border-radius: 14px;
}

.denuo-nav-drawer .denuo-nav-toggle {
    justify-content: center;
    min-width: 48px;
    border-radius: 14px;
}

.denuo-nav-drawer .denuo-nav-item.has-children > .denuo-nav-link { padding-inline-end: 18px; }
.denuo-nav-drawer .denuo-nav-link + .denuo-nav-toggle { padding-inline: 14px; }
.denuo-nav-drawer .denuo-nav-chevron { width: 12px; height: 12px; }

.denuo-nav-drawer .denuo-submenu {
    flex-basis: 100%;
    margin: 4px 0 8px;
    padding: 6px;
    list-style: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-box);
}

.denuo-nav-drawer .denuo-submenu-link { font-size: 1rem; }

.denuo-drawer-search {
    margin: 16px 12px 0;
    padding: 16px 8px 0;
    border-top: 1px solid var(--border);
}

/* 6. Dialogs ------------------------------------------------------------ */

.d2-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.d2-dialog-title {
    margin: 0;
    font-size: 1.125rem;
}

.denuo-lightbox-error { margin: 8px 0; color: var(--danger-text); }

.denuo-search-dialog,
.denuo-lightbox {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-raised);
    overscroll-behavior: contain;
}

/* A closed dialog never renders; v1 leaked the lightbox heading into the footer. */
.denuo-search-dialog:not([open]),
.denuo-lightbox:not([open]) { display: none; }

.denuo-search-dialog { width: min(32rem, calc(100% - 2rem)); padding: 16px 16px 20px; }



.denuo-search-dialog::backdrop,
.denuo-lightbox::backdrop { background: var(--backdrop); }

.denuo-lightbox {
    width: max-content;
    max-width: calc(100vw - 2rem);
    max-height: calc(100dvh - 2rem);
    padding: 16px;
}

.denuo-lightbox img {
    display: block;
    max-height: calc(100dvh - 7rem);
    object-fit: contain;
    margin-inline: auto;
}

/* 7. Pagination and breadcrumbs ----------------------------------------- */

.denuo-pagination-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.denuo-pagination-pill,
.denuo-pagination-ellipsis {
    display: grid;
    place-items: center;
    min-height: 44px;
    line-height: 1.25;
}

.denuo-pagination-pill {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    min-width: 44px;
    padding-inline: 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

a.denuo-pagination-pill:hover {
    background: var(--accent);
    color: var(--on-accent);
}

.denuo-pagination-pill[aria-current="page"] {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 700;
}

.denuo-pagination li[aria-hidden="true"] .denuo-pagination-pill {
    opacity: .45;
}

/* 8. Article ---------------------------------------------------------------
   Hero, head (tag, H1, byline), TOC + body columns, TL;DR, content,
   related, author card, previous/next. */

.d2-article {
    --article-width: 1180px;
}

.d2-article-hero {
    max-width: calc(var(--article-width) + 2 * var(--gutter));
    margin-top: 16px;
}

.d2-article-hero img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 7;
    object-fit: cover;
    border-radius: 24px;
    background: var(--accent);
    box-shadow: var(--shadow-card);
}

.d2-article-head {
    min-width: 0;
    padding-top: 8px;
}

.d2-article-head h1 {
    max-width: 24em;
    margin: 14px 0 18px;
    font-size: clamp(1.875rem, 1.2rem + 2.2vw, 2.625rem);
    line-height: 1.15;
    letter-spacing: -.01em;
    overflow-wrap: anywhere;
}

.d2-byline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.d2-byline .d2-meta {
    margin: 0;
    font-size: .875rem;
    line-height: 1.5;
}

.d2-byline-author {
    color: var(--heading);
    font-weight: 700;
}

.d2-byline-avatar {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.d2-initials {
    display: grid;
    place-items: center;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
}

.d2-article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    max-width: calc(var(--article-width) + 2 * var(--gutter));
    margin-top: 24px;
}

/* Article text on a white card (surface colour, so it follows dark mode). */
.d2-article-body {
    min-width: 0;
    max-width: 900px;
    padding: clamp(20px, 4vw, 48px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

/* Without a TOC the card is centred under the head. */
.d2-article-layout:not(.has-toc) > * {
    width: 100%;
    max-width: 900px;
    margin-inline: auto;
}

/* Phones: the card runs edge to edge so it adds no side padding of its own. */
@media (max-width: 639.98px) {
    .d2-article-body {
        margin-inline: calc(-1 * var(--gutter));
        padding-inline: var(--gutter);
        border-inline: 0;
        border-radius: 0;
    }
}

/* TOC: a collapsible card above the body on small screens, sticky column from 1000px. */
.denuo-toc {
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    font-size: .875rem;
}

.denuo-toc > summary {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 8px 20px;
    color: var(--heading);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.denuo-toc > summary::-webkit-details-marker { display: none; }

/* Chevron so the collapsed card reads as something to open. */
.denuo-toc > summary::after {
    content: "";
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .15s ease;
}

.denuo-toc[open] > summary::after { transform: translateY(2px) rotate(-135deg); }

.denuo-toc ul {
    margin: 0;
    padding: 0 12px 12px;
    list-style: none;
}

.denuo-toc a {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 8px;
    border-radius: 10px;
    color: var(--text);
    line-height: 1.35;
    text-decoration: none;
}

.denuo-toc a:hover {
    background: color-mix(in oklab, var(--accent) 50%, var(--surface));
    color: var(--heading);
}

.denuo-toc a[aria-current="location"] {
    color: var(--link);
    font-weight: 700;
}

@media (min-width: 1000px) {
    .d2-article-layout.has-toc {
        grid-template-columns: 240px minmax(0, 1fr);
        gap: 24px 40px;
    }

    .d2-article-layout.has-toc .d2-article-head { grid-column: 2; }

    .d2-toc-column {
        grid-column: 1;
        grid-row: 2;
        align-self: start;
        position: sticky;
        top: calc(var(--header-height) + 16px);
    }

    .d2-article-layout.has-toc .d2-article-body { grid-column: 2; grid-row: 2; }

    .denuo-toc {
        max-height: calc(100dvh - var(--header-height) - 32px);
        overflow: auto;
        overscroll-behavior: contain;
    }

    /* Always open on desktop; the summary becomes a plain label. */
    .denuo-toc > summary {
        padding-top: 16px;
        pointer-events: none;
        list-style: none;
    }

    .denuo-toc > summary::after { display: none; }
}

.d2-tldr {
    margin-bottom: 32px;
    padding: 22px 24px;
    border-radius: var(--radius-box);
    background: color-mix(in oklab, var(--accent) 45%, var(--surface));
}

.d2-tldr h2 { margin: 0; }

.d2-tldr ul {
    margin: 12px 0 0;
    padding-left: 20px;
    font-size: 1rem;
    line-height: 1.6;
}

.d2-tldr li + li { margin-top: 4px; }

#article-content {
    font-size: clamp(1.0625rem, 1rem + .2vw, 1.125rem);
    line-height: 1.75;
    overflow-wrap: break-word;
}

#article-content :is(h2, h3, h4, h5) {
    margin: 2em 0 .6em;
    line-height: 1.25;
    text-wrap: pretty;
}

#article-content h2 { font-size: clamp(1.5rem, 1.2rem + .9vw, 1.875rem); }
#article-content h3 { font-size: clamp(1.25rem, 1.1rem + .5vw, 1.375rem); }

#article-content > :first-child,
#article-content .lead-block + :is(h2, h3) { margin-top: 0; }

#article-content img {
    border-radius: var(--radius-thumb);
}

#article-content :is(pre, code) {
    font-size: .875em;
}

#article-content pre {
    padding: 16px 20px;
    border-radius: var(--radius-box);
    background: color-mix(in oklab, var(--c-text) 92%, #000);
    color: #E6E8FF;
    overflow: auto;
}

#article-content blockquote {
    margin: 24px 0;
    padding: 4px 0 4px 20px;
    border-left: 4px solid var(--accent);
    color: color-mix(in oklab, var(--text) 90%, var(--surface));
}

/* Wide tables scroll inside their own box (the outline plugin adds .table-responsive). */
#article-content .table-responsive {
    margin-block: 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    overflow-x: auto;
}

#article-content .table-responsive table { margin-bottom: 0; }

#article-content table {
    width: 100%;
    font-size: .9375rem;
    vertical-align: top;
}

#article-content :is(th, td) {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

#article-content thead th {
    border-bottom-width: 2px;
    background: var(--table-head-bg);
    color: var(--heading);
    white-space: nowrap;
}

#article-content tbody th { color: var(--heading); }
#article-content :is(.table-striped, .table-stripe) > tbody > tr:nth-of-type(odd) > * { background: var(--table-stripe-bg); }
#article-content .table-hover > tbody > tr:hover > * { background: var(--table-hover-bg); }
#article-content caption { padding: 8px 14px; color: var(--muted); font-size: .8125rem; }

#article-content tbody tr:last-child > * { border-bottom: 0; }

/* Lead block from the formatter plugin: a soft card, left-aligned. */
.lead-block {
    margin-bottom: 32px;
    padding: 24px !important;
    border-radius: var(--radius-box);
    background: color-mix(in oklab, var(--accent) 45%, var(--surface)) !important;
    color: var(--text);
}

.lead-block .container,
.lead-block .row,
.lead-block [class*="col-"] {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.lead-block h2 {
    margin: 0 0 12px !important;
    font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem) !important;
    line-height: 1.3;
    text-align: left !important;
}

.lead-block .lead { margin-bottom: 16px !important; font-size: 1.0625rem !important; }

.lead-block .btn { display: inline-flex !important; }

/* Author card in the pastel gradient. */
.d2-author { margin-top: 48px; max-width: calc(var(--article-width) + 2 * var(--gutter)); }

.d2-author-card {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    background: linear-gradient(120deg, var(--surface), color-mix(in oklab, var(--c-primary) 14%, var(--surface)));
    box-shadow: var(--shadow-card);
}

.d2-author-avatar {
    flex: none;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    font-size: 1.75rem;
}

.d2-author-text { min-width: 0; }
.d2-author-text .d2-eyebrow { margin-bottom: 4px; }

.d2-author-name {
    margin: 0;
    font-size: 1.5rem;
}

.d2-author-text .d2-meta { margin: 2px 0 0; }

.d2-author-bio {
    max-width: 62ch;
    margin: 10px 0 0;
    color: color-mix(in oklab, var(--text) 90%, var(--surface));
}

@media (max-width: 599.98px) {
    .d2-author-card { flex-direction: column; align-items: flex-start; padding: 22px; }
}

/* Previous / next article */
.d2-adjacent {
    display: grid;
    gap: 16px;
    max-width: calc(var(--article-width) + 2 * var(--gutter));
    margin-top: 32px;
}

@media (min-width: 700px) {
    .d2-adjacent { grid-template-columns: 1fr 1fr; }
    .d2-adjacent-link--next { grid-column: 2; text-align: right; align-items: flex-end; }
}

.d2-adjacent-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 44px;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-box);
    background: var(--surface);
    color: var(--heading);
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease;
}

.d2-adjacent-link .d2-eyebrow { margin: 0; }

.d2-adjacent-title {
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.d2-adjacent-link:hover {
    border-color: color-mix(in oklab, var(--border) 50%, var(--c-primary));
    background: color-mix(in oklab, var(--accent) 40%, var(--surface));
    color: var(--heading);
}

img[data-image-fallback] { object-position: center 34%; }

/* Plain pages, errors and search ------------------------------------------ */

.d2-prose {
    max-width: calc(760px + 2 * var(--gutter));
    padding-top: 24px;
}

.d2-prose h1 {
    margin: 6px 0 20px;
    font-size: clamp(2rem, 1.2rem + 2.6vw, 3rem);
    line-height: 1.1;
}

.d2-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 640px;
}

.d2-search-form .d2-input { flex: 1 1 16rem; }

/* Inputs: pill field, 16px text (no iOS zoom), primary border on focus, danger when invalid. */
.d2-input {
    min-height: 44px;
    width: 100%;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
    transition: border-color .15s ease;
}

.d2-input::placeholder { color: var(--muted); opacity: 1; }
.d2-input:hover { border-color: color-mix(in oklab, var(--border) 50%, var(--c-primary)); }
.d2-input:focus-visible { border-color: var(--primary); outline-offset: 2px; }
.d2-input[aria-invalid="true"] { border-color: var(--danger-text); }
.d2-input:disabled { opacity: .5; cursor: not-allowed; }

.d2-search-summary {
    margin: 16px 0 24px;
    color: var(--muted);
}

/* 9. Footer ------------------------------------------------------------- */

.d2-footer {
    margin-top: 72px;
    padding-block: 48px calc(32px + env(safe-area-inset-bottom));
    background: var(--footer-bg);
    color: var(--footer-text);
    font-size: .9375rem;
}

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

.d2-footer a:hover {
    color: var(--footer-heading);
    text-decoration: underline;
}

.d2-footer :focus-visible { outline-color: var(--footer-heading); }

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

.d2-footer-brand { grid-column: 1 / -1; }

.d2-footer-brand p {
    max-width: 34ch;
    margin: 12px 0 0;
}

.d2-footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    font-size: .875rem;
    font-weight: 700;
}

.d2-footer-logo img { display: block; flex: none; }

.d2-footer-title {
    margin: 0 0 8px;
    color: var(--footer-heading);
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.4;
}

.d2-footer-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.d2-footer-column a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.d2-footer-copy {
    margin-top: 32px;
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
    .d2-footer-grid { grid-template-columns: 2fr repeat(3, minmax(0, 1fr)); }
    .d2-footer-brand { grid-column: auto; }
    .d2-footer-column a { min-height: 32px; }
}

/* 10. Cookie consent ----------------------------------------------------- */

/* Small non-modal card at the bottom: it never blocks reading or the page's own controls. */
.d2-consent {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: 16px;
    z-index: 1040;
    max-width: 26rem;
    margin-inline: auto;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-raised);
}

@media (min-width: 768px) {
    .d2-consent { right: 24px; left: auto; margin: 0; }
}

.d2-consent-title {
    margin: 0 0 4px;
    font-size: .9375rem;
}

.d2-consent-text {
    margin: 0 0 12px;
    font-size: .875rem;
    line-height: 1.5;
}

.d2-consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.d2-consent-actions .d2-btn { flex: 1 1 8rem; }

.d2-footer-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 24px;
}

.d2-footer-consent {
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--footer-heading);
    font-size: inherit;
    text-decoration: underline;
    text-underline-offset: .2em;
}

.d2-footer-consent:hover { color: var(--footer-heading); text-decoration-thickness: 2px; }
