/*
Theme Name: LMS Blueprint Theme
Theme URI: https://lmsblueprint.com
Author: Academic Method
Author URI: https://academicmethod.com
Description: A cinematic block theme for LMS Blueprint — parchment and ink with gold accents, IBM Plex Serif / Sans / Mono typography (one superfamily, 0.45.49). Ships patterns for a cinematic homepage hero, a complete course landing page, a shop introduction, and a closing call-to-action. Designed as the shell around the LMS Blueprint plugins, which style their own lesson, dashboard, and store output.
Version: 0.27.8
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cognition-theme
Tags: education, e-commerce, block-patterns, full-site-editing, one-column
*/

/* All styling lives in theme.json. This file exists for the theme header
   and a few refinements that theme.json cannot express. */

/* ==========================================================================
   THE THREE VALUES THE HOME-PAGE REBUILD SET, 9 Sep 2026 (row 119 §2).
   All three are ADDITIVE — nothing was undone to make room for them, because
   the card's premise was wrong on both counts and the measurement is on the
   record: this theme was serving heading `line-height: 1.15` (not the ~1.4
   the card predicted), no heading letter-spacing at all, and
   `overflow-x: hidden` ZERO times in all 148,673 bytes of CSS served on the
   home page. So no sticky or pinned section was ever blocked here.
   ⚑ Law 21c: these belong in the theme, not on one page. A customer building
   a pinned section on a fresh install hits the same two settings, and now
   gets them right by default.
   ========================================================================== */

/* 1 · Display headings are tight. theme.json says 1.15, which is a sensible
      body-copy-ish default and wrong for a serif display face. */
h1, h2, h3, h4, h5, h6 {
	line-height: 1;
}

/* 2 · …and negatively tracked. Without this every colour and every spacing
      value is correct and the page still reads generic. */
h1, h2, h3, h4, h5, h6 {
	letter-spacing: -0.025em;
}

/* 3 · clip, NOT hidden. `overflow-x: hidden` makes html/body scroll
      containers, and sticky's nearest-scrolling-ancestor lookup then never
      reaches the document — every position:sticky on the site dies silently,
      including the six-pillar cube's 6300px pinned section. `clip` clips
      without creating a scrollport. cb-lms.css already carries this reasoning
      for the lesson canvas; this is the same fix at document level. */
html, body {
	overflow-x: clip;
}

/* ---- Motion + shape tokens (the Wonderment-derived signature curve) ---- */
:root {
	--cog-ease: cubic-bezier(0.24, 0, 0.16, 1.01);
	--cog-dur: 0.55s;
	--cog-radius: 10px;
}

/* Photographic hero — bundled cinematic image under an ink wash.
   Relative URL resolves from this stylesheet, i.e. the theme root. */
.cog-hero-photo {
	background:
		linear-gradient(180deg, rgba(15, 14, 12, 0.82) 0%, rgba(15, 14, 12, 0.68) 55%, rgba(15, 14, 12, 0.9) 100%),
		url(assets/img/hero.jpg) center 38% / cover no-repeat !important;
}

/* ---- Hide-on-scroll header (class added by header.js; static without JS
   or under prefers-reduced-motion). ---- */
.cog-hdr {
	position: sticky;
	top: 0;
	z-index: 90;
	transition: transform 0.5s var(--cog-ease), box-shadow 0.5s var(--cog-ease);
}
body.admin-bar .cog-hdr {
	top: var(--wp-admin--admin-bar--height, 32px);
}
.cog-hdr.cog-hdr--hidden {
	transform: translateY(-103%);
}
.cog-hdr.cog-hdr--scrolled {
	box-shadow: 0 1px 0 rgba(212, 175, 55, 0.28), 0 12px 32px rgba(15, 14, 12, 0.35);
}
/* A hidden header takes its shadow with it (defect card 10 Sep 2026, §3.2).
   Both classes are set while scrolling down, and the 12px/32px shadow
   reached ~44px below the translated-away header — a dark blur across the
   top of the viewport, over whatever heading had just scrolled up to it. */
.cog-hdr.cog-hdr--hidden.cog-hdr--scrolled {
	box-shadow: none;
}

/* ---- Editorial hero: left-aligned, breaks the centred habit.
   !important because constrained layout centres capped-width children
   with its own !important margins. ---- */
.cog-hero-title {
	max-width: 15ch;
	margin-left: max(0px, calc((100% - 1180px) / 2)) !important;
}
.cog-hero-sub {
	max-width: 560px;
	margin-left: max(0px, calc((100% - 1180px) / 2)) !important;
}

/* Kill the root block gap between the sticky header and the first
   section — no parchment sliver under the nav. */
.wp-site-blocks > header.wp-block-template-part + * {
	margin-block-start: 0 !important;
}

/* ---- Editorial splits: alternating text/image with oversized ghost
   numbers and staggered column offsets (the Wonderment 50%-offset move,
   tamed). ---- */
.cog-split {
	position: relative;
	overflow: visible;
}
.cog-split::before {
	position: absolute;
	top: 0.5rem;
	left: -0.5rem;
	z-index: 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: clamp(8rem, 17vw, 14rem);
	line-height: 1;
	color: var(--wp--preset--color--gold);
	opacity: 0.08;
	pointer-events: none;
	user-select: none;
}
.cog-num-1::before { content: "01"; }
.cog-num-2::before { content: "02"; }
.cog-num-3::before { content: "03"; }
.cog-split--rev::before {
	left: auto;
	right: -0.5rem;
}
.cog-split-cols {
	position: relative;
	z-index: 1;
}
.cog-split-text {
	position: relative;
	z-index: 2;
	padding-top: 3.5rem;
}
.cog-split-h {
	font-size: clamp(2.1rem, 3.8vw, 3.1rem);
	line-height: 1.1;
	max-width: none;
	margin-right: -3.5rem; /* headline overhangs into the image column */
	position: relative;
}
.cog-split--rev .cog-split-h {
	margin-right: 0;
	margin-left: -3.5rem;
}
.cog-media-down { margin-top: 4.5rem; }
.cog-media-up { margin-top: -1.5rem; }
.cog-frame {
	border-radius: var(--cog-radius);
	overflow: hidden;
	margin: 0;
}
.cog-frame img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform 0.9s var(--cog-ease);
}
.cog-frame:hover img {
	transform: scale(1.05);
}
.cog-more a {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.85rem;
	letter-spacing: 1.6px;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--gold-deep);
	border-bottom: 1px solid var(--wp--preset--color--gold);
	padding-bottom: 3px;
	transition: color 0.4s var(--cog-ease), border-color 0.4s var(--cog-ease);
}
.cog-more a:hover {
	color: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
}
@media (max-width: 781px) {
	.cog-split-text { padding-top: 0; }
	.cog-split-h,
	.cog-split--rev .cog-split-h { margin-right: 0; margin-left: 0; }
	.cog-media-down,
	.cog-media-up { margin-top: 1.2rem; }
	.cog-split::before { font-size: 7rem; opacity: 0.06; }
}

/* ---- Film band: poster photo + play badge. Swap the .cog-play href for a
   real video URL (or replace the section with a video cover block) when
   footage exists. ---- */
.cog-film-photo {
	background:
		linear-gradient(180deg, rgba(15, 14, 12, 0.88) 0%, rgba(15, 14, 12, 0.72) 55%, rgba(15, 14, 12, 0.92) 100%),
		url(assets/img/film-poster.jpg) center 45% / cover no-repeat !important;
}
.cog-play-wrap { margin-top: 2.2rem; }
.cog-play {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 92px;
	height: 92px;
	border: 1px solid var(--wp--preset--color--gold);
	border-radius: 50%;
	background: rgba(15, 14, 12, 0.45);
	color: transparent !important;
	font-size: 0;
	text-decoration: none;
	position: relative;
	transition: transform 0.5s var(--cog-ease), background-color 0.5s var(--cog-ease);
}
.cog-play::before {
	content: "";
	display: block;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 13px 0 13px 22px;
	border-color: transparent transparent transparent var(--wp--preset--color--gold);
	margin-left: 5px;
	transition: border-left-color 0.5s var(--cog-ease);
}
.cog-play:hover {
	transform: scale(1.08);
	background: var(--wp--preset--color--gold);
}
.cog-play:hover::before {
	border-left-color: var(--wp--preset--color--ink);
}
@media (prefers-reduced-motion: no-preference) {
	.cog-play::after {
		content: "";
		position: absolute;
		inset: -1px;
		border-radius: 50%;
		border: 1px solid var(--wp--preset--color--gold);
		animation: cog-pulse 2.6s var(--cog-ease) infinite;
	}
	@keyframes cog-pulse {
		0% { transform: scale(1); opacity: 0.7; }
		70% { transform: scale(1.45); opacity: 0; }
		100% { transform: scale(1.45); opacity: 0; }
	}
}

/* ---- Featured band header row + manifesto quote ---- */
.cog-band-head {
	margin-bottom: 0.5rem;
}
.cog-band-head .cog-split-h {
	margin-right: 0;
	margin-bottom: 0.4rem;
}
.cog-manifesto {
	border-top: 1px solid var(--wp--preset--color--line);
}
.cog-quote {
	font-family: var(--wp--preset--font-family--body);
	font-style: italic;
	font-size: clamp(1.7rem, 3.2vw, 2.6rem);
	line-height: 1.32;
	color: var(--wp--preset--color--ink);
	border-left: 3px solid var(--wp--preset--color--gold);
	padding-left: 1.6rem;
	margin: 1rem 0 1.2rem;
}
.cog-quote-cite {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.82rem;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	padding-left: 1.9rem;
}

/* Card hover language: rise + gold edge, no shadow soup. */
.cognition-card,
.am-catalogue-card,
.cb-store-card,
.woocommerce ul.products li.product {
	transition: transform var(--cog-dur) var(--cog-ease), border-color var(--cog-dur) var(--cog-ease);
}
.cognition-card:hover,
.am-catalogue-card:hover,
.cb-store-card:hover,
.woocommerce ul.products li.product:hover {
	transform: translateY(-5px);
	border-color: var(--wp--preset--color--gold);
}

/* Images in frames scale gently on hover. */
.am-catalogue-card img,
.cb-store-card img,
.wp-block-media-text__media img {
	transition: transform 0.9s var(--cog-ease);
}
.am-catalogue-card:hover img,
.cb-store-card:hover img,
.wp-block-media-text:hover .wp-block-media-text__media img {
	transform: scale(1.05);
}

/* Buttons pick up the curve too. */
.wp-element-button,
.wp-block-button__link {
	transition: background-color 0.4s var(--cog-ease), color 0.4s var(--cog-ease), transform 0.4s var(--cog-ease);
}
.wp-element-button:hover,
.wp-block-button__link:hover {
	transform: translateY(-2px);
}

/* Headings inside ink (dark) sections — !important because cache plugins'
   generated critical CSS can importantify the global h1..h6 ink colour,
   which would render dark-on-dark inside dark bands. */
.has-ink-background-color h1,
.has-ink-background-color h2,
.has-ink-background-color h3,
.has-ink-background-color h4,
.has-ink-radial-gradient-background h1,
.has-ink-radial-gradient-background h2,
.has-ink-radial-gradient-background h3,
.has-ink-radial-gradient-background h4 {
	color: var(--wp--preset--color--text-light) !important;
}

/* Gold rule under main headings inside content */
.cognition-rule {
	width: 64px;
	height: 3px;
	background: var(--wp--preset--color--gold);
	border: 0;
	margin: 0.4rem 0 1.2rem;
}

/* Kicker — mono uppercase label used across patterns.
   D6 (28 Jul): small mono text takes the DEEP gold, not the accent —
   the accent (#b8913a) measures 2.6:1 on parchment. gold-deep clears
   4.5:1 on every light surface and remaps per pack in dark. */
.cognition-kicker {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8rem;
	letter-spacing: 2.4px;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold-deep);
}

/* Details/accordion refinement (curriculum + FAQ patterns) */
.cognition-accordion details {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 8px;
	padding: 0.9rem 1.2rem;
	margin-bottom: 0.7rem;
	background: var(--wp--preset--color--surface);
}
.cognition-accordion summary {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 600;
	font-size: 1.15rem;
	cursor: pointer;
}
.cognition-accordion details[open] summary {
	margin-bottom: 0.5rem;
}

/* Card grid used in "what you'll learn" */
.cognition-card {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 10px;
	background: var(--wp--preset--color--surface);
	padding: 1.4rem 1.5rem !important;
	height: 100%;
	box-sizing: border-box;
}

/* Cognition Suite catalogue ([am_course_list]) and store ([cb_store]) grids,
   styled to the theme when used outside the LMS page scope (e.g. the
   front-page template). */
.am-catalogue,
.cb-store-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.2rem;
	margin: 2rem 0 0;
}
.am-catalogue-card,
.cb-store-card {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 10px;
	background: var(--wp--preset--color--surface);
	padding: 1.3rem 1.4rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.am-catalogue-card img,
.cb-store-card img {
	border-radius: 8px;
	width: 100%;
	height: auto;
}
.am-catalogue-card h3 {
	margin: 0.2rem 0 0;
	font-size: 1.3rem;
}
.am-catalogue-card h3 a {
	text-decoration: none;
	color: var(--wp--preset--color--ink);
}
.am-cat-excerpt { color: var(--wp--preset--color--muted); margin: 0; }
.am-cat-price {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.9rem;
	letter-spacing: 1px;
	color: var(--wp--preset--color--gold-deep);
	margin: 0;
}
.am-catalogue-card .am-btn {
	margin-top: auto;
	align-self: flex-start;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.82rem;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	text-decoration: none;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--text-light);
	border-radius: 6px;
	padding: 0.6rem 1.2rem;
}
.am-catalogue-card .am-btn:hover {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--ink);
}

/* WooCommerce — product cards and buttons in the theme's language. */
.woocommerce ul.products li.product {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 10px;
	background: var(--wp--preset--color--surface);
	padding: 1.1rem 1.2rem;
	box-sizing: border-box;
}
.woocommerce ul.products li.product img { border-radius: 8px; }
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.25rem;
	color: var(--wp--preset--color--ink);
}
.woocommerce ul.products li.product .price,
.woocommerce div.product p.price {
	font-family: var(--wp--preset--font-family--mono);
	letter-spacing: 1px;
	color: var(--wp--preset--color--gold-deep);
}
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.82rem;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--text-light);
	border-radius: 6px;
	padding: 0.65rem 1.3rem;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--ink);
}
.woocommerce span.onsale {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--mono);
}


/* ============================================================
   SEMANTIC STATE FAMILY — DESIGN-STANDARD §6, amendment L1
   (30 Jul 2026, signed off). Four states; three tokens each;
   one shared text-on-solid token. Every value here is MEASURED
   — the full table lives in DESIGN-STANDARD §6.

   Light values are chosen against --parchment (#f4f1ea) AND
   --surface (#ffffff), and against their own surface tint.
   Dark values live in the html[data-theme="dark"] block below
   and are chosen against the dark canvas (#0f0e0c), --surface
   (#1b1915) and --panel-ink (#141210).

   Anchor hues are the V3 lesson source's own --ok / --warn /
   --danger, read live from six lesson stylesheets on 30 Jul
   2026. Ten of the pairings those literals produce fail AA as
   authored (table in §6) and NONE of the three carries a dark
   remap in any of the 38 lessons. These tokens are the lawful
   equivalents of colours the source already uses — not new
   inventions.

   THE RULE: state colour is for MEANING, never decoration.
   Identity accents (framework realms, module relations, style
   packs) are NOT states and must not borrow these.
   ============================================================ */
:root {
	/* good — correct, saved, complete, strong */
	--state-good:            #327356;
	--state-good-surface:    #e0e9de;
	--state-good-border:     #439973;
	/* warn — developing, partial, needs attention */
	--state-warn:            #8f5918;
	--state-warn-surface:    #eee2d2;
	--state-warn-border:     #c27920;
	/* bad — wrong, failed, weak, destructive */
	--state-bad:             #b03030;
	--state-bad-surface:     #ecdad4;
	--state-bad-border:      #d66969;
	/* neutral — unanswered, informational, no verdict yet */
	--state-neutral:         #696256;
	--state-neutral-surface: #e4e0d8;
	--state-neutral-border:  #928979;
	/* text/icon placed ON a solid --state-* fill (verdict badges) */
	--state-on:              #f4f1ea;
}

/* ============================================================
   THE IDENTITY-ACCENT FAMILY — DESIGN-STANDARD §6d, amendment L6
   (3 Aug 2026, sanctioned). Four positional slots, two tokens
   each: a foreground and a 1px rule. Every value below is
   MEASURED — the full table lives in DESIGN-STANDARD §6d.

   WHAT IT IS FOR, AND WHAT IT IS NOT.
   -----------------------------------
   IDENTITY distinguishes things that are PARALLEL — four realms
   of one framework, three module relations, the members of any
   set where no member is better than another. STATE judges them:
   right, wrong, partial, pending. They are never substitutable.
   §6a rule 2 already forbade identity borrowing --state-*; this
   family is the home that rule promised, and the ban now runs in
   BOTH directions (a verdict may not borrow --identity-* either).

   DERIVED FROM THE SOURCE, NOT CHOSEN.
   ------------------------------------
   Censused across all 38 V3 teaching lessons on 3 Aug 2026:
   dd-realm appears 154 times in 37 documents, and carries 140
   DISTINCT realm names — so a realm has no stable name to hang a
   token on. The slot is POSITIONAL, and the ramp cycles beyond
   four (nth-child(4n+k)).

   Two members ship as the source's OWN values, untouched:

     slot 1 blue    light #2C5BB5  = .wbcard__status--same
                    dark  #6B9BE8  = .wheel__card --w-clarity
     slot 3 violet  light #7B3FA8  = .wbcard__status--next
                    dark  #B58FD4  = .wheel__card --w-integration

   That is not a coincidence dressed up as a finding: V3's wbcard
   status trio is authored against the PAGE canvas (light-legal,
   dark-illegal — measured 2.52–3.65:1 on the dark lesson
   surfaces) and V3's wheel realm hues are authored against a
   FIXED-DARK card (dark-legal, light-illegal — 2.36–2.86:1 on
   the light ones). The source already held one half of each pair
   and never put them together. This family does.

   TWO MOVES AND TWO REFUSALS, each with a number:

     slot 2  V3's .wbcard__status--up #1F7A56 measures dE2000 3.5
             from --state-good #327356 — the same colour to the
             eye. Identity that reads as a verdict is exactly what
             §6a rule 2 forbids, so the hue moved to sea-green
             (189.5°) — the minimum move that clears the family's
             own separation floor. Lightness then solved for AA.
     slot 4  V3's .wheel__card --w-conflict #D77545 measures
             dE2000 11.4 from --state-warn. The warm arc is state
             territory and there is no room in it, so the amber is
             REFUSED and slot 4 is magenta — the same refusal
             shape as L2's gold eyebrow and L3's five.
     gold    .wheel__card --w-craft #C8963E is the course accent:
             customer-settable (am_lms_design_accent) and measured
             2.6–2.94:1 on canvas. Decoration only, never a member.

   THE SEPARATION FLOOR IS THE SOURCE'S OWN. V3 puts --same
   (#2C5BB5) and --next (#7B3FA8) side by side in every wbcard
   grid; they sit dE2000 18.8 apart in light. No member of this
   family sits closer than that to another member, or to any
   --state-* token, in either scheme. Read off, not chosen.
   test-lesson-framework.php recomputes every one of those
   distances from these values and fails below the floor.
   ============================================================ */
:root {
	/* slot 1 — blue    · source: .wbcard__status--same, verbatim */
	--identity-1:        #2C5BB5;
	--identity-1-border: #5b86d7;
	/* slot 2 — sea-green · source: .wbcard__status--up, hue moved off --state-good */
	--identity-2:        #1a7384;
	--identity-2-border: #2191a6;
	/* slot 3 — violet  · source: .wbcard__status--next, verbatim */
	--identity-3:        #7B3FA8;
	--identity-3-border: #a472ca;
	/* slot 4 — magenta · extension; the wheel's amber is refused (see above) */
	--identity-4:        #c9187b;
	--identity-4-border: #f826a1;
}

/* ============================================================
   Dual-scheme (light / dark) — DESIGN-STANDARD §6.
   Light stays identical to the approved references; dark is a
   token remap only. Panel-ink tokens (ink / ink-soft / text-light)
   never remap, so dark ink bands stay ink in BOTH schemes and read
   as subtle elevation (#141210) on the dark canvas (#0f0e0c).
   ============================================================ */
html[data-theme="dark"] {
	color-scheme: dark;
	/* page + elevations flip to a warm ink scale */
	--wp--preset--color--parchment: var(--wp--custom--dark--parchment, #0f0e0c);
	--wp--preset--color--surface:   var(--wp--custom--dark--surface, #1b1915);
	/* text flips to a bone scale */
	--wp--preset--color--prose:  var(--wp--custom--dark--prose, #ece7da);
	--wp--preset--color--muted: var(--wp--custom--dark--muted, #a39c8a);
	/* D1 (27 Jul) — headings used to point at `ink`, which is a scheme-STABLE
	   surface/elevation + text-on-gold token, so every h1–h6 rendered #141210
	   on the #0f0e0c canvas (1.03:1 — invisible). Headings now have their own
	   token, which REMAPS here. `ink` itself is deliberately left alone:
	   remapping it would break gold buttons (color:ink on gold), span.onsale,
	   catalogue card hovers and every background:ink elevated surface.
	   Light value (#141210) is unchanged, so light is pixel-identical.
	   #f4efe2 sits a touch above body bone (#ece7da) — display type wants the
	   extra lift on dark; matches the Cinematic Ink pack's existing choice.
	   Pack-agnostic: every pack shares this dark canvas. */
	--wp--preset--color--heading: var(--wp--custom--dark--heading, #f4efe2);
	/* chrome flips */
	--wp--preset--color--line: var(--wp--custom--dark--line, #2c281e);
	/* PAGEKIT1 C1 · a pack may declare its dark palette under
	   settings.custom.dark (theme.json custom → --wp--custom--dark--<slug>).
	   Declared values win; the values here are the fallback, so a site whose
	   palette declares nothing (the base palette) renders as before. Ink,
	   ink-soft and text-light stay scheme-stable and are never remapped. */
	/* The accent is NOT forced here anymore — it's remapped per pack just
	   below (B1), so each pack keeps its identity in dark instead of every
	   pack collapsing to gold. ink / ink-soft / text-light are panel-ink
	   tokens — never remap. */

	/* Semantic state family — the measured dark remap (§6, amendment L1).
	   Keep value-equal to the panel-ink band block above: a band is dark in
	   both schemes, so both places carry the same values. */
	--state-good:            #4fb286;
	--state-good-surface:    #1b2c22;
	--state-good-border:     #327255;
	--state-warn:            #c37a21;
	--state-warn-surface:    #2f2110;
	--state-warn-border:     #905a18;
	--state-bad:             #d35e5e;
	--state-bad-surface:     #2c1412;
	--state-bad-border:      #bc3333;
	--state-neutral:         #a39c8a;
	--state-neutral-surface: #2a2823;
	--state-neutral-border:  #6c6655;
	--state-on:              #141210;

	/* Identity-accent family — the measured dark remap (§6d, amendment L6).
	   Keep value-equal to the body.am-focus.cb-dark mirror AND to the
	   panel-ink band block: a band is dark in both schemes, so all three
	   places carry the same values. test-lesson-framework.php asserts it. */
	--identity-1:        #6B9BE8;
	--identity-1-border: #2268d8;
	--identity-2:        #2295aa;
	--identity-2-border: #1b7788;
	--identity-3:        #B58FD4;
	--identity-3-border: #8d52bd;
	--identity-4:        #ea48a2;
	--identity-4-border: #ce187d;
}


/* ============================================================
   THE LESSON SURFACE HAS A SECOND SWITCH — and the state family
   has to follow it. Measured live on 30 Jul 2026: on a lesson
   (and the /my-courses/ dashboard) the canvas is painted by
   `body.cb-light` / `body.cb-dark`, driven by the reader's own
   `cbMode` and its `.am-mode-toggle`. `html[data-theme]` does
   NOT repaint that canvas. So a component reading `--state-*`
   there would take the DARK green (#4fb286) onto the LIGHT
   parchment canvas — 2.59:1, the exact failure this family
   exists to prevent, on the one surface it exists for.

   The same class of bug as the 27 Jul reader regression: the
   presets follow <html data-theme>, the lesson chrome follows
   body.cb-dark, and those are different switches.

   Scope is `body.am-focus` deliberately. Only the focus-lesson
   and dashboard shells carry cb-light/cb-dark as a LIVE switch;
   the design module also puts a STATIC `cb-dark` on the course
   landing, cart and account, where the canvas follows
   data-theme and this mirror must NOT fire. Verified live:
   /lms/ and /courses/{slug}/ carry neither class.

   ⚑ Reconciling the two switches (making the shell follow
   data-theme, or vice versa) is its own card. This mirror makes
   the tokens correct in the meantime, and costs nothing if the
   switches are later unified.
   ============================================================ */
body.am-focus.cb-light {
	--state-good:            #327356;
	--state-good-surface:    #e0e9de;
	--state-good-border:     #439973;
	--state-warn:            #8f5918;
	--state-warn-surface:    #eee2d2;
	--state-warn-border:     #c27920;
	--state-bad:             #b03030;
	--state-bad-surface:     #ecdad4;
	--state-bad-border:      #d66969;
	--state-neutral:         #696256;
	--state-neutral-surface: #e4e0d8;
	--state-neutral-border:  #928979;
	--state-on:              #f4f1ea;
	--identity-1:        #2C5BB5;
	--identity-1-border: #5b86d7;
	--identity-2:        #1a7384;
	--identity-2-border: #2191a6;
	--identity-3:        #7B3FA8;
	--identity-3-border: #a472ca;
	--identity-4:        #c9187b;
	--identity-4-border: #f826a1;
}
body.am-focus.cb-dark {
	--state-good:            #4fb286;
	--state-good-surface:    #1b2c22;
	--state-good-border:     #327255;
	--state-warn:            #c37a21;
	--state-warn-surface:    #2f2110;
	--state-warn-border:     #905a18;
	--state-bad:             #d35e5e;
	--state-bad-surface:     #2c1412;
	--state-bad-border:      #bc3333;
	--state-neutral:         #a39c8a;
	--state-neutral-surface: #2a2823;
	--state-neutral-border:  #6c6655;
	--state-on:              #141210;
	/* Identity-accent family — the measured dark remap (§6d, amendment L6).
	   Keep value-equal to the body.am-focus.cb-dark mirror AND to the
	   panel-ink band block: a band is dark in both schemes, so all three
	   places carry the same values. test-lesson-framework.php asserts it. */
	--identity-1:        #6B9BE8;
	--identity-1-border: #2268d8;
	--identity-2:        #2295aa;
	--identity-2-border: #1b7788;
	--identity-3:        #B58FD4;
	--identity-3-border: #8d52bd;
	--identity-4:        #ea48a2;
	--identity-4-border: #ce187d;
}

/* ---- The state family inside a PANEL-INK band. Bands don't flip
   (rule 1), so a band is dark in BOTH schemes and carries the DARK
   state values in both. The `body.am-focus` selectors are listed so
   the band still wins inside the lesson shell, where the mirror above
   raises the surrounding specificity — a selector list applies each
   selector at its OWN specificity, so one block covers both. Keep
   value-equal to the dark remap; test-state-tokens.php asserts it. ---- */
.has-ink-background-color,
.has-ink-radial-gradient-background,
[data-cb-band="ink"],
body.am-focus .has-ink-background-color,
body.am-focus .has-ink-radial-gradient-background,
body.am-focus [data-cb-band="ink"] {
	--state-good:            #4fb286;
	--state-good-surface:    #1b2c22;
	--state-good-border:     #327255;
	--state-warn:            #c37a21;
	--state-warn-surface:    #2f2110;
	--state-warn-border:     #905a18;
	--state-bad:             #d35e5e;
	--state-bad-surface:     #2c1412;
	--state-bad-border:      #bc3333;
	--state-neutral:         #a39c8a;
	--state-neutral-surface: #2a2823;
	--state-neutral-border:  #6c6655;
	--state-on:              #141210;
	/* Identity-accent family — the measured dark remap (§6d, amendment L6).
	   Keep value-equal to the body.am-focus.cb-dark mirror AND to the
	   panel-ink band block: a band is dark in both schemes, so all three
	   places carry the same values. test-lesson-framework.php asserts it. */
	--identity-1:        #6B9BE8;
	--identity-1-border: #2268d8;
	--identity-2:        #2295aa;
	--identity-2-border: #1b7788;
	--identity-3:        #B58FD4;
	--identity-3-border: #8d52bd;
	--identity-4:        #ea48a2;
	--identity-4-border: #ce187d;
}

/* ---- B1 · Pack-aware dark accent. The global dark remap used to force
   every pack's accent to gold (#c8a96e), so Modern Mono's blue and
   Editorial's oxblood vanished in dark. Instead, each pack's accent gets a
   dark-legible lift that keeps its hue — the token law's "gold brightens on
   dark" rule, generalised per pack. data-pack is set by cbm3.js from the
   non-remapping --ink signature, so it's correct in both schemes. Cinematic
   Ink is inherently dark and its gold already reads on the dark canvas, so it
   takes no override (the generic dark rule no longer touches the accent). ---- */
html[data-theme="dark"][data-pack="gold"] {          /* default — gold brightens (token law) */
	--wp--preset--color--gold:      var(--wp--custom--dark--gold, #c8a96e);
	--wp--preset--color--gold-deep: var(--wp--custom--dark--gold-deep, #d4af37);
}
html[data-theme="dark"][data-pack="editorial"] {     /* oxblood → lifted, still oxblood */
	--wp--preset--color--gold:      var(--wp--custom--dark--gold, #cf5b4e);
	--wp--preset--color--gold-deep: var(--wp--custom--dark--gold-deep, #b23e33);
}
html[data-theme="dark"][data-pack="modern-mono"] {   /* electric blue → lifted for dark */
	--wp--preset--color--gold:      var(--wp--custom--dark--gold, #5b8bff);
	--wp--preset--color--gold-deep: var(--wp--custom--dark--gold-deep, #3f74ff);
}
html[data-theme="dark"][data-pack="warm-academic"] { /* forest → lifted, still forest */
	--wp--preset--color--gold:      var(--wp--custom--dark--gold, #57a06b);
	--wp--preset--color--gold-deep: var(--wp--custom--dark--gold-deep, #3d7a4c);
}
html[data-theme="dark"][data-pack="lms-blueprint"] { /* PAGEKIT1 C1 · amber and gold lift (DESIGN.md); the pack declares them */
	--wp--preset--color--gold:      var(--wp--custom--dark--gold, #ffb24a);
	--wp--preset--color--gold-deep: var(--wp--custom--dark--gold-deep, #ffd98a);
}
/* Soft cross-fade on switch (JS adds .theme-anim; reduced-motion skips). */
html.theme-anim,
html.theme-anim body {
	transition: background-color 0.4s var(--cog-ease), color 0.4s var(--cog-ease);
}
@media (prefers-reduced-motion: reduce) {
	html.theme-anim, html.theme-anim body { transition: none; }
}

/* ---- The LIGHT / DARK toggle pill. A block: binds per-instance,
   any number of copies stay in sync via <html> state. ---- */
.theme-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.45ch;
	background: transparent;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 999px;
	padding: 0.34rem 0.72rem;
	cursor: pointer;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--custom--kit--toggle-size, 12px); /* PAGEKIT1 C1 (F-15): a pack sets it; PK-L (LBS-062): the base is 12px too (was 8px) */
	letter-spacing: 1.6px;
	text-transform: uppercase;
	line-height: 1;
	color: var(--wp--preset--color--muted);
	transition: border-color 0.4s var(--cog-ease), color 0.4s var(--cog-ease);
}
.theme-toggle:hover { border-color: var(--wp--preset--color--gold); }
.theme-toggle .tt-sep { opacity: 0.5; }
/* active word gold; the inactive word stays dim.
   D6 (28 Jul): in LIGHT the active word is small mono on parchment (8px then, 12px since PK-L) — the
   accent gold (#b8913a, 2.6:1) and even the old deep gold (#8a6d1f,
   4.34:1) both fail AA there. Light points at gold-deep, whose default
   value is darkened to clear 4.5:1 (theme.json); dark keeps the accent
   (gold on ink measures 8.6:1). Pack accents keep their own hue — each
   pack carries its own gold-deep. */
html[data-theme="light"] .theme-toggle .tt-l { color: var(--wp--preset--color--gold-deep); }
html[data-theme="dark"]  .theme-toggle .tt-d { color: var(--wp--preset--color--gold); }
/* a toggle sitting inside a dark ink band (header / footer / lesson bar) */
.has-ink-background-color .theme-toggle,
.has-ink-radial-gradient-background .theme-toggle {
	color: rgba(237, 233, 225, 0.5);
	border-color: rgba(255, 255, 255, 0.16);
}
.has-ink-background-color .theme-toggle:hover,
.has-ink-radial-gradient-background .theme-toggle:hover { border-color: var(--wp--preset--color--gold); }


/* ============================================================
   Bridge the LMS design shell (.cb-lms) to the theme's data-theme
   dual-scheme. The design module paints plugin surfaces (course
   landing, cart, account, dashboard) with a STATIC `cb-dark` body
   class, which ignores the LIGHT/DARK toggle. These rules re-point
   the shell's --cb-* tokens and canvas by html[data-theme], so those
   surfaces follow the toggle.

   :not(.am-focus, .am-focus *) — TWO-SWITCHES RECONCILIATION (card,
   31 Jul 2026). body.am-focus (the lesson reader + /my-courses/ +
   lesson-list shell) carries `.cb-lms` too, so this bridge used to
   reach it — at equal or greater specificity than the reader's OWN
   body.am-focus.cb-light/dark rules in focus.css — meaning data-theme,
   a switch with no UI on a lesson page at all, could silently outvote
   the reader's own cbMode toggle. First cut excluded only `.am-focus`
   itself; the pixel-conservation screenshot-diff proof caught that
   several components render `.cb-lms` on a DESCENDANT of `.am-focus`
   without carrying `.am-focus` on that element too (e.g. the quiz —
   `class-am-quiz-render.php` emits `<div class="am-quiz cb-lms">`
   several levels inside `body.am-focus`), so `:not(.am-focus)` alone
   still matched it and data-theme kept painting it directly. Excluding
   `.am-focus *` as well (any descendant of `.am-focus`, not just
   `.am-focus` itself) closes that regardless of which component or
   how deep — makes body.cb-* the ONLY switch anywhere inside the
   shell; data-theme still sits on <html>, inert there. focus.css's
   body.am-focus.cb-light/.cb-dark blocks were raised to be fully
   self-sufficient (every --cb-* token this bridge used to supply) so
   the two matched states repaint byte-for-byte identically to before.
   See DESIGN-STANDARD §6a-bis.
   ============================================================ */
html[data-theme="light"] .cb-lms:not(.am-focus, .am-focus *) {
	--cb-ink: #f4f1ea; --cb-surface: #ffffff; --cb-surface-2: #faf7ef;
	--cb-line: rgba(26, 26, 26, 0.12); --cb-text: #1c1a16; --cb-muted: #6b6457;
	--cb-accent: #b8913a;
}
html[data-theme="dark"] .cb-lms:not(.am-focus, .am-focus *) {
	--cb-ink: #0f0e0c; --cb-surface: #17150f; --cb-surface-2: #1f1c15;
	--cb-line: rgba(212, 175, 55, 0.18); --cb-text: #ece7da; --cb-muted: #a39c8a;
	--cb-accent: #c8a96e;
}
/* D7 (28 Jul) — empty-state text ("No courses available yet.", "No
   products yet.") renders the LMS module's hardcoded --am-muted grey
   (#6b6b6b), which measured 3.62:1 on the dark canvas. Re-point it at
   the theme's remapping muted token so it follows the scheme (light
   #6b6457 = 5.2:1, dark #a39c8a = 7.1:1). p.am-empty out-specifies the
   module's .am-empty; the fallback keeps foreign-theme behaviour. The
   ROOT fix (frontend.css :root --am-muted) belongs to the next LMS
   module session — the bundle can't ship from this theme session while
   S-SCHEMA holds the storefront. */
p.am-empty {
	color: var(--wp--preset--color--muted, #6b6b6b);
}

/* D6 ride-along (28 Jul) — the storefront's sale price (`.cb-price ins`)
   falls back to a literal #b8932e where the .cb-lms shell isn't present
   (single product pages): 2.6:1 on parchment in light. Dark passes and
   is untouched. Theme-side override only — storefront module is fenced
   (S-SCHEMA session owns it). */
html[data-theme="light"] .cb-price ins {
	color: var(--wp--preset--color--gold-deep);
}

/* Canvas: flip the design module's forced dark gradient with the scheme. */
html[data-theme="light"] .cb-lms.cb-dark:not(.am-focus, .am-focus *),
html[data-theme="light"] .cb-lms.cb-dark:not(.am-focus, .am-focus *) .am-page {
	background: var(--cb-ink);
	color: var(--cb-text);
}
html[data-theme="dark"] .cb-lms.cb-dark:not(.am-focus, .am-focus *),
html[data-theme="dark"] .cb-lms.cb-dark:not(.am-focus, .am-focus *) .am-page {
	background: radial-gradient(120% 120% at 50% 0%, #1b1810 0%, #0f0e0c 60%);
	color: var(--cb-text);
}


/* ---- Reveal fail-safe (RETIRED in M6). The above-the-fold blank-on-load
   gap is now fixed systemically in cb-motion.js: on load it marks any
   .rv / [data-reveal] / [data-split] already in the viewport as revealed
   immediately (404 / search page-heads included), so this per-surface
   override is no longer needed. ---- */


/* ============================================================
   Site chrome (header + footer) flips with the scheme.
   The reference nav is a glass bar that flips (parchment-tint in
   light, ink-tint in dark); the footer flips too. Our header/footer
   are authored as dark ink bands using the shared ink / text-light /
   ink-soft presets — so in LIGHT mode they stay stuck dark while the
   rest of the page flips (reads as broken). Fix: re-point those
   presets LOCALLY on the header/footer elements in light mode, which
   flips every has-*-color child at once. Content ink bands live in
   <main> (or use hardcoded ink), so they are untouched. Dark mode
   keeps the ink chrome (already correct), so only light is overridden.
   ============================================================ */
html[data-theme="light"] header.wp-block-template-part,
html[data-theme="light"] footer.wp-block-template-part {
	--wp--preset--color--ink: var(--wp--preset--color--parchment);
	--wp--preset--color--ink-soft: #ffffff;
	--wp--preset--color--text-light: #1c1a16;
	--wp--preset--color--muted: #6b6457;
}
/* Hardcoded rgba separators (#2c281e) flip to the light line colour. */
html[data-theme="light"] header.wp-block-template-part hr.wp-block-separator,
html[data-theme="light"] footer.wp-block-template-part hr.wp-block-separator {
	background-color: var(--wp--preset--color--line) !important;
	color: var(--wp--preset--color--line) !important;
}
/* Social icons (inline bone value) read as ink on the light chrome. */
html[data-theme="light"] header.wp-block-template-part .wp-block-social-link,
html[data-theme="light"] footer.wp-block-template-part .wp-block-social-link {
	color: #1c1a16;
}
/* The LIGHT/DARK pill now sits on a light header — use its light styling. */
html[data-theme="light"] header.wp-block-template-part .theme-toggle {
	color: var(--wp--preset--color--muted) !important;
	border-color: var(--wp--preset--color--line) !important;
}

/* ============================================================
   M4 — Consolidated one-row header (deferred from M1).
   Title left · navigation centre · search + account/cart right.
   The LIGHT/DARK pill is injected into the nav (functions.php) and
   rides at the end of the nav row. Chrome flips via the existing
   header.wp-block-template-part scheme rules above — no new colour
   literals here (DESIGN-STANDARD §6, Rule 2).
   ============================================================ */
.cb-header-bar { --cb-hdr-line: rgba(255,255,255,0.10); }
html[data-theme="light"] header.wp-block-template-part.cb-header-bar,
html[data-theme="light"] .cb-header-bar { --cb-hdr-line: var(--wp--preset--color--line); }

.cb-header-row { width: 100%; gap: 1.4rem; }
.cb-header-row > .cb-header-brand { flex: 0 0 auto; }
.cb-header-row > .cb-header-nav   { flex: 1 1 auto; min-width: 0; }
.cb-header-row > .cb-header-actions { flex: 0 0 auto; }

/* Brand — display face, quiet and confident. */
.cb-header-brand,
.cb-header-brand a {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: clamp(17px, 1.5vw, 20px);
	letter-spacing: 0.01em;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
}

/* Nav — mono, uppercase, spaced; a premium editorial nav. */
.cb-header-nav .wp-block-navigation__container { justify-content: center; align-items: center; }
.cb-header-nav .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-decoration: none;
	opacity: 0.86;
	transition: opacity 0.25s var(--cog-ease), color 0.25s var(--cog-ease);
}
.cb-header-nav .wp-block-navigation-item__content:hover { opacity: 1; color: var(--wp--preset--color--gold); }
.cb-header-nav .current-menu-item .wp-block-navigation-item__content { color: var(--wp--preset--color--gold); opacity: 1; }
/* D6 (28 Jul): on the light chrome the accent gold is 2.6:1 — the
   current-item marker and hover take the deep gold in light. */
html[data-theme="light"] .cb-header-nav .current-menu-item .wp-block-navigation-item__content,
html[data-theme="light"] .cb-header-nav .wp-block-navigation-item__content:hover,
html[data-theme="light"] .cb-header-actions .cb-header-links a:hover { color: var(--wp--preset--color--gold-deep); }

/* The injected LIGHT/DARK pill sits at the end of the nav, divided by a hairline. */
.cb-header-nav .theme-toggle { margin-left: 0.4rem; }

/* Actions cluster — search icon + account/cart. */
.cb-header-actions .cb-header-links { margin: 0; white-space: nowrap; }
.cb-header-actions .cb-header-links a { text-decoration: none; opacity: 0.86; }
.cb-header-actions .cb-header-links a:hover { opacity: 1; color: var(--wp--preset--color--gold); }
.cb-header-search .wp-block-search__button { border-radius: 999px; }

/* Tablet: nav collapses to the core overlay (hamburger); keep it centred-less.
   D8 (28 Jul): the row is nowrap, and a long site title pushed the injected
   LIGHT/DARK pill past the right edge at 390 — the brand must be the flex
   item that gives way. Shrink + ellipsis here; everything else keeps its
   natural size. */
@media (max-width: 900px) {
	.cb-header-row { gap: 0.8rem; }
	.cb-header-row > .cb-header-brand { flex: 0 1 auto; min-width: 0; }
	.cb-header-brand,
	.cb-header-brand a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.cb-header-row > .cb-header-nav { flex: 0 0 auto; }
	.cb-header-nav .wp-block-navigation__responsive-container-open { margin-left: 0.2rem; }
}
/* Phone: shed the account/cart text and the search field; hamburger + brand remain. */
@media (max-width: 560px) {
	.cb-header-actions .cb-header-links,
	.cb-header-actions .cb-header-search { display: none; }
	.cb-header-bar { padding-left: 1rem !important; padding-right: 1rem !important; }
	.theme-toggle { padding: 0.3rem 0.5rem; }
}
