/* ============================================================
   MUSX theme — base styles
   Tokens at the top; everything below derives from them.
   ============================================================ */

/* ── Self-hosted fonts ───────────────────────────────────────
   Montserrat (body) + Saira (headings), Latin subset, woff2 only.
   Files in /assets/fonts/. No Google Fonts CDN — no third-party
   DNS, no GDPR footnote. The faces are <link rel=preload>-ed in
   functions.php; font-display:fallback uses them if they arrive
   within ~3s (Barry, 1 Nov 2026: optional left Safari on the system font)
   — a late swap is the price of showing the real fonts. */
@font-face {
  font-family: 'Montserrat'; font-style: normal; font-weight: 400;
  font-display: fallback; src: url('../fonts/montserrat-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat'; font-style: normal; font-weight: 600;
  font-display: fallback; src: url('../fonts/montserrat-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat'; font-style: normal; font-weight: 700;
  font-display: fallback; src: url('../fonts/montserrat-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Saira'; font-style: normal; font-weight: 600;
  font-display: fallback; src: url('../fonts/saira-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Saira'; font-style: normal; font-weight: 700;
  font-display: fallback; src: url('../fonts/saira-700.woff2') format('woff2');
}
:root {
    /* Brand */
    --musx-orange:       #fe5000;
    /* Lightest brand orange that carries WHITE text at normal-size AA (4.93:1).
       #fe5000 is 3.30:1 and only ever passed as AA-LARGE, i.e. by keeping the
       button at 18.72px bold. #d94200 was the near miss at 4.44. Use this
       wherever white sits on orange at a normal text size. */
    --musx-orange-aa:    #cc3e00;
    --musx-orange-aa-hover: #b03600;  /* 6.22:1 — AA fills darken on hover; the old
                                        --musx-orange-hover (#ff7836) is 2.63:1 and fails. */
    --musx-orange-hover: #ff7836;
    --musx-orange-fade:  rgba(254, 80, 0, .75);
    --musx-orange-tint:  rgba(254, 80, 0, .08);
    --musx-green:        #00ad67;
    --musx-blue:         #0087ff;

    /* Neutrals */
    --musx-ink:       #1a1a2e;
    --musx-body:      #333333;
    --musx-muted:     #696969;
    --musx-label:     #4a4a4a;
    --musx-line:      #e3e7ea;
    --musx-line-soft: #efefef;
    --musx-bg-soft:   #f4f4f4;
    --musx-bg:        #ffffff;

    /* Semantic */
    --musx-success: #22c55e;
    --musx-error:   #ef4444;

    /* Typography */
    --musx-font-body:    'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --musx-font-heading: 'Saira', 'Montserrat', sans-serif;
    --musx-font-mono:    ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Radii */
    --musx-radius-sm: 4px;
    --musx-radius:    6px;
    --musx-radius-lg: 12px;
    --musx-radius-xl: 18px;

    /* Shadows */
    --musx-shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
    --musx-shadow:    0 4px 12px rgba(0, 0, 0, .08);
    --musx-shadow-lg: 0 18px 50px rgba(0, 0, 0, .18);

    /* Layout */
    --musx-content:   44rem;
    --musx-feed:      75rem;   /* 1200px — site-wide container width (was 72rem/1152) */
    --musx-pad:       clamp(20px, 5vw, 40px);
    --musx-header-h:  96px;

    /* ── DESIGN-SYSTEM ALIASES (added 2026-05-24 with the design-system pass)
       These mirror the tokens in wp-plugin/musx-quiz/public/musx-tokens.css
       so theme styles and plugin styles speak the same vocabulary. Existing
       `--musx-*` tokens are kept for backward compat. */
    --musx-orange-press:  #cc3e00;
    --musx-orange-soft:   #ffd9c4;
    --ink-900:            #0f0f1f;
    --ink-800:            #1a1a2e;
    --ink-700:            #16213e;
    --ink-600:            #283153;
    --paper:              #ffffff;
    --paper-warm:         #fbfaf7;
    --neutral-50:         #f5f6f9;
    --neutral-100:        #eceef3;
    --neutral-200:        #dce0ea;
    --neutral-300:        #c2c8d6;
    --neutral-400:        #99a1b6;
    --neutral-500:        #6c7591;
    --neutral-600:        #4b5470;
    --neutral-700:        #323a55;
    --success:            #2bb673;
    --danger:             #d6314b;
    --band-distinction:   #2bb673;
    --band-honours:       #1f8ad6;
    --band-merit:         #f5a524;
    --band-participation: var(--neutral-500);
    --cta-bg:             var(--musx-orange);
    --cta-bg-hover:       #e64600;
    --cta-fg:             #ffffff;
    --cta-ring:           rgba(254, 80, 0, 0.32);
    /* Font aliases (the design system uses --font-* — we keep --musx-font-* too) */
    --font-display:       var(--musx-font-heading);
    --font-body:          var(--musx-font-body);
    --font-mono:          var(--musx-font-mono);
    /* Spacing (4pt grid) */
    --space-1: 0.25rem;  --space-2: 0.5rem;   --space-3: 0.75rem;  --space-4: 1rem;
    --space-5: 1.25rem;  --space-6: 1.5rem;   --space-8: 2rem;     --space-10: 2.5rem;
    --space-12: 3rem;    --space-16: 4rem;    --space-20: 5rem;    --space-24: 6rem;
    /* Radii (overlap with --musx-radius* but in design-system names) */
    --r-xs: 4px;  --r-sm: 8px;  --r-md: 12px;  --r-lg: 16px;  --r-xl: 20px;
    --r-2xl: 24px;  --r-3xl: 32px;  --r-pill: 999px;  --r-circle: 50%;
    /* Elevation — 4-step ladder, two-layer shadows */
    --shadow-1: 0 1px 2px rgba(15,15,31,.04), 0 1px 1px rgba(15,15,31,.03);
    --shadow-2: 0 2px 6px rgba(15,15,31,.06), 0 4px 12px rgba(15,15,31,.05);
    --shadow-3: 0 6px 16px rgba(15,15,31,.08), 0 12px 28px rgba(15,15,31,.06);
    --shadow-4: 0 12px 32px rgba(15,15,31,.10), 0 24px 56px rgba(15,15,31,.10);
    --shadow-cta:       0 4px 14px rgba(254,80,0,.32), inset 0 1px 0 rgba(255,255,255,.20);
    --shadow-cta-hover: 0 6px 20px rgba(254,80,0,.40), inset 0 1px 0 rgba(255,255,255,.20);
    /* Motion */
    --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --dur-fast: 120ms;  --dur-base: 220ms;  --dur-slow: 420ms;
    /* Type sizes (modular base 16) */
    --fs-12: 0.75rem;  --fs-14: 0.875rem;  --fs-16: 1rem;     --fs-18: 1.125rem;
    --fs-20: 1.25rem;  --fs-24: 1.5rem;    --fs-30: 1.875rem; --fs-36: 2.25rem;
    --fs-48: 3rem;     --fs-64: 4rem;      --fs-80: 5rem;
    --lh-tight: 1.05;  --lh-snug: 1.20;    --lh-normal: 1.45;
    --tracking-tight: -0.02em;  --tracking-wide: 0.04em;  --tracking-cap: 0.12em;
    /* Layout extras */
    --w-page: 1200px;  --w-card: 560px;  --tap-min: 44px;

    /* Orange as TEXT on light grounds (#fe5000 is 3.30:1 — fails AA) */
    --musx-orange-ink: #b83a00;   /* text-on-light. #c63e00 passed at only +0.13; this holds 5.20 on the worst ground */
    --success-soft: #e3f6ec;
    --success-ink:  #1d7a4d;
    --musx-glass:   rgba(255, 255, 255, .95);
    --musx-bg-tint: #e8eaee;
}

/* Editor-palette presets are LITERALS baked into block markup — they can
   never follow the dark palette on their own. The neutral ones are
   re-pointed at tokens here (ink/orange/green/blue presets stay literal:
   they are design elements identical in both modes). */
.has-bg-soft-background-color { background-color: var(--musx-bg-soft) !important; }
.has-bg-tint-background-color { background-color: var(--musx-bg-tint) !important; }
.has-white-background-color   { background-color: var(--paper) !important; }

/* ── Dark palette ─────────────────────────────────────────────
   One token set, three states (the artifact pattern): system dark
   via the media query unless the visitor chose light; the navbar
   switch stamps data-theme on <html> and wins in both directions.
   Every colour below overrides a token defined above — never a
   colour whose only definition is in this block. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --musx-bg: #100f18; --musx-bg-soft: #1a1926;
        --musx-ink: #f1efe8; --musx-body: #d2d1dc; --musx-muted: #9a99a8; --musx-label: #b8b7c6;
        --musx-line: #2e2d3d; --musx-line-soft: #232231;
        --musx-glass: rgba(16, 15, 24, .92);
        --paper: #1a1926; --paper-warm: #1e1d29;
        --neutral-50: #191823; --neutral-100: #232231; --neutral-200: #2e2d3d; --neutral-300: #3a3950;
        --neutral-400: #6f758c; --neutral-500: #9298ad; --neutral-600: #b6bbcb; --neutral-700: #ccd0dd;
        --ink-900: #f4f3f8; --ink-800: #e9e8f0; --ink-700: #dbdce6; --ink-600: #cdced9;
        --musx-orange-tint: rgba(254, 80, 0, .14);
        --musx-orange-ink: #ff8a4c;
        --success-soft: rgba(43, 182, 115, .16); --success-ink: #62d69e;
        --musx-bg-tint: #211f2e;
        --musx-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
        --musx-shadow: 0 4px 12px rgba(0, 0, 0, .45);
        --musx-shadow-lg: 0 18px 50px rgba(0, 0, 0, .6);
        --shadow-1: 0 1px 2px rgba(0,0,0,.35), 0 1px 1px rgba(0,0,0,.3);
        --shadow-2: 0 2px 6px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.35);
        --shadow-3: 0 6px 16px rgba(0,0,0,.45), 0 12px 28px rgba(0,0,0,.4);
    }
}
:root[data-theme="dark"] {
    --musx-bg: #100f18; --musx-bg-soft: #1a1926;
    --musx-ink: #f1efe8; --musx-body: #d2d1dc; --musx-muted: #9a99a8; --musx-label: #b8b7c6;
    --musx-line: #2e2d3d; --musx-line-soft: #232231;
    --musx-glass: rgba(16, 15, 24, .92);
    --paper: #1a1926; --paper-warm: #1e1d29;
    --neutral-50: #191823; --neutral-100: #232231; --neutral-200: #2e2d3d; --neutral-300: #3a3950;
    --neutral-400: #6f758c; --neutral-500: #9298ad; --neutral-600: #b6bbcb; --neutral-700: #ccd0dd;
    --ink-900: #f4f3f8; --ink-800: #e9e8f0; --ink-700: #dbdce6; --ink-600: #cdced9;
    --musx-orange-tint: rgba(254, 80, 0, .14);
    --musx-orange-ink: #ff8a4c;
    --success-soft: rgba(43, 182, 115, .16); --success-ink: #62d69e;
    --musx-bg-tint: #211f2e;
    --musx-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --musx-shadow: 0 4px 12px rgba(0, 0, 0, .45);
    --musx-shadow-lg: 0 18px 50px rgba(0, 0, 0, .6);
    --shadow-1: 0 1px 2px rgba(0,0,0,.35), 0 1px 1px rgba(0,0,0,.3);
    --shadow-2: 0 2px 6px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.35);
    --shadow-3: 0 6px 16px rgba(0,0,0,.45), 0 12px 28px rgba(0,0,0,.4);
}

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

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--musx-font-body);
    color: var(--musx-body);
    background: var(--musx-bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; }

/* Skip link — for keyboard / screen-reader users */
.musx-skip {
    position: absolute;
    top: -100px;
    left: 8px;
    /* Ink, not orange: white-on-#fe5000 is 3.30:1 and fails AA.
       Literal (not tokens) so it holds in both themes. */
    background: #1a1a2e;
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--musx-radius);
    z-index: 999;
    text-decoration: none;
    font-weight: 600;
}
.musx-skip:focus { top: 8px; }

/* ----------------------------------------------------------
   Typography
   ---------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--musx-font-heading);
    color: var(--musx-ink);
    line-height: 1.2;
    margin: 0 0 .5em;
    letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 4vw, 3rem);      font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; }

/* Never strand the last word of a heading on its own line. "Set all your
   students practising with one code" was breaking after "one", leaving "code"
   alone under it (Barry, 7 Sep). balance evens the lines at every width, so
   this is a fix for headings we have not written yet as much as that one. */
h1, h2, h3 { text-wrap: balance; }
h3 { font-size: 1.5rem;  font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 600; }
h5 { font-size: 1.125rem; font-weight: 600; }
h6 { font-size: 1rem;    font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--musx-orange-ink); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--musx-orange-hover); text-decoration: underline; }

strong, b { font-weight: 700; }
em, i    { font-style: italic; }

small { font-size: .875em; }

code, pre, kbd, samp { font-family: var(--musx-font-mono); }
code {
    background: var(--musx-line-soft);
    padding: .15em .4em;
    border-radius: var(--musx-radius-sm);
    font-size: .9em;
}
pre {
    background: var(--musx-line-soft);
    padding: 1em;
    border-radius: var(--musx-radius-lg);
    overflow-x: auto;
    margin: 1.5em 0;
}

hr {
    border: 0;
    height: 1px;
    background: var(--musx-line);
    margin: 2em 0;
}

/* ----------------------------------------------------------
   Buttons — one definitive style across the site.

   Base: filled orange pill, sentence case, soft brand shadow.
   States: colour/shadow shift on hover, press on :active, ring on :focus.
   In-content buttons (.wp-block-button__link) also grow LR and reveal
   an arrow on hover. The header CTA (.btn) keeps a quieter hover so the
   tight header row doesn't shift around.
   ---------------------------------------------------------- */

.btn,
.musx-btn,
.wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3em;
    padding: 14px 22px;
    background: var(--cta-bg, var(--musx-orange));
    color: var(--cta-fg, #fff);
    border: 0;
    border-radius: var(--r-lg, 16px);
    font-family: var(--font-body, var(--musx-font-body));
    font-size: 1.17rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow-cta);
    min-height: var(--tap-min, 44px);
    transition:
        background var(--dur-base, 220ms) var(--ease-out),
        box-shadow var(--dur-base, 220ms) var(--ease-out),
        padding var(--dur-base, 220ms) var(--ease-out),
        transform var(--dur-fast, 120ms) var(--ease-out),
        color var(--dur-base, 220ms) var(--ease-out);
}

.btn:hover,
.musx-btn:hover,
.wp-block-button__link:hover {
    background: var(--cta-bg-hover);
    color: #fff;
    text-decoration: none;
    box-shadow: var(--shadow-cta-hover);
}

.btn:active,
.musx-btn:active,
.wp-block-button__link:active {
    transform: scale(.97);
    box-shadow: var(--shadow-cta);
}

.btn:focus-visible,
.musx-btn:focus-visible,
.wp-block-button__link:focus-visible {
    outline: 2px solid var(--musx-orange);
    outline-offset: 3px;
}

/* In-content buttons: an arrow after the label.
   Scoped away from .btn so the small header CTA doesn't shift the row.

   The arrow is visible BY DEFAULT and the hover reveal is scoped to devices
   that actually hover. It used to be max-width:0 + overflow:hidden, revealed
   only on :hover — which on a phone meant it could never open properly, and
   iOS's partial hover emulation left a clipped sliver poking out of the button
   (Barry's screenshot, 2026-09-01). A control nobody can trigger should not be
   the default state. */
.wp-block-button__link::after {
    content: "→";
    display: inline-block;
    margin-left: .35em;
}

@media (hover: hover) and (pointer: fine) {
    /* Pointer devices keep the grow-and-reveal. */
    .wp-block-button__link::after {
        max-width: 0;
        overflow: hidden;
        opacity: 0;
        margin-left: 0;
        transform: translateX(-3px);
        transition: max-width .22s ease, opacity .2s ease, transform .22s ease, margin-left .22s ease;
    }
    .wp-block-button__link:hover {
        padding-left: 34px;
        padding-right: 34px;
    }
    .wp-block-button__link:hover::after {
        max-width: 1em;
        opacity: 1;
        margin-left: .35em;
        transform: translateX(0);
    }
}

/* Ghost outline variant. */
.btn-ghost {
    background: transparent;
    color: var(--musx-orange-ink);
    box-shadow: inset 0 0 0 2px var(--musx-orange);
}
.btn-ghost:hover {
    background: var(--musx-orange-tint);
    color: var(--musx-orange-ink);
    box-shadow: inset 0 0 0 2px var(--musx-orange-hover);
    transform: none;
}

/* Size variants. */
.btn-sm { padding: 8px 18px;  font-size: 13px; }
.btn-lg { padding: 16px 40px; font-size: 16px; }

/* ----------------------------------------------------------
   Forms
   ---------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--musx-font-body);
    font-size: 16px;
    line-height: 1.3;
    color: var(--musx-body);
    background: var(--paper);
    border: 1px solid var(--musx-line);
    border-radius: var(--musx-radius-sm);
    transition: border-color .15s ease;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--musx-orange-ink);
    outline: 0;
}
::placeholder { color: var(--musx-muted); opacity: 1; }

label {
    display: block;
    margin-bottom: 6px;
    font-family: var(--musx-font-body);
    font-size: 14px;
    line-height: 1.4;
    color: var(--musx-label);
}

textarea { min-height: 140px; resize: vertical; }

/* ----------------------------------------------------------
   Header
   ---------------------------------------------------------- */

.musx-header {
    position: sticky;
    top: 0;
    background: var(--musx-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--musx-line);
    z-index: 100;
    transition: box-shadow .2s ease;
}
/* Sticky-header shadow once the page scrolls (is-stuck is toggled by theme.js). */
.musx-header.is-stuck { box-shadow: var(--musx-shadow); }
.musx-header-inner {
    display: flex;
    align-items: center;
    gap: clamp(16px, 3vw, 32px);
    max-width: var(--musx-feed);
    margin: 0 auto;
    padding: 0 var(--musx-pad);
    height: var(--musx-header-h);
}

.musx-brand {
    display: inline-flex;
    align-items: center;
    color: var(--musx-ink);
    text-decoration: none;
}
.musx-brand:hover { text-decoration: none; color: var(--musx-ink); }
.musx-brand-logo {
    height: 72px;
    width: auto;
    display: block;
    flex-shrink: 0;
    /* Wordmark is an inline SVG with no baked fill, so it takes currentColor.
       aspect-ratio matches the 93x43 viewBox and reserves the box before paint,
       which is what the old <img> width/height attributes used to do. */
    color: var(--musx-orange, #fe5000);
    aspect-ratio: 93 / 43;
}
.musx-brand-logo svg { height: 100%; width: auto; display: block; fill: currentColor; }
/* The source SVG hardcodes `stroke:#000` at 0.24px on every letterform path,
   which drew a thin black outline around an otherwise orange wordmark.
   Following currentColor rather than removing the stroke keeps the original
   letter weight — the stroke is part of how the mark was drawn. */
/* Only the letterform PATHS carry the baked stroke:#000. The svg also contains
   an invisible artboard <rect fill:none> from the Affinity export — stroking
   that draws a box around the whole logo (seen 2026-08-29), so rect/g are
   explicitly excluded. */
.musx-brand-logo svg path { stroke: currentColor !important; }
.musx-brand-logo svg rect { stroke: none !important; }

/* margin-left:auto pushes the nav + everything after it (the CTA) to the
   right edge of the header — logo stays anchored at the far left, items
   cluster on the right. (Previously the nav had flex:1 which let it
   stretch full-width with items left-aligned, leaving a big gap before
   the CTA.) */
.musx-nav { margin-left: auto; }
.musx-nav-cta { display: none; }   /* mobile panel only — see the 1200px block */
.musx-nav-list {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2.5vw, 28px);
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: var(--musx-font-body);
    font-size: 14px;
    font-weight: 600;
}
.musx-nav-list li { margin: 0; }
.musx-nav-list a {
    color: var(--musx-body);
    text-decoration: none;
    transition: color .15s ease;
}
.musx-nav-list a:hover,
.musx-nav-list .current-menu-item > a,
.musx-nav-list .current-menu-ancestor > a {
    color: var(--musx-orange-ink);
    text-decoration: none;
}

/* ── Gooey nav (prototype, 7 Sep 2026) ──────────────────────────────────
   The selected item lifts out of the bar: a gap opens each side, and the items
   left behind close into single shapes. Only outer corners and corners facing
   an open gap take a radius; a seam between two unselected tiles stays at 0 so
   they read as one piece. Effect after rareui.com/components/gooeynav, but
   rebuilt in CSS -- border-radius, margin-inline and background all animate
   natively, so none of the React/motion machinery is needed.
   Desktop only: below 1200px the nav is the burger panel. */
@media (min-width: 1201px) {
  .musx-nav-list {
    gap: 0;
    padding: 4px;
    border-radius: 16px;
    background: rgba(244, 241, 234, .05);
  }
  .musx-nav-list a {
    display: block;
    padding: 8px 14px;
    border-radius: 0;
    background: rgba(244, 241, 234, .045);
    transition: border-radius .32s cubic-bezier(.4, 0, .2, 1),
                margin .32s cubic-bezier(.4, 0, .2, 1),
                background-color .2s ease, color .2s ease;
  }
  /* hairline seam, so a closed run still reads as separate labels */
  .musx-nav-list li + li a { box-shadow: inset 1px 0 0 rgba(244, 241, 234, .09); }
  .musx-nav-list a:hover { background: rgba(244, 241, 234, .10); color: var(--musx-body); }

  /* outer corners of the bar */
  .musx-nav-list li:first-child a { border-start-start-radius: 12px; border-end-start-radius: 12px; }
  .musx-nav-list li:last-child  a { border-start-end-radius: 12px;   border-end-end-radius: 12px; }

  /* the lifted tile. Label is near-black, NOT white: white on #fe5000 measures
     3.30:1 and fails AA, and this would put it on every page. */
  /* White label (Barry's preference over the near-black), which needs 4.5:1 --
     so the tile takes --musx-orange-aa rather than #fe5000. */
  .musx-nav-list li.is-current a {
    border-radius: 12px;
    margin-inline: 16px;
    background: var(--musx-orange-aa);
    color: #fff;
    box-shadow: none;
  }
  .musx-nav-list li.is-current a:hover { background: var(--musx-orange-aa); color: #fff; }

  /* the two corners that now face an open gap */
  .musx-nav-list li:has(+ li.is-current) a {
    border-start-end-radius: 12px; border-end-end-radius: 12px;
  }
  .musx-nav-list li.is-current + li a {
    border-start-start-radius: 12px; border-end-start-radius: 12px;
    box-shadow: none;
  }
  .musx-nav-list a:focus-visible { outline: 2px solid var(--musx-orange); outline-offset: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .musx-nav-list a { transition: none; }
}

/* Header CTA inherits the standard button size from .btn — the taller
   header has room for the full pill.
   min-width fixes the button at the widest CTA label ("Start a free
   quiz →") so the nav row doesn't shift left/right as the page-specific
   CTA swaps in (see musx_header_cta() in functions.php). Shorter
   labels just sit in a wider pill with extra padding either side. */
.musx-header-cta {
    min-width: 200px;
    justify-content: center;
}

.musx-menu-toggle {
    display: none;
    background: transparent;
    border: 0;
    width: 40px;
    height: 40px;
    padding: 8px;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    flex-shrink: 0;
}
.musx-menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--musx-ink);
    border-radius: 1px;
    transition: transform .2s ease, opacity .2s ease;
}
.musx-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.musx-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.musx-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 1200px, not 880: with the Sept 2026 menu labels ("Theory Practice Papers",
   "Teachers & Schools") the desktop row overflowed the viewport below ~1200px
   down and pushed the Free Quiz button off screen (Barry, 4 Sep 2026). */
@media (max-width: 1200px) {
    :root { --musx-header-h: 72px; }
    .musx-brand-logo { height: 52px; }
    /* Group the two controls on the right: the toggle takes the auto margin and
       pushes the pair over, the burger sits beside it. Previously the burger
       took the margin and the toggle was stranded mid-header (Barry, 2026-09-01). */
    .musx-theme-toggle.is-armed { order: 2; margin-left: auto; }
    .musx-menu-toggle { display: flex; order: 3; margin-left: 10px; }
    .musx-header-cta { display: none; }
    .musx-nav {
        position: absolute;
        top: var(--musx-header-h);
        left: 0;
        right: 0;
        background: var(--paper);
        border-bottom: 1px solid var(--musx-line);
        padding: 16px var(--musx-pad);
        display: none;
        order: 99;
    }
    .musx-nav.is-open { display: block; }
    /* Dim the page behind the open panel. Sits under the sticky header
       (z-index 100) so the panel and the toggle stay bright and tappable. */
    .musx-nav-backdrop {
        position: fixed; inset: 0; z-index: 99;
        background: rgba(16, 15, 24, .55);
        -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
        opacity: 0; transition: opacity 200ms ease;
    }
    .musx-nav-backdrop.is-visible { opacity: 1; }
    .musx-nav-backdrop[hidden] { display: none; }
    @media (prefers-reduced-motion: reduce) { .musx-nav-backdrop { transition: none; } }
    /* The free-quiz CTA, repeated inside the mobile panel. Full width and last,
       so it reads as the action after the destinations rather than a sixth link. */
    .musx-nav-cta {
        display: block; width: 100%; margin-top: 16px;
        text-align: center; box-sizing: border-box;
    }
    .musx-nav-list { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ----------------------------------------------------------
   Main + content
   ---------------------------------------------------------- */

.musx-main { flex: 1; width: 100%; }

/* The page wrapper carries the reading-column width + padding. The inner
   .musx-content is a transparent content holder — it must NOT re-apply width
   or padding, or body text ends up indented + gapped relative to the H1. */
.musx-page,
.musx-article,
.musx-archive {
    max-width: var(--musx-content);
    margin: 0 auto;
    padding: clamp(32px, 6vw, 64px) var(--musx-pad);
}
.musx-wide { max-width: var(--musx-feed); }

/* App-shortcode landings (/practical/, /pricing/, the dashboards) render a
   full-bleed <section> that carries its own vertical padding. The wrapper's
   padding stacked on top of it — ~144px of white above the /practical/
   eyebrow. Let the section own the spacing. */
.musx-page--app { padding-top: 0; padding-bottom: 0; }

/* Same stacking problem for block-built pages: a full-bleed .musx-section as
   the first child already carries clamp(48px,8vw,96px) of top padding, and the
   wrapper's clamp(32px,6vw,64px) piled on top (160px above /support/'s H1).
   Horizontal padding is left intact — only the doubled vertical goes. */
.musx-page:has(> .musx-content > .musx-section:first-child) { padding-top: 0; }
.musx-page:has(> .musx-content > .musx-section:last-child)  { padding-bottom: 0; }

.musx-page-head,
.musx-article-head,
.musx-archive-head { margin-bottom: 32px; }

.musx-meta {
    color: var(--musx-muted);
    font-size: 14px;
    margin: 0 0 1em;
}

.musx-feature-img {
    margin: 0 0 32px;
    border-radius: var(--musx-radius-lg);
    overflow: hidden;
}

.musx-content > * { margin-bottom: 1em; }
.musx-content > *:last-child { margin-bottom: 0; }
.musx-content > h2,
.musx-content > h3 { margin-top: 1.5em; }
.musx-content img:not(.musx-brand-mark) {
    border-radius: var(--musx-radius-lg);
    margin: 1.5em 0;
}
.musx-content ul,
.musx-content ol { padding-left: 1.5em; margin-bottom: 1em; }
.musx-content li { margin-bottom: .4em; }
.musx-content blockquote {
    border-left: 3px solid var(--musx-orange);
    padding: .5em 0 .5em 1em;
    margin: 1.5em 0;
    color: var(--musx-muted);
    font-style: italic;
}

/* ----------------------------------------------------------
   Cards / sections / grids
   ---------------------------------------------------------- */

.musx-card {
    background: var(--paper);
    border: 1px solid var(--musx-line);
    border-radius: var(--musx-radius-lg);
    padding: 24px;
    box-shadow: var(--musx-shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease;
}
.musx-card:hover { transform: translateY(-2px); box-shadow: var(--musx-shadow); }

/* Cards in a feature grid are equal-height (grid stretches them), so a card
   with shorter copy used to leave its button floating mid-card while its
   neighbours' sat lower. Make the card a column and push the buttons to the
   bottom so they line up across the row regardless of copy length. */
.musx-feature-grid .musx-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.musx-feature-grid .musx-card > .wp-block-buttons {
    margin-top: auto;
    padding-top: 4px;
}

.musx-section { padding: clamp(48px, 8vw, 96px) var(--musx-pad); }
.musx-section.is-soft { background: var(--musx-bg-soft); }
.musx-section-inner { max-width: var(--musx-feed); margin: 0 auto; }

.musx-grid {
    display: grid;
    gap: clamp(16px, 2vw, 24px);
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
}

/* ----------------------------------------------------------
   Block-pattern sections
   /patterns/*.php build full-width wp:group bands using these
   classes. Styling lives here so the pattern markup stays
   minimal and survives editing.
   ---------------------------------------------------------- */

/* Dark section — flips text to white (hero + CTA bands). */
.musx-section--dark,
.musx-section--dark :is(h1, h2, h3, h4) { color: #fff; }

/* Constrained layout caps every child at --wp--style--global--content-size
   (44rem). That rule is `.is-layout-constrained > :where(…)`, and :where()
   contributes nothing, so it sits at (0,1,0) — this beats it without
   !important. Headings only: body copy keeps the narrower measure. */
.musx-section.is-layout-constrained > h2.wp-block-heading,
.musx-section.is-layout-constrained > h1.wp-block-heading { max-width: 52rem; }
.musx-section--dark p { color: rgba(255, 255, 255, .82); }
/* On the ORANGE band the .82-white subline composites to ~2.9:1 — AA
   fails. Ink on #fe5000 measures ~4.9:1. Literal: the band is fixed
   scenery, identical in both themes. */
.musx-cta-band p { color: #1a1a2e; }

/* Kicker — small all-caps lead-in line above a heading. */
.musx-kicker {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: .8rem;
    font-weight: 700;
    color: var(--musx-orange-ink);
    margin-bottom: .5em;
}

/* Hero — full-screen height, content vertically centred. */
.musx-hero {
    min-height: calc(100vh - var(--musx-header-h));
    display: flex;
    flex-direction: column;
    justify-content: center;
}
@media (max-width: 782px) {
    /* Full-viewport hero on a phone spends the whole first screen on four
       lines with no action — the landing heroes already cap this; the old
       .musx-hero (music-theory) now does too. */
    .musx-hero { min-height: 0; padding-block: 72px 56px; }
}
.musx-hero h1 { margin-bottom: .3em; }
.musx-hero p  {
    font-size: 1.1rem;
    /* Balance the lines rather than filling each one to the measure. The subtitle
       is two sentences at ~195 characters, which filled 704px and broke as
       "…private music theory results / page. Instant marking…" — stranding a
       single word. `balance` evens the line lengths so the break lands at a
       sentence or phrase instead. Capped at 6 lines by the spec, which is ample
       here; browsers without it simply wrap as before. */
    text-wrap: balance;
}

/* CTA band — white pill on the orange field. On hover it goes ghost:
   transparent fill, 1px white outline (via inset box-shadow so no
   layout shift), white text. Lighter on the eye than an ink fill. */
.musx-cta-band .wp-block-button__link {
    background: #fff;
    color: #c63e00;   /* orange-ink: #fe5000 on white is 3.30:1, fails AA */
    box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
}
.musx-cta-band .wp-block-button__link:hover {
    background: transparent;
    color: #fff;
    box-shadow: inset 0 0 0 1px #fff;
}

/* Feature grid — core grid layout drives the columns; this just
   tunes the gap. */
.musx-feature-grid { gap: clamp(16px, 2vw, 26px); }

/* Feature row — three image+text cards in one row on desktop,
   stack on mobile (WordPress columns block does this for free).
   Flex on each column lets the button stick to the bottom even
   when paragraph lengths differ. */
.musx-feature-row .wp-block-column { display: flex; flex-direction: column; }
/* margin-top:auto bottom-aligns the three cards' buttons, so this padding is
   the ONLY gap on whichever card is tallest — at 4px the button sat flush
   against the last line of copy (Barry, 7 Sep). The padding sits inside the
   wrapper, above the button, so the buttons stay aligned with each other. */
.musx-feature-row .wp-block-column > .wp-block-buttons { margin-top: auto; padding-top: 18px; }
.musx-feature-row .wp-block-image { margin-bottom: 8px; }
.musx-feature-row .wp-block-image img { width: 100%; }
/* Title sits on one line at column width — the global h2 clamps up to
   2.25rem, which is too wide for "Free music theory quizzes" inside a
   third of an alignwide row. Saira (the global heading font) stays. */
.musx-feature-row h2 { font-size: 1.5rem; line-height: 1.25; }

/* Image + text — round the image corners. */
.musx-section .wp-block-image img { border-radius: var(--musx-radius-lg); }

/* Stat — big number + label (stats band). */
.musx-stat-n {
    font-family: var(--musx-font-heading);
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1;
    color: var(--musx-orange-ink);
}
.musx-stat-l { font-size: .9rem; color: var(--musx-muted); }
.musx-section--dark .musx-stat-l { color: rgba(255, 255, 255, .7); }

/* Process step — numbered circle badge. */
.musx-step-n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--musx-orange);
    color: #fff;
    font-family: var(--musx-font-heading);
    font-weight: 800;
    font-size: 1.25rem;
}

/* Stat + step grid items — centred, tight internal spacing. */
.musx-stat,
.musx-step { text-align: center; }

/* Numbered steps get the card treatment (Barry, 2026-08-31) — same surface,
   border, radius and lift-on-hover as .musx-card, so a step row reads as a
   set of cards rather than floating text. Scoped to the standalone step grid:
   the teachers band's inline steps sit INSIDE a card already and must stay
   flat (a card in a card is always wrong). */
.musx-stepgrid > .musx-step {
    background: var(--paper);
    border: 1px solid var(--musx-line);
    border-radius: var(--musx-radius-lg);
    padding: 28px 22px;
    box-shadow: var(--musx-shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease;
}
.musx-stepgrid > .musx-step:hover { transform: translateY(-2px); box-shadow: var(--musx-shadow); }
/* The badge sits on the card, so give it a little air above the title. */
.musx-stepgrid > .musx-step .musx-step-n { margin-bottom: .7em; }
.musx-stat-n { margin-bottom: .1em; }
.musx-stat-l { margin: 0; }
.musx-step-n { margin-bottom: .55em; }
.musx-step h3 { font-size: 1.15rem; margin-bottom: .35em; }
.musx-step p:last-child { margin-bottom: 0; }

/* Stats, steps + feature grids: WordPress's grid layout uses auto-fill, which
   leaves empty column tracks and pushes a short row to the left. auto-fit
   collapses the empties so the items fill the row and sit centred. */
/* These three declare their own `display:grid`, deliberately.
   The column tracks come from here, but `display:grid` used to come ONLY from
   WordPress's generated inline rule `body .is-layout-grid{display:grid}`. Two
   sources for one layout: if that inline rule does not arrive — blocked, stripped,
   or renamed by a WP update — the tracks below apply to a block-level box and the
   whole card row collapses. Declaring display here makes each grid self-contained.
   Prompted by a layout failure on Sam's machine, 2026-08-23. */
.musx-statgrid     { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)) !important; }
.musx-stepgrid     { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)) !important; }
.musx-feature-grid { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(min(26rem, 100%), 1fr)) !important; }  /* 4 cards -> 2x2 at wide, stacks below ~900px */

/* Safari: the actual cause of the collapsed cards (found 2026-08-25).
   WordPress puts `container-type: inline-size` on EVERY .is-layout-grid
   container. Combined with auto-fit/minmax tracks, some WebKit builds resolve
   the column tracks to ZERO: the container measures full width, `display` is
   correctly `grid`, and every child collapses to 0-50px wide while growing very
   tall, so the card text wraps to about one character per line.
   Measured on Sam's Mac (Safari), container width 1184px:
       WHY-CARDS children  50x846   (Chromium: 281x256)
       STEPS               0x465    (Chromium: 282x203)
       STATS               0x122    (Chromium: 588x79)
   The one card block that renders correctly for her is the IMAGE CARDS row,
   which is `is-layout-flex` and which WordPress does NOT give a container-type.
   That exact correlation is what identifies the cause.
   Nothing on this site uses @container — zero occurrences in the served page and
   zero in this file — so the containment buys us nothing and is safe to disable.
   The earlier `display: grid !important` above was a real robustness fix but was
   never this bug: display was already correct on her machine. */
.musx-statgrid,
.musx-stepgrid,
.musx-feature-grid { container-type: normal !important; }

/* ----------------------------------------------------------
   Tables
   ---------------------------------------------------------- */

.musx-content table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--musx-font-body);
    margin: 1.5em 0;
}
.musx-content th {
    background: var(--musx-orange);
    color: #fff;
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    border: 1px solid var(--musx-orange);
}
.musx-content td {
    border: 1px solid var(--musx-line);
    padding: 10px 16px;
    background: var(--paper);
}
.musx-content tr:nth-child(even) td { background: var(--musx-bg-soft); }

/* Pricing table — compact, centred 2-column card (Grade · Price).
   Standalone styling so it looks right on the home page too, where the
   .musx-content table rules don't reach. */
.musx-pricing-table {
    max-width: 28rem;
    margin: 6px auto 0;
    border: 1px solid var(--musx-line);
    border-radius: var(--musx-radius-lg);
    overflow: hidden;
    box-shadow: var(--musx-shadow);
}
.musx-pricing-table table { width: 100%; border-collapse: collapse; }
.musx-pricing-table thead { border: 0; }
.musx-pricing-table th {
    border: 0;
    background: var(--musx-orange);
    color: #fff;
    font-family: var(--musx-font-heading);
    font-weight: 700;
    font-size: .78rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    padding: 14px 22px;
    text-align: left;
}
.musx-pricing-table td {
    border: 0;
    border-top: 1px solid var(--musx-line);
    padding: 15px 22px;
    background: var(--paper);
}
.musx-pricing-table tbody tr:first-child td { border-top: 0; }
.musx-pricing-table td:first-child {
    font-family: var(--musx-font-heading);
    font-weight: 600;
    color: var(--musx-ink);
}
.musx-pricing-table th:last-child,
.musx-pricing-table td:last-child { text-align: right; white-space: nowrap; }
.musx-pricing-table td:last-child {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--musx-orange-ink);
}

/* Home-page price hook — one large centred line linking to /pricing/. */
.musx-price-line {
    font-family: var(--musx-font-heading);
    font-weight: 700;
    font-size: clamp(1.5rem, 3.2vw, 2.25rem);
    line-height: 1.2;
    margin: 0;
}
.musx-price-line a {
    color: var(--musx-ink);
    text-decoration: none;
    transition: color .15s ease;
}
.musx-price-line a:hover { color: var(--musx-orange-ink); text-decoration: none; }
.musx-price-line .musx-price-amount { color: var(--musx-orange-ink); }

/* Cafe peg-board pricing — dark dotted panel, white block letters,
   inspired by retro letterboard signs. Apply to a wp:html block on
   /pricing/. Section breaks use <tr class="board-section"><th colspan="2">. */
.musx-pricing-board {
    background-color: var(--musx-ink);
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .07) 1.5px, transparent 1.6px);
    background-size: 13px 13px;
    border: 1px solid #2a2a4e;
    border-radius: var(--musx-radius-lg);
    box-shadow: var(--musx-shadow);
    color: #f5f5f5;
    margin: 24px 0;
    max-width: 540px;
    padding: 30px 26px;
}
.musx-pricing-board table {
    width: 100%;
    border-collapse: collapse;
    color: #f5f5f5;
    font-family: var(--musx-font-heading);
    letter-spacing: .04em;
    text-transform: uppercase;
}
.musx-pricing-board td {
    border: 0;
    /* !important so the .musx-content tr:nth-child(even) td zebra rule
       (which kicks in because /pricing/ is inside .musx-content) can't
       paint alternate rows light grey and hide the white text. */
    background: transparent !important;
    padding: 10px 4px;
    font-size: 15px;
    line-height: 1.5;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .55);
}
.musx-pricing-board td:first-child { text-align: left; }
.musx-pricing-board td:last-child {
    text-align: right;
    white-space: nowrap;
    font-feature-settings: "tnum";
}
/* Single "AUD" header above the price column — small, muted, lower-weight
   so the per-row prices below ($9.95, $55, …) read as the dominant
   elements. Right-aligned to sit over the column. */
.musx-pricing-board thead th {
    border: 0;
    background: transparent;
    padding: 0 4px 8px;
    text-align: right;
    font-family: var(--musx-font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    color: rgba(255, 255, 255, .55);
    text-transform: uppercase;
}
.musx-pricing-board thead th:first-child { padding: 0; }
.musx-pricing-board tr.board-section th {
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .15);
    padding: 22px 4px 6px;
    text-align: left;
    font-family: var(--musx-font-heading);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .15em;
    color: var(--musx-orange-ink);
    text-shadow: none;
    background: transparent !important;
}
.musx-pricing-board tr.board-section:first-child th { padding-top: 0; }

/* ----------------------------------------------------------
   Music-theory index — full-bleed sections with a 2-column quiz
   card grid in each per-grade band. Hero + syllabus nav + 5 grade
   sections + outbound-syllabus footer. Content stays flat (every
   quiz title and link in the DOM) so it remains SEO-friendly.
   ---------------------------------------------------------- */

/* Landing-style pages: the content drives its own full-bleed sections
   (hero, alternating greys, etc.) so the .musx-page wrapper's vertical
   padding and the per-block 1em bottom-margin would only show as white
   bands between coloured sections. Strip both — each section carries
   its own padding (.musx-section{padding...}). */
body.page-music-theory .musx-page {
    padding-top: 0;
    padding-bottom: 0;
}
body.page-music-theory .musx-content > .alignfull,
body.page-music-theory .musx-content > section.alignfull {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 0;
    margin-bottom: 0;
}
body.page-music-theory .mt-inner {
    max-width: var(--musx-feed);
    margin: 0 auto;
}

/* Syllabus-nav row (used twice: top jump-link nav + bottom outbound links).
   Each card carries a per-board accent colour so the three syllabi are
   immediately identifiable: AMEB = orange (brand), ABRSM = blue, Trinity =
   green. The accent lives in the heading and a top stripe; the jump-link
   text matches the heading colour for cohesion within each card. */
.mt-syllabus-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 20px;
}
.mt-syllabus-card {
    --mt-accent: var(--musx-orange);  /* default, overridden per-board below */
    background: var(--paper);
    border: 1px solid var(--musx-line);
    border-top: 4px solid var(--mt-accent);
    border-radius: var(--musx-radius-lg);
    padding: 22px 26px;
    box-shadow: var(--musx-shadow-sm);
    transition: transform .18s ease, box-shadow .25s ease, border-color .18s ease;
}
.mt-syllabus-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .09);
}
.mt-syllabus-card--ameb    { --mt-accent: var(--musx-orange); }
.mt-syllabus-card--abrsm   { --mt-accent: var(--musx-blue); }
.mt-syllabus-card--trinity { --mt-accent: var(--musx-green); }

.mt-syllabus-card h3 {
    font-size: 1.05rem;
    margin: 0 0 10px;
    color: var(--mt-accent);
    letter-spacing: .02em;
}
.mt-syllabus-card h3 a { color: inherit; text-decoration: none; }
.mt-syllabus-card ul { list-style: none; margin: 0; padding: 0; }
.mt-syllabus-card li { padding: 4px 0; margin: 0; }
/* Links default to ink, not the accent — the heading + top stripe already
   carry the board colour, so colouring the grade links too is over-saturated.
   Underline-on-hover gives the interaction signal. */
.mt-syllabus-card li a {
    color: var(--musx-ink);
    font-weight: 600;
    text-decoration: none;
}
.mt-syllabus-card li a:hover {
    color: var(--mt-accent);
    text-decoration: underline;
}

/* Per-grade section header — same colour-splash language as the syllabus
   cards. A rounded white box on the section's grey background, top stripe
   in the board's accent, heading colour-matched. Sits above the quiz
   grid and visually anchors the section. */
.mt-grade-head {
    --mt-accent: var(--musx-orange);
    background: var(--paper);
    border: 1px solid var(--musx-line);
    border-top: 4px solid var(--mt-accent);
    border-radius: var(--musx-radius-lg);
    padding: 28px 32px;
    box-shadow: var(--musx-shadow-sm);
    margin: 0 0 24px;  /* matches the card-grid row/col gap */
}
.mt-grade-head--ameb    { --mt-accent: var(--musx-orange); }
.mt-grade-head--abrsm   { --mt-accent: var(--musx-blue); }
.mt-grade-head--trinity { --mt-accent: var(--musx-green); }
.mt-grade-head h2 {
    color: var(--mt-accent);
    margin: 0 0 .5em;
    letter-spacing: .01em;
}
.mt-grade-head > p:last-child { margin-bottom: 0; }

/* Per-grade section: full-width intro + 2-col quiz grid.
   Grid (not column-count): deterministic 2-col layout. column-count
   sometimes briefly paints a card across the gutter before reflowing,
   which reads as a flicker on the right edge of the top card. */
.mt-quiz-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;             /* unified vertical + horizontal between cards */
    margin-top: 24px;      /* same value above, matches grade-head margin */
    /* No align-items override → grid items stretch to row height by default.
       Combined with the flex-column card layout below, this keeps every
       card in a row the same height and locks the "Start quiz" link to
       the bottom of each card regardless of description length. */
}
.mt-quiz-card {
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--musx-line);
    border-radius: var(--musx-radius-lg);
    padding: 18px 22px;
    box-shadow: var(--musx-shadow-sm);
    transition: transform .18s ease, box-shadow .25s ease, border-color .18s ease;
}
.mt-quiz-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .09);
    border-color: rgba(254, 80, 0, .3);
}
.mt-quiz-card h3 {
    margin: 0 0 4px;
    font-size: 1.05rem;
    color: var(--musx-ink);
}
.mt-quiz-card .mt-quiz-qty {
    margin: 0 0 6px;
    font-size: .85rem;
    color: var(--musx-muted);
    font-weight: 600;
}
.mt-quiz-card > p {
    font-size: .93rem;
    line-height: 1.5;
    margin: 0 0 .5em;
}
.mt-quiz-card .mt-quiz-cta {
    margin: auto 0 0;      /* auto-top pushes CTA to bottom of stretched card */
    padding-top: 10px;     /* minimum visual gap above the CTA on short cards */
}
.mt-quiz-card .mt-quiz-cta a {
    color: var(--musx-orange-ink);   /* #fe5000 as text on white is 3.30:1 — the token is for exactly this */
    font-weight: 700;
    text-decoration: none;
}
.mt-quiz-card .mt-quiz-cta a:hover { text-decoration: underline; }

@media (max-width: 720px) {
    .mt-quiz-grid { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------
   FAQ accordion (Yoast schema) — preserve existing pattern
   ---------------------------------------------------------- */

.yoast-faq-accordion .schema-faq-question {
    display: block;
    color: var(--musx-orange-ink);
    background: var(--musx-line-soft);
    padding: 1em;
    cursor: pointer;
    border: 1px solid #ddd;
    border-bottom: 0;
    border-radius: 5px 5px 0 0;
    font-family: var(--musx-font-heading);
    font-weight: 600;
}
.yoast-faq-accordion .schema-faq-answer {
    margin: 0 0 25px;
    padding: 1em 1em 30px;
    border: 1px solid #ddd;
    border-top: 0;
    border-radius: 0 0 5px 5px;
}

/* ----------------------------------------------------------
   Archive list
   ---------------------------------------------------------- */

.musx-post-list { list-style: none; padding: 0; margin: 0; }
.musx-post-list > li { margin-bottom: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--musx-line); }
.musx-post-list > li:last-child { border-bottom: 0; }
.musx-post-card h2 { font-size: 1.5rem; margin-bottom: .25em; }
.musx-post-card h2 a { color: var(--musx-ink); }
.musx-post-card h2 a:hover { color: var(--musx-orange-ink); }
.musx-empty { text-align: center; padding: 48px 0; color: var(--musx-muted); }

.wp-block-buttons,
.musx-content .wp-block-buttons { margin: 1.5em 0; }

.musx-pagelinks { margin: 2em 0; color: var(--musx-muted); font-size: 14px; }

/* ----------------------------------------------------------
   Footer
   ---------------------------------------------------------- */

.musx-footer {
    background: var(--musx-bg-soft);
    border-top: 1px solid var(--musx-line);
    padding: 32px 0 24px;
    margin-top: auto;
}
.musx-footer-inner {
    max-width: var(--musx-feed);
    margin: 0 auto;
    padding: 0 var(--musx-pad);
}
.musx-footer-nav ul,
.musx-footer-list {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    font-size: 14px;
    font-family: var(--musx-font-body);
}
.musx-footer-nav a,
.musx-footer-list a {
    color: var(--musx-muted);
    text-decoration: none;
    transition: color .15s ease;
}
.musx-footer-nav a:hover,
.musx-footer-list a:hover { color: var(--musx-orange-ink); }

.musx-footer-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--musx-muted);
    border-top: 1px solid var(--musx-line);
    padding-top: 16px;
    text-align: center;
}
.musx-copyright { margin: 0; }

/* ----------------------------------------------------------
   Utility
   ---------------------------------------------------------- */

.musx-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.alignwide  { max-width: var(--musx-feed); margin-left: auto; margin-right: auto; }
.alignfull  { max-width: none; width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignleft  { float: left;  margin: 0 1em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1em; }

/* ----------------------------------------------------------
   Reduced motion — respect OS pref
   ---------------------------------------------------------- */

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

/* ── Games landing (/games/) ─────────────────────────────────────────────── */
.musx-games { text-align: center; padding: 4px 0 40px; }
.musx-games-eyebrow { display: block; font-family: var(--font-head, inherit); font-size: 13px; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase; color: var(--o, #fe5000); margin: 0 0 22px; }
.musx-games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 20px; max-width: 760px; margin: 0 auto; }
.musx-game-card { position: relative; overflow: hidden; display: flex; gap: 20px; align-items: center;
  padding: 26px 26px; border-radius: 20px; text-decoration: none; isolation: isolate;
  background: radial-gradient(120% 140% at 15% 0%, #1c1b30 0%, #100f1c 60%);
  border: 1px solid rgba(255,255,255,.08); box-shadow: 0 14px 40px rgba(16,15,28,.28);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.musx-game-card:hover { transform: translateY(-4px);
  box-shadow: 0 22px 54px rgba(254,80,0,.22); border-color: rgba(254,80,0,.5);
  /* Beat the global `a:hover { text-decoration: underline }` (specificity 0,1,1)
     so the whole card doesn't underline — only .musx-game-play does, below. */
  text-decoration: none; }
/* The whole card is an <a> for a big tap target, but only the CTA should READ as a
   link — kill the theme's global underline everywhere inside it. */
.musx-game-card, .musx-game-card * { text-decoration: none; }
/* faint starfield */
.musx-game-stars { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .6;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, rgba(255,255,255,.35), transparent),
    radial-gradient(1.5px 1.5px at 85% 65%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.5px 1.5px at 40% 80%, rgba(255,255,255,.3), transparent),
    radial-gradient(1.5px 1.5px at 55% 45%, rgba(254,80,0,.4), transparent); }
.musx-game-icon { flex: 0 0 auto; width: 72px; height: 80px; display: grid; place-items: center;
  filter: drop-shadow(0 6px 16px rgba(254,80,0,.35)); }
.musx-game-icon svg { width: 60px; height: auto; animation: musx-ship-bob 3.2s ease-in-out infinite; }
@keyframes musx-ship-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .musx-game-icon svg { animation: none; } }
.musx-game-body { display: flex; flex-direction: column; gap: 7px; text-align: left; }
.musx-game-name { font-family: var(--font-head, inherit); font-weight: 800; font-size: 1.4rem; color: #fff; }
.musx-game-desc { color: rgba(255,255,255,.72); font-size: .96rem; line-height: 1.45; }
.musx-game-play { margin-top: 4px; font-weight: 700; font-size: .95rem; color: var(--o2, #ff7a3c);
  transition: transform .18s ease; }
.musx-game-card:hover .musx-game-play { transform: translateX(4px); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 520px) { .musx-game-card { flex-direction: column; text-align: center; }
  .musx-game-body { text-align: center; align-items: center; } }

/* ══════════════════════════════════════════════════════════════════════════
   MUSX LANDING DESIGN SYSTEM  (2026-08-29)
   The design language of the /practice-papers/ and /practical/ landing pages,
   ported onto the theme so their FSE block rebuilds keep the look. Direction
   (Barry): the landing pages are the newest design — build the theme UP to
   them, then converge the rest of the site. Every rule is ancestor-qualified
   under .musx-sec (house rule: bare classes lose to host descendant rules).
   Values are copied from the landing pages' CSS, not reinvented; the colour
   tokens already exist in this file's :root.
   ══════════════════════════════════════════════════════════════════════════ */

.musx-page--landing { padding: 0; }
.musx-page--landing .musx-sec { margin-block: 0; }

/* ── sections ── */
.musx-sec { padding: 72px 0; }
.musx-sec--band { background: var(--neutral-50); border-block: 1px solid var(--neutral-100); padding: 80px 0; }

/* ── dark shell: hero + closing bookend (three paint layers, copied) ── */
.musx-sec--hero, .musx-sec--close {
    position: relative; overflow: hidden; color: #fff;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
.musx-sec--hero::before, .musx-sec--close::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: url("/wp-content/plugins/musx-quiz/public/img/musx-sheet-texture.webp") center/cover no-repeat;
    opacity: .14; filter: saturate(.75);
}
.musx-sec--hero::after, .musx-sec--close::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(140% 80% at 80% 0%, rgba(254,80,0,.18), transparent 50%),
                linear-gradient(180deg, rgba(15,15,31,.10), rgba(15,15,31,.45));
}
.musx-sec--hero > *, .musx-sec--close > * { position: relative; z-index: 1; }

/* ── photo hero variant (/practical/, 2026-08-29) ──
   The violinist-and-phone photograph (hero-practice-v2, the 17 Aug reshoot
   with the instrument deliberately behind the focal plane) replaces the
   manuscript texture. The scrim is heavier than the default because the
   photo's window light is bright: white text measured against the
   COMPOSITED ground (photo highlight ~#d0c0a8 under rgba(15,15,31,.72))
   lands ≈#3f3f4e — comfortably past AA. */
.musx-sec--hero.musx-hero--photo::before {
    background-image: url("/wp-content/plugins/musx-quiz/public/img/hero-practice-v2.jpg");
    background-image: url("/wp-content/plugins/musx-quiz/public/img/hero-practice-v2.webp");
    background-size: cover;
    /* musx-reveal.js pans --musx-hero-pan 22%→58% with scroll (parallax
       reveal of the phone); 22% stands without JS / with reduced motion. */
    background-position: 50% var(--musx-hero-pan, 22%);
    background-repeat: no-repeat;
    opacity: 1; filter: none;
}
.musx-sec--hero.musx-hero--photo::after {
    /* Steeper downward scrim (Barry, 4 Sep 2026): the big H1 near the top can
       sit on the photo, but the 18px body copy and the offer line lower down
       need a near-solid ground. Composited highlight under .92 ≈ #1f1f2f. */
    background: linear-gradient(180deg, rgba(15,15,31,.50) 0%, rgba(15,15,31,.70) 32%, rgba(15,15,31,.88) 62%, rgba(15,15,31,.94) 100%);
}

/* ── teachers photo hero (2026-08-31) ──
   Codex classroom scene with the REAL PWA start screen composited on the
   tablet (Codex's own screen text was garbled — verified at 2×). Landscape
   image on the slim hero: static crop, no parallax (the parallax JS keys
   on .musx-hero--photo only, deliberately not this class). Scrim heavier
   left where the text sits. */
.musx-sec--hero.musx-hero--teachers::before {
    background-image: url("/wp-content/plugins/musx-quiz/public/img/hero-teachers-v1.jpg");
    background-image: url("/wp-content/plugins/musx-quiz/public/img/hero-teachers-v1.webp");
    background-size: cover;
    background-position: 62% 40%;   /* keeps the tablet and the class in frame */
    background-repeat: no-repeat;
    opacity: 1; filter: none;
}
.musx-sec--hero.musx-hero--teachers::after {
    background: linear-gradient(100deg, rgba(15,15,31,.86) 0%, rgba(15,15,31,.72) 45%, rgba(15,15,31,.45) 100%);
}
.musx-sec--hero .musx-hero-caption {
    margin-top: 28px;
    font-size: .78rem;
    color: rgba(255, 255, 255, .78);
    font-style: italic;
}
/* Full-viewport hero, vertically centred (the original landing design).
   Flex column + WP's `margin-inline:auto !important` normally shrinks short
   children to fit-content (the ragged-left-edge bug, 2026-08-29) — countered
   by width:100% on the children: an explicit width beats shrink-to-fit, and
   the auto margins then centre the 44rem column instead of the text. */
.musx-sec--hero {
    min-height: calc(100dvh - var(--musx-header-h, 97px));
    display: flex; flex-direction: column; justify-content: center;
    padding: 72px 0;
}
.musx-sec--hero > * { width: 100%; }
.musx-sec--close { padding: 96px 0; }

/* ── type ── */
.musx-sec .musx-eyebrow {
    font-family: var(--font-display); font-weight: 600; font-size: .75rem;
    text-transform: uppercase; letter-spacing: .12em; color: var(--musx-orange-ink); margin: 0;
}
.musx-sec--hero .musx-eyebrow, .musx-sec--close .musx-eyebrow { color: #ff8a4d; }
.musx-sec h1 {
    font-family: var(--font-display); font-weight: 800;
    font-size: clamp(38px, 5vw + 1rem, 68px); line-height: 1.04;
    letter-spacing: -.02em; color: #fff; margin: 16px 0 20px; text-wrap: pretty;
}
.musx-sec h2 {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(30px, 3vw, 44px); line-height: 1.1;
    letter-spacing: -.02em; margin: 10px 0 14px; text-wrap: pretty;
}
.musx-sec--close h2 { font-weight: 800; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.08; color: #fff; }
.musx-sec p { font-size: 17px; line-height: 1.55; color: var(--neutral-600); }
.musx-sec--hero p { font-size: 18px; color: rgba(255,255,255,.88); }
.musx-sec--hero p b, .musx-sec--hero p strong { color: #fff; font-weight: 600; }
.musx-sec--hero a:not(.wp-block-button__link) { color: #ff8a4d; }
.musx-sec--close p { color: rgba(255,255,255,.85); }

/* Hero offer lines — the three-product statement on the homepage hero.
   Each line names one product and links to it; the link colour comes from the
   hero link rule (#ff8a4d). Tighter rhythm than lede paragraphs. */
.musx-sec--hero .musx-offer { font-size: 19px; line-height: 1.5; margin: 0 0 10px; color: rgba(255,255,255,.92); }
.musx-sec--hero .musx-offer a { font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(255,138,77,.45); }
.musx-sec--hero .musx-offer a:hover { border-bottom-color: #ff8a4d; }
.musx-sec--hero h1 + .musx-offer { margin-top: 6px; }

/* ── buttons: primary + outline, mapped onto core button markup ── */
.musx-sec .wp-block-buttons { gap: 12px; margin-top: 26px; }
.musx-sec .wp-block-button__link {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-body); font-weight: 700; font-size: 19px;
    padding: 14px 22px; min-height: 48px; border-radius: var(--r-lg); border: 0;
    background: var(--musx-orange); color: #fff; box-shadow: var(--shadow-cta);
    text-decoration: none; white-space: nowrap;
    transition: background var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform 120ms var(--ease-out);
}
.musx-sec .wp-block-button__link:hover { background: var(--musx-orange-hover); color: #fff; box-shadow: var(--shadow-cta-hover); }
.musx-sec .wp-block-button__link:active { transform: scale(.97); }
.musx-sec .is-style-outline .wp-block-button__link {
    background: var(--paper); color: var(--ink-800);
    border: 1.5px solid var(--ink-800); box-shadow: none; font-size: 16px; font-weight: 600;
}
.musx-sec .is-style-outline .wp-block-button__link:hover { background: var(--neutral-50); color: var(--ink-800); }
.musx-sec--hero .is-style-outline .wp-block-button__link,
.musx-sec--close .is-style-outline .wp-block-button__link {
    background: transparent; color: #fff; border-color: rgba(255,255,255,.55);
}
.musx-sec--hero .is-style-outline .wp-block-button__link:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ── card grids (feature cards) ── */
.musx-sec .musx-cards { gap: 16px; margin-top: 34px; }
.musx-sec .musx-cards .wp-block-column {
    background: var(--paper); border: 1px solid var(--border);
    border-radius: var(--r-2xl); padding: 28px; box-shadow: var(--shadow-1);
}
.musx-sec .musx-cards h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: 0; margin: 0 0 10px; }
.musx-sec .musx-cards p { font-size: 14px; line-height: 1.6; color: var(--neutral-600); margin: 0; }

/* ── board chips ── */
.musx-sec .musx-boards { gap: 12px; margin-top: 18px; }
.musx-sec .musx-boards .wp-block-column {
    background: var(--paper); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 14px 18px; flex-grow: 0; flex-basis: auto !important;
}
.musx-sec .musx-boards h3 { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin: 0; }
.musx-sec .musx-boards p { font-size: 13px; color: var(--neutral-600); margin: 2px 0 0; }

/* ── FAQ details ── */
.musx-sec .wp-block-details { border-top: 1px solid var(--neutral-100); padding: 4px 0; }
.musx-sec .wp-block-details:last-of-type { border-bottom: 1px solid var(--neutral-100); }
.musx-sec .wp-block-details summary {
    font-family: var(--font-display); font-weight: 600; font-size: 16.5px;   /* DESIGN.md: Saira summaries */
    padding: 16px 28px 16px 0; cursor: pointer; list-style: none; position: relative;
}
.musx-sec .wp-block-details summary::-webkit-details-marker { display: none; }
.musx-sec .wp-block-details summary::after {
    content: ""; position: absolute; right: 4px; top: 50%;
    width: 9px; height: 9px; border-right: 2px solid var(--neutral-500); border-bottom: 2px solid var(--neutral-500);
    transform: translateY(-70%) rotate(45deg); transition: transform var(--dur-base) var(--ease-out);
}
.musx-sec .wp-block-details[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.musx-sec .wp-block-details p { font-size: 15px; line-height: 1.6; color: var(--neutral-600); margin: 0 0 14px; }

/* Card grid — a core grid-layout group of group-cards, for card counts a
   columns block cannot hold (the /teachers/ feature grid is 14). WP gives
   grid-layout groups `container-type: inline-size`, which is the exact rule
   that collapsed the homepage grids to zero-width columns in Safari
   (2026-08-25) — nothing here uses @container, so it is neutralised on day
   one rather than rediscovered. */
.musx-sec .musx-cardgrid { gap: 16px; container-type: normal !important; margin-top: 30px;
    /* WP's minimumColumnWidth grid uses auto-FILL, which keeps empty tracks —
       two cards in a three-track row sit flush left (teachers page, 2026-08-30).
       auto-fit collapses the empties so partial rows fill the width. */
    grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)) !important; }
.musx-sec .musx-cardgrid > .wp-block-group {
    background: var(--paper); border: 1px solid var(--border);
    border-radius: var(--r-2xl); padding: 24px 26px; box-shadow: var(--shadow-1);
}
.musx-sec .musx-cardgrid h3 { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: 0; margin: 0 0 8px; }
.musx-sec .musx-cardgrid p { font-size: 14px; line-height: 1.6; color: var(--neutral-600); margin: 0 0 10px; }
.musx-sec .musx-cardgrid p:last-child { margin-bottom: 0; }

/* Slim hero — the dark shell as a compact page header (FAQs, utility pages)
   rather than a full landing hero. Same paint layers, a fraction of the height. */
.musx-sec--hero.musx-sec--hero-slim { padding-block: 72px 56px; min-height: 0; }
.musx-sec--hero-slim h1 { font-size: clamp(32px, 3.6vw, 48px); }

/* The theme's theme.json sets useRootPaddingAwareAlignments but never defines
   styles.spacing.padding, so `has-global-padding` resolves to zero and content
   sits flush against the viewport edge below the 44rem column (seen at 375px:
   every left edge = 0). This is the landing pages' .wrap padding, restored.
   Placed after every section padding shorthand so the inline axis wins. */
.musx-sec { padding-inline: clamp(20px, 4vw, 32px); }

/* ── responsive ── */
@media (max-width: 781px) {
    /* block-axis only — a `padding: X 0` shorthand here would zero the inline
       padding set above (it did; found by computed padding "80px 0px 64px") */
    .musx-sec { padding-block: 52px; }
    .musx-sec--hero { min-height: 0; padding-block: 80px 64px; }
    .musx-sec .musx-boards .wp-block-column { flex-basis: 100% !important; }
}

/* ----------------------------------------------------------
   Reveal-on-scroll (musx-reveal.js) — restored 2026-08-29.
   html.rv-on is stamped ONLY by the script, so without JS
   nothing on the page is ever hidden. The script tags targets
   with .rv at runtime (FSE markup can't carry the class).
   Component (.musx-pc) internals — ring arc, chart draw —
   define their own rv-on rules in musx-page-components.php.
   ---------------------------------------------------------- */
.rv-on .rv {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .9s cubic-bezier(.22,1,.36,1), transform .9s cubic-bezier(.22,1,.36,1);
}
.rv-on .musx-card.rv,
.rv-on .musx-cards > .rv,
.rv-on .musx-cardgrid > .rv,
.rv-on .musx-boards > .rv { transition-duration: 1.4s; }
.rv-on .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .rv-on .rv, .rv-on .rv.in { opacity: 1; transform: none; transition: none; }
}

/* ----------------------------------------------------------
   Theme switcher (navbar) — added 2026-08-30. The button shows
   the ICON OF THE MODE YOU WOULD SWITCH TO. html.rv never hides
   it; without JS the button is removed entirely by theme.js not
   running, since it is rendered but does nothing — so it is
   hidden until JS arms it. -- see theme.js
   ---------------------------------------------------------- */
.musx-theme-toggle {
    display: none;                    /* armed by theme.js */
    align-items: center; justify-content: center;
    /* flex: none — five nowrap nav labels otherwise crush this to a
       9px sliver in the header flex row (found by critique run 2). */
    flex: 0 0 44px;
    width: 44px; height: 44px;
    border: 1px solid var(--musx-line); border-radius: 50%;
    background: var(--paper); color: var(--musx-ink);
    cursor: pointer; padding: 0;
}
.musx-theme-toggle.is-armed { display: inline-grid; place-items: center; }
.musx-theme-toggle:hover { border-color: var(--musx-orange-ink); color: var(--musx-orange-ink); }

/* Sun and moon morph rather than cut. Both icons are always rendered and
   stacked in ONE grid cell — grid-area, not position:absolute, because the
   animation needs `transform` and an absolutely-positioned icon would have to
   spend it on translate(-50%,-50%) to stay centred. The state is the same
   html.musx-dark the rest of the theme uses, so no JS changed. */
.musx-theme-toggle svg {
    grid-area: 1 / 1;
    width: 18px; height: 18px; display: block;
    transition: opacity .3s ease, filter .3s ease, transform .3s ease;
}
/* Which icon is showing follows the BUTTON's data-mode, not html.musx-dark,
   because the button must tell "dark by choice" apart from "dark because the
   system is dark" — those are different states with different next steps. */
.musx-theme-toggle .icon-sun,
.musx-theme-toggle .icon-moon,
.musx-theme-toggle .icon-auto { opacity: 0; filter: blur(6px); transform: scale(.7) rotate(-20deg); }
.musx-theme-toggle[data-mode="light"]  .icon-sun,
.musx-theme-toggle[data-mode="dark"]   .icon-moon,
.musx-theme-toggle[data-mode="system"] .icon-auto { opacity: 1; filter: blur(0); transform: scale(1) rotate(0deg); }

@media (prefers-reduced-motion: reduce) {
    .musx-theme-toggle svg { transition: none; }
}

/* ----------------------------------------------------------
   Teachers & Schools band (homepage, 2026-08-30).
   DOM order is card-first so mobile leads with the payoff;
   desktop reverses so copy reads on the left. Steps inside
   the copy column go horizontal-badge (left-aligned) rather
   than the centred grid the standalone stepgrid uses.
   ---------------------------------------------------------- */
/* Five nav items squeeze labels into wrapping at laptop widths — keep each
   label on one line; the flex gap absorbs the difference. */
.musx-nav-list a { white-space: nowrap; }

.musx-section .musx-teachband { align-items: center; }
@media (min-width: 782px) {
    .musx-section .musx-teachband { flex-direction: row-reverse; }
}
.musx-section .musx-teachband .musx-step {
    display: flex; gap: 16px; text-align: left; align-items: flex-start;
    margin-bottom: 18px;
}
.musx-section .musx-teachband .musx-step:last-child { margin-bottom: 0; }
.musx-section .musx-teachband .musx-step-n { flex: 0 0 48px; margin-bottom: 0; }
/* WP block-gap puts 24px above the text group, sinking the title below the
   badge — zero it so the circle top and the step title top align. */
.musx-section .musx-teachband .musx-step > .wp-block-group { margin-top: 0; }
.musx-section .musx-teachband .musx-step h3 { margin-bottom: .2em; }
.musx-section .musx-teachband .musx-step p { margin: 0; font-size: .95rem; }

/* 18.72px/700 = WCAG large text, so white on MUSX Orange (3.30:1) passes
   AA-large; 16px/600 did not. Compound selector because WP global styles
   re-declare font-size on .wp-element-button after the theme sheet. */
.wp-block-button__link.wp-element-button {
    font-size: 1.17rem !important;
    font-weight: 700 !important;   /* AA-large requires BOLD at this size */
}

/* The header CTA now matches the nav items at 14px (Barry, 7 Sep). That is the
   whole reason it was 18.72px/700: at that size white on #fe5000 qualified as
   AA-LARGE and passed on 3:1. Shrinking it forfeits the exemption and normal
   AA (4.5:1) applies, so the button takes --musx-orange-aa instead. Size and
   colour here are one change, not two. */
a.musx-header-cta.btn {
    font-size: 14px !important;
    font-weight: 700 !important;
    padding: 9px 18px;
    min-width: 0;
    white-space: nowrap;   /* it lost the 200px min-width, so "Sit a full paper" wrapped */
    background: var(--musx-orange-aa);
}
a.musx-header-cta.btn:hover { background: #b83a00; }

/* ----------------------------------------------------------
   Tap-target floor (overnight pass 2026-08-31): 44px controls,
   padded inline links in the footer so the hit box is the row,
   not the 17px text line.
   ---------------------------------------------------------- */
.musx-menu-toggle { min-width: 44px; min-height: 44px; }
.musx-footer a, footer.musx-footer a, .musx-footer-links a {
    display: inline-block;
    padding-block: 10px;
}

/* Dark-shell inline links use the dark-ground orange (2026-08-31) — the
   close shell was serving raw #fe5000 while the hero used #ff8a4c.
   Literal: shells are fixed scenery. */
.musx-sec--hero a:not(.wp-block-button__link),
.musx-sec--close a:not(.wp-block-button__link) { color: #ff8a4c; }

/* Card headings promoted to h2 for outline order keep their h3 scale. */
.musx-sec h2.h3-scale { font-size: 1.15rem; text-align: left; margin-bottom: .35em; }

/* Unbroken raw-URL links in FAQ answers widened the 375px viewport to
   462px (overnight scan). Guard: long tokens wrap inside accordion and
   content bodies. */
.wp-block-details p, .musx-content p { overflow-wrap: anywhere; }

/* Quiz cards: the whole card is the tap target (overnight scan found all
   47 "Start quiz" links at 93x18px with inert cards). Stretched-link over
   the card; the visible link also gets a padded hit box. */
.mt-quiz-card { position: relative; }
.mt-quiz-card > a[href]::after { content: ""; position: absolute; inset: 0; }
.mt-quiz-card a, .mt-grade-head a { display: inline-block; padding-block: 10px; }

/* Jump-link targets clear the sticky header. */
.musx-content h2, .musx-content h3 { scroll-margin-top: calc(var(--musx-header-h, 97px) + 12px); }

/* ----------------------------------------------------------
   Paper row — closes each grade's quiz grid on /music-theory/
   (Barry 2026-08-31). Visually its own object: Ink surface, one
   line of invitation, one quiet CTA. Never a card in the grid.
   ---------------------------------------------------------- */
.mt-paper-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: clamp(16px, 3vw, 32px);
    margin-top: 22px; padding: 22px clamp(20px, 3vw, 30px);
    border-radius: var(--r-lg, 16px);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
}
.mt-paper-row__lead { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin: 0 0 4px; color: #fff; }
.mt-paper-row__sub  { margin: 0; font-size: .92rem; line-height: 1.55; color: rgba(255,255,255,.82); }
.mt-paper-row__sub b { color: #fff; }
.mt-paper-row__cta {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: .4em;
    background: var(--musx-orange-aa); color: #fff; font-weight: 700; font-size: 1.05rem;
    padding: 12px 22px; border-radius: 999px; text-decoration: none;
    box-shadow: var(--shadow-cta);
}
.mt-paper-row__cta::after { content: "→"; }
.mt-paper-row__cta:hover { background: var(--musx-orange-aa-hover, #b03600); }
@media (max-width: 640px) {
    .mt-paper-row { flex-direction: column; align-items: flex-start; }
    .mt-paper-row__cta { width: 100%; justify-content: center; }
}

/* Phones: in-content buttons wrap instead of running off the viewport. The
   nowrap above suits desktop; a long label ("Get feedback before exam day →")
   plus iOS text sizing overflowed on Barry's phone, 3 Sep 2026. */
@media (max-width: 700px) {
    .musx-sec .wp-block-button__link,
    .wp-block-button__link {
        white-space: normal;
        max-width: 100%;
        text-align: center;
        line-height: 1.25;
    }
}

/* Anchored grade sections must clear the sticky header when jumped to from the
   syllabus nav at the top of /music-theory/. */
#abrsm-g1, #abrsm-g2, #abrsm-g3, #abrsm-g4, #abrsm-g5,
#ameb-g1, #trinity-g1 { scroll-margin-top: calc(var(--musx-header-h, 97px) + 12px); }
}

/* /music-theory/ hero — the question-count line under the subtitle.
   Slightly smaller than the subtitle so it reads as supporting evidence
   rather than competing with it; the number itself carries the weight. */
/* Ancestor-qualified: a bare .musx-hero-count loses to `.musx-hero p`
   (1.1rem), which is the house trap — the component's own descendant rule
   outranks a new single class, so the size silently did nothing. */
.musx-hero p.musx-hero-count {
    /* Its own breathing room: it is a separate claim from the subtitle, not a
       third line of it. */
    margin-top: 22px !important;
    font-size: 1rem;
    line-height: 1.5;
    opacity: .92;
}
.musx-hero p.musx-hero-count strong { font-weight: 700; }
@media (max-width: 600px) {
    .musx-hero p.musx-hero-count { font-size: .95rem; }
}

/* Scores Apart article list (/scores-apart/): titles in the heading colour, not the link orange (Barry, 1 Nov 2026). */
.wp-block-query .wp-block-post-title a { color: var(--musx-ink); text-decoration: none; }
.wp-block-query .wp-block-post-title a:hover { color: var(--musx-orange-ink); text-decoration: none; }
.wp-block-query .wp-block-post-featured-image, .wp-block-query .wp-block-post-featured-image img { border-radius: 3px; overflow: hidden; }

/* Podcast hub (/podcast/, behind musicexams.com/barry): on phones the show's
   cover art comes first, above the heading (Barry, 27 Nov 2026). The columns
   keep text-then-image order in the markup for desktop; this only reorders
   them once core has stacked them (its breakpoint, 781px). */
@media (max-width: 781px) {
    .musx-sec--hero .musx-hub-hero > .wp-block-column:last-child { order: -1; }
    .musx-sec--hero .musx-hub-hero img { width: 100% !important; height: auto; }   /* full-width cover on phones; desktop keeps its 230px tile */
}
