/*
Theme Name: Trackr Live
Theme URI: https://www.trackr.live
Author: Robert Weber
Author URI: https://github.com/CyberSecDef
Description: Warm-paper editorial theme for Trackr.Live — cybersecurity, AI, forensics, and software-development long-form writing. Ports the Cyber Trackr design system (Fraunces + IBM Plex, oxblood-on-cream light + amber-on-near-black dark, with a subtle paper-grain overlay). Self-hosted variable fonts, light/dark toggle with prefers-color-scheme fallback, and an accessible top-nav layout shell. No frameworks — Bootstrap and jQuery are intentionally not loaded.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: trackr-live
Tags: blog, two-columns, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, dark-mode

Self-hosted variable fonts (Fraunces, IBM Plex Sans, IBM Plex Mono) live in
assets/fonts/. Design system originates from cyber.trackr.live, ported to the
classic-theme template hierarchy for trackr.live.
*/

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

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

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

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

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

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

/*
 *
 *
 * Sections:
 *   0. Design tokens          (light + dark themes, spacing, radius, severity, freshness)
 *   1. Base / shell
 *   2. Detail-page typography (legacy — hardcoded colors retained until Group 4)
 *   3. List-table compact     (legacy)
 *   4. Print
 *
 * Future additions per TODO.md:
 *   - Typography utilities (§1.3 — Fraunces, IBM Plex)
 *   - Component layer       (§2.x — .ident, .sev, .sev-bar, .dot, .chip, .tile)
 *   - Layout shell           (§3.x — header, footer, atmospheric)
 */


/* =============================================================================
 * 0. Design tokens
 *    Light theme on :root; dark theme via [data-theme="dark"] on <html>.
 *    Never hardcode color values in components — always reference tokens.
 * ========================================================================== */

:root {
    /* Surface & text — warm paper aesthetic */
    --bg:             #f4efe2;
    --surface:        #fbf8ee;
    --surface-2:      #ebe3cd;
    --text:           #1a1612;
    --text-muted:     #6f655a;
    --border:         #d8cdb1;
    --border-strong:  #b5a684;
    --accent:         #7a1e1e;
    --accent-hover:   #5e1414;

    /* Severity (DISA convention) */
    --sev-high:       #9a1a1a;
    --sev-med:        #a86415;
    --sev-low:        #1f4f8c;

    /* Freshness — STIG age indicators */
    --fresh:          #3d6b3d;
    --stale:          #a86415;
    --aged:           #8a3a1a;
    --old:            #6f655a;

    /* Spacing scale (4-based, strict) */
    --space-1:        4px;
    --space-2:        8px;
    --space-3:        12px;
    --space-4:        16px;
    --space-5:        24px;
    --space-6:        32px;
    --space-7:        48px;
    --space-8:        64px;
    --space-9:        80px;
    --space-10:       112px;

    /* Border-radius scale */
    --radius-sm:      2px;   /* chips, sev pills */
    --radius-md:      3px;   /* idents, kbd */
    --radius-lg:      4px;   /* buttons, inputs */
    --radius-xl:      6px;   /* tiles, cards */
}

[data-theme="dark"] {
    --bg:             #15120c;
    --surface:        #1d1912;
    --surface-2:      #2a2418;
    --text:           #ece2c8;
    --text-muted:     #968870;  /* WCAG AA on both --bg and --surface */
    --border:         #2e2820;
    --border-strong:  #4a3f2c;
    --accent:         #d4a04a;   /* warm amber */
    --accent-hover:   #e8b85a;

    --sev-high:       #e85d5d;
    --sev-med:        #d4a04a;
    --sev-low:        #6ba3d0;

    --fresh:          #7ab57a;
    --stale:          #d4a04a;
    --aged:           #d4763a;
    --old:            #6e6452;
}

::selection {
    background: color-mix(in srgb, var(--accent) 30%, transparent);
    color: var(--text);
}

/* Global focus ring — :focus-visible keeps it off mouse clicks, only shows
   on keyboard navigation. Anything that has its own focus styling above
   (form inputs, .site-search, etc.) overrides this with their own rule. */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Element that already has a strong border + box-shadow focus state should
   suppress the global outline so the two don't fight. */
.hero-search:focus-within :focus-visible,
.site-search:focus-within :focus-visible,
.form-field input:focus-visible,
.form-field textarea:focus-visible,
.versions-panel__controls select:focus-visible,
#recent-stigs-q:focus-visible,
#stig-q:focus-visible,
#scap-q:focus-visible {
    outline: none;
}


/* =============================================================================
 * 0a. Typography utilities
 *    Three typefaces are loaded from Google Fonts in base.html.twig:
 *      - Fraunces (display, with opsz + SOFT axes)
 *      - IBM Plex Sans (UI body)
 *      - IBM Plex Mono (identifiers, labels, numerics)
 * ========================================================================== */

.font-display {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-variation-settings: "opsz" 144, "SOFT" 30;
    letter-spacing: -0.025em;
}

.font-display-italic {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-variation-settings: "opsz" 144, "SOFT" 100;
    letter-spacing: -0.025em;
}

.font-mono {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.eyebrow {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
}


/* =============================================================================
 * 0b. Component layer — Identifiers
 *    .ident wraps every technical identifier across the site:
 *    STIG version strings (V2R7), RMF control IDs (AC-2), CCI numbers
 *    (CCI-000196), rule IDs, vuln IDs, SRG references.
 *    Use via the {{ ui.ident(value) }} macro in templates/macros.html.twig.
 * ========================================================================== */

.ident {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.84em;
    font-weight: 500;
    padding: 0.1em 0.42em;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    letter-spacing: -0.01em;
    white-space: nowrap;
}


/* =============================================================================
 * 0c. Component layer — Severity
 *    .sev for static severity labels, e.g., {{ ui.sev('high', 30) }} → "H · 30"
 *    .sev.is-filter for interactive filter buttons (with .active toggle).
 *    Color is the severity token directly; bg/border via color-mix.
 * ========================================================================== */

.sev {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.04em;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    white-space: nowrap;
}

.sev.high {
    color: var(--sev-high);
    background: color-mix(in srgb, var(--sev-high) 10%, transparent);
    border-color: color-mix(in srgb, var(--sev-high) 35%, transparent);
}

.sev.med {
    color: var(--sev-med);
    background: color-mix(in srgb, var(--sev-med) 10%, transparent);
    border-color: color-mix(in srgb, var(--sev-med) 35%, transparent);
}

.sev.low {
    color: var(--sev-low);
    background: color-mix(in srgb, var(--sev-low) 10%, transparent);
    border-color: color-mix(in srgb, var(--sev-low) 35%, transparent);
}

/* Reset native button chrome when .sev is used on a <button> element */
button.sev {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

/* Interactive filter variant: dims when inactive, full color when active */
.sev.is-filter {
    padding: 4px 10px;
    font-size: 12px;
    user-select: none;
    transition: opacity 0.15s ease;
}

.sev.is-filter:not(.active) {
    opacity: 0.4;
}

.sev.is-filter:hover {
    opacity: 1;
}


/* =============================================================================
 * 0d. Component layer — Severity bar
 *    Proportional 96×5 strip showing high/med/low rule mix at a glance.
 *    Use via {{ ui.sev_bar(high, med, low) }} — widths set inline as %.
 * ========================================================================== */

.sev-bar {
    display: inline-flex;
    height: 5px;
    width: 96px;
    border-radius: 1px;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
    vertical-align: middle;
}

.sev-bar > .h {
    background: var(--sev-high);
}

.sev-bar > .m {
    background: var(--sev-med);
}

.sev-bar > .l {
    background: var(--sev-low);
}


/* =============================================================================
 * 0e. Component layer — Freshness dot
 *    7×7 colored circle paired with a relative-time label everywhere
 *    a date appears. Use via {{ ui.freshness(date) }}.
 *      .fresh ≤ 1 yr — green with subtle glow
 *      .stale 1–3 yr — amber, no glow
 *      .aged  3–5 yr — burnt orange, no glow
 *      .old   > 5 yr — gray, dimmed
 * ========================================================================== */

.dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    vertical-align: baseline;
}

.dot.fresh {
    background: var(--fresh);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--fresh) 18%, transparent);
}

.dot.stale {
    background: var(--stale);
}

.dot.aged {
    background: var(--aged);
}

.dot.old {
    background: var(--old);
    opacity: 0.5;
}

.freshness {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12.5px;
    white-space: nowrap;
}


/* =============================================================================
 * 0f. Component layer — Filter chip
 *    Used for filter tags, query suggestions, category filters, and small
 *    radio-style multi-choice groups (sort options, age buckets).
 *    .chip-group wraps a row with consistent spacing.
 *    .scroll-x is a mobile-friendly horizontal scroll container that
 *    hides its scrollbar — pair with .chip-group on narrow viewports.
 * ========================================================================== */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12.5px;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.chip:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

.chip.active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

button.chip {
    appearance: none;
    -webkit-appearance: none;
}

/* Touch-target bump — chips are small for fingers on mobile. */
@media (max-width: 767.98px) {
    .chip {
        min-height: 36px;
        padding: 8px 14px;
    }
}

.chip-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.scroll-x {
    overflow-x: auto;
    scrollbar-width: none;
}

.scroll-x::-webkit-scrollbar {
    display: none;
}


/* =============================================================================
 * 0g. Component layer — Navigation tile
 *    Card-shaped clickable region used in the homepage browse grid.
 *    Composes with Bootstrap col-* utilities for span; pair with the
 *    Bootstrap Icons "bi bi-arrow-up-right" inside .tile-arrow for the
 *    spec's top-right indicator.
 *
 *    Hover effects (gated on prefers-reduced-motion will come in §15):
 *      - 2px translate-up + accent border
 *      - bottom 2px underline reveal (scaleX 0 → 1, left origin)
 *      - tile-arrow nudges (2px, -2px)
 *
 *    Tile content can use .eyebrow + .font-display freely. The base
 *    rule keeps the link's text color neutral (--text) on hover so
 *    only the border, underline, and arrow signal interactivity.
 * ========================================================================== */

.tile {
    position: relative;
    display: block;
    overflow: hidden;
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

a.tile,
a.tile:hover {
    color: var(--text) !important;
    text-decoration: none;
}

.tile:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.tile::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tile:hover::after {
    transform: scaleX(1);
}

.tile-arrow {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    color: var(--accent);
    font-size: 20px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.tile:hover .tile-arrow {
    transform: translate(2px, -2px);
}

.tile-meta {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    color: var(--text-muted);
}


/* =============================================================================
 * 1. Base / shell
 * ========================================================================== */

html {
    min-height: 100%;
}

body {
    font-family: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-feature-settings: 'ss02' on, 'ss03' on;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
}

a {
    color: var(--accent) !important;
}

a:hover {
    color: var(--accent-hover) !important;
}

/* .logo-text is still used by home/index.html.twig — will be replaced when
   that page gets the hero treatment in §4.1. */
.logo-text {
    font-family: "Linux Libertine", Georgia, Times, serif;
}

/* Override Bootstrap's hardcoded bg-light (#f8f9fa cool near-white) so it
   matches our theme tokens instead of clashing with the warm cream page in
   light mode and producing light-text-on-light-bg in dark mode. Used on the
   metadata <dl> panels in stig/scap/rmf detail templates. */
.bg-light {
    background-color: var(--surface) !important;
    color: var(--text);
}

/* Same idea for Bootstrap's neutral border — use our --border token so the
   cool gray (#dee2e6) doesn't clash with the warm palette. */
.border,
.border-1 {
    border-color: var(--border) !important;
}


/* =============================================================================
 * 1a. Layout shell — Skip link, sticky header, main
 *    Replaces the old 4-quadrant grid (sidebar + body) with a sticky
 *    horizontal nav over a centered main column. Footer comes in §3.3.
 * ========================================================================== */

.skip-link {
    position: absolute;
    left: var(--space-2);
    top: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--text);
    color: var(--bg) !important;
    border-radius: var(--radius-lg);
    text-decoration: none !important;
    transform: translateY(-200%);
    transition: transform 0.15s ease;
    z-index: 1000;
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none !important;
    color: var(--text) !important;
    flex-shrink: 0;
}

.site-brand__label {
    display: none;
    flex-direction: column;
    line-height: 1.15;
}

@media (min-width: 576px) {
    .site-brand__label {
        display: flex;
    }
}

.site-brand__name {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text);
}

.site-brand__tagline {
    font-size: 13px;
    color: var(--text-muted);
}

/* Concentric "seal" monogram badge — left-most element of the brand */
.seal {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--text);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: -0.02em;
    color: var(--text);
    user-select: none;
}

.seal::before,
.seal::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.seal::before {
    inset: 3px;
    border: 1px solid var(--text);
    opacity: 0.45;
}

.seal::after {
    inset: 6px;
    border: 1px dashed var(--text);
    opacity: 0.3;
}

/* Center cluster: primary nav.
 * Hidden below lg (replaced by .nav-toggle hamburger). The actual flex
 * row lives on .site-nav__list so the WordPress walker can wrap items
 * in a real <ul> for accessibility (and so submenus can position
 * themselves relative to their parent <li>). */
.site-nav {
    display: none;
    flex: 1;
    justify-content: center;
    font-size: 14px;
}

@media (min-width: 992px) {
    .site-nav {
        display: flex;
    }
}

.site-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.site-nav__item {
    position: relative;
}

.site-nav__item > a {
    color: var(--text) !important;
    text-decoration: none !important;
    transition: color 0.15s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.site-nav__item > a:hover,
.site-nav__item > a:focus-visible,
.site-nav__item.is-current > a,
.site-nav__item.is-ancestor > a {
    color: var(--accent) !important;
}

.site-nav__caret {
    font-size: 10px;
    line-height: 1;
    opacity: 0.55;
    transition: transform 0.15s ease, opacity 0.15s ease;
    display: inline-block;
}

.site-nav__item.has-children:hover > a .site-nav__caret,
.site-nav__item.has-children:focus-within > a .site-nav__caret {
    transform: rotate(180deg);
    opacity: 1;
}

/* Submenu panels — depth 1 drops *below* the trigger; deeper levels fly out
 * to the right. Hidden via opacity/visibility so the transition is smooth
 * and so :focus-within stays meaningful for keyboard users. */
.site-nav__submenu {
    list-style: none;
    margin: 0;
    padding: var(--space-2) 0;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}

[data-theme="dark"] .site-nav__submenu {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
}

.site-nav__item:hover > .site-nav__submenu,
.site-nav__item:focus-within > .site-nav__submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
}

/* Invisible bridge so the cursor can cross the 8px gap between the trigger
 * and the dropdown without losing :hover. */
.site-nav__submenu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.site-nav__submenu .site-nav__item {
    display: block;
}

.site-nav__submenu .site-nav__item > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4);
    font-size: 13px;
    white-space: nowrap;
    border-radius: 0;
}

.site-nav__submenu .site-nav__item > a:hover,
.site-nav__submenu .site-nav__item > a:focus-visible {
    background: var(--surface-2);
}

/* Sub-submenu (depth >= 2): flyout to the right of the parent panel. */
.site-nav__submenu .site-nav__submenu {
    top: calc(-1 * var(--space-2));
    left: 100%;
    margin-left: 4px;
}

.site-nav__submenu .site-nav__submenu::before {
    top: 0;
    left: -8px;
    right: auto;
    width: 8px;
    height: 100%;
}

/* Hamburger toggle — visible only below lg where the inline nav hides. */
.nav-toggle {
    /* uses .icon-btn structure from §2e */
}

@media (min-width: 992px) {
    .nav-toggle {
        display: none !important;
    }
}

/* Mobile nav: full-width fixed panel under the header when .is-open.
 * Submenus collapse to inline indented lists rather than floating
 * dropdowns — every level is visible so the user doesn't have to fight
 * with hover-equivalent gestures on touch. */
@media (max-width: 991.98px) {
    .site-nav.is-open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border-strong);
        padding: var(--space-3) var(--space-5);
        z-index: 99;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
    }

    .site-nav.is-open .site-nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
    }

    .site-nav.is-open .site-nav__item {
        position: static;
    }

    .site-nav.is-open .site-nav__item > a {
        padding: var(--space-3) 0;
        border-bottom: 1px solid var(--border);
        font-size: 16px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .site-nav.is-open .site-nav__list > .site-nav__item:last-child > a {
        border-bottom: 0;
    }

    /* Submenus inline, indented, no floating panel. */
    .site-nav.is-open .site-nav__submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        border: 0;
        box-shadow: none;
        padding: 0 0 var(--space-2) var(--space-5);
        margin: 0 0 var(--space-2);
        min-width: 0;
        transition: none;
    }

    .site-nav.is-open .site-nav__submenu::before {
        display: none;
    }

    .site-nav.is-open .site-nav__submenu .site-nav__item > a {
        font-size: 14px;
        padding: var(--space-2) 0;
        min-height: 36px;
        border-bottom: 1px dashed var(--border);
    }

    .site-nav.is-open .site-nav__submenu .site-nav__submenu {
        padding-left: var(--space-4);
    }

    /* Caret stays helpful but doesn't rotate (panel is always open). */
    .site-nav.is-open .site-nav__caret {
        transform: none !important;
        opacity: 0.7;
    }
}

/* Right cluster: search + theme toggle */
.site-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    margin-left: auto;
}

@media (min-width: 992px) {
    .site-actions {
        margin-left: 0;
    }
}

.site-search {
    display: none;
    align-items: center;
    gap: var(--space-2);
    height: 36px;
    padding: 0 var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    transition: border-color 0.15s ease;
}

.site-search:focus-within {
    border-color: var(--accent);
}

.site-search__input {
    appearance: none;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--text);
    font-size: 13px;
    width: 180px;
}

.site-search__input::placeholder {
    color: var(--text-muted);
}

@media (min-width: 768px) {
    .site-search {
        display: inline-flex;
    }
}

kbd, .site-search__kbd {
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10.5px;
    color: var(--text-muted);
    line-height: 1.4;
}

.theme-toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
    font-size: 16px;
    line-height: 1;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Show moon in light mode (= "switch to dark"), sun in dark mode. */
.theme-toggle [data-theme-icon="show-in-dark"] {
    display: none;
}

[data-theme="dark"] .theme-toggle [data-theme-icon="show-in-light"] {
    display: none;
}

[data-theme="dark"] .theme-toggle [data-theme-icon="show-in-dark"] {
    display: inline-flex;
}

.site-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-5);
}


/* =============================================================================
 * 1b. Atmospheric — Paper grain overlay
 *    Apply class="grain" on <body>. The ::before pseudo-element covers the
 *    viewport with a fixed SVG fractal-noise layer; pointer-events: none lets
 *    clicks fall through to real content. z-index sits above the sticky
 *    header (z:100) so the texture stays continuous across the chrome.
 *
 *    Light: multiply blend mode darkens the cream in random flecks (printed
 *    paper feel). Dark: screen mode lightens the near-black with speckle.
 *    Noise SVG is inlined as a data URI to avoid an extra network request.
 * ========================================================================== */

.grain::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 200;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='5'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.5;
    mix-blend-mode: multiply;
}

[data-theme="dark"] .grain::before {
    mix-blend-mode: screen;
    opacity: 0.18;
}


/* =============================================================================
 * 1c. Atmospheric — Section divider with eyebrow
 *    <div class="rule-text">§ II · Recent Updates</div>
 *    Renders a 1px line on each side of the eyebrow text. Use between
 *    long-page sections.
 * ========================================================================== */

.rule-text {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-6) 0;
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
}

.rule-text::before,
.rule-text::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-strong);
}


/* =============================================================================
 * 1d. Layout shell — Footer
 *    4-column grid + bottom strip with mini-seal and italic tagline.
 *    Status column uses .dot for the operational indicator and mono lines
 *    for the DISA / NIST sync timestamps.
 * ========================================================================== */

.site-footer {
    border-top: 1px solid var(--border);
    margin-top: var(--space-9);
    padding: var(--space-7) 0 var(--space-5);
}

.site-footer__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.site-footer__columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
    margin-bottom: var(--space-7);
}

@media (min-width: 768px) {
    .site-footer__columns {
        grid-template-columns: repeat(4, 1fr);
    }
}

.site-footer__heading {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    margin: 0 0 var(--space-4) 0;
}

.site-footer__links,
.site-footer__status {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer__links li {
    margin-bottom: 10px;
    font-size: 13.5px;
}

.site-footer__links a {
    color: var(--text) !important;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

.site-footer__links a:hover {
    color: var(--accent) !important;
}

.site-footer__links a[aria-disabled="true"] {
    color: var(--text-muted) !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.site-footer__status li {
    margin-bottom: 8px;
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.site-footer__strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border);
}

.site-footer__strip-left {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.site-footer__strip-right {
    font-size: 14px;
    color: var(--text-muted);
}

/* Smaller seal variant for the footer strip */
.seal--small {
    width: 28px;
    height: 28px;
    font-size: 10px;
    border-width: 1px;
}

.seal--small::before {
    inset: 2px;
}

.seal--small::after {
    inset: 4px;
}


/* =============================================================================
 * 1e. Animation — .rise entrance + delay utilities (§5.3)
 *    Wrapped in prefers-reduced-motion: no-preference so motion-sensitive
 *    users get an immediate, animation-free reveal.
 * ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
    @keyframes rise {
        from { opacity: 0; transform: translateY(10px); }
        to   { opacity: 1; transform: translateY(0);   }
    }

    .rise {
        animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    }

    .delay-1 { animation-delay: 0.05s; }
    .delay-2 { animation-delay: 0.15s; }
    .delay-3 { animation-delay: 0.25s; }
    .delay-4 { animation-delay: 0.35s; }
    .delay-5 { animation-delay: 0.45s; }
}


/* =============================================================================
 * 2a. Page — Homepage hero
 *    Replaces the legacy 'Welcome to Cyber Trackr' Bootstrap card. Stamp +
 *    issue line, massive Fraunces headline with italic accent phrase,
 *    Fraunces subhead, hero search, "Try" chip row, trust strip with sync
 *    dots and dataset counts.
 * ========================================================================== */

.hero {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--space-9) 0 var(--space-7);
}

.hero__top {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-7);
}

.stamp {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 9.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
}

.hero__issue {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
}

.hero__headline {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-variation-settings: "opsz" 144, "SOFT" 30;
    font-weight: 300;
    font-size: clamp(48px, 9vw, 112px);
    line-height: 0.92;
    letter-spacing: -0.04em;
    color: var(--text);
    margin: 0 0 var(--space-5);
    max-width: 14ch;
}

@media (max-width: 575.98px) {
    .hero__headline {
        max-width: none;
    }
}

.hero__headline em {
    font-style: italic;
    font-variation-settings: "opsz" 144, "SOFT" 100;
    color: var(--accent);
}

.hero__subhead {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 17px;
    line-height: 1.5;
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 0 var(--space-6);
}

.hero-search {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: 64px;
    max-width: 760px;
    margin: 0 0 var(--space-5);
    padding: 0 var(--space-5);
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-lg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hero-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.hero-search__icon {
    font-size: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.hero-search__input {
    flex: 1;
    appearance: none;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--text);
    font-size: 16px;
    height: 100%;
    min-width: 0;
}

.hero-search__input::placeholder {
    color: var(--text-muted);
}

.hero__try {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-7);
    flex-wrap: wrap;
}

.hero__try-label {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    flex-shrink: 0;
}

.hero__trust {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    flex-wrap: wrap;
    padding-top: var(--space-5);
    border-top: 1px solid var(--border);
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.hero__trust-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}


/* =============================================================================
 * 2b. Page — Homepage tile grid
 *    12-column CSS Grid with .span-N utilities. Stacks to single column
 *    below md, transitions through md (6-cols-or-12), settles at 12-col on lg.
 *    Tiles auto-flow rows; spans must sum to 12 per row at the lg breakpoint.
 * ========================================================================== */

.tile-grid {
    max-width: 1280px;
    margin: 0 auto var(--space-9);
}

.tile-grid__inner {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-4);
}

/* Below md: every tile spans the full 12 cols (single column stack). */
@media (max-width: 767.98px) {
    .tile-grid__inner > * {
        grid-column: span 12;
    }
}

/* Spans target the lg layout. Reset to 6 on md for the half-width tiles
   so the row 2 (r4 + CCIs) and row 3 (SCAP + API) pair cleanly. */
.span-3 { grid-column: span 12; }
.span-4 { grid-column: span 12; }
.span-5 { grid-column: span 12; }
.span-6 { grid-column: span 12; }
.span-7 { grid-column: span 12; }

@media (min-width: 768px) {
    .span-3, .span-4 { grid-column: span 6; }
    .span-6 { grid-column: span 6; }
}

@media (min-width: 992px) {
    .span-3 { grid-column: span 3; }
    .span-4 { grid-column: span 4; }
    .span-5 { grid-column: span 5; }
    .span-6 { grid-column: span 6; }
    .span-7 { grid-column: span 7; }
}

/* Tile content typography — Fraunces title with italic accent variant. */
.tile-title {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-variation-settings: "opsz" 144, "SOFT" 30;
    letter-spacing: -0.025em;
    font-size: 28px;
    line-height: 1.05;
    font-weight: 400;
    margin: var(--space-3) 0;
    color: var(--text);
}

.tile-title em {
    font-style: italic;
    font-variation-settings: "opsz" 144, "SOFT" 100;
    color: var(--accent);
}

/* Tall variant — STIGs hero tile. Flex column pushes meta to bottom. */
.tile--tall {
    min-height: 260px;
    display: flex;
    flex-direction: column;
}

.tile--tall .tile-title {
    font-size: clamp(40px, 5vw, 56px);
    line-height: 1;
    margin: var(--space-4) 0 var(--space-3);
}

.tile--tall .tile-meta {
    margin-top: auto;
}


/* =============================================================================
 * 2c. Page — Homepage "Recent updates" managed table
 *    Custom-managed (no DataTables) so the visual matches spec exactly.
 *    Sticky mono headers, sortable columns with aria-sort, row hover,
 *    text + age chip filters, legend row, footer with paging label.
 * ========================================================================== */

.lib-page {
    max-width: 1280px;
    margin: 0 auto var(--space-9);
}

/* Page-header variant — used on dedicated library pages (/stig, /scap, etc.). */
.lib-page__header {
    margin-bottom: var(--space-6);
}

.lib-page__title-large {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-variation-settings: "opsz" 144, "SOFT" 30;
    letter-spacing: -0.025em;
    font-size: clamp(40px, 6vw, 64px);
    line-height: 1;
    font-weight: 300;
    margin: var(--space-2) 0 var(--space-3);
    color: var(--text);
}

.lib-page__title-large em {
    font-style: italic;
    font-variation-settings: "opsz" 144, "SOFT" 100;
    color: var(--accent);
}

.lib-page__lede {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 17px;
    line-height: 1.5;
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 0 var(--space-6);
}

.lib-page__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-5);
    margin-bottom: var(--space-4);
}

.lib-page__head {
    flex: 1 1 auto;
    min-width: 240px;
}

.lib-page__title {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-variation-settings: "opsz" 144, "SOFT" 30;
    letter-spacing: -0.025em;
    font-size: 32px;
    line-height: 1;
    font-weight: 400;
    margin: var(--space-2) 0 0;
    color: var(--text);
}

.lib-page__title em {
    font-style: italic;
    font-variation-settings: "opsz" 144, "SOFT" 100;
    color: var(--accent);
}

.lib-page__filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

#recent-stigs-q {
    appearance: none;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    height: 36px;
    padding: 0 var(--space-3);
    width: 220px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#recent-stigs-q:focus {
    outline: 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

#recent-stigs-q::placeholder {
    color: var(--text-muted);
}

.lib-page__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.lib-page__legend > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}


/* Generic data-table component (reusable for stig/index, scap/index later) */

.data-table-wrap {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--bg);
}

.data-table-scroll {
    max-height: 620px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface);
    text-align: left;
    padding: 12px var(--space-4);
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    border-bottom: 1.5px solid var(--border-strong);
    white-space: nowrap;
}

.data-table thead th[data-sort-key] {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
}

.data-table thead th[data-sort-key]:hover {
    color: var(--accent);
}

.data-table thead th.sorted {
    color: var(--accent);
}

.data-table thead th .sort-ind {
    display: inline-block;
    margin-left: 4px;
    width: 1ch;
    opacity: 0.4;
}

.data-table thead th.sorted .sort-ind {
    opacity: 1;
}

.data-table thead th.num,
.data-table tbody td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-table tbody td {
    padding: 13px var(--space-4);
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr.is-hidden {
    display: none;
}

.data-table tbody tr:hover {
    background: color-mix(in srgb, var(--accent) 5%, transparent);
}

/* Card-view rendering below md: each row stacks as a labeled card.
   Templates supply data-label="..." on every <td> for the row labels.
   Skips the thead and the .data-table-scroll max-height clamp. */
@media (max-width: 767.98px) {
    .data-table-scroll {
        max-height: none;
    }

    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tbody tr,
    .data-table tbody td {
        display: block;
        width: 100%;
    }

    .data-table tbody tr {
        padding: var(--space-3) var(--space-4);
        border-bottom: 1px solid var(--border-strong);
    }

    .data-table tbody tr:hover {
        background: transparent;
    }

    .data-table tbody td {
        padding: 6px 0;
        border-bottom: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: var(--space-3);
        text-align: left;
    }

    .data-table tbody td.num {
        text-align: left;
    }

    .data-table tbody td::before {
        content: attr(data-label);
        font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
        font-size: 10.5px;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.14em;
        color: var(--text-muted);
        flex-shrink: 0;
    }

    .data-table tbody td:not([data-label])::before {
        content: none;
    }
}

.data-table tbody td a {
    color: var(--text) !important;
    text-decoration: none !important;
    font-weight: 500;
    transition: color 0.15s ease;
}

.data-table tbody td a:hover {
    color: var(--accent) !important;
}

/* Severity-mix cell stays on a single line — sev-bar + pills never split.
   Auto table layout will give the column its minimum content width and
   wrap the longer Name column instead. (In card-view below md, each td
   sits on its own row, so wrap-vs-nowrap is irrelevant there.) */
.data-table .sev-mix {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: nowrap;
    white-space: nowrap;
}

.data-table-foot {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border);
    background: var(--surface);
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.data-table-foot a {
    color: var(--accent) !important;
    text-decoration: none !important;
}

.data-table-foot a:hover {
    color: var(--accent-hover) !important;
}

.data-table-foot__pager {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.data-table-foot__pager button {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    cursor: pointer;
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.data-table-foot__pager button:not(:disabled):hover {
    border-color: var(--accent);
    color: var(--accent);
}

.data-table-foot__pager button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


/* =============================================================================
 * 2g. DataTables theming
 *    The CCI list page (and any future export-heavy table) keeps the
 *    DataTables library — these overrides skin its toolbar (filter input,
 *    length select, info row, pagination, export buttons) to the token
 *    palette so it doesn't look like a different aesthetic in the middle
 *    of the page.
 * ========================================================================== */

.dataTables_wrapper {
    color: var(--text);
    font-family: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 4px 10px;
    font-family: inherit;
    font-size: 13px;
    min-height: 32px;
    margin-left: 6px;
    transition: border-color 0.15s ease;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    outline: 0;
    border-color: var(--accent);
}

.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.dataTables_wrapper .dataTables_info {
    padding-top: var(--space-3);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
    font-size: 11px !important;
    padding: 4px 10px !important;
    margin-left: 4px !important;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--surface) !important;
    color: var(--accent) !important;
    border-color: var(--accent) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--text) !important;
    color: var(--bg) !important;
    border-color: var(--text) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    opacity: 0.4;
    color: var(--text-muted) !important;
    border-color: var(--border) !important;
}

/* Export-button toolbar (Buttons extension) */
.dt-buttons {
    display: inline-flex;
    gap: 4px;
    margin-left: var(--space-3);
}

.dt-button {
    appearance: none;
    -webkit-appearance: none;
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-md) !important;
    padding: 4px 10px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
    background-image: none !important;
    box-shadow: none !important;
}

.dt-button:hover {
    background: var(--surface) !important;
    color: var(--accent) !important;
    border-color: var(--accent) !important;
}

/* CCI table — match other .data-table headers (sticky, mono, uppercase). */
#ccis thead th {
    background: var(--surface);
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    border-bottom: 1.5px solid var(--border-strong) !important;
    padding: 12px var(--space-3) !important;
    white-space: nowrap;
}

#ccis tbody td {
    border-bottom: 1px solid var(--border) !important;
    color: var(--text);
    padding: 10px var(--space-3) !important;
    font-size: 13px;
}

#ccis tbody tr:hover {
    background: color-mix(in srgb, var(--accent) 5%, transparent) !important;
}

/* Drop the alternating-stripe pattern — the row hover provides enough cue. */
#ccis tbody tr.odd,
#ccis tbody tr.even {
    background-color: transparent !important;
}


/* =============================================================================
 * 2h. Page — Search results
 *    Replaces the legacy bg-primary-subtle / border-primary Bootstrap
 *    sections with tokenized collapsible blocks.
 * ========================================================================== */

.search-section {
    margin-bottom: var(--space-5);
}

.search-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, color 0.15s ease;
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text);
}

.search-section__header:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.search-section__count {
    color: var(--text-muted);
    font-weight: 500;
}

.search-section__body {
    padding: var(--space-3) var(--space-2);
}

.search-section__item {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
}

.search-section__item:last-child {
    border-bottom: 0;
}

.search-section__item-title {
    font-size: 15px;
    color: var(--text);
    margin-bottom: var(--space-2);
}

.search-section__item-title a {
    color: var(--text) !important;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

.search-section__item-title a:hover {
    color: var(--accent) !important;
}

.search-section__excerpt {
    max-height: 10rem;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
}

.search-section__excerpt strong {
    color: var(--accent);
    font-weight: 500;
}

.search-section__meta {
    margin-bottom: var(--space-2);
    font-size: 13px;
}

.search-query {
    margin-bottom: var(--space-6);
    padding: var(--space-4) var(--space-5);
    background: var(--surface);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
}

.search-query__label {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}

.search-query__value {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-variation-settings: "opsz" 144, "SOFT" 30;
    letter-spacing: -0.025em;
    font-size: 24px;
    line-height: 1.2;
    color: var(--text);
}


/* =============================================================================
 * 0k. Component layer — Form fields
 *    Generic stacked label + input + textarea for any form on the site.
 * ========================================================================== */

.form-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-width: 640px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="search"],
.form-field input[type="url"],
.form-field textarea,
.form-field select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 10px var(--space-3);
    font-family: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.form-field textarea {
    min-height: 8rem;
    resize: vertical;
    font-family: inherit;
}

.form-field__hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-2);
}


/* =============================================================================
 * 2i. Page — Report generator (/report_generator)
 *    Heavy client-side parsing UI. CSS only — JS hooks (every #id and
 *    every onclick) preserved unchanged.
 * ========================================================================== */

.rg-setup {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-5);
    margin-bottom: var(--space-7);
}

@media (min-width: 768px) {
    .rg-setup {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 992px) {
    .rg-setup {
        grid-template-columns: 1.2fr 0.9fr 0.9fr;
        gap: var(--space-6);
    }
}

.rg-setup__col {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-width: 0;
}

.rg-setup__col .eyebrow {
    margin-bottom: var(--space-2);
}

/* In the 3-col layout the .form-stack inside the data-points column needs to
   ignore its 640px max-width so it fills the column. */
.rg-setup__col .form-stack {
    max-width: none;
}

/* The drop area's default state sits on the page bg with a dashed border.
   The JS adds/removes .bg-light on drag-over for visual feedback — paired
   with the global .bg-light override (var(--surface)), the surface tone
   contrasts with the page bg enough to read as "active drop target". */
.rg-drop-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    min-height: 160px;
    padding: var(--space-5);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.rg-drop-area:hover {
    border-color: var(--accent);
}

.rg-drop-area__text {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.rg-alerts {
    margin-top: var(--space-5);
}

.rg-alerts:not(:empty) {
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--sev-high);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 13px;
}

.rg-alerts p {
    margin: 0 0 4px;
}

.rg-alerts p:last-child {
    margin-bottom: 0;
}

/* Switch labels — keep Bootstrap's form-switch widget functional, just lift
   the label typography to our token vocabulary. */
.rg-options__col .form-check {
    margin-bottom: 6px;
}

.rg-options__col .form-check-label {
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
}


/* =============================================================================
 * 2d. Page — Homepage colophon
 *    12-col split with eyebrow + Fraunces heading on the left (cols 1-4)
 *    and pull-quote + body + CTA row on the right (cols 6-12, leaving
 *    column 5 as gutter per spec).
 * ========================================================================== */

.colophon {
    max-width: 1280px;
    margin: 0 auto var(--space-9);
    padding-top: var(--space-7);
}

.colophon__inner {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-4);
    align-items: start;
}

.colophon__left,
.colophon__right {
    grid-column: span 12;
}

@media (min-width: 992px) {
    .colophon__left {
        grid-column: span 4;
    }
    .colophon__right {
        grid-column: 6 / span 7;
    }
}

.colophon__heading {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-variation-settings: "opsz" 144, "SOFT" 30;
    letter-spacing: -0.025em;
    font-size: clamp(36px, 5vw, 52px);
    line-height: 0.95;
    font-weight: 300;
    margin: var(--space-2) 0 0;
    color: var(--text);
}

.colophon__heading em {
    font-style: italic;
    font-variation-settings: "opsz" 144, "SOFT" 100;
    color: var(--accent);
}

.colophon__quote {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 20px;
    line-height: 1.5;
    color: var(--text);
    margin: 0 0 var(--space-5);
}

.colophon__body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0 0 var(--space-5);
}

.colophon__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-5);
}


/* =============================================================================
 * 0i. Component layer — CTA buttons
 *    Distinct from Bootstrap's .btn-primary/.btn-secondary so they don't
 *    collide. Used in the colophon and any future call-to-action context.
 * ========================================================================== */

.cta-primary,
.cta-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 4px 16px;
    border-radius: var(--radius-lg);
    font-family: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none !important;
    transition: opacity 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
}

.cta-primary {
    background: var(--text);
    color: var(--bg) !important;
    border: 1px solid var(--text);
}

.cta-primary:hover {
    opacity: 0.85;
    color: var(--bg) !important;
}

.cta-secondary {
    background: var(--surface);
    color: var(--text) !important;
    border: 1px solid var(--border-strong);
}

.cta-secondary:hover {
    border-color: var(--accent);
    color: var(--accent) !important;
}

.cta-secondary[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
    color: var(--text-muted) !important;
}

.cta-secondary[aria-disabled="true"]:hover {
    border-color: var(--border-strong);
    color: var(--text-muted) !important;
}


/* =============================================================================
 * 2. Detail-page typography (tokenized)
 *    Shared by stig/view, scap/view, rmf/view_v4, rmf/view_v5, home/search.
 *    All hardcoded grays/blacks replaced with --border / --border-strong /
 *    --text-muted. Detail pages dropped .doc-title / .doc-summary in §4.6.
 * ========================================================================== */

.doc-desc {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: var(--space-5);
}

.sec-title {
    font-size: 20px;
    font-weight: 400;
    line-height: 1.25;
    color: var(--text);
    border-bottom: 1px solid var(--border-strong);
    padding-top: var(--space-3);
    margin-bottom: var(--space-2);
}

.sec-header {
    display: block;
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--space-1);
    margin-top: var(--space-4);
    margin-bottom: var(--space-3);
}

.req-header {
    display: block;
    font-size: 15px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding: var(--space-3) 0;
    margin-top: var(--space-5);
}

.req-desc {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text);
    margin-left: var(--space-1);
    padding-bottom: var(--space-5);
}

.requirement {
    border-bottom: 1px solid var(--border);
}

.reference {
    font-size: 12px;
    color: var(--text-muted);
}

.text-justify {
    text-align: justify;
    text-justify: inter-word;
}

.text-sm {
    font-size: 0.75em;
}

.text-md {
    font-size: 0.9em;
}

/* Preserve whitespace + line wrapping in scan output / xpath text dumps. */
.pre-wrap {
    white-space: pre-wrap;
}

/* Clickable italic title for collapsible rule headers (stig/view, scap/view). */
.requirement-title {
    cursor: pointer;
    font-style: italic;
}

/* Tightener — drop leading margin where two paragraphs need to read as one
   block (used by the report-generator lede continuation). */
.u-mt-0 {
    margin-top: 0 !important;
}

dt.inline {
    float: left;
    clear: left;
    width: 110px;
    font-weight: 500;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

dt.inline::after {
    content: ":";
}


/* =============================================================================
 * 2e. Page — STIG (and SCAP) detail
 *    Breadcrumbs, page header (eyebrow + title + meta + actions),
 *    severity stat-cards (clickable filters), versions panel, rule controls.
 *    Rule-card markup is the legacy .req-header / .requirement-details
 *    structure styled via the rules above; new wrappers below provide the
 *    surrounding chrome.
 * ========================================================================== */

.stig-detail {
    max-width: 1280px;
    margin: 0 auto var(--space-9);
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: var(--space-5);
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.breadcrumbs li + li::before {
    content: "›";
    margin-right: var(--space-2);
    color: var(--border-strong);
}

.breadcrumbs a {
    color: var(--text-muted) !important;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

.breadcrumbs a:hover {
    color: var(--accent) !important;
}

.breadcrumbs [aria-current="page"] {
    color: var(--text);
}

/* Page header */
.stig-detail__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.stig-detail__header-text {
    flex: 1 1 auto;
    min-width: 0;
}

.stig-detail__title {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-variation-settings: "opsz" 144, "SOFT" 30;
    letter-spacing: -0.025em;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
    font-weight: 300;
    color: var(--text);
    margin: var(--space-2) 0 var(--space-3);
}

.stig-detail__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stig-detail__actions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.icon-btn {
    appearance: none;
    -webkit-appearance: none;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}


/* =============================================================================
 * 0j. Component layer — Stat card (severity stat-cards on STIG/SCAP detail)
 * ========================================================================== */

.stat-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

@media (min-width: 768px) {
    .stat-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

.stat-card {
    appearance: none;
    -webkit-appearance: none;
    text-align: left;
    cursor: pointer;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: var(--radius-xl);
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    transition: opacity 0.15s ease, border-color 0.15s ease;
}

.stat-card.high { border-left-color: var(--sev-high); }
.stat-card.med  { border-left-color: var(--sev-med); }
.stat-card.low  { border-left-color: var(--sev-low); }

.stat-card:not(.active) {
    opacity: 0.45;
}

.stat-card:hover {
    opacity: 1;
}

.stat-card__num {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-variation-settings: "opsz" 144, "SOFT" 30;
    letter-spacing: -0.02em;
    font-size: 36px;
    line-height: 1;
    font-weight: 400;
    color: var(--text);
}

.stat-card.high .stat-card__num { color: var(--sev-high); }
.stat-card.med  .stat-card__num { color: var(--sev-med); }
.stat-card.low  .stat-card__num { color: var(--sev-low); }

.stat-card__label {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
}


/* =============================================================================
 * 2f. Page — Versions panel and rule-controls bar
 * ========================================================================== */

.versions-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-6);
}

@media (min-width: 768px) {
    .versions-panel {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-6);
    }
}

.versions-panel__col {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.versions-panel__hint {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 var(--space-2);
}

.versions-panel__controls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

.versions-panel__controls select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    height: 36px;
    padding: 0 var(--space-3);
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    cursor: pointer;
    flex: 1 1 120px;
    min-width: 0;
}

.versions-panel__controls select:focus {
    outline: 0;
    border-color: var(--accent);
}

.versions-panel__controls .cta-primary {
    height: 36px;
    padding: 0 var(--space-4);
}

/* Single-column variant — used on SCAP detail (no Compare action, only View). */
.versions-panel--single {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .versions-panel--single {
        grid-template-columns: 1fr;
    }
}

.rule-controls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-5);
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) 0;
    margin-bottom: var(--space-4);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.rule-controls__group {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.rule-controls__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--text);
}


/* =============================================================================
 * 3. List-table compact
 *    Consolidated from inline <style> blocks previously duplicated in
 *    home/index.html.twig, stig/index.html.twig, scap/index.html.twig.
 * ========================================================================== */

#stigs td,
#scaps td,
#ccis td {
    padding: 0 !important;
    font-family: "Linux Libertine", Georgia, Times, serif;
}


/* =============================================================================
 * 4. Print
 *    Used by stig/compare (landscape orientation, hide non-essential UI).
 *    .sidemenu rule will become irrelevant once the sidebar is removed in §3.1.
 * ========================================================================== */

@media print {
    @page {
        size: landscape;
    }

    body {
        font-size: 8pt;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .no-print,
    .no-print *,
    .sidemenu,
    .sidemenu * {
        display: none !important;
    }
}

/* =====================================================================
 * §99 WordPress integration layer
 *
 * Selectors for WP-specific markup that the design system above doesn't
 * cover: post grid + cards (loop), entry typography (single/page), the
 * comments stack, sidebar widgets, pagination, search form, and the
 * Gutenberg block alignments (alignwide / alignfull / alignleft / etc.).
 *
 * Everything here uses the design tokens defined at the top of the file —
 * no hard-coded colors, fonts, or spacing values.
 * ===================================================================== */

/* ---- Font-family aliases ---------------------------------------------
 * The design system above sets font-family inline. We alias the three
 * stacks once here so the WordPress-layer selectors don't have to repeat
 * the lists. */

:root {
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body:    'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ---- Layout: content + sidebar two-column shell ---------------------- */

.content-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: var(--space-8);
    align-items: start;
}

@media (max-width: 960px) {
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }
}

.content-main {
    min-width: 0;
}

.content-sidebar {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.lib-page--narrow {
    max-width: 78ch;
    margin-inline: auto;
}

/* ---- Post grid (home, archive, search) ------------------------------- */

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-6);
}

.post-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.post-card__thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--surface-2);
}

.post-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 240ms ease;
}

.post-card:hover .post-card__thumb img {
    transform: scale(1.03);
}

.post-card__body {
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    flex: 1 1 auto;
}

.post-card__title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.35rem;
    line-height: 1.25;
    margin: 0;
    color: var(--text);
}

.post-card__title a {
    color: inherit;
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0 1px;
    transition: background-size 220ms ease;
}

.post-card:hover .post-card__title a,
.post-card__title a:focus-visible {
    background-size: 100% 1px;
}

.post-card__excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.post-card__excerpt p {
    margin: 0;
}

.post-card__meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    padding-top: var(--space-3);
    border-top: 1px dashed var(--border);
    font-size: 0.825rem;
    color: var(--text-muted);
}

.post-card__comments {
    margin-left: auto;
}

/* ---- Single entry (long-form reading) -------------------------------- */

.entry {
    margin-bottom: var(--space-10);
}

.entry__header {
    margin-bottom: var(--space-6);
}

.entry__title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    line-height: 1.1;
    margin: var(--space-3) 0 var(--space-4);
    color: var(--text);
    letter-spacing: -0.01em;
}

.entry--page .entry__title {
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
}

.entry__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.entry__sep {
    opacity: 0.55;
}

.entry__byline a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
}

.entry__hero {
    margin: 0 0 var(--space-7);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.entry__hero img {
    width: 100%;
    height: auto;
    display: block;
}

.entry__content {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text);
}

.entry__content > * + * {
    margin-top: var(--space-5);
}

.entry__content h2,
.entry__content h3,
.entry__content h4 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.25;
    color: var(--text);
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
}

.entry__content h2 { font-size: 1.75rem; letter-spacing: -0.005em; }
.entry__content h3 { font-size: 1.4rem; }
.entry__content h4 { font-size: 1.15rem; }

.entry__content p { margin: 0; }

.entry__content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
}

.entry__content a:hover {
    text-decoration-thickness: 2px;
}

.entry__content blockquote {
    margin: 0;
    padding: var(--space-4) var(--space-6);
    border-left: 3px solid var(--accent);
    background: var(--surface-2);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--text);
}

.entry__content blockquote p { margin: 0; }
.entry__content blockquote cite {
    display: block;
    margin-top: var(--space-2);
    font-family: var(--font-body);
    font-style: normal;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.entry__content ul,
.entry__content ol {
    padding-left: 1.5em;
}

.entry__content li + li {
    margin-top: var(--space-2);
}

.entry__content code,
.entry__content kbd,
.entry__content samp {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--surface-2);
    padding: 0.12em 0.4em;
    border-radius: 4px;
}

.entry__content pre {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.55;
    background: var(--surface-2);
    color: var(--text);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.entry__content pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.entry__content img,
.entry__content figure {
    max-width: 100%;
    height: auto;
}

.entry__content figure {
    margin: 0;
}

.entry__content figcaption {
    margin-top: var(--space-2);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

.entry__content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.entry__content th,
.entry__content td {
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.entry__content th {
    font-family: var(--font-display);
    font-weight: 500;
}

.entry__content hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: var(--space-7) 0;
}

.entry__page-links {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    margin-top: var(--space-5);
    font-size: 0.9rem;
}

.entry__footer {
    margin-top: var(--space-7);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.entry__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

.entry__tags .ident {
    text-decoration: none;
}

.entry__tags .eyebrow {
    margin-right: var(--space-2);
}

.entry__nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.entry__nav-prev a,
.entry__nav-next a {
    display: block;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1rem;
    transition: background 160ms ease, border-color 160ms ease;
}

.entry__nav-next {
    text-align: right;
}

.entry__nav-prev a:hover,
.entry__nav-next a:hover {
    background: var(--surface-2);
    border-color: var(--text-muted);
}

@media (max-width: 600px) {
    .entry__nav {
        grid-template-columns: 1fr;
    }
    .entry__nav-next {
        text-align: left;
    }
}

/* ---- WordPress block alignments -------------------------------------- */

.alignleft  { float: left;  margin: var(--space-2) var(--space-5) var(--space-4) 0; }
.alignright { float: right; margin: var(--space-2) 0 var(--space-4) var(--space-5); }
.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.entry__content > .alignwide,
.entry__content > .wp-block-image.alignwide,
.entry__content > .wp-block-gallery.alignwide {
    margin-inline: calc(-1 * var(--space-6));
    max-width: calc(100% + var(--space-6) * 2);
}
.entry__content > .alignfull,
.entry__content > .wp-block-image.alignfull {
    margin-inline: calc(50% - 50vw);
    max-width: 100vw;
    width: 100vw;
}

.wp-caption,
.wp-block-image figcaption {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: var(--bg);
    clip: auto !important;
    clip-path: none;
    color: var(--text);
    display: block;
    font-size: 1rem;
    height: auto;
    left: var(--space-3);
    padding: var(--space-2) var(--space-3);
    position: absolute;
    top: var(--space-3);
    width: auto;
    z-index: 100000;
    text-decoration: none;
}

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

.pagination,
.nav-links,
.comments .nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-7);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.pagination .nav-links {
    margin-top: 0;
}

.pagination a,
.pagination .page-numbers,
.nav-links a,
.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    text-decoration: none;
    transition: background 160ms ease, border-color 160ms ease;
}

.pagination a:hover,
.nav-links a:hover {
    background: var(--surface-2);
    border-color: var(--text-muted);
}

.pagination .current,
.nav-links .current {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.pagination .dots,
.nav-links .dots {
    border: 0;
    color: var(--text-muted);
}

/* ---- Sidebar widgets ------------------------------------------------- */

.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    color: var(--text);
}

.widget + .widget {
    /* gap is on the parent, but if widgets are siblings outside the sidebar
       wrapper this keeps spacing predictable */
    margin-top: 0;
}

.widget__title {
    margin: 0 0 var(--space-3);
}

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

.widget li {
    padding: var(--space-2) 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.95rem;
}

.widget li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.widget li:first-child {
    padding-top: 0;
}

.widget a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px dotted transparent;
}

.widget a:hover {
    border-bottom-color: var(--text-muted);
}

.widget--placeholder {
    background: transparent;
    border-style: dashed;
    color: var(--text-muted);
}

.widget__placeholder-text {
    margin: 0;
    font-size: 0.9rem;
}

/* tag cloud override — the WP defaults set inline px font sizes which clash
 * with our type ramp; use ident pills instead */
.widget .tagcloud a {
    display: inline-block;
    padding: 0.2em 0.55em;
    margin: 0.15em 0.2em 0.15em 0;
    font-family: var(--font-mono);
    font-size: 0.825rem !important;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    text-decoration: none;
    line-height: 1;
}

.widget .tagcloud a:hover {
    background: var(--surface-2);
    border-color: var(--text-muted);
}

.widget .search-form,
.widget_search .search-form {
    margin: 0;
}

/* ---- Reusable search form (sidebar/404) ------------------------------ */

.search-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.search-form__label {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.search-form__row {
    display: flex;
    gap: var(--space-2);
}

.search-form__input {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.search-form__input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

/* ---- Comments -------------------------------------------------------- */

.comments {
    margin-top: var(--space-9);
    padding-top: var(--space-7);
    border-top: 1px solid var(--border);
}

.comments__header {
    margin-bottom: var(--space-5);
}

.comments__title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.6rem;
    margin: var(--space-2) 0 0;
    color: var(--text);
}

.comments__list {
    list-style: none;
    margin: 0 0 var(--space-7);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.comments__list .children {
    list-style: none;
    margin: var(--space-4) 0 0;
    padding-left: var(--space-5);
    border-left: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.comments__closed {
    color: var(--text-muted);
    font-style: italic;
}

.comment-card {
    list-style: none;
}

.comment-card__inner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
}

.comment-card__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.comment-card__avatar {
    border-radius: 50%;
    flex-shrink: 0;
}

.comment-card__meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}

.comment-card__author {
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--text);
}

.comment-card__author a {
    color: inherit;
    text-decoration: none;
}

.comment-card__time {
    font-size: 0.825rem;
    color: var(--text-muted);
}

.comment-card__time a {
    color: inherit;
    text-decoration: none;
}

.comment-card__body {
    color: var(--text);
    line-height: 1.6;
}

.comment-card__body > * + * {
    margin-top: var(--space-3);
}

.comment-card__foot {
    margin-top: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 0.875rem;
}

.comment-card__edit a,
.comment-card__foot a {
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.comment-form__title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.25rem;
    margin: 0 0 var(--space-2);
    color: var(--text);
}

.comment-form label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-1);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    box-sizing: border-box;
}

.comment-form textarea {
    min-height: 8em;
    resize: vertical;
    font-family: var(--font-body);
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.comment-form .comment-notes,
.comment-form .logged-in-as {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.comment-form .form-submit {
    margin: 0;
}

.comment-form .submit {
    cursor: pointer;
    appearance: none;
    border: 0;
    font: inherit;
}

/* ---- Empty state ------------------------------------------------------ */

.empty-state {
    padding: var(--space-7);
    text-align: center;
}

.empty-state__body {
    max-width: 36rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.empty-state__title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.5rem;
    margin: 0;
    color: var(--text);
}

.empty-state__lede {
    color: var(--text-muted);
    margin: 0;
}

.empty-state .search-form {
    margin-top: var(--space-4);
}

/* ---- Custom logo handling ------------------------------------------- */

.site-brand__logo img {
    display: block;
    max-height: 48px;
    width: auto;
}

/* ---- Block editor: aligncenter on inline content -------------------- */

.entry__content > .aligncenter {
    margin-left: auto;
    margin-right: auto;
}

/* ---- Hide edit-link helper on the front end (visible to admins only) - */

.entry__edit a,
.comment-card__edit a {
    font-size: 0.825rem;
}

