/* =========================================================
   PortalCMS — Documentation
   Three-column reference layout: browse nav on the left,
   article in the middle, "on this page" rail on the right.
   Every structural piece can be switched off from
   Design > Blog & Docs Pages, so each rule degrades to a
   sensible two- or one-column layout on its own.
   ========================================================= */

/* Declared on :root as well as .docs-scope, not only on the wrapper.
   The docs WIDGETS can be dropped on any page and are previewed in the
   builder canvas, neither of which has a .docs-scope ancestor - and 18
   declarations here are used without a fallback, so outside that wrapper
   they resolved to nothing and the rule was thrown away. .docs-scope is
   kept so a docs page can still override any of them. */
/* .posts-scope shares this whole token layer. The blog and a doc page are
   the same problem — a column of prose that has to read well — so they get
   one design system rather than two that drift. The post side overrides the
   tokens it wants differently in its own block further down, and the
   --doc-* names stay as they are: renaming them now would mean touching
   every rule in this file for no visual gain. */
:root,
.docs-scope,
.posts-scope {
    --doc-nav-w: 264px;
    --doc-toc-w: 216px;
    --doc-gap: 40px;
    --doc-radius: 10px;
    --doc-accent: var(--pcms-doc-accent, var(--brand-color, #8B5CF6));
    /* The category icon tile used to share --doc-accent with link and hover
       colours, so tinting the tile also repainted every hover state. It has
       its own variable now; unset, it still derives from the accent so
       nothing changes until you set one. */
    --doc-icon-bg: var(--pcms-doc-icon-bg, color-mix(in srgb, var(--doc-accent, #8B5CF6) 16%, transparent));
    --doc-sticky-top: 84px;

    /* ---------------------------------------------------------------
       Design tokens.

       Everything below this line reads these rather than reaching for
       --bg-card / --border-color directly. That is what makes the style
       presets further down possible: a preset redefines eight variables
       and the whole section follows, instead of every rule needing a
       variant. Each one still derives from the site theme when untouched,
       so a stock install looks like the site it is part of.
       --------------------------------------------------------------- */

    /* Every colour token below takes an optional --pcms-doc-* override,
       written onto the wrapper by ContentPages::docStyleVars() when an admin
       has picked one in Design > Blog & Docs Pages. Unset, each falls through
       to the site theme exactly as before — so the whole palette is settable
       without a stock install moving at all.

       The two-step (override, then theme, then literal) matters: docs.css is
       also inlined into the widget preview endpoint, where only admin.css is
       loaded, so the literal at the end of each chain is what keeps a rule
       from being thrown away there. */

    /* Surfaces, in increasing prominence. */
    --doc-surface:    var(--pcms-doc-surface, var(--bg-card, #1e1e32));
    --doc-surface-2:  color-mix(in srgb, var(--doc-surface, #1e1e32) 60%, transparent);
    --doc-surface-3:  var(--pcms-doc-code-bg, var(--bg-dark, #16162a));

    /* Two border weights: hairline for structure, strong for emphasis. */
    --doc-line-strong: var(--pcms-doc-line, var(--border-color, #2d2d44));
    --doc-line:        color-mix(in srgb, var(--doc-line-strong, #2d2d44) 70%, transparent);

    /* Text, in decreasing prominence. */
    --doc-ink:      var(--pcms-doc-heading, var(--text-light, #e2e2ef));
    --doc-ink-2:    var(--pcms-doc-text, color-mix(in srgb, var(--doc-ink, #e2e2ef) 78%, transparent));
    --doc-ink-3:    var(--pcms-doc-muted, var(--text-muted, #9595aa));

    /* Named separately from the accent so "what colour are links in an
       article" and "what colour is the active nav item" can differ. */
    --doc-link: var(--pcms-doc-link, var(--doc-accent, #8B5CF6));

    /* Code. The block surface is --doc-surface-3 above; these are the text
       on it and the tinted inline chip. */
    --doc-code-ink:    var(--pcms-doc-code-text, var(--doc-ink, #e2e2ef));
    --doc-inline-bg:   var(--pcms-doc-inline-bg, color-mix(in srgb, var(--doc-accent, #8B5CF6) 10%, transparent));
    --doc-inline-ink:  var(--pcms-doc-inline-text, color-mix(in srgb, var(--doc-accent, #8B5CF6) 45%, var(--doc-ink, #e2e2ef)));

    /* Callout tints. Defaults are the conventional four, so an admin only
       sets these to match a palette rather than to make them work. */
    --doc-note:    var(--pcms-doc-note, #3B82F6);
    --doc-tip:     var(--pcms-doc-tip, #10B981);
    --doc-warning: var(--pcms-doc-warning, #F59E0B);
    --doc-danger:  var(--pcms-doc-danger, #EF4444);

    /* Badges (the pill beside a doc title or nav item) and the nav's current
       item, both of which default to the accent but often want to differ —
       a badge that matches the active-page colour reads as a state. */
    --doc-badge:      var(--pcms-doc-badge, var(--doc-accent, #8B5CF6));
    --doc-badge-ink:  var(--pcms-doc-badge-text, #fff);
    --doc-nav-active: var(--pcms-doc-nav-active, var(--doc-accent, #8B5CF6));

    /* Layered rather than single-drop: a wide soft pass for the ambient
       cast plus a tight dark one for the contact edge. One 34px blur
       reads as a sticker; two read as depth. */
    --doc-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.18);
    --doc-shadow-md: 0 2px 4px rgba(0, 0, 0, 0.14), 0 8px 20px -6px rgba(0, 0, 0, 0.28);
    --doc-shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.16), 0 18px 44px -12px rgba(0, 0, 0, 0.42);

    /* Corner scale. Presets move these together so the section stays
       internally consistent rather than mixing 6px chips with 14px cards. */
    --doc-r-xs: 6px;
    --doc-r-sm: 8px;
    --doc-r-md: 12px;
    --doc-r-lg: 16px;
    --doc-r-pill: 999px;

    /* Reading measure and rhythm. */
    --doc-measure: 74ch;
    --doc-body-size: 16px;
    --doc-body-leading: 1.75;
    --doc-heading-font: inherit;
    --doc-heading-weight: 650;
    --doc-heading-tracking: -0.018em;

    /* Density multiplier — the presets and the site density setting scale
       padding through this rather than restating every value. */
    --doc-pad: 1;

    /* One easing curve for the whole section. Mixed easings are the main
       reason interfaces feel assembled rather than designed. */
    --doc-ease: cubic-bezier(0.32, 0.72, 0, 1);
    --doc-fast: 0.14s var(--doc-ease);
    --doc-slow: 0.28s var(--doc-ease);

    /* Focus ring, one definition, used by everything focusable. */
    --doc-ring: 0 0 0 3px color-mix(in srgb, var(--doc-accent, #8B5CF6) 34%, transparent);

    /* Tints of the accent, pre-mixed so rules do not each re-derive them. */
    --doc-accent-weak:   color-mix(in srgb, var(--doc-accent, #8B5CF6) 10%, transparent);
    --doc-accent-medium: color-mix(in srgb, var(--doc-accent, #8B5CF6) 22%, transparent);
    --doc-accent-ink:    var(--doc-accent, #8B5CF6);
}

/* =========================================================
   Style presets

   Set on the docs wrapper as data-doc-style. Each one moves the tokens
   above as a set — that is the point: picking "Editorial" should change
   the whole feel in one move, not require twelve individual choices that
   have to be kept in agreement by hand.

   'default' is deliberately absent. No attribute means the tokens above,
   which are the site's own theme.
   ========================================================= */

/* Serif headings, a narrower measure and more air. For documentation that
   reads as prose — guides, handbooks, policy. */
.docs-scope[data-doc-style="editorial"] {
    --doc-heading-font: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
    --doc-heading-weight: 600;
    --doc-heading-tracking: -0.005em;
    --doc-measure: 66ch;
    --doc-body-size: 17px;
    --doc-body-leading: 1.85;
    --doc-r-xs: 4px;
    --doc-r-sm: 5px;
    --doc-r-md: 7px;
    --doc-r-lg: 9px;
    --doc-pad: 1.15;
}

/* Denser, squarer, more surface. For API references and anything read in
   fragments rather than end to end. */
.docs-scope[data-doc-style="technical"] {
    --doc-measure: 84ch;
    --doc-body-size: 15px;
    --doc-body-leading: 1.68;
    --doc-heading-tracking: -0.01em;
    --doc-r-xs: 4px;
    --doc-r-sm: 5px;
    --doc-r-md: 6px;
    --doc-r-lg: 8px;
    --doc-pad: 0.85;
    --doc-shadow-md: 0 1px 2px rgba(0, 0, 0, 0.2);
    --doc-shadow-lg: 0 1px 3px rgba(0, 0, 0, 0.24);
}

/* Hairlines instead of cards. Nothing is boxed unless it has to be.

   The presets below set the LOOK — what a token becomes when nobody has picked
   one. A colour picked in Design → Blog & Docs is an explicit choice and wins,
   so each surface reads the admin's --pcms-* value first and falls back to the
   preset's own. They used to assign their values outright, and because a preset
   rule ([data-doc-style]) outranks the base token block, choosing Minimal or
   Elevated silently threw away every surface colour on the Docs look tab. */
.docs-scope[data-doc-style="minimal"] {
    --doc-surface: var(--pcms-doc-surface, transparent);
    --doc-surface-2: color-mix(in srgb, var(--pcms-doc-surface, transparent) 60%, transparent);
    --doc-surface-3: var(--pcms-doc-code-bg, color-mix(in srgb, var(--pcms-doc-surface, transparent) 45%, transparent));
    --doc-line: color-mix(in srgb, var(--doc-line-strong, #2d2d44) 45%, transparent);
    --doc-shadow-sm: none;
    --doc-shadow-md: none;
    --doc-shadow-lg: none;
    --doc-measure: 70ch;
    --doc-pad: 0.9;
}

/* Soft, rounded and lifted. The most "product" of the five. */
.docs-scope[data-doc-style="elevated"] {
    /* This used to read var(--doc-surface) inside --doc-surface's own
       declaration. A custom property that refers to itself is a cycle, which
       CSS resolves by discarding it — so under Elevated every docs surface fell
       back to its hardcoded literal and no setting could reach it. */
    --doc-surface: var(--pcms-doc-surface, color-mix(in srgb, var(--bg-card, #1e1e32) 92%, var(--doc-accent, #8B5CF6)));
    --doc-surface-2: color-mix(in srgb, var(--pcms-doc-surface, var(--bg-card, #1e1e32)) 55%, transparent);
    --doc-line: color-mix(in srgb, var(--doc-line-strong, #2d2d44) 55%, transparent);
    --doc-r-xs: 9px;
    --doc-r-sm: 12px;
    --doc-r-md: 18px;
    --doc-r-lg: 24px;
    --doc-pad: 1.2;
    --doc-shadow-md: 0 2px 6px rgba(0, 0, 0, 0.16), 0 14px 34px -10px rgba(0, 0, 0, 0.4);
    --doc-shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.18), 0 28px 64px -16px rgba(0, 0, 0, 0.5);
}

/* Density is separate from style: any preset can be run tight or roomy. */
.docs-scope[data-doc-density="compact"] { --doc-pad: 0.78; --doc-body-leading: 1.62; }
.docs-scope[data-doc-density="roomy"]   { --doc-pad: 1.3;  --doc-body-leading: 1.9; }

/* Presets and density are set on the wrapper, but the docs WIDGETS can be
   dropped on a page that has no wrapper. Same declarations on :root when
   the attribute lands there instead. */
:root[data-doc-style="editorial"] { --doc-heading-font: Georgia, 'Iowan Old Style', 'Times New Roman', serif; --doc-measure: 66ch; --doc-body-size: 17px; --doc-body-leading: 1.85; --doc-pad: 1.15; }
:root[data-doc-style="technical"] { --doc-measure: 84ch; --doc-body-size: 15px; --doc-body-leading: 1.68; --doc-pad: 0.85; }
:root[data-doc-style="minimal"]   { --doc-surface: var(--pcms-doc-surface, transparent); --doc-surface-2: color-mix(in srgb, var(--pcms-doc-surface, transparent) 60%, transparent); --doc-shadow-md: none; --doc-shadow-lg: none; --doc-pad: 0.9; }
:root[data-doc-style="elevated"]  { --doc-r-md: 18px; --doc-r-lg: 24px; --doc-pad: 1.2; }

/* =========================================================
   Docs home
   ========================================================= */

.docs-hero {
    position: relative;
    text-align: center;
    padding: calc(64px * var(--doc-pad)) 20px 8px;
}

/* A single wide accent bloom behind the title. Cheap — one radial on a
   pseudo-element, no image — and it is the difference between a heading
   floating on flat colour and a page that has a top to it. */
/* The horizontal inset used to be -20%, which hung the bloom off both sides
   of the page. An absolutely positioned pseudo-element still counts toward
   scrollable overflow, so /docs reported a scroll width 40% wider than the
   viewport and grew a horizontal scrollbar with nothing horizontal on it.
   A 60% ellipse in a 140%-wide box and an 84% ellipse in a 100%-wide box are
   the same gradient; only one of them scrolls.

   (The docs-home LOOKS further down still set negative horizontal insets of
   their own. The ones that also set overflow:hidden on the hero — panel,
   aurora, halo — are contained; the rest are not, and are worth the same
   treatment.) */
.docs-hero::before {
    content: '';
    position: absolute;
    inset: -10% 0 30%;
    background: radial-gradient(84% 70% at 50% 0%,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 13%, transparent) 0%,
        transparent 72%);
    pointer-events: none;
    z-index: 0;
}

.docs-hero > * { position: relative; z-index: 1; }

.docs-hero h1 {
    font-family: var(--doc-heading-font);
    font-weight: var(--doc-heading-weight);
    font-size: clamp(2rem, 4.4vw, 3rem);
    line-height: 1.1;
    margin: 0 0 12px;
    letter-spacing: var(--doc-heading-tracking);
    /* Falls back to the plain ink colour wherever background-clip:text is
       unsupported, because the fallback here is invisible text. */
    color: var(--doc-ink);
    /* Derived from the heading colour, NOT from white. On a light palette a
       white-to-ink gradient starts invisible, which put the top third of the
       title into the page background. */
    background: linear-gradient(180deg,
        var(--doc-ink) 0%,
        color-mix(in srgb, var(--doc-ink) 68%, transparent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
    .docs-hero h1 { background: none; -webkit-text-fill-color: currentColor; }
}

.docs-hero .page-subtitle {
    color: var(--doc-ink-3);
    font-size: 16.5px;
    line-height: 1.6;
    max-width: 56ch;
    margin: 0 auto;
}

.docs-search {
    position: relative;
    max-width: 620px;
    margin: calc(30px * var(--doc-pad)) auto 0;
}

.docs-search input {
    width: 100%;
    padding: 15px 18px 15px 48px;
    background: var(--doc-surface);
    border: 1px solid var(--doc-line-strong);
    border-radius: var(--doc-r-pill);
    color: var(--doc-ink);
    font-size: 15px;
    font-family: inherit;
    box-shadow: var(--doc-shadow-sm);
    transition: border-color var(--doc-fast), box-shadow var(--doc-fast), background var(--doc-fast);
}

.docs-search input:hover { border-color: var(--doc-line-strong); background: var(--doc-surface-3); }

.docs-search input:focus {
    outline: none;
    border-color: var(--doc-accent);
    background: var(--doc-surface);
    box-shadow: var(--doc-ring), var(--doc-shadow-md);
}

.docs-search input::placeholder { color: var(--doc-ink-3); }

.docs-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    opacity: 0.6;
    pointer-events: none;
    transition: opacity var(--doc-fast);
}

.docs-search:focus-within .docs-search-icon { opacity: 1; }

.docs-search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    padding: 6px;
    background: var(--doc-surface, #1e1e32);
    border: 1px solid var(--doc-line-strong);
    border-radius: var(--doc-r-md);
    box-shadow: var(--doc-shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: none;
    z-index: 60;
    text-align: left;
}

/* Animated in rather than snapped: the panel appears under the cursor's
   focus, and a hard cut there reads as a glitch. */
.docs-search-results.active {
    display: block;
    animation: doc-pop 0.16s var(--doc-ease);
}

@keyframes doc-pop {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}

/* Rows, not a bordered list. The separator was doing the job a little
   breathing room and a hover surface do better. */
.docs-search-results a {
    display: block;
    padding: 10px 12px;
    border-radius: var(--doc-r-sm);
    text-decoration: none;
    transition: background var(--doc-fast);
}

.docs-search-results a:hover,
.docs-search-results a:focus-visible {
    background: var(--doc-accent-weak);
    outline: none;
}

.docs-search-results .result-title {
    color: var(--doc-ink);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.docs-search-results .result-excerpt {
    color: var(--doc-ink-3);
    font-size: 12.5px;
    line-height: 1.5;
    /* Two lines, then stop. A four-line excerpt turns eight results into a
       scroll and buries the titles that are the actual answer. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Above the title, not below it — it is the context you read first. */
.docs-search-results .result-category {
    color: var(--doc-accent-ink);
    font-size: 10.5px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 3px;
}

.docs-search-results::-webkit-scrollbar { width: 8px; }
.docs-search-results::-webkit-scrollbar-thumb {
    background: var(--doc-line-strong);
    border-radius: var(--doc-r-pill);
    border: 2px solid transparent;
    background-clip: content-box;
}

/* ---- Category cards ---- */
.docs-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 34px 0 60px;
}

.doc-category-card {
    position: relative;
    background: var(--doc-surface);
    border: 1px solid var(--doc-line);
    border-radius: var(--doc-r-lg);
    padding: calc(24px * var(--doc-pad));
    box-shadow: var(--doc-shadow-sm);
    transition: border-color var(--doc-slow), transform var(--doc-slow),
                box-shadow var(--doc-slow), background var(--doc-slow);
}

/* A top-edge highlight rather than a full accent border on hover.
   Repainting all four sides makes the card jump; lighting the leading edge
   reads as the card coming forward, which is what the lift is saying. */
.doc-category-card::before {
    content: '';
    position: absolute;
    inset: -1px -1px auto;
    height: 1px;
    border-radius: var(--doc-r-lg) var(--doc-r-lg) 0 0;
    background: linear-gradient(90deg,
        transparent 0%,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 70%, transparent) 50%,
        transparent 100%);
    opacity: 0;
    transition: opacity var(--doc-slow);
    pointer-events: none;
}

.doc-category-card:hover {
    border-color: color-mix(in srgb, var(--doc-accent, #8B5CF6) 38%, var(--doc-line-strong));
    transform: translateY(-3px);
    box-shadow: var(--doc-shadow-lg);
}

.doc-category-card:hover::before { opacity: 1; }

/* Keyboard parity: tabbing to a card's link should light the card, not just
   ring the text inside it. */
.doc-category-card:focus-within {
    border-color: color-mix(in srgb, var(--doc-accent, #8B5CF6) 38%, var(--doc-line-strong));
    box-shadow: var(--doc-shadow-md);
}

.doc-category-card:focus-within::before { opacity: 1; }

.doc-category-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

.doc-category-icon {
    position: relative;
    flex-shrink: 0;
    width: var(--doc-card-icon-size, 44px);
    height: var(--doc-card-icon-size, 44px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--doc-card-icon-size, 44px) * 0.5);
    border-radius: calc(var(--doc-card-icon-size, 44px) * 0.27);
    background-color: var(--doc-icon-bg);
    /* An image is set inline per category. Size/position/fit live here so the
       inline style only ever carries the url - and 'contain' is available for
       a logo that should not be cropped to a square. */
    background-size: var(--doc-card-icon-fit, cover);
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    /* An inset top highlight: the tile reads as a physical chip rather than
       a flat coloured square, and it costs nothing. */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09),
                inset 0 0 0 1px rgba(255, 255, 255, 0.045);
    transition: transform var(--doc-slow);
}

.doc-category-card:hover .doc-category-icon { transform: scale(1.06) rotate(-2deg); }

/* With an image behind it the emoji needs separating from the artwork, or a
   dark glyph on a dark photo is unreadable. */
.doc-category-icon.has-image {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

.doc-category-card h3 {
    font-family: var(--doc-heading-font);
    font-weight: var(--doc-heading-weight);
    margin: 0 0 3px;
    font-size: 1.06rem;
    line-height: 1.35;
    letter-spacing: var(--doc-heading-tracking);
}

.doc-category-card h3 a {
    color: var(--doc-ink);
    text-decoration: none;
    transition: color var(--doc-fast);
}

.doc-category-card h3 a:hover { color: var(--doc-accent-ink); }

/* A pill, not loose grey text. It is a count — a discrete fact — and
   reads as one when it is contained. */
.doc-category-card .doc-count {
    display: inline-block;
    color: var(--doc-ink-3);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.doc-category-desc {
    color: var(--doc-ink-3);
    font-size: 13.5px;
    line-height: 1.65;
    margin: 0 0 14px;
}

.doc-category-card .doc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid var(--doc-line);
    padding-top: 12px;
}

.doc-category-card .doc-list li { margin-bottom: 1px; }

.doc-category-card .doc-list a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    margin: 0 -9px;
    border-radius: var(--doc-r-xs);
    color: var(--doc-ink-3);
    font-size: 13.5px;
    text-decoration: none;
    transition: background var(--doc-fast), color var(--doc-fast), padding-left var(--doc-fast);
}

.doc-category-card .doc-list a:hover,
.doc-category-card .doc-list a:focus-visible {
    background: var(--doc-accent-weak);
    color: var(--doc-ink);
    padding-left: 13px;
    outline: none;
}

.doc-category-card .doc-list-more a {
    color: var(--doc-accent, var(--brand-color));
    font-weight: 600;
    font-size: 12.5px;
}

.docs-empty {
    text-align: center;
    padding: 70px 20px;
    color: var(--doc-ink-3);
}

/* =========================================================
   Doc page — three column shell
   Columns drop out cleanly: no TOC gives nav+content, no
   sidebar gives content+TOC, neither gives one centred column.
   ========================================================= */

.doc-layout {
    display: grid;
    grid-template-columns: var(--doc-nav-w) minmax(0, 1fr) var(--doc-toc-w);
    gap: var(--doc-gap);
    padding: 32px 0 70px;
    align-items: start;
}

.doc-layout.no-toc     { grid-template-columns: var(--doc-nav-w) minmax(0, 1fr); }
.doc-layout.no-sidebar { grid-template-columns: minmax(0, 1fr) var(--doc-toc-w); }

.doc-layout.no-sidebar.no-toc {
    grid-template-columns: minmax(0, 1fr);
    max-width: var(--pcms-doc-width, 820px);
    margin: 0 auto;
}

/* Author-chosen width (DocOptions) caps the article column only —
   the nav and TOC rails keep their own track widths. */
.doc-layout .doc-content {
    min-width: 0;
    max-width: var(--pcms-doc-width, none);
}

/* =========================================================
   Left navigation
   ========================================================= */

.doc-sidebar {
    position: sticky;
    top: var(--doc-sticky-top);
    max-height: calc(100vh - var(--doc-sticky-top) - 20px);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.doc-sidebar h4 {
    color: var(--doc-ink-3);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 12px;
}

.doc-sidebar-home a {
    color: inherit;
    text-decoration: none;
    transition: color var(--doc-fast);
}

.doc-sidebar-home a:hover { color: var(--doc-accent-ink); }

/* ---- filter box ---- */
.doc-nav-filter {
    position: relative;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.doc-nav-filter input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    background: var(--doc-surface-3);
    border: 1px solid var(--doc-line);
    border-radius: var(--doc-r-sm);
    color: var(--doc-ink);
    font-size: 13px;
    font-family: inherit;
    transition: border-color var(--doc-fast), box-shadow var(--doc-fast);
}

.doc-nav-filter input::placeholder { color: var(--doc-ink-3); }

.doc-nav-filter input:focus {
    outline: none;
    border-color: var(--doc-accent);
    box-shadow: var(--doc-ring);
}

.doc-nav-filter-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.55;
    pointer-events: none;
}

/* The scroll area fades at both ends instead of slicing a link in half at
   the edge. mask-image so it works over any background — a gradient overlay
   would need to know the colour behind it, and the sidebar's is settable. */
.doc-nav-scroll {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--doc-line-strong) transparent;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 18px), transparent 100%);
}

/* A nav that is not stuck grows to its full height and never scrolls, so
   the fade would just be dimming its first and last links for no reason —
   and a mask clips the focus ring on those. (The drawer is handled in the
   narrow-screen block further down, where it is the one that applies.) */
.pcms-docs-nav:not(.is-sticky) .doc-nav-scroll {
    -webkit-mask-image: none;
    mask-image: none;
}

.doc-nav-scroll::-webkit-scrollbar { width: 8px; }
.doc-nav-scroll::-webkit-scrollbar-track { background: transparent; }
.doc-nav-scroll::-webkit-scrollbar-thumb {
    background: var(--doc-line-strong);
    border-radius: var(--doc-r-pill);
    border: 2px solid transparent;
    background-clip: content-box;
}
.doc-nav-scroll:hover::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--doc-ink-3) 55%, transparent);
    background-clip: content-box;
}

.doc-nav-empty {
    color: var(--doc-ink-3);
    font-size: 12.5px;
    padding: 10px 4px;
    display: none;
}

/* ---- collapsible category groups ---- */
.doc-sidebar .sidebar-category { margin-bottom: 4px; }

.doc-sidebar .sidebar-category-name {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 8px;
    background: none;
    border: none;
    border-radius: 7px;
    color: var(--doc-ink);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
    /* The name renders as a <button>, a <div> or — when the section lists no
       articles of its own — an <a> to the category page. Only the anchor
       needs this, but stating it once keeps the three shapes identical. */
    text-decoration: none;
}

.doc-sidebar .sidebar-category-name:hover { background: var(--doc-accent-weak); }

.doc-sidebar .sidebar-category-name:focus-visible {
    outline: none;
    box-shadow: var(--doc-ring);
}

/* "Nothing to list here yet" inside the nav widget, which can be pointed at a
   scope that turns out to be empty. */
.doc-nav-none {
    margin: 6px 8px;
    color: var(--doc-ink-3);
    font-size: 12.5px;
}

/* Chevron drawn with borders so there is no icon font or SVG to load.
   Points right when collapsed, down when open. */
.sidebar-chevron {
    margin-left: auto;
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid var(--doc-ink-3);
    border-bottom: 1.5px solid var(--doc-ink-3);
    transform: rotate(-45deg);
    transition: transform 0.18s ease;
}

.sidebar-category.is-open > .sidebar-category-name .sidebar-chevron {
    transform: rotate(45deg);
}

.sidebar-icon { font-size: 14px; line-height: 1; }

.doc-sidebar ul {
    list-style: none;
    margin: 2px 0 8px;
    padding: 0 0 0 9px;
    border-left: 1px solid var(--doc-line-strong);
}

/* Collapsed by default in markup; the open class reveals. Height is not
   animated because the lists vary wildly in length and a fixed max-height
   either clips long categories or makes short ones feel sluggish. */
.sidebar-category:not(.is-open) > ul { display: none; }

.doc-sidebar li { margin: 0; }

/* The active item is a filled pill with its own marker, not a coloured
   border on a transparent row. The old treatment put the emphasis on the
   1px rule to the left of the text rather than on the text itself, which
   is why the current page never quite read as current. */
.doc-sidebar li a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    margin-left: -1px;
    border-radius: var(--doc-r-xs);
    color: var(--doc-ink-3);
    font-size: 13px;
    line-height: 1.45;
    text-decoration: none;
    transition: color var(--doc-fast), background var(--doc-fast);
}

/* The marker rides on the rule the <ul> already draws, so it reads as that
   line thickening at the current item rather than as a second element. */
.doc-sidebar li a::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    width: 2px;
    height: 0;
    border-radius: var(--doc-r-pill);
    background: var(--doc-nav-active);
    transform: translateY(-50%);
    transition: height var(--doc-slow);
}

.doc-sidebar li a:hover {
    color: var(--doc-ink);
    background: var(--doc-surface-2);
}

.doc-sidebar li a:hover::before { height: 40%; }

.doc-sidebar li a:focus-visible {
    outline: none;
    color: var(--doc-ink);
    box-shadow: var(--doc-ring);
}

.doc-sidebar li a.active {
    color: var(--doc-nav-active);
    background: color-mix(in srgb, var(--doc-nav-active, #8B5CF6) 12%, transparent);
    font-weight: 600;
}

.doc-sidebar li a.active::before { height: 62%; }

.doc-sidebar .sidebar-doc-icon { font-size: 13px; flex-shrink: 0; }

.doc-sidebar .sidebar-doc-badge {
    margin-left: auto;
    flex-shrink: 0;
    padding: 2px 6px;
    border-radius: var(--doc-r-pill);
    background: var(--doc-badge);
    color: var(--doc-badge-ink);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    line-height: 1.5;
    text-transform: uppercase;
    box-shadow: var(--doc-shadow-sm);
}

/* ---- mobile drawer ---- */
.doc-nav-toggle {
    display: none;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 18px;
    background: var(--doc-surface);
    border: 1px solid var(--doc-line-strong);
    border-radius: var(--doc-r-sm);
    color: var(--doc-ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--doc-shadow-sm);
    transition: border-color var(--doc-fast), background var(--doc-fast);
}

.doc-nav-toggle:hover { border-color: var(--doc-accent); background: var(--doc-accent-weak); }
.doc-nav-toggle:focus-visible { outline: none; box-shadow: var(--doc-ring); }

.doc-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: var(--pcms-z-header, 10000);
}

body.doc-nav-open .doc-nav-backdrop { animation: doc-fade 0.2s var(--doc-ease); }

@keyframes doc-fade { from { opacity: 0; } to { opacity: 1; } }

/* =========================================================
   Article
   ========================================================= */

.doc-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    font-size: 12.5px;
    color: var(--doc-ink-3);
}

.doc-breadcrumbs a {
    color: var(--doc-ink-3);
    text-decoration: none;
    padding: 2px 5px;
    margin: -2px -1px;
    border-radius: var(--doc-r-xs);
    transition: color var(--doc-fast), background var(--doc-fast);
}

.doc-breadcrumbs a:hover { color: var(--doc-accent-ink); background: var(--doc-accent-weak); }
.doc-breadcrumbs a:focus-visible { outline: none; box-shadow: var(--doc-ring); }
.doc-breadcrumbs .separator { opacity: 0.4; }

/* The last crumb is where you are, so it is the one that should read as
   solid rather than as another dimmed link. */
.doc-crumb-current { color: var(--doc-ink-2); font-weight: 500; }

.doc-article { min-width: 0; }

.doc-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-family: var(--doc-heading-font);
    font-weight: var(--doc-heading-weight);
    font-size: clamp(1.85rem, 3.4vw, 2.6rem);
    line-height: 1.14;
    letter-spacing: var(--doc-heading-tracking);
    color: var(--doc-ink);
    margin: 0 0 12px;
    /* Long words in a heading are the one place text-wrap:balance earns
       its keep — a two-word orphan on line three of a title is the most
       common way a good page looks unfinished. */
    text-wrap: balance;
}

.doc-title-icon { font-size: 0.85em; line-height: 1; }

.doc-title-badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: var(--doc-r-pill);
    background: var(--doc-badge);
    color: var(--doc-badge-ink);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    vertical-align: middle;
    box-shadow: var(--doc-shadow-sm);
}

.doc-subtitle {
    margin: 0 0 18px;
    max-width: 62ch;
    color: var(--doc-ink-3);
    font-size: 16.5px;
    line-height: 1.62;
}

.doc-meta {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    padding-bottom: calc(20px * var(--doc-pad));
    margin-bottom: calc(30px * var(--doc-pad));
    border-bottom: 1px solid var(--doc-line);
    color: var(--doc-ink-3);
    font-size: 13px;
}

/* The separators between byline parts. Dimmer than the text they divide,
   or the row reads as a list of bullets rather than one line. */
.doc-meta > span[aria-hidden] { opacity: 0.4; }

.doc-print-btn {
    margin-left: auto;
    padding: 5px 12px;
    background: none;
    border: 1px solid var(--doc-line-strong);
    border-radius: var(--doc-r-xs);
    color: var(--doc-ink-3);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--doc-fast), border-color var(--doc-fast), background var(--doc-fast);
}

.doc-print-btn:hover {
    color: var(--doc-ink);
    border-color: var(--doc-accent);
    background: var(--doc-accent-weak);
}

.doc-print-btn:focus-visible { outline: none; box-shadow: var(--doc-ring); }

.doc-featured { margin: 0 0 calc(28px * var(--doc-pad)); }

.doc-featured img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--doc-r-lg);
    border: 1px solid var(--doc-line);
    box-shadow: var(--doc-shadow-md);
}

/* ---- body copy ---- */
.doc-body {
    color: var(--doc-ink-2);
    font-size: var(--doc-body-size);
    line-height: var(--doc-body-leading);
    /* Kerning and ligatures are off by default in most browsers below
       ~20px. Documentation is read for minutes at a time; it earns them. */
    text-rendering: optimizeLegibility;
    font-kerning: normal;
    /* Long identifiers and URLs are the norm in docs and the main cause of
       a horizontal scrollbar on a phone. */
    overflow-wrap: break-word;
}

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

/* Headings take the preset's family and tracking, and step down in a
   consistent ratio rather than three unrelated sizes. */
.doc-body h2,
.doc-body h3,
.doc-body h4 {
    position: relative;
    font-family: var(--doc-heading-font);
    font-weight: var(--doc-heading-weight);
    letter-spacing: var(--doc-heading-tracking);
    color: var(--doc-ink);
    line-height: 1.3;
    scroll-margin-top: calc(var(--doc-sticky-top) + 16px);
}

/* A hairline above every H2. The old 2.2em gap was the only thing marking
   a new section, which on a long page left the reader hunting. */
.doc-body h2 {
    font-size: 1.55rem;
    margin: 2.4em 0 0.7em;
    padding-top: 1em;
    border-top: 1px solid var(--doc-line);
}

.doc-body h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }

.doc-body h3 { font-size: 1.2rem; margin: 2em 0 0.55em; }
.doc-body h4 { font-size: 1.04rem; margin: 1.6em 0 0.45em; }

/* Anchor affordance. Every heading already has an id — docs.js assigns
   them for the contents list — so linking to a section was possible and
   completely undiscoverable. */
.doc-body h2::after,
.doc-body h3::after {
    content: '#';
    position: absolute;
    left: -0.75em;
    top: auto;
    color: var(--doc-accent-ink);
    font-weight: 400;
    opacity: 0;
    transition: opacity var(--doc-fast);
    pointer-events: none;
}

.doc-body h2:hover::after,
.doc-body h3:hover::after { opacity: 0.55; }

/* No room to hang it outside the measure on a narrow screen. */
@media (max-width: 900px) {
    .doc-body h2::after,
    .doc-body h3::after { content: none; }
}

.doc-body p { margin: 0 0 1.15em; }
.doc-body ul, .doc-body ol { margin: 0 0 1.15em; padding-left: 1.35em; }
.doc-body li { margin-bottom: 0.4em; }
.doc-body li::marker { color: var(--doc-ink-3); }

/* Underline offset and a thin rule, so descenders are not struck through
   and the link does not shout over the sentence it is in. */
.doc-body a {
    color: var(--doc-link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: color-mix(in srgb, var(--doc-link, #8B5CF6) 40%, transparent);
    transition: text-decoration-color var(--doc-fast);
}

.doc-body a:hover { text-decoration-color: currentColor; }

.doc-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--doc-r-md);
    border: 1px solid var(--doc-line);
}

.doc-body hr {
    margin: 2.4em 0;
    border: none;
    border-top: 1px solid var(--doc-line);
}

/* A quote, not a note. The oversized mark and the surface keep it distinct
   from the callouts below, which are a different thing saying so. */
.doc-body blockquote {
    position: relative;
    margin: 1.6em 0;
    padding: calc(14px * var(--doc-pad)) calc(20px * var(--doc-pad));
    border-left: 2px solid var(--doc-accent);
    border-radius: 0 var(--doc-r-sm) var(--doc-r-sm) 0;
    background: var(--doc-surface-2);
    color: var(--doc-ink-2);
    font-style: italic;
}

.doc-body blockquote > :last-child { margin-bottom: 0; }

/* ---- tables ----
   Rounded, ruled between rows only, and scrollable inside its own box so a
   wide table never makes the whole page scroll sideways. */
.doc-body table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.6em 0;
    font-size: 14px;
    border: 1px solid var(--doc-line);
    border-radius: var(--doc-r-md);
    overflow: hidden;
}

.doc-body th,
.doc-body td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--doc-line);
}

.doc-body tr:last-child td { border-bottom: none; }

.doc-body th {
    background: var(--doc-surface);
    color: var(--doc-ink);
    font-weight: 650;
    font-size: 12.5px;
    letter-spacing: 0.2px;
}

.doc-body tbody tr { transition: background var(--doc-fast); }
.doc-body tbody tr:hover { background: var(--doc-surface-2); }

/* ---- inline code ----
   Tinted rather than bordered. A 1px box around every third word in a
   paragraph is visual noise; a faint accent wash reads as "this is a
   literal" without chopping the line up. */
.doc-body :not(pre) > code {
    padding: 0.15em 0.4em;
    border-radius: var(--doc-r-xs);
    background: var(--doc-inline-bg);
    color: var(--doc-inline-ink);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.86em;
    font-weight: 500;
    /* Deliberately breakable. Inline code in docs is routinely a long flag
       or a namespaced identifier, and nowrap on those pushes a scrollbar
       onto the whole page on a phone. */
    overflow-wrap: break-word;
}

/* A link that is entirely code should read as a link. */
.doc-body a > code { color: inherit; text-decoration: inherit; }

/* ---- callouts ----
   Note / tip / warning / danger. Documentation without them ends up with
   bold paragraphs doing the job badly, which is what a stock install had.
   Written as [data-callout] and as plain classes so either markup works. */
.doc-body .doc-callout,
.doc-body [data-callout] {
    --doc-callout-tint: var(--doc-accent, #8B5CF6);
    position: relative;
    margin: 1.6em 0;
    padding: calc(14px * var(--doc-pad)) calc(18px * var(--doc-pad));
    padding-left: calc(18px * var(--doc-pad));
    border: 1px solid color-mix(in srgb, var(--doc-callout-tint) 26%, transparent);
    border-left: 3px solid var(--doc-callout-tint);
    border-radius: var(--doc-r-sm);
    background: color-mix(in srgb, var(--doc-callout-tint) 8%, transparent);
    color: var(--doc-ink-2);
    font-size: 0.95em;
}

.doc-body .doc-callout > :last-child,
.doc-body [data-callout] > :last-child { margin-bottom: 0; }

.doc-body .doc-callout > :first-child,
.doc-body [data-callout] > :first-child { margin-top: 0; }

/* The label is generated, so the author writes the prose and nothing else. */
.doc-body [data-callout]::before {
    content: attr(data-callout);
    display: block;
    margin-bottom: 5px;
    color: var(--doc-callout-tint);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.doc-body [data-callout="tip"],
.doc-body .doc-callout.is-tip     { --doc-callout-tint: var(--doc-tip); }
.doc-body [data-callout="warning"],
.doc-body .doc-callout.is-warning { --doc-callout-tint: var(--doc-warning); }
.doc-body [data-callout="danger"],
.doc-body .doc-callout.is-danger  { --doc-callout-tint: var(--doc-danger); }
.doc-body [data-callout="note"],
.doc-body .doc-callout.is-note    { --doc-callout-tint: var(--doc-note); }

/* ---- keyboard keys ---- */
.doc-body kbd {
    display: inline-block;
    padding: 2px 6px;
    border: 1px solid var(--doc-line-strong);
    border-bottom-width: 2px;
    border-radius: var(--doc-r-xs);
    background: var(--doc-surface);
    color: var(--doc-ink);
    font-family: inherit;
    font-size: 0.82em;
    font-weight: 600;
    line-height: 1.4;
}

/* ---- code blocks ----
   Wrapper added by docs.js so the copy button can sit over the block
   without the pre needing position:relative (which would break the
   horizontal scroll it relies on). The wrapper owns the frame; the pre
   inside it owns only the scrolling. */
.doc-code-wrap {
    position: relative;
    margin: 1.6em 0;
    border: 1px solid var(--doc-line);
    border-radius: var(--doc-r-md);
    background: var(--doc-surface-3);
    box-shadow: var(--doc-shadow-sm);
    overflow: hidden;
}

.doc-body pre {
    margin: 0;
    padding: calc(16px * var(--doc-pad)) calc(18px * var(--doc-pad));
    background: none;
    border: none;
    border-radius: 0;
    overflow-x: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--doc-code-ink);
    /* Tabs default to eight columns, which throws away a third of the
       width on any indented block. */
    tab-size: 2;
}

.doc-body pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
    white-space: pre;
}

/* A horizontal scrollbar that is visible enough to be discovered but does
   not sit under the code like a mistake. */
.doc-body pre::-webkit-scrollbar { height: 9px; }
.doc-body pre::-webkit-scrollbar-track { background: transparent; }
.doc-body pre::-webkit-scrollbar-thumb {
    background: var(--doc-line-strong);
    border-radius: var(--doc-r-pill);
    border: 2px solid transparent;
    background-clip: content-box;
}

.doc-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 5px 10px;
    background: color-mix(in srgb, var(--doc-surface, #1e1e32) 88%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--doc-line-strong);
    border-radius: var(--doc-r-xs);
    color: var(--doc-ink-3);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity var(--doc-fast), transform var(--doc-fast),
                color var(--doc-fast), border-color var(--doc-fast);
}

.doc-code-wrap:hover .doc-copy-btn,
.doc-copy-btn:focus-visible {
    opacity: 1;
    transform: none;
}

.doc-copy-btn:focus-visible { outline: none; box-shadow: var(--doc-ring); }

.doc-copy-btn:hover {
    color: var(--doc-ink);
    border-color: var(--doc-accent);
}

.doc-copy-btn.is-copied {
    opacity: 1;
    transform: none;
    color: #10B981;
    border-color: color-mix(in srgb, #10B981 55%, transparent);
    background: color-mix(in srgb, #10B981 14%, var(--doc-surface, #1e1e32));
}

/* Touch devices have no hover, so the button would never appear. */
@media (hover: none) {
    .doc-copy-btn { opacity: 1; transform: none; }
}

/* =========================================================
   Right rail — on this page
   ========================================================= */

.doc-toc {
    position: sticky;
    top: var(--doc-sticky-top);
    max-height: calc(100vh - var(--doc-sticky-top) - 20px);
    overflow-y: auto;
    font-size: 13px;
    scrollbar-width: thin;
}

.doc-toc h4 {
    margin: 0 0 10px;
    color: var(--doc-ink-3);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* The rail line is drawn once on the list rather than as a left border on
   each link. Per-link borders leave a hairline seam at every row boundary
   and cannot be a continuous track behind a moving marker. */
.doc-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--doc-line);
}

.doc-toc li { margin: 0; }

.doc-toc a {
    position: relative;
    display: block;
    padding: 5px 12px;
    color: var(--doc-ink-3);
    line-height: 1.45;
    text-decoration: none;
    transition: color var(--doc-fast);
}

/* The marker sits ON the track, so the rule appears to thicken and take
   the accent at the section being read. */
.doc-toc a::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    border-radius: var(--doc-r-pill);
    background: var(--doc-nav-active);
    opacity: 0;
    transform: scaleY(0.4);
    transition: opacity var(--doc-slow), transform var(--doc-slow);
}

.doc-toc a:hover { color: var(--doc-ink); }
.doc-toc a:hover::before { opacity: 0.35; transform: scaleY(1); }

.doc-toc a:focus-visible {
    outline: none;
    color: var(--doc-ink);
    border-radius: var(--doc-r-xs);
    box-shadow: var(--doc-ring);
}

.doc-toc a.toc-active {
    color: var(--doc-nav-active);
    font-weight: 600;
}

.doc-toc a.toc-active::before { opacity: 1; transform: scaleY(1); }

.doc-toc .toc-h3 a { padding-left: 26px; font-size: 12.5px; }

/* Sub-entries get a shorter marker, so the outline's two levels stay
   readable at a glance rather than looking like one flat list. */
.doc-toc .toc-h3 a::before { top: 7px; bottom: 7px; }

.doc-toc::-webkit-scrollbar { width: 8px; }
.doc-toc::-webkit-scrollbar-track { background: transparent; }
.doc-toc::-webkit-scrollbar-thumb {
    background: var(--doc-line-strong);
    border-radius: var(--doc-r-pill);
    border: 2px solid transparent;
    background-clip: content-box;
}

/* The TOC only makes sense as a right rail on a wide screen. Below that
   it becomes a collapsed summary above the article. */
.doc-toc.is-inline {
    position: static;
    max-height: none;
    background: var(--doc-surface);
    border: 1px solid var(--doc-line-strong);
    border-radius: var(--doc-radius);
    padding: 14px 18px;
    margin-bottom: 28px;
}

/* Boxed above the article there is no rail to run a marker down — the box
   itself is the grouping — so the track and marker come off and the active
   item is carried by colour and weight alone. */
.doc-toc.is-inline ul { border-left: none; }
.doc-toc.is-inline a { padding-left: 0; }
.doc-toc.is-inline a::before { content: none; }
.doc-toc.is-inline .toc-h3 a { padding-left: 14px; }

/* =========================================================
   Footer blocks — prev/next, related, reactions
   ========================================================= */

.doc-prevnext {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: calc(48px * var(--doc-pad));
    padding-top: calc(28px * var(--doc-pad));
    border-top: 1px solid var(--doc-line);
}

.doc-prevnext-link {
    display: block;
    padding: calc(15px * var(--doc-pad)) calc(18px * var(--doc-pad));
    background: var(--doc-surface);
    border: 1px solid var(--doc-line);
    border-radius: var(--doc-r-md);
    text-decoration: none;
    box-shadow: var(--doc-shadow-sm);
    transition: border-color var(--doc-slow), transform var(--doc-slow),
                box-shadow var(--doc-slow), background var(--doc-slow);
}

.doc-prevnext-link:hover {
    border-color: color-mix(in srgb, var(--doc-accent, #8B5CF6) 42%, var(--doc-line-strong));
    background: var(--doc-accent-weak);
    transform: translateY(-2px);
    box-shadow: var(--doc-shadow-md);
}

.doc-prevnext-link:focus-visible {
    outline: none;
    box-shadow: var(--doc-ring), var(--doc-shadow-md);
}

/* The direction cue slides toward its edge on hover — a small thing, but
   it is the difference between a link and a card that knows which way it
   is going. */
.doc-prevnext-link .doc-prevnext-dir { transition: transform var(--doc-slow), color var(--doc-fast); }
.doc-prevnext-link.is-prev:hover .doc-prevnext-dir { transform: translateX(-3px); }
.doc-prevnext-link.is-next:hover .doc-prevnext-dir { transform: translateX(3px); }
.doc-prevnext-link:hover .doc-prevnext-dir { color: var(--doc-accent-ink); }

.doc-prevnext-link.is-next { grid-column: 2; text-align: right; }

.doc-prevnext-dir {
    display: block;
    color: var(--doc-ink-3);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 5px;
}

.doc-prevnext-title {
    display: block;
    color: var(--doc-ink);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
}

.doc-related { margin-top: calc(48px * var(--doc-pad)); }

.doc-related h3 {
    font-family: var(--doc-heading-font);
    font-weight: var(--doc-heading-weight);
    letter-spacing: var(--doc-heading-tracking);
    color: var(--doc-ink);
    font-size: 1.05rem;
    margin: 0 0 14px;
}

.related-docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.related-doc-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(13px * var(--doc-pad)) calc(16px * var(--doc-pad));
    background: var(--doc-surface);
    border: 1px solid var(--doc-line);
    border-radius: var(--doc-r-sm);
    text-decoration: none;
    transition: border-color var(--doc-slow), background var(--doc-slow),
                transform var(--doc-slow);
}

.related-doc-card:hover {
    border-color: color-mix(in srgb, var(--doc-accent, #8B5CF6) 42%, var(--doc-line-strong));
    background: var(--doc-accent-weak);
    transform: translateY(-2px);
}

.related-doc-card:focus-visible { outline: none; box-shadow: var(--doc-ring); }

.related-doc-title {
    color: var(--doc-ink);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
}

.related-doc-arrow {
    margin-left: auto;
    color: var(--doc-ink-3);
    flex-shrink: 0;
    transition: transform var(--doc-slow), color var(--doc-fast);
}

.related-doc-card:hover .related-doc-arrow {
    transform: translateX(3px);
    color: var(--doc-accent-ink);
}

.doc-reactions {
    margin-top: calc(48px * var(--doc-pad));
    padding: calc(24px * var(--doc-pad));
    background: var(--doc-surface);
    border: 1px solid var(--doc-line);
    border-radius: var(--doc-r-lg);
    text-align: center;
}

.doc-reactions h4 {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 650;
    color: var(--doc-ink);
}

.reaction-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.reaction-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    background: var(--doc-surface-3);
    border: 1px solid var(--doc-line-strong);
    border-radius: var(--doc-r-pill);
    color: var(--doc-ink-3);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--doc-fast), transform var(--doc-slow),
                background var(--doc-fast), color var(--doc-fast);
}

.reaction-btn:hover {
    border-color: var(--doc-accent);
    background: var(--doc-accent-weak);
    color: var(--doc-ink);
    transform: translateY(-2px);
}

.reaction-btn:focus-visible { outline: none; box-shadow: var(--doc-ring); }

.reaction-btn.selected {
    border-color: var(--doc-accent);
    background: var(--doc-accent-medium);
    color: var(--doc-ink);
}

/* The emoji is the button. A small scale on press is the only feedback
   between the click and the count coming back from the server. */
.reaction-btn .emoji {
    font-size: 17px;
    line-height: 1;
    transition: transform var(--doc-slow);
}

.reaction-btn:hover .emoji { transform: scale(1.16); }
.reaction-btn:active .emoji { transform: scale(0.94); }
.reaction-btn.selected .emoji { transform: scale(1.1); }

.reaction-btn .count { font-variant-numeric: tabular-nums; }

/* Reading progress bar */
.doc-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: var(--doc-progress-h, 3px);
    width: 0;
    background: var(--doc-progress-fill, var(--doc-accent, var(--brand-color)));
    z-index: var(--pcms-z-overlay, 11000);
    transition: width 0.1s linear;
}

/* ---- Doc Reading Progress widget ----
   The widget wraps the bar in a track, which is what gives the fill
   something full-width to be a percentage of and the only place a track
   colour can live. Inside a track the bar stops positioning itself. */
.doc-progress-track {
    height: var(--doc-progress-h, 3px);
    background: var(--doc-progress-track, transparent);
    overflow: hidden;
}

.doc-progress-track > .doc-progress-bar {
    position: static;
    height: 100%;
    z-index: auto;
}

.doc-progress-track.is-pinned {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--pcms-z-overlay, 11000);
}

.doc-progress-track.is-inline { position: relative; width: 100%; }

.doc-progress-track.is-round,
.doc-progress-track.is-round > .doc-progress-bar { border-radius: 999px; }

/* The host is a zero-height anchor when the track is pinned out of the flow,
   so a pinned bar does not leave a gap where the block sits. */
.doc-progress-host { line-height: 0; }

/* =========================================================
   Responsive
   The right rail goes first (it is the least essential), then
   the left nav becomes a drawer. Both thresholds are keyed to
   the column widths above, not to device names.
   ========================================================= */

@media (max-width: 1180px) {
    .doc-layout,
    .doc-layout.no-sidebar {
        grid-template-columns: var(--doc-nav-w) minmax(0, 1fr);
    }
    .doc-layout.no-sidebar { grid-template-columns: minmax(0, 1fr); }
    /* TOC moves inline above the article — see .is-inline, applied by docs.js */
    .doc-toc { grid-column: auto; }
}

@media (max-width: 900px) {
    .doc-layout,
    .doc-layout.no-toc,
    .doc-layout.no-sidebar {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .doc-nav-toggle { display: flex; }

    /* Off-canvas drawer. Static positioning would put 50 nav links
       between the reader and the first paragraph.

       Opt-in by attribute, NOT on .doc-sidebar itself. The Docs Navigation
       widget carries that class too, and it renders no toggle button and no
       backdrop — so this rule used to translate the widget clean off the
       left edge of every phone with nothing on the page able to bring it
       back. The widget now says which of the three mobile behaviours it
       wants, and only "drawer" asks for this. */
    .doc-sidebar[data-mobile="drawer"] {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(310px, 85vw);
        max-height: none;
        padding: 22px 18px;
        background: var(--doc-surface);
        border-right: 1px solid var(--doc-line-strong);
        z-index: calc(var(--pcms-z-header, 10000) + 1);
        transform: translateX(-102%);
        transition: transform 0.24s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    }

    /* Stacked in the flow where it was placed — the sane default for a nav
       dropped into a builder column, which has no drawer to open. */
    .doc-sidebar[data-mobile="inline"] {
        position: static;
        max-height: none;
    }

    .doc-sidebar[data-mobile="hide"] { display: none; }

    /* The drawer is a full-height panel with its own edges — a fade at its
       top and bottom reads as the panel being cut off rather than as a list
       continuing past the fold. */
    .doc-sidebar[data-mobile="drawer"] .doc-nav-scroll,
    .doc-sidebar[data-mobile="inline"] .doc-nav-scroll {
        -webkit-mask-image: none;
        mask-image: none;
    }

    body.doc-nav-open .doc-sidebar[data-mobile="drawer"] { transform: translateX(0); }
    body.doc-nav-open .doc-nav-backdrop { display: block; }
    body.doc-nav-open { overflow: hidden; }

    .doc-prevnext { grid-template-columns: minmax(0, 1fr); }
    .doc-prevnext-link.is-next { grid-column: 1; }

    /* Wrapped as a row, not stacked as a column: stacking put each middot
       separator on a line of its own between the parts it was dividing. */
    .doc-meta { flex-wrap: wrap; gap: 4px 8px; }
    .doc-print-btn { margin-left: 0; }
}

@media (max-width: 640px) {
    .docs-hero { padding: 36px 16px 4px; }
    /* The hero's glow (::before) is drawn 10% wider than the hero on each side. On
       a phone the hero IS the screen width, so the glow made every docs page
       scroll sideways by ~40px. clip, not hidden: hidden would make this a scroll
       container and break the sticky header above it. */
    .docs-scope { overflow-x: clip; }
    .docs-categories { grid-template-columns: minmax(0, 1fr); }
    .related-docs-grid { grid-template-columns: minmax(0, 1fr); }
    .reaction-buttons { flex-wrap: wrap; }
    .doc-body { font-size: 15.5px; }
    /* Thumb-sized targets. The category title was a 21px-tall link; its whole
       header row — icon, title, count — now answers the tap, while the article
       links underneath stay their own targets and gain height. */
    .doc-category-header { position: relative; }
    .doc-category-card h3 a::after { content: ""; position: absolute; inset: -6px 0; }
    .doc-category-card .doc-list a { padding-top: 11px; padding-bottom: 11px; font-size: 14.5px; }
}

/* One place, covering the whole section. Listing individual selectors meant
   every new hover state had to remember to opt in here, and the newer ones
   (the card lift, the sliding contents marker, the search panel's entrance)
   did not exist when the old list was written. */
@media (prefers-reduced-motion: reduce) {
    .docs-scope *,
    .docs-scope *::before,
    .docs-scope *::after,
    .pcms-w[class*="doc"] *,
    .doc-body *,
    .doc-sidebar *,
    .doc-toc *,
    .docs-categories * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Movement specifically, not just its speed: a lift that snaps is still
       a lift, and the point is that nothing should shift under the cursor. */
    .doc-category-card:hover,
    .doc-prevnext-link:hover,
    .related-doc-card:hover,
    .reaction-btn:hover,
    .doc-category-card:hover .doc-category-icon,
    .reaction-btn:hover .emoji,
    .doc-prevnext-link:hover .doc-prevnext-dir,
    .related-doc-card:hover .related-doc-arrow { transform: none; }

    .docs-search-results.active { animation: none; }
}

/* =========================================================
   Print — drop every navigational chrome
   ========================================================= */
@media print {
    .doc-sidebar,
    .doc-toc,
    .doc-nav-toggle,
    .doc-nav-backdrop,
    .doc-progress-bar,
    .doc-progress-track,
    .doc-progress-host,
    .doc-nav-toggle,
    .doc-print-btn,
    .doc-reactions,
    .doc-prevnext,
    .doc-related,
    .doc-breadcrumbs,
    .doc-copy-btn { display: none !important; }

    .doc-layout {
        display: block !important;
        padding: 0;
    }

    .doc-article {
        background: #fff !important;
        color: #000 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .doc-body { color: #000 !important; font-size: 12pt; }
    .doc-body a { color: #000 !important; text-decoration: underline; }
}

/* =========================================================
   TOC rail wrapper
   Sticky lives on the wrapper, not the nav, because the grid uses
   align-items:start and a content-height grid item has nothing to
   stick within. When docs.js moves the TOC inline on a narrow screen
   the wrapper is left empty and removes itself — which also means the
   rail still renders (wrapping below) if JavaScript never runs.
   ========================================================= */
.doc-toc-rail {
    position: sticky;
    top: var(--doc-sticky-top);
    max-height: calc(100vh - var(--doc-sticky-top) - 20px);
    overflow-y: auto;
    min-width: 0;
    scrollbar-width: thin;
}

.doc-toc-rail:empty { display: none; }

.doc-toc-rail .doc-toc {
    position: static;
    max-height: none;
    overflow: visible;
}

/* =========================================================
   Category page — the index of one category
   ========================================================= */

.doc-cat-header {
    text-align: center;
    padding: 48px 20px 6px;
}

.doc-cat-header .doc-cat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Scales with the site-wide tile size rather than a fixed 62px, so one
       setting governs the tile on the home cards and here. */
    width: calc(var(--doc-card-icon-size, 44px) * 1.4);
    height: calc(var(--doc-card-icon-size, 44px) * 1.4);
    margin-bottom: 14px;
    border-radius: calc(var(--doc-r-lg) * 1.15);
    /* background-color, not the shorthand: an uploaded category image is
       set as background-image inline, and the shorthand would reset it. */
    background-color: var(--doc-icon-bg);
    background-size: var(--doc-card-icon-fit, cover);
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09),
                inset 0 0 0 1px rgba(255, 255, 255, 0.045);
    font-size: calc(var(--doc-card-icon-size, 44px) * 0.68);
}

/* Emoji over artwork needs separating from it, same as the home cards. */
.doc-cat-header .doc-cat-icon.has-image { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65); }

.doc-cat-header h1 {
    font-family: var(--doc-heading-font);
    font-weight: var(--doc-heading-weight);
    font-size: clamp(1.8rem, 3.8vw, 2.5rem);
    line-height: 1.14;
    color: var(--doc-ink);
    margin: 0 0 10px;
    letter-spacing: var(--doc-heading-tracking);
    text-wrap: balance;
}

.doc-cat-header p {
    max-width: 620px;
    margin: 0 auto;
    color: var(--doc-ink-3);
    font-size: 15px;
    line-height: 1.65;
}

.doc-subcats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 34px;
}

.doc-subcat-card {
    display: block;
    padding: calc(20px * var(--doc-pad));
    background: var(--doc-surface);
    border: 1px solid var(--doc-line);
    border-radius: var(--doc-r-md);
    box-shadow: var(--doc-shadow-sm);
    text-align: center;
    text-decoration: none;
    transition: border-color var(--doc-slow), transform var(--doc-slow),
                background var(--doc-slow), box-shadow var(--doc-slow);
}

.doc-subcat-card:hover {
    border-color: color-mix(in srgb, var(--doc-accent, #8B5CF6) 42%, var(--doc-line-strong));
    background: var(--doc-accent-weak);
    transform: translateY(-2px);
    box-shadow: var(--doc-shadow-md);
}

.doc-subcat-card .doc-subcat-icon { display: block; font-size: 24px; margin-bottom: 8px; }

.doc-subcat-card h3 {
    margin: 0;
    color: var(--doc-ink);
    font-size: 0.98rem;
}

/* Doubled up with .page-body: style.css sizes `.page-body h2` at (0,1,1),
   which beat this (0,1,0) label and blew "Articles" up into a page heading. */
.doc-index-heading,
.page-body .doc-index-heading {
    margin: 0 0 14px;
    color: var(--doc-ink-3);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.doc-index-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.doc-index-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: calc(15px * var(--doc-pad)) calc(18px * var(--doc-pad));
    background: var(--doc-surface);
    border: 1px solid var(--doc-line);
    border-radius: var(--doc-r-md);
    box-shadow: var(--doc-shadow-sm);
    /* Stated on the anchor AND on everything inside it: the row is one link,
       and a site-wide `a { text-decoration: underline }` was striking the
       excerpt through as though it were a second one. */
    text-decoration: none;
    transition: border-color var(--doc-slow), transform var(--doc-slow),
                background var(--doc-slow), box-shadow var(--doc-slow);
}

.doc-index-item,
.doc-index-item * { text-decoration: none; }

.doc-index-item:focus-visible { outline: none; box-shadow: var(--doc-ring); }

.doc-index-item:hover {
    border-color: color-mix(in srgb, var(--doc-accent, #8B5CF6) 42%, var(--doc-line-strong));
    background: var(--doc-accent-weak);
    transform: translateX(3px);
    box-shadow: var(--doc-shadow-md);
}

.doc-index-icon {
    flex-shrink: 0;
    font-size: 19px;
    line-height: 1;
    color: var(--doc-accent, var(--brand-color));
}

.doc-index-text { min-width: 0; flex: 1; }

.doc-index-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--doc-ink);
    font-size: 15px;
    font-weight: 500;
}

.doc-index-excerpt {
    margin-top: 4px;
    color: var(--doc-ink-3);
    font-size: 13px;
    line-height: 1.55;
    /* Was an inline <span>, so margin-top did nothing and it ran on from the
       title instead of sitting under it. Two lines, then stop. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc-index-arrow {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--doc-ink-3);
    font-size: 18px;
}

@media (prefers-reduced-motion: reduce) {
    .doc-subcat-card, .doc-index-item { transition: none; }
    .doc-subcat-card:hover, .doc-index-item:hover { transform: none; }
}

/* The mobile nav button now renders even with its label cleared, so it has
   to stay usable as an icon-only control rather than collapsing to nothing. */
.doc-nav-toggle { min-height: 44px; justify-content: center; }
.doc-nav-toggle > span:only-child { font-size: 18px; }

/* =========================================================
   Docs widgets (modules/header-widgets/widgets/doc*.php)
   Placed in builder layouts, so they carry their own spacing
   rather than relying on the built-in template's grid.
   ========================================================= */

/* Shown on the builder canvas, where there is no current document to
   render. Without it a docs widget is an invisible empty box and the
   layout is impossible to judge while designing it. */
.pcms-doc-widget-empty {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 22px;
    border: 1px dashed var(--doc-line-strong, #2d2d44);
    border-radius: 10px;
    background: var(--doc-surface-3, #1a1a2e);
    color: var(--doc-ink-3, #9595aa);
    font-size: 13px;
    text-align: center;
}

.pcms-doc-widget-empty strong { color: var(--doc-ink, #e2e2ef); font-size: 13.5px; }

/* Only ever emitted by Doc Content while it is previewing a stand-in article,
   where the whole body would otherwise fill the settings page. */
.doc-body .doc-sample-cut {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px dashed var(--doc-line-strong, #2d2d44);
    color: var(--doc-ink-3, #9595aa);
    font-size: 12.5px;
    font-style: italic;
}

/* The nav widget can be dropped into any column, so it sticks on its own
   rather than depending on the built-in three-column grid.
   --doc-nav-max is the widget's Height setting; unset it fills the screen. */
.pcms-docs-nav.is-sticky {
    position: sticky;
    top: var(--doc-sticky-top, 84px);
    max-height: var(--doc-nav-max, calc(100vh - var(--doc-sticky-top, 84px) - 20px));
    display: flex;
    flex-direction: column;
}

/* A fixed height is worth honouring even when the nav is not stuck — it is
   how a long tree is kept from pushing everything below it off the page. */
.pcms-docs-nav:not(.is-sticky) {
    display: flex;
    flex-direction: column;
    max-height: var(--doc-nav-max, none);
}

/* Article count beside a category name, off by default. Pushed to the right
   so the names still line up; the chevron sits outside it. */
.sidebar-cat-count {
    margin-left: auto;
    flex-shrink: 0;
    padding: 1px 7px;
    border-radius: 9px;
    background: var(--doc-surface-3, rgba(255, 255, 255, 0.05));
    color: var(--doc-ink-3, #9595aa);
    font-size: 10.5px;
    font-weight: 600;
}

/* The chevron also claims margin-left:auto; with a count present the count
   has taken it, so the chevron only needs its own gap. */
.sidebar-cat-count + .sidebar-chevron { margin-left: 8px; }

/* Widget context: these render outside .doc-layout, so the rules that
   assumed the grid need their own home here. */
.doc-prevnext.is-stacked { grid-template-columns: minmax(0, 1fr); }
.doc-prevnext.is-stacked .doc-prevnext-link.is-next { grid-column: 1; text-align: left; }

/* The rule and its lead-in are one thing — dropping the line but keeping a
   28px gap above it just looks like a mistake. */
.doc-prevnext.is-ruleless { border-top: none; padding-top: 0; }

/* First and last article in a category have one neighbour. Left alone the
   single link sits in half the row; this lets it take the whole width. */
.doc-prevnext.is-spanning { grid-template-columns: minmax(0, 1fr); }
.doc-prevnext.is-spanning .doc-prevnext-link.is-next { grid-column: 1; }

.doc-prevnext-title.is-truncated {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A widget-built page has no .doc-layout wrapper, so give the blocks that
   normally sit inside it sane standalone spacing. The built-in template
   stacks these under an article and wants the 48px lead-in; a widget is
   placed exactly where the author put it and must not add its own gap. */
.docs-scope .pcms-w-body > .doc-prevnext:first-child { margin-top: 0; }
.pcms-w-body.doc-related,
.pcms-w-body.doc-reactions { margin-top: 0; }

/* ---- Doc Contents List widget: numbering and the current-section marker ----
   Counters live on the list, so the numbers renumber themselves when docs.js
   rebuilds it and stay right no matter how many headings the article grows. */
.doc-toc[data-numbered="decimal"] ul { counter-reset: pcms-toc; }
.doc-toc[data-numbered="decimal"] li { counter-increment: pcms-toc; }
.doc-toc[data-numbered="decimal"] a::before {
    content: counter(pcms-toc) ". ";
    color: var(--doc-ink-3);
    font-variant-numeric: tabular-nums;
}

/* Nested numbering restarts the sub-counter at every top-level entry, which
   is why the reset sits on the H2 rows rather than on the list. */
.doc-toc[data-numbered="nested"] ul { counter-reset: pcms-toc; }
.doc-toc[data-numbered="nested"] li:not(.toc-h3) {
    counter-increment: pcms-toc;
    counter-reset: pcms-toc-sub;
}
.doc-toc[data-numbered="nested"] li.toc-h3 { counter-increment: pcms-toc-sub; }
.doc-toc[data-numbered="nested"] li:not(.toc-h3) > a::before {
    content: counter(pcms-toc) ". ";
    color: var(--doc-ink-3);
    font-variant-numeric: tabular-nums;
}
.doc-toc[data-numbered="nested"] li.toc-h3 > a::before {
    content: counter(pcms-toc) "." counter(pcms-toc-sub) " ";
    color: var(--doc-ink-3);
    font-variant-numeric: tabular-nums;
}

/* The default marker is the bar riding the rail. The other two suppress it:
   "dot" trades it for a disc centred on the track, "none" leaves colour and
   weight to carry the current section on their own. */
.doc-toc[data-marker="dot"] a::before,
.doc-toc[data-marker="none"] a::before { content: none; }

.doc-toc[data-marker="dot"] a.toc-active::after {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -3.5px;
    border-radius: 50%;
    background: var(--doc-nav-active);
    /* Ringed in the PAGE background so the disc reads as sitting on the
       track rather than being pierced by it. Not the card or code surface:
       the contents rail sits on the page itself. */
    box-shadow: 0 0 0 3px var(--pcms-doc-bg, var(--bg-dark, #16162a));
}

/* No track to centre on when the list is boxed. */
.doc-toc.is-inline[data-marker="dot"] a.toc-active::after { content: none; }

/* ---- Doc Content widget ----
   The built-in template caps the article through `.doc-layout .doc-content`,
   which a widget has no ancestor for. Same custom property, own rule — the
   widget sets it on itself, so both routes end up meaning the same thing. */
.pcms-w-body.doc-article {
    max-width: var(--pcms-doc-width, none);
}

.pcms-w-body.doc-article[data-align="center"] .doc-title,
.pcms-w-body.doc-article[data-align="center"] .doc-meta { justify-content: center; }

.pcms-w-body.doc-article[data-align="center"] .doc-subtitle { text-align: center; }

/* Title size steps. The default is the fluid clamp() the template already
   uses; each step scales that whole range rather than pinning a fixed px,
   so a large title still shrinks on a phone. */
.doc-article[data-title-size="sm"] .doc-title { font-size: clamp(1.35rem, 2.4vw, 1.75rem); }
.doc-article[data-title-size="lg"] .doc-title { font-size: clamp(2rem, 4vw, 2.9rem); }
.doc-article[data-title-size="xl"] .doc-title { font-size: clamp(2.3rem, 5vw, 3.5rem); }

/* ---- Doc Breadcrumbs widget ---- */
.pcms-w-body.doc-breadcrumbs { margin-bottom: 0; }

/* A long article title is the last crumb and the one most likely to wrap the
   row onto three lines. Shortening is opt-out, not opt-in. */
.doc-crumb-current.is-truncated {
    max-width: 42ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Doc Related Articles widget ---- */
.doc-related-empty { margin: 0; color: var(--doc-ink-3); font-size: 13px; }

.related-doc-icon { flex-shrink: 0; font-size: 15px; line-height: 1; }

/* Plain list: no card, just rows with a rule between them. */
.doc-related[data-layout="list"] .related-docs-grid {
    display: block;
    border-top: 1px solid var(--doc-line-strong);
}

.doc-related[data-layout="list"] .related-doc-card {
    background: none;
    border: none;
    border-bottom: 1px solid var(--doc-line-strong);
    border-radius: 0;
    padding: 11px 2px;
}

.doc-related[data-layout="list"] .related-doc-card:hover {
    border-color: var(--doc-line-strong);
    background: var(--doc-surface);
}

/* Chips: as many per row as fit, sized to their own text. */
.doc-related[data-layout="inline"] .related-docs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.doc-related[data-layout="inline"] .related-doc-card {
    padding: 7px 13px;
    border-radius: 999px;
}

.doc-related[data-layout="inline"] .related-doc-title { font-size: 12.5px; }

/* ---- Doc Feedback Buttons widget ---- */
.doc-reactions.is-plain {
    padding: 0;
    background: none;
    border: none;
}

.doc-reactions[data-align="left"] { text-align: left; }
.doc-reactions[data-align="left"] .reaction-buttons { justify-content: flex-start; }

/* Hidden rather than omitted — sendReaction() writes into .count after a
   vote and throws on a button that hasn't got one. */
.doc-reactions.is-countless .reaction-btn .count { display: none; }

.doc-reactions-note {
    margin: 12px 0 0;
    color: var(--doc-ink-3);
    font-size: 12.5px;
    line-height: 1.5;
}

@media (max-width: 900px) {
    /* Sticky is a wide-screen idea — on a phone it pins the nav over the
       article. Excluding the drawer matters: this rule sits after the
       drawer's own block and has equal specificity, so without the guard it
       won the cascade and reset a slide-out nav back to static, leaving it
       stacked in the flow while its button pretended to open something. */
    .pcms-docs-nav.is-sticky:not([data-mobile="drawer"]) {
        position: static;
        max-height: none;
    }

    /* A drawer is full-height by definition, so the Height setting stops
       applying once it becomes one — a 320px-capped slide-out would show a
       third of the tree and cut the rest off. */
    .pcms-docs-nav[data-mobile="drawer"] { max-height: none; }
}

/* Widget placements sit outside .doc-layout, so the pieces that normally
   rely on that grid get their standalone spacing here. */
.pcms-docs-cats .docs-categories { padding: 0; }

.docs-search.is-compact input { padding: 9px 14px 9px 38px; font-size: 14px; }
.docs-search.is-compact .docs-search-icon { left: 14px; font-size: 13px; }

/* Was an inline style on a div built in JS; a class so the wording can be a
   setting and the panel can still be themed from here. */
.docs-search-empty { padding: 15px; color: var(--doc-ink-3); font-size: 13.5px; }

/* Back link shown when the sidebar is narrowed to one section, so a reader
   is never stuck inside a category with no route out. */
.doc-nav-all {
    display: inline-block;
    margin-top: 14px;
    padding: 7px 10px;
    color: var(--doc-ink-3, #9595aa);
    font-size: 12.5px;
    text-decoration: none;
    border-radius: 7px;
    transition: color 0.15s, background 0.15s;
}

.doc-nav-all:hover {
    color: var(--doc-accent, var(--brand-color));
    background: var(--doc-surface, #1e1e32);
}

@media (prefers-reduced-motion: reduce) {
    .doc-nav-all { transition: none; }
}

/* Optional sidebar surface, set from Design > Blog & Docs Pages. Unset it
   stays transparent, which is how the three-column layout has always read —
   only the panel colour is opt-in, never forced. */
.doc-sidebar {
    background: var(--pcms-doc-nav-bg, transparent);
    padding: var(--pcms-doc-nav-pad, 0);
    border-radius: var(--pcms-doc-nav-radius, 0);
}

/* Optional background for the docs area itself, so the section can sit on
   its own colour without touching the rest of the site. Transparent unset,
   and it deliberately covers the whole wrapper rather than the article
   column — a band that stops at the text edge looks like a mistake. */
.docs-scope {
    background: var(--pcms-doc-bg, transparent);
}

/* ---- Docs Category Grid widget: card style options ---- */
.pcms-docs-cats[data-card-style="outline"] .doc-category-card {
    background: transparent;
}

.pcms-docs-cats[data-card-style="plain"] .doc-category-card {
    background: transparent;
    border-color: transparent;
    padding: 0 0 8px;
}

.pcms-docs-cats[data-card-style="plain"] .doc-category-card:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.pcms-docs-cats[data-align="center"] .doc-category-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.pcms-docs-cats[data-align="center"] .doc-category-desc,
.pcms-docs-cats[data-align="center"] .doc-count {
    text-align: center;
}

.pcms-docs-cats[data-align="center"] .doc-list a {
    justify-content: center;
}

/* Optional heading above the grid. */
.docs-cats-heading {
    margin: 0 0 16px;
    font-size: 1.25rem;
    font-weight: 650;
    color: var(--doc-ink);
}

/* ---- Whole card clickable ----
   The card cannot BE an anchor — it already contains article links, and an
   anchor may not hold anchors. The category name's own link is stretched
   over the card instead, and the article links are lifted above it so they
   still win a click. */
.pcms-docs-cats[data-linkcard="1"] .doc-category-card { position: relative; }

.pcms-docs-cats[data-linkcard="1"] .doc-category-card h3 a::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.pcms-docs-cats[data-linkcard="1"] .doc-list,
.pcms-docs-cats[data-linkcard="1"] .doc-list a {
    position: relative;
    z-index: 1;
}

/* ---- Card text colours ----
   The card title and the body text took --text-light / --text-muted straight
   from the theme, so the widget's colour controls had nothing to hook into
   and appeared to do nothing. They read their own variables now, falling
   back to the theme when unset. */
.doc-category-card h3 a {
    color: var(--doc-card-title, var(--doc-ink, #e2e2ef));
}

.doc-category-desc,
.doc-category-card .doc-count {
    color: var(--doc-card-text, var(--doc-ink-3, #9595aa));
}

.doc-category-card .doc-list a {
    color: var(--doc-card-text, var(--doc-ink-3, #9595aa));
}

/* Hover still uses the accent, so the two stay independently settable. */
.doc-category-card .doc-list a:hover {
    color: var(--doc-accent, var(--doc-ink));
}

/* =========================================================
   Blog and single post

   The post side of the same design system. It reads the tokens declared at
   the top of this file, then swaps in its own --pcms-post-* overrides so a
   site can style its blog differently from its documentation without
   maintaining two palettes.

   Everything here was inline styles in views/posts/*.php before: hardcoded
   pixel widths, hardcoded greys, and a "layout" setting that only ever
   changed a max-width. None of it could be themed.
   ========================================================= */

.posts-scope {
    /* Same chain as the docs tokens: explicit override, then the site
       theme, then a literal so nothing is ever thrown away. */
    --doc-surface:     var(--pcms-post-surface, var(--bg-card, #1e1e32));
    --doc-surface-2:   color-mix(in srgb, var(--doc-surface, #1e1e32) 60%, transparent);
    --doc-line-strong: var(--pcms-post-line, var(--border-color, #2d2d44));
    --doc-line:        color-mix(in srgb, var(--doc-line-strong, #2d2d44) 70%, transparent);
    --doc-ink:         var(--pcms-post-heading, var(--text-light, #e2e2ef));
    --doc-ink-2:       var(--pcms-post-text, color-mix(in srgb, var(--doc-ink, #e2e2ef) 78%, transparent));
    --doc-ink-3:       var(--pcms-post-muted, var(--text-muted, #9595aa));
    --doc-accent:      var(--pcms-post-accent, var(--brand-color, #8B5CF6));
    --doc-link:        var(--pcms-post-link, var(--doc-accent, #8B5CF6));
    --doc-accent-ink:  var(--doc-accent, #8B5CF6);
    --doc-accent-weak: color-mix(in srgb, var(--doc-accent, #8B5CF6) 10%, transparent);
    --doc-ring:        0 0 0 3px color-mix(in srgb, var(--doc-accent, #8B5CF6) 34%, transparent);

    /* The blog's second and third accents.
     *
     * The Aurora and Halo looks and the gradient header card are built from
     * THREE colours, not one: --doc-accent plus --doc-note and --doc-tip. Those
     * two are docs tokens — the callout colours — and .posts-scope never
     * redefined them, so on the blog they sat on the docs settings, or on a
     * hardcoded blue and green when those were blank. Setting the blog's accent
     * changed a third of the effect and left a blue and a green behind that no
     * blog setting could reach.
     *
     * Same fallback chain as everything else here, so an untouched blog keeps
     * exactly the colours it has: the blog's own setting first, then whatever
     * the docs side resolved to, then the original literal. */
    --doc-note:        var(--pcms-post-accent-2, var(--pcms-doc-note, #3B82F6));
    --doc-tip:         var(--pcms-post-accent-3, var(--pcms-doc-tip, #10B981));

    background: var(--pcms-post-bg, transparent);
}

/* The four style presets, same names and same meaning as the docs ones so
   an admin only has to learn the idea once. */
.posts-scope[data-post-style="editorial"] {
    --doc-heading-font: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
    --doc-heading-weight: 600;
    --doc-heading-tracking: -0.005em;
    --doc-measure: 66ch;
    --doc-body-size: 17px;
    --doc-body-leading: 1.85;
    --doc-r-xs: 4px; --doc-r-sm: 5px; --doc-r-md: 7px; --doc-r-lg: 9px;
    --doc-pad: 1.15;
}

.posts-scope[data-post-style="technical"] {
    --doc-measure: 84ch;
    --doc-body-size: 15px;
    --doc-body-leading: 1.68;
    --doc-r-xs: 4px; --doc-r-sm: 5px; --doc-r-md: 6px; --doc-r-lg: 8px;
    --doc-pad: 0.85;
    --doc-shadow-md: 0 1px 2px rgba(0, 0, 0, 0.2);
    --doc-shadow-lg: 0 1px 3px rgba(0, 0, 0, 0.24);
}

/* Same rule as the docs presets: a picked Post colour beats the preset's own. */
.posts-scope[data-post-style="minimal"] {
    --doc-surface: var(--pcms-post-surface, transparent);
    --doc-surface-2: color-mix(in srgb, var(--pcms-post-surface, transparent) 60%, transparent);
    --doc-line: color-mix(in srgb, var(--doc-line-strong, #2d2d44) 45%, transparent);
    --doc-shadow-sm: none; --doc-shadow-md: none; --doc-shadow-lg: none;
    --doc-measure: 70ch;
    --doc-pad: 0.9;
}

.posts-scope[data-post-style="elevated"] {
    --doc-surface: var(--pcms-post-surface, color-mix(in srgb, var(--bg-card, #1e1e32) 92%, var(--doc-accent, #8B5CF6)));
    --doc-line: color-mix(in srgb, var(--doc-line-strong, #2d2d44) 55%, transparent);
    --doc-r-xs: 9px; --doc-r-sm: 12px; --doc-r-md: 18px; --doc-r-lg: 24px;
    --doc-pad: 1.2;
    --doc-shadow-md: 0 2px 6px rgba(0, 0, 0, 0.16), 0 14px 34px -10px rgba(0, 0, 0, 0.4);
    --doc-shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.18), 0 28px 64px -16px rgba(0, 0, 0, 0.5);
}

.posts-scope[data-post-density="compact"] { --doc-pad: 0.78; --doc-body-leading: 1.62; }
.posts-scope[data-post-density="roomy"]   { --doc-pad: 1.3;  --doc-body-leading: 1.9; }

/* ---- single post shell ----
   The layout preset only moves the measure and where the featured image
   sits. A blog post is one column; there is no second axis to vary. */
.post-article {
    max-width: var(--doc-measure, 74ch);
    margin: 0 auto;
    min-width: 0;
}

.posts-scope[data-post-layout="wide"]   .post-article { max-width: 88ch; }
.posts-scope[data-post-layout="narrow"] .post-article { max-width: 62ch; }
.posts-scope[data-post-layout="hero"]   .post-article { max-width: 74ch; }

.post-title {
    font-family: var(--doc-heading-font);
    font-weight: var(--doc-heading-weight);
    font-size: clamp(1.9rem, 3.6vw, 2.7rem);
    line-height: 1.14;
    letter-spacing: var(--doc-heading-tracking);
    color: var(--doc-ink);
    margin: 0 0 12px;
    text-wrap: balance;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    padding-bottom: calc(20px * var(--doc-pad));
    margin-bottom: calc(28px * var(--doc-pad));
    border-bottom: 1px solid var(--doc-line);
    color: var(--doc-ink-3);
    font-size: 13px;
}

.post-meta > span[aria-hidden] { opacity: 0.4; }

.post-featured { margin: 0 0 calc(28px * var(--doc-pad)); }

.post-featured img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--doc-r-lg);
    border: 1px solid var(--doc-line);
    box-shadow: var(--doc-shadow-md);
}

/* Hero: the image runs the full width of the page above the title.
   views/posts/single.php renders the figure inside .post-hero on this
   layout — outside the .container — so this is a plain full-width figure
   and needs no breakout.

   It used to be `position:relative; left:50%; width:100vw; margin-left:-50vw`,
   escaping the article measure from inside the body. Two problems: 100vw is
   the viewport INCLUDING the scrollbar, so it overhung by ~8px and put a
   horizontal scrollbar on every hero post; and it burst straight out of the
   Panel and Frame looks, which give the header a max-width of its own. */
.posts-scope[data-post-layout="hero"] .post-featured {
    width: 100%;
    margin-bottom: calc(34px * var(--doc-pad));
}

.posts-scope[data-post-layout="hero"] .post-featured img {
    border-radius: 0;
    border: none;
    max-height: 52vh;
    object-fit: cover;
    box-shadow: none;
}

/* The article body reuses the doc-body typography wholesale — same
   headings, links, tables, code, callouts and blockquotes. */
.post-body {
    color: var(--doc-ink-2);
    font-size: var(--doc-body-size);
    line-height: var(--doc-body-leading);
    text-rendering: optimizeLegibility;
    overflow-wrap: break-word;
}

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

/* ---- blog list layouts ---- */
.posts-scope .pcms-post-list { display: grid; gap: 18px; }

.posts-scope[data-blog-layout="grid"] .pcms-post-list {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Magazine: the newest post takes the full width, everything after it
   falls into the grid beneath. One rule, no special-casing in the view. */
.posts-scope[data-blog-layout="magazine"] .pcms-post-list {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.posts-scope[data-blog-layout="magazine"] .pcms-post-list > :first-child {
    grid-column: 1 / -1;
}

/* Minimal: no cards, no images — a dated index. */
.posts-scope[data-blog-layout="minimal"] .pcms-post-list { gap: 0; }

.posts-scope[data-blog-layout="minimal"] .pcms-post-card {
    background: none;
    border: none;
    border-bottom: 1px solid var(--doc-line);
    border-radius: 0;
    box-shadow: none;
    padding: 14px 2px;
}

.posts-scope[data-blog-layout="minimal"] .pcms-post-card img,
.posts-scope[data-blog-layout="minimal"] .pcms-post-thumb { display: none; }

/* =========================================================
   Reclaiming .page-body inside the docs and posts sections

   style.css styles the generic content wrapper:

       .page-body h2 { color: var(--brand-red); }
       .page-body a  { color: var(--brand-red); text-decoration: underline; }

   All three docs views and both post views sit inside that wrapper, and
   those selectors are (0,1,1) — which outranks single-class docs rules
   like .doc-index-heading and .doc-index-item at (0,1,0). The category
   page lost both: its "Articles" heading rendered in the brand colour
   instead of muted grey, and every article row's excerpt was underlined
   and tinted as though the excerpt were a second link.

   Where the docs rule happened to also be (0,1,1) it only won on source
   order — docs.css loading after style.css — which is not something to
   leave a section's appearance resting on.

   Scoping these at (0,2,1) settles it by specificity rather than by file
   order. Deliberately narrow: it hands the properties back to the docs
   tokens and touches nothing else the generic wrapper does.
   ========================================================= */

/* Colour only. Size and spacing are left to whichever component owns the
   heading — overriding those here would mean guessing on behalf of every
   h2 in the section, including ones that do not exist yet. */
.docs-scope .page-body h2,
.docs-scope .page-body h3,
.posts-scope .page-body h2,
.posts-scope .page-body h3 { color: var(--doc-ink); }

/* Links go back to inheriting, so each component decides for itself: the
   article body underlines them, a card or an index row does not. */
.docs-scope .page-body a,
.posts-scope .page-body a {
    color: inherit;
    text-decoration: none;
}

/* ...except inside the prose itself, which does want underlined links. */
.docs-scope .page-body .doc-body a,
.posts-scope .page-body .post-body a {
    color: var(--doc-link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: color-mix(in srgb, var(--doc-link, #8B5CF6) 40%, transparent);
}

/* The section headings inside an article keep the treatment the article
   typography gives them, not the generic wrapper's. */
.docs-scope .page-body .doc-body h2,
.posts-scope .page-body .post-body h2 {
    color: var(--doc-ink);
}

.docs-scope .page-body .doc-body h3,
.posts-scope .page-body .post-body h3 {
    color: var(--doc-ink);
}

/* The category index heading is a label, not a section title. */
.docs-scope .page-body .doc-index-heading { color: var(--doc-ink-3); }

/* =========================================================
   Docs home layouts

   Four shapes for /docs, all driven from data-docs-layout on the wrapper
   over the SAME markup. The view branches for nothing: switching preset
   cannot produce a half-built page, and a preset added here needs no PHP.

   'cards' is the shipped shape, so it declares nothing.
   ========================================================= */

/* ---- Compact: same cards, no article lists, more per row ----
   For a site with a lot of categories, where the point of the index is
   "which section do I want", not "show me every article twice". */
.docs-scope[data-docs-layout="compact"] .docs-categories {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.docs-scope[data-docs-layout="compact"] .doc-category-card .doc-list { display: none; }

.docs-scope[data-docs-layout="compact"] .doc-category-card {
    padding: calc(18px * var(--doc-pad));
}

.docs-scope[data-docs-layout="compact"] .doc-category-desc {
    margin-bottom: 0;
    /* Two lines, so an uneven set of descriptions still produces a tidy
       row of equal-height cards. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Index: a dense list, not cards ----
   Categories become headed groups with their articles beneath. Closest to
   a table of contents for the whole section. */
.docs-scope[data-docs-layout="index"] .docs-categories {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 8px 34px;
}

.docs-scope[data-docs-layout="index"] .doc-category-card {
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: calc(14px * var(--doc-pad)) 0;
    transform: none;
}

.docs-scope[data-docs-layout="index"] .doc-category-card:hover {
    background: none;
    box-shadow: none;
    transform: none;
    border-color: transparent;
}

.docs-scope[data-docs-layout="index"] .doc-category-card::before { content: none; }

.docs-scope[data-docs-layout="index"] .doc-category-icon {
    width: 30px;
    height: 30px;
    font-size: 16px;
    border-radius: var(--doc-r-sm);
}

.docs-scope[data-docs-layout="index"] .doc-category-card:hover .doc-category-icon {
    transform: none;
}

.docs-scope[data-docs-layout="index"] .doc-category-desc { display: none; }

.docs-scope[data-docs-layout="index"] .doc-category-card .doc-list {
    border-top: none;
    padding-top: 4px;
}

/* ---- Search first: the box is the page ----
   For a help centre, where most people arrive knowing what they want to
   ask rather than wanting to browse. */
.docs-scope[data-docs-layout="search"] .docs-hero {
    padding: calc(84px * var(--doc-pad)) 20px calc(20px * var(--doc-pad));
}

.docs-scope[data-docs-layout="search"] .docs-hero h1 {
    font-size: clamp(1.7rem, 3.2vw, 2.3rem);
}

.docs-scope[data-docs-layout="search"] .docs-search {
    max-width: 720px;
    margin-top: calc(26px * var(--doc-pad));
}

.docs-scope[data-docs-layout="search"] .docs-search input {
    padding: 19px 20px 19px 54px;
    font-size: 16.5px;
    box-shadow: var(--doc-shadow-md);
}

.docs-scope[data-docs-layout="search"] .docs-search-icon {
    left: 21px;
    font-size: 17px;
}

/* The categories are a secondary route here, so they sit quieter under it. */
.docs-scope[data-docs-layout="search"] .docs-categories {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    padding-top: calc(20px * var(--doc-pad));
}

.docs-scope[data-docs-layout="search"] .doc-category-card .doc-list { display: none; }
.docs-scope[data-docs-layout="search"] .doc-category-desc { display: none; }

@media (max-width: 640px) {
    .docs-scope[data-docs-layout="index"] .docs-categories,
    .docs-scope[data-docs-layout="compact"] .docs-categories,
    .docs-scope[data-docs-layout="search"] .docs-categories {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* =========================================================
   Docs home LOOKS  (data-docs-home)

   A separate axis from data-docs-layout: the layout decides what is on the
   page and how it is arranged, these decide how it is dressed. Any look
   runs over any layout.

   All five are CSS over the same markup, and every one derives from the
   accent and the design tokens — so a site that has set its own docs
   colours keeps them in whichever look it picks.
   ========================================================= */

/* ---- Spotlight ----------------------------------------------------------
   The glossy one. A stronger accent bloom, a title that warms toward its
   baseline, a search box that lights up, and cards that lift further. */
.docs-scope[data-docs-home="spotlight"] .docs-hero::before {
    inset: -20% -25% 10%;
    background: radial-gradient(55% 80% at 50% 0%,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 26%, transparent) 0%,
        transparent 70%);
}

.docs-scope[data-docs-home="spotlight"] .docs-hero h1 {
    font-size: clamp(2.3rem, 5.2vw, 3.6rem);
    background: linear-gradient(180deg,
        var(--doc-ink) 0%,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 55%, var(--doc-ink)) 115%);
    -webkit-background-clip: text;
    background-clip: text;
}

.docs-scope[data-docs-home="spotlight"] .docs-search input {
    box-shadow: var(--doc-shadow-lg),
                0 0 0 1px color-mix(in srgb, var(--doc-accent, #8B5CF6) 22%, transparent);
}

.docs-scope[data-docs-home="spotlight"] .doc-category-card {
    background: linear-gradient(160deg,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 7%, var(--doc-surface)) 0%,
        var(--doc-surface) 60%);
    box-shadow: var(--doc-shadow-md);
}

.docs-scope[data-docs-home="spotlight"] .doc-category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--doc-shadow-lg);
}

.docs-scope[data-docs-home="spotlight"] .doc-category-card::before { opacity: 0.5; }

/* ---- Banner -------------------------------------------------------------
   A full-width accent band behind the header. The bloom comes off: two
   background treatments fighting each other is what makes a header muddy. */
.docs-scope[data-docs-home="banner"] .docs-hero {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 88%, #000) 0%,
        var(--doc-accent, #8B5CF6) 55%,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 70%, var(--doc-surface)) 100%);
    padding-bottom: calc(46px * var(--doc-pad));
    margin-bottom: calc(-18px * var(--doc-pad));
}

.docs-scope[data-docs-home="banner"] .docs-hero::before { content: none; }

/* On a saturated band the title has to be flat white — a gradient clipped
   to text disappears into the colour behind it. */
.docs-scope[data-docs-home="banner"] .docs-hero h1 {
    background: none;
    -webkit-text-fill-color: #fff;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.docs-scope[data-docs-home="banner"] .docs-hero .page-subtitle {
    color: rgba(255, 255, 255, 0.86);
}

.docs-scope[data-docs-home="banner"] .docs-search input {
    background: rgba(255, 255, 255, 0.96);
    border-color: transparent;
    color: #16161d;
    box-shadow: var(--doc-shadow-lg);
}

.docs-scope[data-docs-home="banner"] .docs-search input::placeholder { color: #6b6b7b; }
.docs-scope[data-docs-home="banner"] .docs-search-icon { opacity: 0.75; }

/* ---- Panel --------------------------------------------------------------
   Header and search inside their own bordered card, floating over the page.
   Reads as a console rather than a landing page. */
.docs-scope[data-docs-home="panel"] .docs-hero {
    max-width: 900px;
    margin: calc(36px * var(--doc-pad)) auto 0;
    padding: calc(44px * var(--doc-pad)) calc(32px * var(--doc-pad)) calc(36px * var(--doc-pad));
    background: var(--doc-surface);
    border: 1px solid var(--doc-line-strong);
    border-radius: var(--doc-r-lg);
    box-shadow: var(--doc-shadow-lg);
    overflow: hidden;
}

.docs-scope[data-docs-home="panel"] .docs-hero::before { inset: -40% -10% 20%; }

.docs-scope[data-docs-home="panel"] .docs-search { margin-bottom: 4px; }

.docs-scope[data-docs-home="panel"] .docs-search input {
    background: var(--doc-surface-3);
}

.docs-scope[data-docs-home="panel"] .docs-categories { padding-top: calc(26px * var(--doc-pad)); }

/* ---- Terminal -----------------------------------------------------------
   Monospace, square, hairlines, no shadows. For a dev-facing reference
   where the page should read as tooling rather than as marketing. */
.docs-scope[data-docs-home="terminal"] {
    --doc-r-xs: 0px;
    --doc-r-sm: 0px;
    --doc-r-md: 2px;
    --doc-r-lg: 2px;
    --doc-r-pill: 2px;
    --doc-shadow-sm: none;
    --doc-shadow-md: none;
    --doc-shadow-lg: none;
}

.docs-scope[data-docs-home="terminal"] .docs-hero::before { content: none; }

.docs-scope[data-docs-home="terminal"] .docs-hero h1 {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--doc-ink);
}

/* A prompt rather than an icon: the one flourish this look allows itself. */
.docs-scope[data-docs-home="terminal"] .docs-hero h1::before {
    content: "~/ ";
    color: var(--doc-accent-ink);
}

.docs-scope[data-docs-home="terminal"] .docs-hero .page-subtitle {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 13.5px;
}

.docs-scope[data-docs-home="terminal"] .docs-search input {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 14px;
    background: var(--doc-surface-3);
}

.docs-scope[data-docs-home="terminal"] .doc-category-card {
    background: none;
    border-color: var(--doc-line-strong);
}

.docs-scope[data-docs-home="terminal"] .doc-category-card:hover { transform: none; }
.docs-scope[data-docs-home="terminal"] .doc-category-card::before { content: none; }

.docs-scope[data-docs-home="terminal"] .doc-category-icon {
    background: none;
    box-shadow: inset 0 0 0 1px var(--doc-line-strong);
}

.docs-scope[data-docs-home="terminal"] .doc-category-card h3 {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.98rem;
}

/* ---- Journal ------------------------------------------------------------
   Serif display heading, generous air, cards reduced to ruled rows. The
   least "software" of the five. */
.docs-scope[data-docs-home="journal"] .docs-hero {
    padding: calc(84px * var(--doc-pad)) 20px calc(10px * var(--doc-pad));
}

.docs-scope[data-docs-home="journal"] .docs-hero::before {
    inset: -10% -20% 55%;
    background: radial-gradient(50% 60% at 50% 0%,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 8%, transparent) 0%,
        transparent 72%);
}

.docs-scope[data-docs-home="journal"] .docs-hero h1 {
    font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
    font-weight: 500;
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    letter-spacing: -0.012em;
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--doc-ink);
}

.docs-scope[data-docs-home="journal"] .docs-hero .page-subtitle {
    font-family: Georgia, "Iowan Old Style", serif;
    font-style: italic;
    font-size: 17px;
}

.docs-scope[data-docs-home="journal"] .docs-search { max-width: 520px; }

.docs-scope[data-docs-home="journal"] .docs-categories {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 0 44px;
}

.docs-scope[data-docs-home="journal"] .doc-category-card {
    background: none;
    border: none;
    border-top: 1px solid var(--doc-line-strong);
    border-radius: 0;
    box-shadow: none;
    padding: calc(22px * var(--doc-pad)) 0;
}

.docs-scope[data-docs-home="journal"] .doc-category-card:hover {
    background: none;
    box-shadow: none;
    transform: none;
    border-color: var(--doc-line-strong);
}

.docs-scope[data-docs-home="journal"] .doc-category-card::before { content: none; }

.docs-scope[data-docs-home="journal"] .doc-category-card h3 {
    font-family: Georgia, "Iowan Old Style", serif;
    font-weight: 500;
    font-size: 1.25rem;
}

.docs-scope[data-docs-home="journal"] .doc-category-icon {
    background: none;
    box-shadow: none;
    width: 28px;
    height: 28px;
    font-size: 22px;
}

.docs-scope[data-docs-home="journal"] .doc-category-card:hover .doc-category-icon {
    transform: none;
}

/* ---- Aurora --------------------------------------------------------------
   Three offset colour fields behind the header rather than one bloom. The
   hues are rotated off the accent with hue-rotate on the layer itself, so a
   site keeps its own colour and simply gets a wider spread of it. */
.docs-scope[data-docs-home="aurora"] .docs-hero {
    padding: calc(80px * var(--doc-pad)) 20px calc(14px * var(--doc-pad));
    isolation: isolate;
}

.docs-scope[data-docs-home="aurora"] .docs-hero::before {
    inset: -40% -30% -10%;
    filter: blur(46px) saturate(1.25);
    opacity: 0.75;
    background:
        radial-gradient(38% 55% at 22% 18%,
            color-mix(in srgb, var(--doc-accent, #8B5CF6) 62%, transparent) 0%, transparent 70%),
        radial-gradient(34% 48% at 74% 8%,
            color-mix(in srgb, var(--doc-accent, #8B5CF6) 40%, #22D3EE) 0%, transparent 72%),
        radial-gradient(42% 60% at 52% 46%,
            color-mix(in srgb, var(--doc-accent, #8B5CF6) 32%, #F472B6) 0%, transparent 74%);
}

.docs-scope[data-docs-home="aurora"] .docs-hero h1 {
    font-size: clamp(2.4rem, 5.4vw, 3.8rem);
    letter-spacing: -0.03em;
}

/* Translucent cards so the field behind reads through them. */
.docs-scope[data-docs-home="aurora"] .doc-category-card {
    background: color-mix(in srgb, var(--doc-surface) 62%, transparent);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border-color: color-mix(in srgb, #fff 12%, transparent);
}

.docs-scope[data-docs-home="aurora"] .docs-search input {
    background: color-mix(in srgb, var(--doc-surface) 70%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-color: color-mix(in srgb, #fff 14%, transparent);
}

/* ---- Grid ----------------------------------------------------------------
   A faint engineering grid behind the header, fading out downward. Crisp,
   flat cards over it. The modern-SaaS-docs look. */
.docs-scope[data-docs-home="grid"] .docs-hero {
    padding: calc(76px * var(--doc-pad)) 20px calc(12px * var(--doc-pad));
}

.docs-scope[data-docs-home="grid"] .docs-hero::before {
    inset: 0 -20% 0;
    background-image:
        linear-gradient(to right,
            color-mix(in srgb, var(--doc-ink-3) 20%, transparent) 1px, transparent 1px),
        linear-gradient(to bottom,
            color-mix(in srgb, var(--doc-ink-3) 20%, transparent) 1px, transparent 1px);
    background-size: 46px 46px;
    /* Faded at the edges so the grid reads as texture, not as a table. */
    -webkit-mask-image: radial-gradient(70% 80% at 50% 30%, #000 0%, transparent 78%);
    mask-image: radial-gradient(70% 80% at 50% 30%, #000 0%, transparent 78%);
    opacity: 0.5;
}

.docs-scope[data-docs-home="grid"] .docs-hero h1 {
    font-size: clamp(2.1rem, 4.6vw, 3.1rem);
    letter-spacing: -0.028em;
}

.docs-scope[data-docs-home="grid"] .doc-category-card {
    box-shadow: none;
    border-color: var(--doc-line-strong);
}

.docs-scope[data-docs-home="grid"] .doc-category-card:hover {
    box-shadow: var(--doc-shadow-md);
    transform: translateY(-2px);
}

/* ---- Bold ----------------------------------------------------------------
   Thick borders, hard offset shadows, no blur. Loud on purpose — the shadow
   moves with the card instead of staying put, which is what makes the style
   read as physical rather than as a mistake. */
.docs-scope[data-docs-home="bold"] {
    --doc-r-xs: 4px;
    --doc-r-sm: 6px;
    --doc-r-md: 8px;
    --doc-r-lg: 10px;
}

.docs-scope[data-docs-home="bold"] .docs-hero::before { content: none; }

.docs-scope[data-docs-home="bold"] .docs-hero h1 {
    font-size: clamp(2.3rem, 5.4vw, 3.6rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--doc-ink);
}

.docs-scope[data-docs-home="bold"] .docs-search input {
    border-width: 2px;
    border-color: var(--doc-ink);
    box-shadow: 4px 4px 0 0 var(--doc-accent);
}

.docs-scope[data-docs-home="bold"] .docs-search input:focus {
    box-shadow: 4px 4px 0 0 var(--doc-accent), var(--doc-ring);
}

.docs-scope[data-docs-home="bold"] .doc-category-card {
    border-width: 2px;
    border-color: var(--doc-ink);
    box-shadow: 5px 5px 0 0 color-mix(in srgb, var(--doc-accent, #8B5CF6) 85%, transparent);
    transition: transform var(--doc-fast), box-shadow var(--doc-fast);
}

.docs-scope[data-docs-home="bold"] .doc-category-card::before { content: none; }

.docs-scope[data-docs-home="bold"] .doc-category-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 0 var(--doc-accent);
    border-color: var(--doc-ink);
}

.docs-scope[data-docs-home="bold"] .doc-category-icon {
    border-radius: var(--doc-r-sm);
    box-shadow: inset 0 0 0 2px var(--doc-ink);
}

/* ---- Sheet ---------------------------------------------------------------
   Everything on one raised sheet, the way a settings screen or a dashboard
   is laid out. Quiet, and the least decorative of the set. */
.docs-scope[data-docs-home="sheet"] .docs-hero {
    padding: calc(52px * var(--doc-pad)) 20px calc(8px * var(--doc-pad));
}

.docs-scope[data-docs-home="sheet"] .docs-hero::before { content: none; }

.docs-scope[data-docs-home="sheet"] .docs-hero h1 {
    font-size: clamp(1.7rem, 3.2vw, 2.2rem);
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--doc-ink);
}

.docs-scope[data-docs-home="sheet"] .docs-categories {
    background: var(--doc-surface);
    border: 1px solid var(--doc-line-strong);
    border-radius: var(--doc-r-lg);
    box-shadow: var(--doc-shadow-md);
    padding: calc(10px * var(--doc-pad));
    gap: 0;
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: 60px;
}

/* Inside the sheet the cards are rows, divided rather than boxed. */
.docs-scope[data-docs-home="sheet"] .doc-category-card {
    background: none;
    border: none;
    border-bottom: 1px solid var(--doc-line);
    border-radius: 0;
    box-shadow: none;
    padding: calc(18px * var(--doc-pad));
    transform: none;
}

.docs-scope[data-docs-home="sheet"] .docs-categories > .doc-category-card:last-child {
    border-bottom: none;
}

.docs-scope[data-docs-home="sheet"] .doc-category-card::before { content: none; }

.docs-scope[data-docs-home="sheet"] .doc-category-card:hover {
    background: var(--doc-accent-weak);
    transform: none;
    box-shadow: none;
    border-color: var(--doc-line);
}

.docs-scope[data-docs-home="sheet"] .doc-category-card:hover .doc-category-icon {
    transform: none;
}

/* ---- Beam ----------------------------------------------------------------
   A single bright rule across the top of the page with the glow hanging off
   it, and cards that light their own top edge. Restrained but not flat. */
.docs-scope[data-docs-home="beam"] .docs-hero {
    padding: calc(72px * var(--doc-pad)) 20px calc(12px * var(--doc-pad));
    border-top: 1px solid transparent;
    /* Two backgrounds: the beam itself, then the glow beneath it. */
    background:
        linear-gradient(90deg,
            transparent 0%,
            var(--doc-accent, #8B5CF6) 30%,
            color-mix(in srgb, var(--doc-accent, #8B5CF6) 60%, #fff) 50%,
            var(--doc-accent, #8B5CF6) 70%,
            transparent 100%) top / 100% 2px no-repeat;
}

.docs-scope[data-docs-home="beam"] .docs-hero::before {
    inset: 0 -10% 40%;
    background: radial-gradient(46% 100% at 50% 0%,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 30%, transparent) 0%,
        transparent 76%);
}

.docs-scope[data-docs-home="beam"] .docs-hero h1 {
    font-size: clamp(2.2rem, 4.8vw, 3.2rem);
}

.docs-scope[data-docs-home="beam"] .doc-category-card::before {
    opacity: 1;
    background: linear-gradient(90deg,
        transparent 0%,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 45%, transparent) 50%,
        transparent 100%);
}

.docs-scope[data-docs-home="beam"] .doc-category-card:hover::before {
    background: linear-gradient(90deg,
        transparent 0%,
        var(--doc-accent, #8B5CF6) 50%,
        transparent 100%);
}

/* Blur and translucency are expensive on a phone and the aurora field is
   decoration, so it simplifies rather than scaling down. */
@media (max-width: 640px) {
    .docs-scope[data-docs-home="aurora"] .docs-hero::before { filter: blur(30px); }
    .docs-scope[data-docs-home="aurora"] .doc-category-card {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--doc-surface);
    }
    .docs-scope[data-docs-home="bold"] .doc-category-card { box-shadow: 3px 3px 0 0 var(--doc-accent); }
}

/* ---- Split ---------------------------------------------------------------
   Asymmetric header: the wording holds the left, the search takes the right.
   Everything else in this set is centred, so this is the one that does not
   read as "a title with something under it".

   The view has h1, subtitle and search as three siblings inside .container,
   so the columns are assigned by grid-column rather than by wrapping them —
   no markup change, and it collapses back to one column on its own. */
.docs-scope[data-docs-home="split"] .docs-hero {
    padding: calc(72px * var(--doc-pad)) 20px calc(24px * var(--doc-pad));
    text-align: left;
}

.docs-scope[data-docs-home="split"] .docs-hero::before {
    inset: -30% 0 10% -20%;
    background: radial-gradient(50% 70% at 18% 30%,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 20%, transparent) 0%,
        transparent 72%);
}

.docs-scope[data-docs-home="split"] .docs-hero .container {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    align-items: center;
    column-gap: 48px;
}

.docs-scope[data-docs-home="split"] .docs-hero h1 {
    grid-column: 1;
    font-size: clamp(2.1rem, 4.4vw, 3.2rem);
    text-align: left;
}

.docs-scope[data-docs-home="split"] .docs-hero .page-subtitle {
    grid-column: 1;
    margin: 0;
    max-width: 46ch;
}

/* Spans both rows so it stays centred against the wording beside it. */
.docs-scope[data-docs-home="split"] .docs-search {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin: 0;
    max-width: none;
}

@media (max-width: 860px) {
    .docs-scope[data-docs-home="split"] .docs-hero .container {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 18px;
    }
    .docs-scope[data-docs-home="split"] .docs-search { grid-column: 1; grid-row: auto; }
}

/* ---- Frame ---------------------------------------------------------------
   A drawn frame inset around the header with ticks at the corners. Reads as
   a technical drawing rather than a banner — the corner marks are what stop
   it looking like a plain box. */
.docs-scope[data-docs-home="frame"] .docs-hero {
    position: relative;
    margin: calc(28px * var(--doc-pad)) 20px 0;
    padding: calc(64px * var(--doc-pad)) 24px calc(30px * var(--doc-pad));
}

.docs-scope[data-docs-home="frame"] .docs-hero::before {
    inset: 0;
    border: 1px solid color-mix(in srgb, var(--doc-accent, #8B5CF6) 34%, transparent);
    background: radial-gradient(60% 70% at 50% 0%,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 9%, transparent) 0%,
        transparent 74%);
}

/* The four corner ticks, drawn as one element using two crossed gradients
   repeated into each corner — cheaper than four pseudo-elements and it
   cannot fall out of alignment with the border above. */
.docs-scope[data-docs-home="frame"] .docs-hero::after {
    content: '';
    position: absolute;
    inset: -4px;
    pointer-events: none;
    background:
        linear-gradient(var(--doc-accent) 0 0) 0 0 / 9px 1px no-repeat,
        linear-gradient(var(--doc-accent) 0 0) 0 0 / 1px 9px no-repeat,
        linear-gradient(var(--doc-accent) 0 0) 100% 0 / 9px 1px no-repeat,
        linear-gradient(var(--doc-accent) 0 0) 100% 0 / 1px 9px no-repeat,
        linear-gradient(var(--doc-accent) 0 0) 0 100% / 9px 1px no-repeat,
        linear-gradient(var(--doc-accent) 0 0) 0 100% / 1px 9px no-repeat,
        linear-gradient(var(--doc-accent) 0 0) 100% 100% / 9px 1px no-repeat,
        linear-gradient(var(--doc-accent) 0 0) 100% 100% / 1px 9px no-repeat;
}

.docs-scope[data-docs-home="frame"] .docs-hero h1 {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--doc-ink);
}

.docs-scope[data-docs-home="frame"] .doc-category-card {
    box-shadow: none;
    border-color: var(--doc-line-strong);
}

/* ---- Noir ----------------------------------------------------------------
   Oversized display type, no cards at all, one hairline between categories.
   The most editorial-brutal of the set: everything is carried by scale and
   space rather than by any surface. */
.docs-scope[data-docs-home="noir"] .docs-hero {
    padding: calc(100px * var(--doc-pad)) 20px calc(16px * var(--doc-pad));
    text-align: left;
}

.docs-scope[data-docs-home="noir"] .docs-hero::before { content: none; }

.docs-scope[data-docs-home="noir"] .docs-hero h1 {
    font-size: clamp(2.8rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 0.94;
    letter-spacing: -0.045em;
    text-align: left;
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--doc-ink);
}

.docs-scope[data-docs-home="noir"] .docs-hero .page-subtitle {
    margin: 14px 0 0;
    max-width: 44ch;
    font-size: 15px;
}

.docs-scope[data-docs-home="noir"] .docs-search {
    margin-left: 0;
    max-width: 420px;
}

.docs-scope[data-docs-home="noir"] .docs-search input {
    background: none;
    border-width: 0 0 1px 0;
    border-radius: 0;
    padding-left: 30px;
    box-shadow: none;
}

.docs-scope[data-docs-home="noir"] .docs-search input:focus {
    box-shadow: none;
    border-bottom-color: var(--doc-accent);
}

.docs-scope[data-docs-home="noir"] .docs-search-icon { left: 2px; }

.docs-scope[data-docs-home="noir"] .docs-categories {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.docs-scope[data-docs-home="noir"] .doc-category-card {
    background: none;
    border: none;
    border-top: 1px solid var(--doc-line-strong);
    border-radius: 0;
    box-shadow: none;
    padding: calc(30px * var(--doc-pad)) 0;
    transform: none;
}

.docs-scope[data-docs-home="noir"] .doc-category-card::before { content: none; }

.docs-scope[data-docs-home="noir"] .doc-category-card:hover {
    background: none;
    box-shadow: none;
    transform: none;
    border-color: var(--doc-accent);
}

.docs-scope[data-docs-home="noir"] .doc-category-card h3 {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.docs-scope[data-docs-home="noir"] .doc-category-icon {
    background: none;
    box-shadow: none;
    width: 34px;
    height: 34px;
    font-size: 26px;
}

.docs-scope[data-docs-home="noir"] .doc-category-card:hover .doc-category-icon { transform: none; }

/* ---- Ribbon --------------------------------------------------------------
   Categories as a horizontal rail you scroll rather than a grid you scan.
   Suits a lot of shallow categories, and keeps the fold high. */
.docs-scope[data-docs-home="ribbon"] .docs-categories {
    display: flex;
    grid-template-columns: none;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    /* Padding for the lift so hovering the first card is not clipped by the
       scroll container. */
    padding: 34px 4px 40px;
    scrollbar-width: thin;
    scrollbar-color: var(--doc-line-strong) transparent;
    /* Faded at the right edge so it reads as continuing rather than ending. */
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 40px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 40px), transparent 100%);
}

.docs-scope[data-docs-home="ribbon"] .doc-category-card {
    flex: 0 0 clamp(240px, 26vw, 300px);
    scroll-snap-align: start;
}

.docs-scope[data-docs-home="ribbon"] .docs-categories::-webkit-scrollbar { height: 8px; }
.docs-scope[data-docs-home="ribbon"] .docs-categories::-webkit-scrollbar-track { background: transparent; }
.docs-scope[data-docs-home="ribbon"] .docs-categories::-webkit-scrollbar-thumb {
    background: var(--doc-line-strong);
    border-radius: var(--doc-r-pill);
    border: 2px solid transparent;
    background-clip: content-box;
}

/* ---- Halo ----------------------------------------------------------------
   A conic ring behind the title and gradient-edged cards. The card border is
   a two-layer background trick — a real gradient border, not a glow — so it
   stays crisp at any radius. */
.docs-scope[data-docs-home="halo"] .docs-hero { isolation: isolate; }

.docs-scope[data-docs-home="halo"] .docs-hero::before {
    inset: -60% -10% -20%;
    background: conic-gradient(from 210deg at 50% 42%,
        transparent 0deg,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 42%, transparent) 70deg,
        transparent 150deg,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 28%, transparent) 250deg,
        transparent 330deg);
    filter: blur(38px);
    opacity: 0.8;
}

.docs-scope[data-docs-home="halo"] .docs-hero h1 {
    font-size: clamp(2.3rem, 5vw, 3.4rem);
}

.docs-scope[data-docs-home="halo"] .doc-category-card {
    border: 1px solid transparent;
    background:
        linear-gradient(var(--doc-surface), var(--doc-surface)) padding-box,
        linear-gradient(150deg,
            color-mix(in srgb, var(--doc-accent, #8B5CF6) 42%, transparent) 0%,
            color-mix(in srgb, var(--doc-line-strong) 90%, transparent) 45%,
            color-mix(in srgb, var(--doc-accent, #8B5CF6) 22%, transparent) 100%) border-box;
}

.docs-scope[data-docs-home="halo"] .doc-category-card:hover {
    background:
        linear-gradient(var(--doc-surface), var(--doc-surface)) padding-box,
        linear-gradient(150deg,
            var(--doc-accent, #8B5CF6) 0%,
            color-mix(in srgb, var(--doc-accent, #8B5CF6) 40%, transparent) 55%,
            var(--doc-accent, #8B5CF6) 100%) border-box;
}

.docs-scope[data-docs-home="halo"] .doc-category-card::before { content: none; }

@media (max-width: 640px) {
    .docs-scope[data-docs-home="halo"] .docs-hero::before { filter: blur(26px); }
    .docs-scope[data-docs-home="noir"] .doc-category-card h3 { font-size: 1.35rem; }
}

/* =========================================================
   Carrying each look through the whole section

   Everything above dresses the docs HOME. A look that stops at the hero
   leaves the article, the category page and the nav on the plain treatment,
   so picking "Bold" gave you a bold landing page in front of an ordinary
   one — which reads as unfinished rather than as a choice.

   Most of it is done by moving TOKENS rather than by restating rules: the
   article, sidebar, contents rail, footer blocks and category page all read
   the same radius / shadow / surface / heading tokens, so a look that sets
   those is inherited by every one of them for free. Only the handful of
   looks with a signature that cannot be expressed as a token — Bold's
   offset shadows, Noir's rules-not-cards — need rules of their own.
   ========================================================= */

/* ---- Spotlight: softer, deeper, slightly warmed surfaces ---- */
.docs-scope[data-docs-home="spotlight"] {
    --doc-r-md: 14px;
    --doc-r-lg: 20px;
    --doc-surface: var(--pcms-doc-surface, color-mix(in srgb, var(--doc-accent, #8B5CF6) 5%, var(--bg-card, #1e1e32)));
    --doc-shadow-md: 0 2px 6px rgba(0, 0, 0, 0.18), 0 14px 34px -10px rgba(0, 0, 0, 0.42);
    --doc-shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.2), 0 28px 64px -16px rgba(0, 0, 0, 0.52);
}

/* ---- Panel: prominent surfaces, generous corners ---- */
.docs-scope[data-docs-home="panel"] {
    --doc-r-sm: 10px;
    --doc-r-md: 14px;
    --doc-r-lg: 18px;
    --doc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.22);
}

/* The contents rail and the feedback box become panels too, so the article
   reads as the same construction as the header above it. */
.docs-scope[data-docs-home="panel"] .doc-toc-rail .doc-toc,
.docs-scope[data-docs-home="panel"] .doc-toc.is-inline {
    background: var(--doc-surface);
    border: 1px solid var(--doc-line-strong);
    border-radius: var(--doc-r-md);
    padding: 14px 16px;
}

/* ---- Terminal: the mono carries into the article ---- */
.docs-scope[data-docs-home="terminal"] {
    --doc-heading-font: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    --doc-heading-weight: 600;
    --doc-heading-tracking: -0.01em;
    --doc-measure: 82ch;
}

/* Section headings get a prompt too, matching the page title. */
.docs-scope[data-docs-home="terminal"] .doc-body h2::before {
    content: "# ";
    color: var(--doc-accent-ink);
    font-weight: 400;
}

.docs-scope[data-docs-home="terminal"] .doc-sidebar li a.active::after {
    content: " <";
    color: var(--doc-accent-ink);
}

/* ---- Journal: serif and airy throughout ---- */
.docs-scope[data-docs-home="journal"] {
    --doc-heading-font: Georgia, "Iowan Old Style", "Times New Roman", serif;
    --doc-heading-weight: 500;
    --doc-heading-tracking: -0.008em;
    --doc-measure: 66ch;
    --doc-body-size: 17px;
    --doc-body-leading: 1.85;
    --doc-shadow-sm: none;
    --doc-shadow-md: none;
    --doc-shadow-lg: none;
    --doc-pad: 1.15;
}

/* Cards throughout become ruled rows, the same move the home makes. */
.docs-scope[data-docs-home="journal"] .doc-prevnext-link,
.docs-scope[data-docs-home="journal"] .related-doc-card,
.docs-scope[data-docs-home="journal"] .doc-index-item,
.docs-scope[data-docs-home="journal"] .doc-subcat-card {
    background: none;
    border: none;
    border-top: 1px solid var(--doc-line-strong);
    border-radius: 0;
    box-shadow: none;
}

.docs-scope[data-docs-home="journal"] .doc-prevnext-link:hover,
.docs-scope[data-docs-home="journal"] .related-doc-card:hover,
.docs-scope[data-docs-home="journal"] .doc-index-item:hover,
.docs-scope[data-docs-home="journal"] .doc-subcat-card:hover {
    background: none;
    box-shadow: none;
    transform: none;
    border-color: var(--doc-accent);
}

/* ---- Aurora: translucent surfaces everywhere ---- */
.docs-scope[data-docs-home="aurora"] {
    --doc-r-md: 14px;
    --doc-r-lg: 20px;
}

.docs-scope[data-docs-home="aurora"] .doc-prevnext-link,
.docs-scope[data-docs-home="aurora"] .related-doc-card,
.docs-scope[data-docs-home="aurora"] .doc-reactions,
.docs-scope[data-docs-home="aurora"] .doc-index-item,
.docs-scope[data-docs-home="aurora"] .doc-code-wrap {
    background: color-mix(in srgb, var(--doc-surface) 66%, transparent);
    backdrop-filter: blur(12px) saturate(1.15);
    -webkit-backdrop-filter: blur(12px) saturate(1.15);
    border-color: color-mix(in srgb, #fff 11%, transparent);
}

/* ---- Grid: flat, crisp, squarer ---- */
.docs-scope[data-docs-home="grid"] {
    --doc-r-xs: 4px;
    --doc-r-sm: 5px;
    --doc-r-md: 7px;
    --doc-r-lg: 9px;
    --doc-shadow-sm: none;
    --doc-shadow-md: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.docs-scope[data-docs-home="grid"] .doc-prevnext-link,
.docs-scope[data-docs-home="grid"] .related-doc-card,
.docs-scope[data-docs-home="grid"] .doc-index-item,
.docs-scope[data-docs-home="grid"] .doc-subcat-card {
    box-shadow: none;
    border-color: var(--doc-line-strong);
}

/* ---- Bold: the offset shadow is the whole idea, so it goes everywhere ---- */
.docs-scope[data-docs-home="bold"] {
    --doc-heading-weight: 800;
    --doc-heading-tracking: -0.03em;
}

.docs-scope[data-docs-home="bold"] .doc-prevnext-link,
.docs-scope[data-docs-home="bold"] .related-doc-card,
.docs-scope[data-docs-home="bold"] .doc-reactions,
.docs-scope[data-docs-home="bold"] .doc-index-item,
.docs-scope[data-docs-home="bold"] .doc-subcat-card,
.docs-scope[data-docs-home="bold"] .doc-code-wrap {
    border-width: 2px;
    border-color: var(--doc-ink);
    box-shadow: 4px 4px 0 0 color-mix(in srgb, var(--doc-accent, #8B5CF6) 85%, transparent);
}

.docs-scope[data-docs-home="bold"] .doc-prevnext-link:hover,
.docs-scope[data-docs-home="bold"] .related-doc-card:hover,
.docs-scope[data-docs-home="bold"] .doc-index-item:hover,
.docs-scope[data-docs-home="bold"] .doc-subcat-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 0 var(--doc-accent);
    border-color: var(--doc-ink);
}

.docs-scope[data-docs-home="bold"] .doc-sidebar li a.active {
    border-radius: var(--doc-r-xs);
    box-shadow: 3px 3px 0 0 var(--doc-accent);
}

/* ---- Sheet: flat rows, one surface ---- */
.docs-scope[data-docs-home="sheet"] {
    --doc-shadow-sm: none;
    --doc-r-md: 10px;
    --doc-r-lg: 14px;
}

.docs-scope[data-docs-home="sheet"] .doc-prevnext-link,
.docs-scope[data-docs-home="sheet"] .related-doc-card,
.docs-scope[data-docs-home="sheet"] .doc-index-item {
    box-shadow: none;
}

/* ---- Beam: accent-lit top edges on the article's blocks too ---- */
.docs-scope[data-docs-home="beam"] .doc-prevnext,
.docs-scope[data-docs-home="beam"] .doc-related h3,
.docs-scope[data-docs-home="beam"] .doc-body h2 {
    border-top-color: color-mix(in srgb, var(--doc-accent, #8B5CF6) 34%, var(--doc-line));
}

/* ---- Split: the article gets the same left-weighted treatment ---- */
.docs-scope[data-docs-home="split"] {
    --doc-measure: 78ch;
}

/* ---- Frame: hairline frames rather than filled cards ---- */
.docs-scope[data-docs-home="frame"] {
    --doc-shadow-sm: none;
    --doc-shadow-md: none;
    --doc-r-md: 6px;
    --doc-r-lg: 8px;
}

.docs-scope[data-docs-home="frame"] .doc-prevnext-link,
.docs-scope[data-docs-home="frame"] .related-doc-card,
.docs-scope[data-docs-home="frame"] .doc-index-item,
.docs-scope[data-docs-home="frame"] .doc-subcat-card,
.docs-scope[data-docs-home="frame"] .doc-code-wrap {
    background: none;
    border-color: color-mix(in srgb, var(--doc-accent, #8B5CF6) 26%, var(--doc-line-strong));
    box-shadow: none;
}

/* ---- Noir: rules, not cards, all the way through ---- */
.docs-scope[data-docs-home="noir"] {
    --doc-heading-weight: 800;
    --doc-heading-tracking: -0.035em;
    --doc-shadow-sm: none;
    --doc-shadow-md: none;
    --doc-shadow-lg: none;
    --doc-r-xs: 0px;
    --doc-r-sm: 0px;
    --doc-r-md: 0px;
    --doc-r-lg: 0px;
}

.docs-scope[data-docs-home="noir"] .doc-prevnext-link,
.docs-scope[data-docs-home="noir"] .related-doc-card,
.docs-scope[data-docs-home="noir"] .doc-reactions,
.docs-scope[data-docs-home="noir"] .doc-index-item,
.docs-scope[data-docs-home="noir"] .doc-subcat-card {
    background: none;
    border: none;
    border-top: 1px solid var(--doc-line-strong);
    box-shadow: none;
}

.docs-scope[data-docs-home="noir"] .doc-prevnext-link:hover,
.docs-scope[data-docs-home="noir"] .related-doc-card:hover,
.docs-scope[data-docs-home="noir"] .doc-index-item:hover,
.docs-scope[data-docs-home="noir"] .doc-subcat-card:hover {
    background: none;
    box-shadow: none;
    transform: none;
    border-color: var(--doc-accent);
}

.docs-scope[data-docs-home="noir"] .doc-title {
    font-size: clamp(2.2rem, 5.6vw, 3.6rem);
    line-height: 1.02;
}

/* ---- Halo: gradient edges on the article's cards as well ---- */
.docs-scope[data-docs-home="halo"] .doc-prevnext-link,
.docs-scope[data-docs-home="halo"] .related-doc-card,
.docs-scope[data-docs-home="halo"] .doc-reactions,
.docs-scope[data-docs-home="halo"] .doc-index-item {
    border: 1px solid transparent;
    background:
        linear-gradient(var(--doc-surface), var(--doc-surface)) padding-box,
        linear-gradient(150deg,
            color-mix(in srgb, var(--doc-accent, #8B5CF6) 38%, transparent) 0%,
            color-mix(in srgb, var(--doc-line-strong) 90%, transparent) 45%,
            color-mix(in srgb, var(--doc-accent, #8B5CF6) 20%, transparent) 100%) border-box;
}

/* ---- Ribbon has no section-wide signature -------------------------------
   It is a shape choice for the index, not a visual language, so the article
   deliberately stays on the plain treatment rather than being given one it
   does not imply. */

/* Blur is expensive and these are decoration, so they drop on small screens. */
@media (max-width: 640px) {
    .docs-scope[data-docs-home="aurora"] .doc-prevnext-link,
    .docs-scope[data-docs-home="aurora"] .related-doc-card,
    .docs-scope[data-docs-home="aurora"] .doc-reactions,
    .docs-scope[data-docs-home="aurora"] .doc-index-item,
    .docs-scope[data-docs-home="aurora"] .doc-code-wrap {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--doc-surface);
    }
}

/* =========================================================
   Blog section furniture — hero, list shell, article header

   Every element in this block used to be an inline style in
   views/posts/*.php: a centred .page-header with hardcoded padding, a
   container whose max-width was computed in PHP from the layout setting,
   and a footer rule drawn with a literal #334155. None of it could be
   themed, and — more to the point — none of it could be hooked by a named
   look, because none of it had a class to hook.

   Named to mirror the docs side (.docs-hero → .blog-hero) so the two
   halves of the section read as one design rather than two.
   ========================================================= */

.posts-scope .blog-hero {
    position: relative;
    text-align: center;
    padding: calc(58px * var(--doc-pad)) 20px calc(10px * var(--doc-pad));
}

/* The same single wide accent bloom the docs home uses. One radial on a
   pseudo-element — it is what gives the page a top rather than starting
   flat at the first card. */
/* The horizontal inset is 0, and the ellipse is widened to compensate.
   Hanging the bloom 20% off each side — which is what .docs-hero does — is
   scrollable overflow: an absolutely positioned pseudo-element still counts,
   so a 1265px page reports a 1518px scroll width and every blog page grows a
   horizontal scrollbar. A 60% ellipse in a 140%-wide box and an 84% ellipse
   in a 100%-wide box are the same gradient; only one of them scrolls. */
.posts-scope .blog-hero::before {
    content: '';
    position: absolute;
    inset: -10% 0 24%;
    background: radial-gradient(84% 70% at 50% 0%,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 12%, transparent) 0%,
        transparent 72%);
    pointer-events: none;
    z-index: 0;
}

.posts-scope .blog-hero > * { position: relative; z-index: 1; }

.posts-scope .blog-hero-title {
    font-family: var(--doc-heading-font);
    font-weight: var(--doc-heading-weight);
    font-size: clamp(1.9rem, 4.2vw, 2.8rem);
    line-height: 1.1;
    letter-spacing: var(--doc-heading-tracking);
    margin: 0 0 12px;
    text-wrap: balance;
    /* Derived from the heading ink, not from white: on a light palette a
       white-to-ink gradient starts invisible and eats the top of the title. */
    color: var(--doc-ink);
    background: linear-gradient(180deg,
        var(--doc-ink) 0%,
        color-mix(in srgb, var(--doc-ink) 68%, transparent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
    .posts-scope .blog-hero-title { background: none; -webkit-text-fill-color: currentColor; }
}

.posts-scope .blog-hero-sub {
    color: var(--doc-ink-3);
    font-size: 16.5px;
    line-height: 1.6;
    max-width: 56ch;
    margin: 0 auto;
}

/* The filter rail lives in the header now, so it needs the top margin the
   old free-floating placement got from the body padding. */
.posts-scope .blog-hero .pcms-term-filter {
    margin: calc(26px * var(--doc-pad)) 0 0;
}

/* ---- List measure ----
   Was `style="max-width:<?= … ?>px"`, computed in PHP. As a stylesheet rule
   it can be overridden by a look, which an inline style cannot. */
.posts-scope .blog-container { max-width: 900px; }
.posts-scope[data-blog-layout="minimal"] .blog-container { max-width: 760px; }
.posts-scope[data-blog-layout="grid"] .blog-container,
.posts-scope[data-blog-layout="magazine"] .blog-container { max-width: 1120px; }

.posts-scope .post-page-body { padding-bottom: calc(64px * var(--doc-pad)); }

.posts-scope .blog-empty {
    text-align: center;
    padding: calc(64px * var(--doc-pad)) 20px;
    border: 1px dashed var(--doc-line-strong);
    border-radius: var(--doc-r-lg);
    background: var(--doc-surface-2);
}

.posts-scope .blog-empty-title {
    color: var(--doc-ink);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px;
}

.posts-scope .blog-empty-text {
    color: var(--doc-ink-3);
    font-size: 14px;
    margin: 0;
}

.posts-scope .blog-empty-text a { color: var(--doc-link); }

/* ---- Single post header ---- */

.posts-scope .post-hero {
    position: relative;
    text-align: center;
    padding: calc(52px * var(--doc-pad)) 0 calc(4px * var(--doc-pad));
}

.posts-scope .post-hero::before {
    content: '';
    position: absolute;
    inset: -10% 0 30%;
    background: radial-gradient(82% 68% at 50% 0%,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 11%, transparent) 0%,
        transparent 72%);
    pointer-events: none;
    z-index: 0;
}

.posts-scope .post-hero > * { position: relative; z-index: 1; }

.posts-scope .post-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
    color: var(--doc-ink-3);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--doc-fast), gap var(--doc-fast);
}

.posts-scope .post-back:hover {
    color: var(--doc-accent-ink);
    gap: 10px;
}

.posts-scope .post-hero-terms {
    justify-content: center;
    margin: 0 0 16px;
}

/* The byline rule is the article's own; the header does not draw one, so
   the two never stack into a double line under the metadata. */
.posts-scope .post-hero .post-meta {
    justify-content: center;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* Hero layout: the image is inside the header now, so the header's own top
   padding would push it away from the site chrome. */
.posts-scope .post-hero.has-hero-image { padding-top: 0; }

/* Panel and Frame give the header rounded or drawn edges; a hero image that
   ran to the header's own corners would square them off. */
.posts-scope[data-post-look="panel"] .post-hero.has-hero-image .post-featured img,
.posts-scope[data-post-look="frame"] .post-hero.has-hero-image .post-featured img {
    border-radius: var(--doc-r-md);
}

.posts-scope .post-hero.has-hero-image .post-featured {
    margin-bottom: calc(34px * var(--doc-pad));
}

.posts-scope .post-hero.has-hero-image .container { padding-top: 0; }

.posts-scope .post-footer {
    margin-top: calc(48px * var(--doc-pad));
    padding-top: calc(26px * var(--doc-pad));
    border-top: 1px solid var(--doc-line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.posts-scope .post-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--doc-link);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: gap var(--doc-fast);
}

.posts-scope .post-footer-link:hover { gap: 11px; }

/* Phones: the two "back" links were 21px-tall strips of text. 44px targets, with the
   added height handed back through negative margins so nothing on the page moves. */
@media (max-width: 640px) {
    .posts-scope .post-back,
    .posts-scope .post-footer-link { padding-top: 11px; padding-bottom: 11px; margin-top: -11px; }
    .posts-scope .post-back { margin-bottom: 7px; }
    .posts-scope .post-footer-link { margin-bottom: -11px; }
}

/* Prev/next reuses .doc-prevnext wholesale — same tokens, same hover, same
   grid. Only the top rule is dropped when the gallery or the footer link
   is already drawing one directly above it. */
.posts-scope .post-prevnext { margin-top: calc(44px * var(--doc-pad)); }

/* =========================================================
   Post list furniture, on the section's own tokens

   .pcms-post-card and friends live in style.css and reach straight for
   --bg-card / --border-color / --brand-color / --text-light. That predates
   the token layer, and the consequence was that half of the "Post colours"
   panel saved fine and changed nothing: card surface, card border, card
   title, secondary text and the accent all stopped at the card's edge.

   Repainted here on --doc-* so every picker on that panel reaches the
   whole list. Scoped at .posts-scope so the same classes keep their old
   appearance anywhere else they are used (the post widgets, for one).
   ========================================================= */

.posts-scope .pcms-post-list { gap: calc(20px * var(--doc-pad)); }

.posts-scope .pcms-post-card {
    background: var(--doc-surface);
    border: 1px solid var(--doc-line);
    border-radius: var(--doc-r-lg);
    box-shadow: var(--doc-shadow-sm);
    transition: border-color var(--doc-slow), transform var(--doc-slow),
                box-shadow var(--doc-slow), background var(--doc-slow);
}

.posts-scope .pcms-post-card:hover {
    border-color: color-mix(in srgb, var(--doc-accent, #8B5CF6) 42%, var(--doc-line-strong));
    box-shadow: var(--doc-shadow-md);
    transform: translateY(-2px);
}

.posts-scope .pcms-post-card:focus-within {
    border-color: var(--doc-accent);
    box-shadow: var(--doc-ring);
}

.posts-scope .pcms-post-card-body { padding: calc(26px * var(--doc-pad)) calc(28px * var(--doc-pad)); }

.posts-scope .pcms-post-card-meta {
    color: var(--doc-ink-3);
    font-size: 12.5px;
}

.posts-scope .pcms-post-card-meta > span[aria-hidden] { opacity: 0.4; }

.posts-scope .pcms-post-card .pcms-post-card-title {
    font-family: var(--doc-heading-font);
    letter-spacing: var(--doc-heading-tracking);
    font-size: 1.3rem;
}

.posts-scope .pcms-post-card .pcms-post-card-title a {
    color: var(--doc-ink);
    font-weight: var(--doc-heading-weight);
    transition: color var(--doc-fast);
}

.posts-scope .pcms-post-card .pcms-post-card-title a:hover { color: var(--doc-accent-ink); }

.posts-scope .pcms-post-card-excerpt { color: var(--doc-ink-3); }

/* =========================================================
   Blog list emphasis — data-blog-emphasis

   An axis of its own, because "make the posts stand out more" was not
   answerable by any existing setting. The card layout decides a row's SHAPE
   and the look decides its character; on Minimal, which strips the card to a
   rule, a lifted style had nothing left to lift, so the two settings read as
   contradicting each other.

   All three work without a card, which is the point — they act on the row and
   on the words, so they compose with Minimal exactly as they do with Grid.
   ========================================================= */

/* Lift on hover. Applied to the row rather than the card surface, so a ruled
   index gets it too — there the tint IS the affordance, since there is no
   border to brighten. */
.posts-scope[data-blog-emphasis="hover"] .pcms-post-card {
    transition: transform var(--doc-slow), box-shadow var(--doc-slow),
                background var(--doc-slow);
}
.posts-scope[data-blog-emphasis="hover"] .pcms-post-card:hover {
    transform: translateY(-2px);
    background: color-mix(in srgb, var(--doc-accent, #8B5CF6) 7%, var(--doc-surface));
    box-shadow: var(--doc-shadow-lg);
}

/* An accent bar down the left. Drawn with a border rather than a pseudo
   element so it cannot collide with the ::before several looks already use for
   their own decoration. */
.posts-scope[data-blog-emphasis="accent"] .pcms-post-card {
    border-left: 3px solid color-mix(in srgb, var(--doc-accent, #8B5CF6) 55%, transparent);
    padding-left: 16px;
    transition: border-left-color var(--doc-slow);
}
.posts-scope[data-blog-emphasis="accent"] .pcms-post-card:hover {
    border-left-color: var(--doc-accent, #8B5CF6);
}

/* Bigger, higher-contrast titles with more room. --doc-ink is the strongest
   text token in the palette, so the title stops sharing a colour with the
   excerpt beneath it. */
.posts-scope[data-blog-emphasis="strong"] .pcms-post-card .pcms-post-card-title {
    font-size: 1.55rem;
    line-height: 1.2;
}
.posts-scope[data-blog-emphasis="strong"] .pcms-post-card .pcms-post-card-title a {
    color: var(--doc-ink);
    font-weight: 700;
}
.posts-scope[data-blog-emphasis="strong"] .pcms-post-card {
    padding-top: 22px;
    padding-bottom: 22px;
}
.posts-scope[data-blog-emphasis="strong"] .pcms-post-card-excerpt {
    color: var(--doc-ink-2);
    font-size: 1.02rem;
}

.posts-scope .pcms-post-card .pcms-post-card-more {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--doc-link);
    transition: gap var(--doc-fast);
}

.posts-scope .pcms-post-card .pcms-post-card-more:hover { gap: 10px; text-decoration: none; }

.posts-scope .pcms-post-card-thumb { background: var(--doc-surface-3); }

.posts-scope .pcms-post-card-thumb img { transition: transform var(--doc-slow); }

.posts-scope .pcms-post-card:hover .pcms-post-card-thumb img { transform: scale(1.03); }

/* ---- Pills ---- */
.posts-scope .pcms-term-pill {
    background: var(--doc-surface-2);
    border-color: var(--doc-line);
    color: var(--doc-ink-3);
    border-radius: var(--doc-r-pill);
    transition: color var(--doc-fast), border-color var(--doc-fast), background var(--doc-fast);
}

.posts-scope .pcms-term-pill:hover {
    color: var(--doc-ink);
    border-color: var(--doc-accent);
    background: var(--doc-accent-weak);
}

.posts-scope .pcms-term-pill.is-active {
    background: var(--doc-accent);
    border-color: var(--doc-accent);
    color: var(--doc-badge-ink, #fff);
}

.posts-scope .pcms-term-pill:focus-visible { outline: none; box-shadow: var(--doc-ring); }

/* Three classes, deliberately.
   A term pill is an <a>, and inside the article body it is caught by
   `.posts-scope .page-body a { color: inherit }` further up — the rule that
   hands links back to whichever component owns them. That selector is
   (0,2,1) and the pill rules above are (0,2,0), so the pills lost: they
   inherited the wrapper's text colour instead of taking the section's
   "Secondary text" setting. On a dark theme that was merely wrong (light
   grey where muted grey was asked for); on a light palette it was white on
   white at 1.28:1, which is invisible.
   The filter rail in the header was never affected — it sits outside
   .page-body — which is what made this look like a card-specific glitch. */
.posts-scope .page-body .pcms-term-pill { color: var(--doc-ink-3); }
.posts-scope .page-body .pcms-term-pill:hover { color: var(--doc-ink); }
.posts-scope .page-body .pcms-term-pill.is-active { color: var(--doc-badge-ink, #fff); }

/* ---- Pagination ---- */
.posts-scope .pcms-post-pagination a {
    background: var(--doc-surface);
    border-color: var(--doc-line);
    color: var(--doc-ink-3);
    border-radius: var(--doc-r-sm);
    transition: color var(--doc-fast), border-color var(--doc-fast), background var(--doc-fast);
}

.posts-scope .pcms-post-pagination a:hover {
    color: var(--doc-ink);
    border-color: var(--doc-accent);
    background: var(--doc-accent-weak);
}

.posts-scope .pcms-post-pagination .is-current {
    background: var(--doc-accent);
    color: var(--doc-badge-ink, #fff);
    border-radius: var(--doc-r-sm);
}

/* ---- Featured image ---- */
.posts-scope .pcms-post-featured img {
    border-radius: var(--doc-r-lg);
    border-color: var(--doc-line);
}

@media (prefers-reduced-motion: reduce) {
    .posts-scope .pcms-post-card,
    .posts-scope .pcms-post-card:hover,
    .posts-scope .pcms-post-card-thumb img,
    .posts-scope .pcms-post-card:hover .pcms-post-card-thumb img { transform: none; }
}

@media (max-width: 700px) {
    .posts-scope .blog-hero { padding-top: calc(38px * var(--doc-pad)); }
    .posts-scope .post-hero { padding-top: calc(34px * var(--doc-pad)); }
    .posts-scope .post-prevnext { grid-template-columns: minmax(0, 1fr); }
    .posts-scope .post-prevnext .doc-prevnext-link.is-next { grid-column: 1; text-align: left; }
}

/* =========================================================
   Blog LOOKS  (data-post-look)

   The post-side twin of data-docs-home, and deliberately the same fourteen
   words: a site that sets both to Spotlight should get one design, not two
   that rhyme. Each look is CSS over the markup that is already there, so
   switching cannot produce a half-built page, and each derives everything
   from --doc-accent / --doc-ink / --doc-surface so it still answers to the
   colour pickers underneath it.

   Unlike the docs version these reach the whole section — the list at
   /updates AND the article at /post/{slug} — because a blog is two views
   of one thing and a header treatment that stops at the index is exactly
   the mismatch this was added to fix.
   ========================================================= */

/* ---- Spotlight ---------------------------------------------------------
   The glossy one. A stronger bloom, a title that warms toward the accent,
   and cards that lift further off the page than the default. */
.posts-scope[data-post-look="spotlight"] .blog-hero::before,
.posts-scope[data-post-look="spotlight"] .post-hero::before {
    /* Same trade as the base rule above: width stays in the box, the ellipse
       grows to match. */
    inset: -18% 0 10%;
    background: radial-gradient(87% 76% at 50% 0%,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 26%, transparent) 0%,
        transparent 74%);
}

.posts-scope[data-post-look="spotlight"] .blog-hero-title,
.posts-scope[data-post-look="spotlight"] .post-hero .post-title {
    background: linear-gradient(180deg,
        var(--doc-ink) 0%,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 55%, var(--doc-ink)) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.posts-scope[data-post-look="spotlight"] .pcms-post-card {
    box-shadow: var(--doc-shadow-md);
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 5%, var(--doc-surface)) 0%,
        var(--doc-surface) 60%);
}

.posts-scope[data-post-look="spotlight"] .pcms-post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--doc-shadow-lg);
    border-color: color-mix(in srgb, var(--doc-accent, #8B5CF6) 60%, var(--doc-line-strong));
}

/* ---- Banner ------------------------------------------------------------
   A full-width accent band behind the header. The bloom comes off: two
   light sources on one header is one too many. */
.posts-scope[data-post-look="banner"] .blog-hero,
.posts-scope[data-post-look="banner"] .post-hero {
    background: linear-gradient(160deg,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 82%, #000) 0%,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 52%, var(--doc-surface)) 100%);
    padding-bottom: calc(34px * var(--doc-pad));
    margin-bottom: calc(34px * var(--doc-pad));
}

.posts-scope[data-post-look="banner"] .blog-hero::before,
.posts-scope[data-post-look="banner"] .post-hero::before { content: none; }

.posts-scope[data-post-look="banner"] .blog-hero-title,
.posts-scope[data-post-look="banner"] .post-hero .post-title {
    background: none;
    -webkit-text-fill-color: #fff;
    color: #fff;
}

.posts-scope[data-post-look="banner"] .blog-hero-sub,
.posts-scope[data-post-look="banner"] .post-hero .post-meta,
.posts-scope[data-post-look="banner"] .post-back {
    color: rgba(255, 255, 255, 0.82);
}

.posts-scope[data-post-look="banner"] .post-back:hover { color: #fff; }

.posts-scope[data-post-look="banner"] .blog-hero .pcms-term-pill,
.posts-scope[data-post-look="banner"] .post-hero .pcms-term-pill {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.posts-scope[data-post-look="banner"] .blog-hero .pcms-term-pill.is-active {
    background: #fff;
    border-color: #fff;
    color: color-mix(in srgb, var(--doc-accent, #8B5CF6) 80%, #000);
}

/* ---- Panel -------------------------------------------------------------
   The header inside its own bordered card, floating over the page. Reads
   as a console rather than a landing page. */
.posts-scope[data-post-look="panel"] .blog-hero,
.posts-scope[data-post-look="panel"] .post-hero {
    /* min() rather than a bare max-width: below 1160px the panel would
       otherwise run edge to edge, and a card with no margin stops reading
       as a card. */
    max-width: min(1120px, calc(100% - 40px));
    margin: calc(26px * var(--doc-pad)) auto 0;
    padding: calc(40px * var(--doc-pad)) calc(28px * var(--doc-pad)) calc(30px * var(--doc-pad));
    background: var(--doc-surface);
    border: 1px solid var(--doc-line-strong);
    border-radius: var(--doc-r-lg);
    box-shadow: var(--doc-shadow-md);
    overflow: hidden;
}

.posts-scope[data-post-look="panel"] .blog-hero::before,
.posts-scope[data-post-look="panel"] .post-hero::before { inset: -60% -10% 20%; }

.posts-scope[data-post-look="panel"] .post-page-body { padding-top: calc(26px * var(--doc-pad)); }

/* ---- Terminal ----------------------------------------------------------
   Monospace, square, hairlines, no shadows. For a changelog or a
   release-notes blog, where the content is already half code. */
.posts-scope[data-post-look="terminal"] {
    --doc-r-xs: 0px; --doc-r-sm: 0px; --doc-r-md: 0px; --doc-r-lg: 0px; --doc-r-pill: 0px;
    --doc-shadow-sm: none; --doc-shadow-md: none; --doc-shadow-lg: none;
    --doc-heading-tracking: 0;
}

.posts-scope[data-post-look="terminal"] .blog-hero::before,
.posts-scope[data-post-look="terminal"] .post-hero::before { content: none; }

.posts-scope[data-post-look="terminal"] .blog-hero,
.posts-scope[data-post-look="terminal"] .post-hero {
    text-align: left;
    border-bottom: 1px solid var(--doc-line-strong);
    padding-bottom: calc(24px * var(--doc-pad));
    margin-bottom: calc(30px * var(--doc-pad));
}

.posts-scope[data-post-look="terminal"] .blog-hero-title,
.posts-scope[data-post-look="terminal"] .post-hero .post-title {
    font-family: 'JetBrains Mono', Consolas, Menlo, monospace;
    font-size: clamp(1.5rem, 3vw, 2.05rem);
    font-weight: 600;
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--doc-ink);
}

.posts-scope[data-post-look="terminal"] .blog-hero-title::before {
    content: '$ ';
    color: var(--doc-accent-ink);
}

.posts-scope[data-post-look="terminal"] .blog-hero-sub,
.posts-scope[data-post-look="terminal"] .pcms-post-card-meta,
.posts-scope[data-post-look="terminal"] .post-hero .post-meta {
    font-family: 'JetBrains Mono', Consolas, Menlo, monospace;
    font-size: 12px;
    margin-left: 0;
}

.posts-scope[data-post-look="terminal"] .blog-hero .pcms-term-filter,
.posts-scope[data-post-look="terminal"] .post-hero-terms { justify-content: flex-start; }

.posts-scope[data-post-look="terminal"] .post-hero .post-meta { justify-content: flex-start; }

/* The card title too, not just the metadata. A monospace byline over a
   proportional headline is the half-committed version of this look. */
.posts-scope[data-post-look="terminal"] .pcms-post-card .pcms-post-card-title {
    font-family: 'JetBrains Mono', Consolas, Menlo, monospace;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.posts-scope[data-post-look="terminal"] .pcms-post-card:hover { transform: none; }

/* ---- Journal -----------------------------------------------------------
   Serif display heading, generous air, cards reduced to ruled rows. The
   one that looks like a publication rather than an app. */
.posts-scope[data-post-look="journal"] .blog-hero,
.posts-scope[data-post-look="journal"] .post-hero {
    padding-top: calc(72px * var(--doc-pad));
}

.posts-scope[data-post-look="journal"] .blog-hero::before,
.posts-scope[data-post-look="journal"] .post-hero::before {
    inset: auto 0 0 0;
    height: 1px;
    background: var(--doc-line-strong);
}

.posts-scope[data-post-look="journal"] .blog-hero-title,
.posts-scope[data-post-look="journal"] .post-hero .post-title {
    font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
    font-weight: 500;
    letter-spacing: -0.01em;
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--doc-ink);
}

.posts-scope[data-post-look="journal"] .blog-hero-sub {
    font-family: Georgia, 'Iowan Old Style', serif;
    font-style: italic;
}

.posts-scope[data-post-look="journal"] .pcms-post-card {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--doc-line);
    border-radius: 0;
    box-shadow: none;
}

.posts-scope[data-post-look="journal"] .pcms-post-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--doc-accent);
    background: var(--doc-accent-weak);
}

.posts-scope[data-post-look="journal"] .pcms-post-card .pcms-post-card-title {
    font-family: Georgia, 'Iowan Old Style', serif;
    font-weight: 500;
    font-size: 1.45rem;
}

.posts-scope[data-post-look="journal"] .pcms-post-card-body {
    padding-left: 0;
    padding-right: 0;
}

/* ---- Aurora ------------------------------------------------------------
   Three offset colour fields behind the header rather than one bloom, and
   translucent cards over them. */
.posts-scope[data-post-look="aurora"] .blog-hero,
.posts-scope[data-post-look="aurora"] .post-hero { overflow: hidden; }

/* The fields are placed against the hero's own box, not floated above it:
   at -40% top they sat off the top of a header this short and all three
   read as one faint smudge. Positioned inside and mixed harder, they read
   as three light sources, which is the whole idea. */
.posts-scope[data-post-look="aurora"] .blog-hero,
.posts-scope[data-post-look="aurora"] .post-hero {
    padding-bottom: calc(30px * var(--doc-pad));
}

.posts-scope[data-post-look="aurora"] .blog-hero::before,
.posts-scope[data-post-look="aurora"] .post-hero::before {
    inset: -20% -15% -25%;
    background:
        radial-gradient(42% 62% at 16% 34%,
            color-mix(in srgb, var(--doc-accent, #8B5CF6) 46%, transparent) 0%, transparent 70%),
        radial-gradient(38% 56% at 84% 20%,
            color-mix(in srgb, var(--doc-note, #3B82F6) 38%, transparent) 0%, transparent 68%),
        radial-gradient(52% 50% at 50% 104%,
            color-mix(in srgb, var(--doc-tip, #10B981) 26%, transparent) 0%, transparent 72%);
    filter: blur(10px);
}

.posts-scope[data-post-look="aurora"] .pcms-post-card {
    background: color-mix(in srgb, var(--doc-surface) 62%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-color: color-mix(in srgb, var(--doc-ink) 12%, transparent);
}

/* ---- Grid --------------------------------------------------------------
   A faint engineering grid behind the header, fading downward. Crisp flat
   cards, no lift. */
.posts-scope[data-post-look="grid"] .blog-hero::before,
.posts-scope[data-post-look="grid"] .post-hero::before {
    inset: 0 0 0 0;
    background-image:
        linear-gradient(color-mix(in srgb, var(--doc-ink) 7%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--doc-ink) 7%, transparent) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 88%);
    mask-image: linear-gradient(180deg, #000 0%, transparent 88%);
}

.posts-scope[data-post-look="grid"] .pcms-post-card {
    box-shadow: none;
    border-color: var(--doc-line-strong);
    border-radius: var(--doc-r-sm);
}

.posts-scope[data-post-look="grid"] .pcms-post-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--doc-accent);
}

/* ---- Bold --------------------------------------------------------------
   Thick borders, hard offset shadows, no blur. Loud on purpose: the shadow
   is a second border, not a light source. */
.posts-scope[data-post-look="bold"] {
    --doc-heading-weight: 800;
    --doc-heading-tracking: -0.03em;
}

.posts-scope[data-post-look="bold"] .blog-hero::before,
.posts-scope[data-post-look="bold"] .post-hero::before { content: none; }

.posts-scope[data-post-look="bold"] .blog-hero-title,
.posts-scope[data-post-look="bold"] .post-hero .post-title {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--doc-ink);
    font-size: clamp(2.2rem, 5.4vw, 3.4rem);
    text-transform: none;
}

.posts-scope[data-post-look="bold"] .pcms-post-card {
    border: 2px solid var(--doc-ink);
    border-radius: var(--doc-r-sm);
    box-shadow: 5px 5px 0 0 var(--doc-accent);
}

.posts-scope[data-post-look="bold"] .pcms-post-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 0 var(--doc-accent);
    border-color: var(--doc-ink);
}

.posts-scope[data-post-look="bold"] .pcms-term-pill {
    border: 2px solid var(--doc-ink);
    font-weight: 700;
}

.posts-scope[data-post-look="bold"] .doc-prevnext-link {
    border: 2px solid var(--doc-ink);
    box-shadow: 4px 4px 0 0 var(--doc-accent);
}

/* ---- Sheet -------------------------------------------------------------
   Everything on one raised panel, cards as rows inside it — the shape a
   settings screen or a dashboard uses. */
.posts-scope[data-post-look="sheet"] .blog-container {
    background: var(--doc-surface);
    border: 1px solid var(--doc-line-strong);
    border-radius: var(--doc-r-lg);
    box-shadow: var(--doc-shadow-lg);
    padding: calc(10px * var(--doc-pad)) calc(24px * var(--doc-pad)) calc(24px * var(--doc-pad));
}

.posts-scope[data-post-look="sheet"] .pcms-post-list { gap: 0; }

.posts-scope[data-post-look="sheet"] .pcms-post-card {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--doc-line);
    border-radius: 0;
    box-shadow: none;
}

.posts-scope[data-post-look="sheet"] .pcms-post-card:last-child { border-bottom: none; }

.posts-scope[data-post-look="sheet"] .pcms-post-card:hover {
    transform: none;
    box-shadow: none;
    background: var(--doc-accent-weak);
}

.posts-scope[data-post-look="sheet"] .blog-hero::before,
.posts-scope[data-post-look="sheet"] .post-hero::before { content: none; }

/* ---- Beam --------------------------------------------------------------
   A lit rule across the top of the header with the glow hanging beneath
   it, rather than a bloom rising behind the title. */
.posts-scope[data-post-look="beam"] .blog-hero,
.posts-scope[data-post-look="beam"] .post-hero {
    border-top: 1px solid color-mix(in srgb, var(--doc-accent, #8B5CF6) 60%, transparent);
}

.posts-scope[data-post-look="beam"] .blog-hero::before,
.posts-scope[data-post-look="beam"] .post-hero::before {
    inset: 0 0 auto 0;
    height: 240px;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 20%, transparent) 0%,
        transparent 100%);
}

.posts-scope[data-post-look="beam"] .pcms-post-card {
    position: relative;
    overflow: hidden;
}

/* The leading edge lights on hover rather than the whole border — repainting
   all four sides makes the card look like it jumped. */
.posts-scope[data-post-look="beam"] .pcms-post-card::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 2px;
    background: var(--doc-accent);
    opacity: 0;
    transition: opacity var(--doc-slow);
}

.posts-scope[data-post-look="beam"] .pcms-post-card:hover::after { opacity: 1; }

/* ---- Frame -------------------------------------------------------------
   A drawn frame with corner ticks around the header. The ticks are two
   pseudo-elements with two borders each, not four elements. */
.posts-scope[data-post-look="frame"] .blog-hero,
.posts-scope[data-post-look="frame"] .post-hero {
    position: relative;
    max-width: min(1120px, calc(100% - 40px));
    margin: calc(30px * var(--doc-pad)) auto 0;
    padding: calc(44px * var(--doc-pad)) calc(30px * var(--doc-pad));
    border: 1px solid var(--doc-line-strong);
}

.posts-scope[data-post-look="frame"] .blog-hero::before,
.posts-scope[data-post-look="frame"] .post-hero::before {
    content: '';
    position: absolute;
    inset: 8px;
    background: none;
    border: 1px solid color-mix(in srgb, var(--doc-accent, #8B5CF6) 26%, transparent);
    pointer-events: none;
}

/* inset:0, not a negative one. Hanging the ticks 5px outside the header
   put 10px of content past the viewport on any screen narrower than the
   header's max-width, and a horizontal scrollbar on a page that has no
   horizontal content is the most avoidable bug in a stylesheet. */
.posts-scope[data-post-look="frame"] .blog-hero::after,
.posts-scope[data-post-look="frame"] .post-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--doc-accent);
    border-image: none;
    clip-path: polygon(
        0 0, 18px 0, 18px 2px, 2px 2px, 2px 18px, 0 18px,
        0 100%, 18px 100%, 18px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 18px), 0 calc(100% - 18px),
        100% 100%, calc(100% - 18px) 100%, calc(100% - 18px) calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) calc(100% - 18px), 100% calc(100% - 18px),
        100% 0, calc(100% - 18px) 0, calc(100% - 18px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 18px, 100% 18px);
    pointer-events: none;
}

.posts-scope[data-post-look="frame"] .post-page-body { padding-top: calc(28px * var(--doc-pad)); }

/* ---- Noir --------------------------------------------------------------
   Oversized type, no cards, hairlines only. The list becomes an index and
   the title carries the page. */
.posts-scope[data-post-look="noir"] .blog-hero::before,
.posts-scope[data-post-look="noir"] .post-hero::before { content: none; }

.posts-scope[data-post-look="noir"] .blog-hero,
.posts-scope[data-post-look="noir"] .post-hero { text-align: left; }

.posts-scope[data-post-look="noir"] .blog-hero-title,
.posts-scope[data-post-look="noir"] .post-hero .post-title {
    font-size: clamp(2.4rem, 6.4vw, 4.2rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--doc-ink);
}

.posts-scope[data-post-look="noir"] .blog-hero-sub { margin-left: 0; }

.posts-scope[data-post-look="noir"] .blog-hero .pcms-term-filter,
.posts-scope[data-post-look="noir"] .post-hero-terms,
.posts-scope[data-post-look="noir"] .post-hero .post-meta { justify-content: flex-start; }

.posts-scope[data-post-look="noir"] .pcms-post-card {
    background: none;
    border: none;
    border-top: 1px solid var(--doc-line);
    border-radius: 0;
    box-shadow: none;
}

.posts-scope[data-post-look="noir"] .pcms-post-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--doc-accent);
}

.posts-scope[data-post-look="noir"] .pcms-post-card .pcms-post-card-title {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    letter-spacing: -0.03em;
}

.posts-scope[data-post-look="noir"] .pcms-post-card-body { padding-left: 0; padding-right: 0; }

/* ---- Halo --------------------------------------------------------------
   A conic glow behind the title and gradient edges on the cards. The one
   place in the section where a border is a gradient rather than a colour. */
.posts-scope[data-post-look="halo"] .blog-hero,
.posts-scope[data-post-look="halo"] .post-hero { overflow: hidden; }

.posts-scope[data-post-look="halo"] .blog-hero::before,
.posts-scope[data-post-look="halo"] .post-hero::before {
    inset: -70% -30% 20%;
    /* The arc is centred on the title rather than swept from one side:
       210deg put the whole glow into the top-right corner, which reads as
       a smudge on the header instead of a halo behind the heading. */
    background: conic-gradient(from 200deg at 50% 62%,
        transparent 0deg,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 34%, transparent) 60deg,
        color-mix(in srgb, var(--doc-note, #3B82F6) 26%, transparent) 180deg,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 18%, transparent) 300deg,
        transparent 360deg);
    -webkit-mask-image: radial-gradient(52% 58% at 50% 62%, #000 0%, transparent 78%);
    mask-image: radial-gradient(52% 58% at 50% 62%, #000 0%, transparent 78%);
}

.posts-scope[data-post-look="halo"] .pcms-post-card,
.posts-scope[data-post-look="halo"] .doc-prevnext-link {
    border: 1px solid transparent;
    background:
        linear-gradient(var(--doc-surface), var(--doc-surface)) padding-box,
        linear-gradient(150deg,
            color-mix(in srgb, var(--doc-accent, #8B5CF6) 38%, transparent) 0%,
            color-mix(in srgb, var(--doc-line-strong) 90%, transparent) 45%,
            color-mix(in srgb, var(--doc-accent, #8B5CF6) 20%, transparent) 100%) border-box;
}

/* ---- The row-shaped looks and their thumbnails -------------------------
   Journal, Noir and Sheet all take the card chrome off, and .pcms-post-card
   .has-thumb is a two-column grid with no gap that relied on the card's own
   border-radius and overflow:hidden to make the image look deliberate. With
   the chrome gone the image butted straight into the text and squared off
   against the page edge. These three want an index row: a narrower image,
   a real gap, and the corner radius back on the image itself. */
/* :not(.is-grid), because a 190px image column inside a 300px grid card
   leaves no room for the words — style.css already stacks the image on top
   in grid mode and this must not out-specify that. Same reason the media
   query below restates it: these selectors are (0,6,0) and would otherwise
   beat the (0,2,0) phone rule in style.css and put a side-by-side row on a
   360px screen. */
.posts-scope[data-post-look="journal"] .pcms-post-list:not(.is-grid) .pcms-post-card.has-thumb,
.posts-scope[data-post-look="noir"] .pcms-post-list:not(.is-grid) .pcms-post-card.has-thumb,
.posts-scope[data-post-look="sheet"] .pcms-post-list:not(.is-grid) .pcms-post-card.has-thumb {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: calc(22px * var(--doc-pad));
    overflow: visible;
}

.posts-scope[data-post-look="journal"] .pcms-post-card.has-thumb .pcms-post-card-thumb img,
.posts-scope[data-post-look="noir"] .pcms-post-card.has-thumb .pcms-post-card-thumb img,
.posts-scope[data-post-look="sheet"] .pcms-post-card.has-thumb .pcms-post-card-thumb img {
    border-radius: var(--doc-r-sm);
}

@media (max-width: 768px) {
    .posts-scope[data-post-look="journal"] .pcms-post-list:not(.is-grid) .pcms-post-card.has-thumb,
    .posts-scope[data-post-look="noir"] .pcms-post-list:not(.is-grid) .pcms-post-card.has-thumb,
    .posts-scope[data-post-look="sheet"] .pcms-post-list:not(.is-grid) .pcms-post-card.has-thumb {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    /* style.css tightens this to 20px on a phone at (0,1,0); the token-aware
       rule above is (0,2,0) and was quietly reinstating the desktop padding. */
    .posts-scope .pcms-post-card-body { padding: calc(20px * var(--doc-pad)); }
}

/* Blur and layered gradients are decoration, and expensive. They come off
   on a phone, where the page is one column and they read as noise anyway. */
@media (max-width: 640px) {
    .posts-scope[data-post-look="aurora"] .pcms-post-card {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--doc-surface);
    }
    .posts-scope[data-post-look="aurora"] .blog-hero::before,
    .posts-scope[data-post-look="aurora"] .post-hero::before { filter: none; }
    .posts-scope[data-post-look="frame"] .blog-hero,
    .posts-scope[data-post-look="frame"] .post-hero,
    .posts-scope[data-post-look="panel"] .blog-hero,
    .posts-scope[data-post-look="panel"] .post-hero {
        padding-left: calc(18px * var(--doc-pad));
        padding-right: calc(18px * var(--doc-pad));
    }
}

/* =========================================================
   Header card  (data-hero-card)

   What the page heading SITS ON, as an axis of its own.

   The looks each have a character, and a few of them happen to give the
   header a surface — but "I want the title to stand out" is a different
   question from "what character should this section have", and answering it
   used to mean picking Banner or Panel and accepting everything else those
   bring. This is that one question, and it runs across the docs home, the
   blog list and the article alike.

   Painted on the hero's own .container, so no view needed a new wrapper:
   the container is already the element that holds the heading, the
   subheading and the search box, and it is already centred. It is NOT given
   overflow:hidden — the docs search results hang out of the bottom of it,
   and clipping them would trade a legible heading for a broken search.

   ContentPages::heroCard() returns '' when the chosen look already paints
   its own header (Banner, Panel, Frame, Sheet), so a card can never end up
   sitting inside a band. That is decided in PHP rather than unpicked here
   with four :not() selectors that would be wrong the day a fifth look lands.
   ========================================================= */

.docs-scope[data-hero-card] .docs-hero > .container,
.docs-scope[data-hero-card] > .docs-searchonly,
.posts-scope[data-hero-card] .blog-hero > .container,
.posts-scope[data-hero-card] .post-hero > .container {
    position: relative;
    /* min(), so the card keeps a margin instead of running to the edges on
       anything narrower than its own maximum. */
    max-width: min(920px, calc(100% - 40px));
    padding: calc(40px * var(--doc-pad)) calc(36px * var(--doc-pad));
    border-radius: var(--doc-r-lg);
}

/* The article's card tracks the reading measure rather than a fixed width —
   a 920px panel around a 74ch column reads as a mistake. */
.posts-scope[data-hero-card] .post-hero > .container {
    max-width: min(calc(var(--doc-measure, 74ch) + 90px), calc(100% - 40px));
}

/* Two light sources on one header is one too many: with a card behind the
   words, the page-level bloom drops back to a hint. */
.docs-scope[data-hero-card] .docs-hero::before,
.posts-scope[data-hero-card] .blog-hero::before,
.posts-scope[data-hero-card] .post-hero::before { opacity: 0.4; }

/* Secondary text is the part that actually struggles on a lit surface — the
   heading is already large and full-strength. */
.docs-scope[data-hero-card] .docs-hero .page-subtitle,
.posts-scope[data-hero-card] .blog-hero-sub,
.posts-scope[data-hero-card] .post-hero .post-meta { color: var(--doc-ink-2); }

/* ---- Gradient: the lit panel ----------------------------------------
   Three layers: an accent bloom off the top-left, a cooler one off the
   top-right so the wash is not one flat tint, and a base that starts a few
   percent toward the accent and settles onto the plain surface. The 1px
   white stop at the top is the inner highlight — as a background layer
   rather than a pseudo-element, because .container is a shared class and
   claiming its ::after would be a trap for whatever uses it next. */
.docs-scope[data-hero-card="gradient"] .docs-hero > .container,
.docs-scope[data-hero-card="gradient"] > .docs-searchonly,
.posts-scope[data-hero-card="gradient"] .blog-hero > .container,
.posts-scope[data-hero-card="gradient"] .post-hero > .container {
    background:
        linear-gradient(180deg, color-mix(in srgb, #fff 16%, transparent) 0px, transparent 1.5px),
        radial-gradient(120% 150% at 6% -12%,
            color-mix(in srgb, var(--doc-accent, #8B5CF6) 30%, transparent) 0%, transparent 58%),
        radial-gradient(110% 135% at 94% 0%,
            color-mix(in srgb, var(--doc-note, #3B82F6) 20%, transparent) 0%, transparent 60%),
        linear-gradient(165deg,
            color-mix(in srgb, var(--doc-surface) 86%, var(--doc-accent, #8B5CF6)) 0%,
            var(--doc-surface) 72%);
    border: 1px solid color-mix(in srgb, var(--doc-accent, #8B5CF6) 30%, var(--doc-line-strong));
    box-shadow: var(--doc-shadow-lg);
}

/* ---- Solid ---- */
.docs-scope[data-hero-card="solid"] .docs-hero > .container,
.docs-scope[data-hero-card="solid"] > .docs-searchonly,
.posts-scope[data-hero-card="solid"] .blog-hero > .container,
.posts-scope[data-hero-card="solid"] .post-hero > .container {
    background: var(--doc-surface);
    border: 1px solid var(--doc-line-strong);
    box-shadow: var(--doc-shadow-md);
}

/* ---- Glass ---- */
.docs-scope[data-hero-card="glass"] .docs-hero > .container,
.docs-scope[data-hero-card="glass"] > .docs-searchonly,
.posts-scope[data-hero-card="glass"] .blog-hero > .container,
.posts-scope[data-hero-card="glass"] .post-hero > .container {
    background: color-mix(in srgb, var(--doc-surface) 55%, transparent);
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    border: 1px solid color-mix(in srgb, var(--doc-ink) 14%, transparent);
    box-shadow: var(--doc-shadow-md);
}

/* ---- Outline ---- */
.docs-scope[data-hero-card="outline"] .docs-hero > .container,
.docs-scope[data-hero-card="outline"] > .docs-searchonly,
.posts-scope[data-hero-card="outline"] .blog-hero > .container,
.posts-scope[data-hero-card="outline"] .post-hero > .container {
    background: none;
    border: 1px solid var(--doc-line-strong);
}

/* The docs search box sits inside the card, so it needs to read as inset
   against it rather than as another panel floating on the same plane. */
.docs-scope[data-hero-card="gradient"] .docs-search input,
.docs-scope[data-hero-card="solid"] .docs-search input,
.docs-scope[data-hero-card="glass"] .docs-search input {
    background: color-mix(in srgb, var(--doc-surface-3) 82%, transparent);
    box-shadow: none;
}

/* The search box on its own, when the big title banner is switched off.
   Was an inline padding-top in archive.php, which the header-card rule could
   not override. */
.docs-scope > .docs-searchonly { padding-top: 34px; }

/* Nothing below the card should collide with it. */
.docs-scope[data-hero-card] .docs-hero,
.posts-scope[data-hero-card] .blog-hero,
.posts-scope[data-hero-card] .post-hero {
    padding-bottom: calc(26px * var(--doc-pad));
}

@media (max-width: 640px) {
    .docs-scope[data-hero-card] .docs-hero > .container,
.docs-scope[data-hero-card] > .docs-searchonly,
    .posts-scope[data-hero-card] .blog-hero > .container,
    .posts-scope[data-hero-card] .post-hero > .container {
        padding: calc(28px * var(--doc-pad)) calc(20px * var(--doc-pad));
    }
    /* Blur is expensive and reads as mush at this size. */
    .docs-scope[data-hero-card="glass"] .docs-hero > .container,
.docs-scope[data-hero-card="glass"] > .docs-searchonly,
    .posts-scope[data-hero-card="glass"] .blog-hero > .container,
    .posts-scope[data-hero-card="glass"] .post-hero > .container {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--doc-surface);
    }
}

/* =========================================================
   Blog list: two more shapes

   Both are CSS over the markup that is already there, like the four before
   them, so the view still branches for nothing.
   ========================================================= */

.posts-scope[data-blog-layout="showcase"] .blog-container { max-width: 1120px; }
.posts-scope[data-blog-layout="feature"] .blog-container { max-width: 1000px; }

/* ---- Featured lead -----------------------------------------------------
   The newest post gets the space, everything after it becomes a compact
   row. Magazine puts the rest in a grid; this keeps them as a readable
   column, which suits a blog whose later posts are notes rather than
   features. */
.posts-scope[data-blog-layout="feature"] .pcms-post-list {
    grid-template-columns: minmax(0, 1fr);
    gap: calc(16px * var(--doc-pad));
}

.posts-scope[data-blog-layout="feature"] .pcms-post-card:first-child.has-thumb {
    grid-template-columns: minmax(0, 1fr);
}

.posts-scope[data-blog-layout="feature"] .pcms-post-card:first-child .pcms-post-card-thumb img {
    height: clamp(220px, 34vw, 360px);
    min-height: 0;
}

.posts-scope[data-blog-layout="feature"] .pcms-post-card:first-child .pcms-post-card-title {
    font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.posts-scope[data-blog-layout="feature"] .pcms-post-card:first-child .pcms-post-card-body {
    padding: calc(30px * var(--doc-pad)) calc(32px * var(--doc-pad));
}

/* Everything after the lead: a narrow thumb, no excerpt, one line of title. */
.posts-scope[data-blog-layout="feature"] .pcms-post-card:not(:first-child).has-thumb {
    grid-template-columns: 148px minmax(0, 1fr);
}

.posts-scope[data-blog-layout="feature"] .pcms-post-card:not(:first-child) .pcms-post-card-thumb img {
    min-height: 108px;
}

.posts-scope[data-blog-layout="feature"] .pcms-post-card:not(:first-child) .pcms-post-card-body {
    padding: calc(16px * var(--doc-pad)) calc(20px * var(--doc-pad));
}

.posts-scope[data-blog-layout="feature"] .pcms-post-card:not(:first-child) .pcms-post-card-title {
    font-size: 1.05rem;
}

.posts-scope[data-blog-layout="feature"] .pcms-post-card:not(:first-child) .pcms-post-card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

/* ---- Showcase ----------------------------------------------------------
   The image IS the card and the words sit on it. The card is already a
   two-track grid when it has a thumbnail, so both children are dropped into
   the same cell rather than the markup being restacked; the scrim is what
   keeps the words readable over whatever photo turns up. */
.posts-scope[data-blog-layout="showcase"] .pcms-post-list {
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: calc(20px * var(--doc-pad));
}

.posts-scope[data-blog-layout="showcase"] .pcms-post-card.has-thumb {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(300px, auto);
}

.posts-scope[data-blog-layout="showcase"] .pcms-post-card.has-thumb > * {
    grid-area: 1 / 1;
}

.posts-scope[data-blog-layout="showcase"] .pcms-post-card-thumb {
    position: relative;
    height: 100%;
}

/* A wash over the whole picture, on top of the scrim under the words.
   The scrim alone is not enough: it fades to nothing at the top of the body
   box, and on a card whose text runs long that top edge is where the byline
   sits — over whatever the brightest part of the photo happens to be. */
.posts-scope[data-blog-layout="showcase"] .pcms-post-card-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.5) 100%);
    pointer-events: none;
}

.posts-scope[data-blog-layout="showcase"] .pcms-post-card-thumb img {
    height: 100%;
    min-height: 300px;
}

.posts-scope[data-blog-layout="showcase"] .pcms-post-card.has-thumb .pcms-post-card-body {
    align-self: end;
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(0, 0, 0, 0.42) 34%,
        rgba(0, 0, 0, 0.86) 100%);
    padding-top: calc(60px * var(--doc-pad));
}

/* Fixed light values, not tokens: this text is over a photograph, and what
   it needs to be readable against is the scrim above, not the theme. */
.posts-scope[data-blog-layout="showcase"] .pcms-post-card.has-thumb .pcms-post-card-title a,
.posts-scope[data-blog-layout="showcase"] .pcms-post-card.has-thumb .pcms-post-card-title a:hover { color: #fff; }

.posts-scope[data-blog-layout="showcase"] .pcms-post-card.has-thumb .pcms-post-card-meta,
.posts-scope[data-blog-layout="showcase"] .pcms-post-card.has-thumb .pcms-post-card-excerpt { color: rgba(255, 255, 255, 0.82); }

.posts-scope[data-blog-layout="showcase"] .pcms-post-card.has-thumb .pcms-post-card-more { color: #fff; }

.posts-scope[data-blog-layout="showcase"] .pcms-post-card.has-thumb .pcms-term-pill {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.posts-scope[data-blog-layout="showcase"] .pcms-post-card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* A post with no featured image has no picture to sit on, so it stays a
   normal card — matched in height so the row does not go ragged. */
.posts-scope[data-blog-layout="showcase"] .pcms-post-card:not(.has-thumb) {
    display: flex;
    align-items: flex-end;
    min-height: 300px;
}

/* ---- Magazine's lead, made to read as one ------------------------------
   It used to be "the same card, spanning both columns", which on a wide
   screen is a normal card stretched — not a lead story. Image beside the
   words at close to half and half, and a title scaled to match. */
.posts-scope[data-blog-layout="magazine"] .pcms-post-list > :first-child.has-thumb {
    grid-template-columns: minmax(0, 46%) minmax(0, 1fr);
}

.posts-scope[data-blog-layout="magazine"] .pcms-post-list > :first-child .pcms-post-card-thumb img {
    min-height: 300px;
}

.posts-scope[data-blog-layout="magazine"] .pcms-post-list > :first-child .pcms-post-card-title {
    font-size: clamp(1.45rem, 2.6vw, 2rem);
}

.posts-scope[data-blog-layout="magazine"] .pcms-post-list > :first-child .pcms-post-card-body {
    padding: calc(30px * var(--doc-pad)) calc(32px * var(--doc-pad));
    align-self: center;
}

@media (max-width: 768px) {
    /* Every side-by-side card in this block goes back to stacking. These
       selectors out-specify style.css's phone rule, so they have to say so
       themselves. */
    .posts-scope[data-blog-layout="magazine"] .pcms-post-list > :first-child.has-thumb,
    .posts-scope[data-blog-layout="feature"] .pcms-post-card:not(:first-child).has-thumb {
        grid-template-columns: minmax(0, 1fr);
    }
    .posts-scope[data-blog-layout="feature"] .pcms-post-card:not(:first-child) .pcms-post-card-thumb img {
        height: 180px;
    }
}

/* =========================================================
   Docs home: two more shapes
   ========================================================= */

/* ---- Tiles -------------------------------------------------------------
   Icon, name, count. For a section whose categories are recognisable at a
   glance — the shape a launcher uses, not a reading list. */
.docs-scope[data-docs-layout="tiles"] .docs-categories {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.docs-scope[data-docs-layout="tiles"] .doc-category-card {
    padding: calc(28px * var(--doc-pad)) calc(16px * var(--doc-pad));
    text-align: center;
}

.docs-scope[data-docs-layout="tiles"] .doc-category-header {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.docs-scope[data-docs-layout="tiles"] .doc-category-icon {
    width: calc(var(--doc-card-icon-size, 44px) * 1.35);
    height: calc(var(--doc-card-icon-size, 44px) * 1.35);
    font-size: 26px;
}

.docs-scope[data-docs-layout="tiles"] .doc-category-desc,
.docs-scope[data-docs-layout="tiles"] .doc-category-card .doc-list { display: none; }

.docs-scope[data-docs-layout="tiles"] .doc-category-card h3 { font-size: 1.02rem; }

/* ---- Rows --------------------------------------------------------------
   One full-width row per category: the name and description on the left,
   its articles listed beside them instead of underneath. Reads as a
   contents page rather than a grid of tiles, and puts the article titles —
   which are what people are actually looking for — above the fold. */
.docs-scope[data-docs-layout="rows"] .docs-categories {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.docs-scope[data-docs-layout="rows"] .doc-category-card {
    display: grid;
    grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
    column-gap: calc(34px * var(--doc-pad));
    align-items: start;
}

.docs-scope[data-docs-layout="rows"] .doc-category-header,
.docs-scope[data-docs-layout="rows"] .doc-category-desc { grid-column: 1; }

.docs-scope[data-docs-layout="rows"] .doc-category-card .doc-list {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    columns: 2;
    column-gap: calc(28px * var(--doc-pad));
}

.docs-scope[data-docs-layout="rows"] .doc-category-card .doc-list li {
    break-inside: avoid;
}

.docs-scope[data-docs-layout="rows"] .doc-category-card:hover { transform: none; }

/* A category with no published articles still gets a card — archive.php only
   guards the <ul>, not the card — and in a two-column row that left the whole
   right-hand half blank, which reads as a rendering fault rather than as an
   empty section. With nothing to put beside the name, the row is one column. */
.docs-scope[data-docs-layout="rows"] .doc-category-card:not(:has(.doc-list)) {
    grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 860px) {
    .docs-scope[data-docs-layout="rows"] .doc-category-card {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 12px;
    }
    .docs-scope[data-docs-layout="rows"] .doc-category-header,
    .docs-scope[data-docs-layout="rows"] .doc-category-desc,
    .docs-scope[data-docs-layout="rows"] .doc-category-card .doc-list {
        grid-column: 1;
        grid-row: auto;
    }
    .docs-scope[data-docs-layout="rows"] .doc-category-card .doc-list { columns: 1; }
}

@media (max-width: 640px) {
    .docs-scope[data-docs-layout="tiles"] .docs-categories {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* =========================================================
   Single post: Split
   Image beside the title rather than above it. views/posts/single.php
   renders the figure inside .post-hero on this preset (see
   ContentPages::POST_LAYOUTS_HEADER_IMAGE), which is what makes the two
   siblings a grid can pair up.
   ========================================================= */

.posts-scope[data-post-layout="split"] .post-hero.has-hero-image {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: calc(38px * var(--doc-pad));
    max-width: 1180px;
    margin: 0 auto;
    padding: calc(48px * var(--doc-pad)) 20px calc(24px * var(--doc-pad));
    text-align: left;
}

/* The words first in the source and on the left, the picture second: a
   screen reader should reach the title before the decoration. */
.posts-scope[data-post-layout="split"] .post-hero.has-hero-image > .container { order: 1; }
.posts-scope[data-post-layout="split"] .post-hero.has-hero-image .post-featured { order: 2; margin: 0; }

/* Every rule in this block is gated on .has-hero-image, not on the layout
   alone. Split only makes sense when there IS an image to sit beside: a post
   with no featured image — or with the "Featured image at the top" switch off
   — never gets that class, and the ungated version dropped the container's
   max-width AND its side padding, so the title ran from one edge of the
   viewport to the other with nothing holding it in. Without the class the
   header simply stays the ordinary centred one. */
.posts-scope[data-post-layout="split"] .post-hero.has-hero-image > .container {
    max-width: none;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
}

.posts-scope[data-post-layout="split"] .post-hero .post-featured img {
    max-height: 440px;
    object-fit: cover;
}

.posts-scope[data-post-layout="split"] .post-hero.has-hero-image .post-meta,
.posts-scope[data-post-layout="split"] .post-hero.has-hero-image .post-hero-terms { justify-content: flex-start; }

/* The header bloom is behind a two-column block now, so it belongs behind
   the whole width rather than centred on a title that is no longer centred. */
.posts-scope[data-post-layout="split"] .post-hero.has-hero-image::before {
    background: radial-gradient(70% 90% at 25% 10%,
        color-mix(in srgb, var(--doc-accent, #8B5CF6) 14%, transparent) 0%,
        transparent 70%);
}

/* With a header card the two columns need the card's padding back, or the
   words sit flush against its edge. */
.posts-scope[data-hero-card][data-post-layout="split"] .post-hero.has-hero-image > .container {
    padding: calc(34px * var(--doc-pad));
    max-width: none;
}

@media (max-width: 860px) {
    .posts-scope[data-post-layout="split"] .post-hero.has-hero-image {
        grid-template-columns: minmax(0, 1fr);
        gap: calc(24px * var(--doc-pad));
        text-align: center;
    }
    .posts-scope[data-post-layout="split"] .post-hero.has-hero-image .post-featured { order: 0; }
    .posts-scope[data-post-layout="split"] .post-hero.has-hero-image .post-meta,
    .posts-scope[data-post-layout="split"] .post-hero.has-hero-image .post-hero-terms { justify-content: center; }
}

/* =========================================================
   Category page shell — was inline styles in views/docs/category.php,
   which no look or theme could reach.
   ========================================================= */
.doc-cat-search,
.doc-cat-container { max-width: 860px; }
.doc-cat-search .docs-search { margin-top: 22px; }
.doc-cat-body { padding-bottom: 64px; }
.doc-cat-crumbs { margin: 26px 0 30px; }

/* ---- Per-post extras (models/PostOptions.php) ---- */
.post-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--doc-accent, #8B5CF6);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.5;
}
.post-badge.is-card { align-self: flex-start; margin: 10px 0 -2px; }
.posts-scope .post-subtitle {
    max-width: 60ch;
    margin: 0 auto 16px;
    color: var(--doc-ink-3);
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    line-height: 1.55;
    text-wrap: balance;
}
