/* Call to Action block — token-driven rewrite (2026-08-14).
   A variant may reassign the LAYER 1 custom properties below. It may not
   write a colour onto a button, a heading, or a link directly — every
   colour a variant needs comes from reassigning a token, never from a
   new selector. See omorphos-visual / this file's own git history for
   the specificity bug this replaces: .variant-b .btn scored 0-2-0 against
   .btn--fill's 0-1-0, so a variant could silently win an argument over a
   button's own color it was never meant to be in. Buttons are written
   once here, at 0-1-0, reading colour only from var() — there is no
   competing selector left for a variant to out-specify.

   Scoping note: .variant-a–.variant-f is a class name shared with Asset
   Cards, Email Capture, and Styled Container (VariantSelectorControl).
   Their own sitewide rules for those classes (style.css) are NOT deleted
   here — only the pieces of those rules that were CTA-exclusive
   (.call-to-action__button-*, .call-to-action__actions) were removed
   from style.css, since only this block emits those classes. Anything
   still shared (bare .section__eyebrow/.section__title/.section__description
   text colors, base padding/text-align on the bare .variant-X wrapper)
   is deliberately re-declared below at .gt-call-to-action-block.variant-X
   compound specificity (0-2-0/0-3-0) so it reliably wins for THIS block
   without touching or breaking the other three. */

/* ── LAYER 1 — token contract. Variants reassign these and nothing else
      touches button or text colour. Matches the :root fallback in
      style.css (search --cta-fill-bg there) — that fallback exists
      because 404.php renders these same button classes with no
      .gt-call-to-action-block wrapper around them at all; keep the two
      in sync if either changes. ── */
.gt-call-to-action-block {
	/* surface */
	--cta-surface: transparent;
	--cta-border-w: 0;
	--cta-border-c: transparent;
	--cta-radius: 0;
	--cta-pad-y: 0;
	--cta-pad-x: 0;
	/* type */
	--cta-eyebrow: var(--color-coffee);
	--cta-title: var(--color-text);
	--cta-desc: var(--color-text-strong);
	--cta-title-size: 28px;
	--cta-title-lh: 1.25;
	--cta-desc-size: 16px;
	/* filled button */
	--cta-fill-bg: var(--color-coffee);
	--cta-fill-fg: var(--color-on-coffee);
	--cta-fill-bg-hover: var(--color-coffee-hover);
	--cta-fill-bg-active: var(--color-coffee-press);
	/* outline button */
	--cta-outline-fg: var(--color-ink);
	--cta-outline-bd: var(--color-ink);
	--cta-outline-bg-hover: var(--color-ink);
	--cta-outline-fg-hover: var(--color-surface);
	/* text link + focus */
	--cta-link-fg: var(--color-coffee);
	--cta-link-rule: var(--color-link-rule);
	--cta-focus: var(--color-coffee);
}

/* ── LAYER 2 — structure. Identical in every variant. ── */
.gt-call-to-action-block {
	background: var(--cta-surface);
	border: var(--cta-border-w) solid var(--cta-border-c);
	border-radius: var(--cta-radius);
	padding: var(--cta-pad-y) var(--cta-pad-x);
	text-align: left;
}

/* Compound-selector re-declaration of surface/border/padding/text-align,
   prefixed with `body` for one extra guaranteed specificity tier — the
   bare .variant-a…f rules in style.css (background-color: var(--color-amber)
   on .variant-c, padding: var(--space-8)…, .variant-a/c/e/f{text-align:center})
   are 0-1-0 on the frontend, which a plain 0-2-0 compound selector here
   already beats regardless of load order. But `add_editor_style(
   get_stylesheet_uri() )` (inc/theme-setup.php) loads this entire
   stylesheet into the block editor scoped under `.editor-styles-wrapper`
   — WordPress adds that as a real ancestor class to every one of
   style.css's own selectors, IN THE EDITOR ONLY, silently bumping
   `.variant-c` there to 0-2-0. That ties this file's own compound
   selectors at the same 0-2-0, which then falls back to load order —
   and reproduced live as the editor canvas rendering variant-c with the
   OLD amber background while the real frontend render (unaffected by
   editor-styles-wrapper) rendered correctly. `body` as a real ancestor
   type-selector adds a tuple-breaking tier (0,2,1 vs style.css's
   editor-boosted 0,2,0) that wins unconditionally, in both contexts,
   regardless of stylesheet load order.

   hero-a/default are deliberately NOT in this list — unlike a/b/c/d,
   neither is one of the six variant names style.css's own
   VariantSelectorControl-shared `.variant-a`–`.variant-f` system
   defines (they're CTA-exclusive), so there's no competing style.css
   rule to guard against for either. Including them here anyway was a
   real bug, found live: it made this generic rule's `padding: var(
   --cta-pad-y) var(--cta-pad-x)` outrank hero-a's own LAYER 4 override
   below (a literal, non-token `padding: 44px 0 34px`, at a plain,
   un-prefixed 0-2-0) — silently replacing it with `44px 34px 0`
   (--cta-pad-y's second token, "34px", leaking into the shorthand's
   left/right slot, since hero-a never redefines --cta-pad-x) — i.e. a
   phantom 34px of horizontal padding hero-a never actually declared
   anywhere, plus its own intended 0-left/right lost. See variant-d's
   own LAYER 4 rule for how a variant that DOES need to stay in this
   list keeps its own override safe from the same collision. */
body .gt-call-to-action-block.variant-a,
body .gt-call-to-action-block.variant-b,
body .gt-call-to-action-block.variant-c,
body .gt-call-to-action-block.variant-d {
	background: var(--cta-surface);
	border: var(--cta-border-w) solid var(--cta-border-c);
	border-radius: var(--cta-radius);
	padding: var(--cta-pad-y) var(--cta-pad-x);
	text-align: left;
}

.gt-call-to-action-block .section__header {
	max-width: none;
	margin: 0;
}

.gt-call-to-action-block .section__eyebrow {
	font-family: var(--font-sans);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .11em;
	text-transform: uppercase;
	line-height: 1.3;
	color: var(--cta-eyebrow);
	margin: 0 0 12px;
	/* render.php outputs this as <span>, not <p> — a span is inline, and
	   inline elements ignore vertical margin entirely, which would
	   silently collapse the 12px gap above. display:block (not
	   inline-block — nothing here needs to sit beside other inline
	   content) makes the margin actually apply. */
	display: block;
}

.gt-call-to-action-block .section__title {
	font-family: var(--font-serif);
	font-weight: 600;
	font-style: normal;
	letter-spacing: -.012em;
	font-size: var(--cta-title-size);
	line-height: var(--cta-title-lh);
	color: var(--cta-title);
	margin: 0 0 10px;
}

.gt-call-to-action-block .section__description {
	font-family: var(--font-sans);
	font-weight: 400;
	line-height: 1.6;
	font-size: var(--cta-desc-size);
	color: var(--cta-desc);
	max-width: 54ch;
	margin: 0 0 22px;
}

/* Compound-selector re-declaration of eyebrow/title/description colour on
   the four variants (a/c/e/f) whose OLD style.css rules still set these
   same properties on the bare .variant-X selector (0-2-0, shared with
   Asset Cards/Email Capture — not deleted). 0-3-0 here beats that on the
   frontend, but ties it in the block editor — add_editor_style() loads
   style.css there scoped under .editor-styles-wrapper, which bumps every
   one of ITS selectors up one tier too (e.g. style.css's own
   `.variant-c .section__eyebrow`, already 0-2-0, becomes 0-3-0 in the
   editor specifically), erasing the margin this compound selector relies
   on. `body` adds one guaranteed-real tier on top (0,3,1 vs the
   editor-boosted 0,3,0) so this always wins regardless of load order, in
   both contexts — see the surface/border/padding compound rule above for
   the fuller writeup of why. b/d have no such old rule to compete with,
   but are included for uniformity so a future addition to the shared
   rules can't silently reopen this exact bug on them either. hero-a/
   default are excluded — same reasoning as the surface/border/padding
   rule above: neither is one of style.css's own six shared variant
   names, so there's nothing to guard against, and including them risked
   the identical kind of silent-override collision found there. Their
   own eyebrow/title/description colors already come from LAYER 2's
   plain (un-prefixed) bare rule, which nothing competes with. */
body .gt-call-to-action-block.variant-a .section__eyebrow,
body .gt-call-to-action-block.variant-b .section__eyebrow,
body .gt-call-to-action-block.variant-c .section__eyebrow,
body .gt-call-to-action-block.variant-d .section__eyebrow {
	color: var(--cta-eyebrow);
}

body .gt-call-to-action-block.variant-a .section__title,
body .gt-call-to-action-block.variant-b .section__title,
body .gt-call-to-action-block.variant-c .section__title,
body .gt-call-to-action-block.variant-d .section__title {
	color: var(--cta-title);
}

body .gt-call-to-action-block.variant-a .section__description,
body .gt-call-to-action-block.variant-b .section__description,
body .gt-call-to-action-block.variant-c .section__description,
body .gt-call-to-action-block.variant-d .section__description {
	color: var(--cta-desc);
}

.gt-call-to-action-block .call-to-action__actions {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
}

/* Button alignment override (editor "Button alignment" field,
   buttonAlignment attribute) — independent of variant, since every
   variant is left-aligned by default now (LAYER 2's text-align: left).
   No !important needed — unlike the old sitewide system this replaced,
   nothing else sets justify-content on .call-to-action__actions to
   compete with, so plain specificity is enough. */
.gt-call-to-action-block .call-to-action__actions--left {
	justify-content: flex-start;
}
.gt-call-to-action-block .call-to-action__actions--center {
	justify-content: center;
}

/* ── LAYER 3 — buttons. Written once, at 0-1-0. Colour comes only from
      tokens, so no variant can ever out-specify them. ── */
.call-to-action__button-primary,
.call-to-action__button-secondary,
.call-to-action__button-text {
	--cta-btn-padding: 12px 24px;
	--cta-btn-font-size: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-sans);
	font-weight: 500;
	letter-spacing: .06em;
	line-height: 1.2;
	padding: var(--cta-btn-padding);
	font-size: var(--cta-btn-font-size);
	border: 2px solid transparent;
	border-radius: 8px;
	background: transparent;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.call-to-action__button--md {
	--cta-btn-padding: 10px 20px;
	--cta-btn-font-size: 15px;
}

.call-to-action__button--sm {
	--cta-btn-padding: 8px 16px;
	--cta-btn-font-size: 13px;
}

.call-to-action__button-primary {
	background: var(--cta-fill-bg);
	border-color: var(--cta-fill-bg);
	color: var(--cta-fill-fg);
}
.call-to-action__button-primary:hover {
	background: var(--cta-fill-bg-hover);
	border-color: var(--cta-fill-bg-hover);
}
.call-to-action__button-primary:active {
	background: var(--cta-fill-bg-active);
	border-color: var(--cta-fill-bg-active);
}

.call-to-action__button-secondary {
	color: var(--cta-outline-fg);
	border-color: var(--cta-outline-bd);
}
.call-to-action__button-secondary:hover {
	background: var(--cta-outline-bg-hover);
	color: var(--cta-outline-fg-hover);
}
.call-to-action__button-secondary:active {
	filter: brightness(.88);
}

.call-to-action__button-text {
	padding-left: 0;
	padding-right: 0;
	letter-spacing: 0;
	color: var(--cta-link-fg);
	text-decoration: underline;
	text-decoration-color: var(--cta-link-rule);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}
.call-to-action__button-text:hover {
	text-decoration-color: currentColor;
}

.call-to-action__button-primary:focus-visible,
.call-to-action__button-secondary:focus-visible,
.call-to-action__button-text:focus-visible {
	outline: 2px solid var(--cta-focus);
	outline-offset: 3px;
	border-radius: 2px;
}

/* ── LAYER 4 — the six variants. Token reassignment only. ── */

/* hero-a — page lead. Centered, content-sized (never viewport-height),
   direct ask 2026-09-08 after reviewing notion.com's own hero: a big
   centered headline/subhead/button pair, with whatever sits below (the
   Reader Demo, once it ships here) already peeking into the first
   screen rather than pushed under a full-height fold.

   Currently still placed inside the homepage's 66%-width column next to
   languages-hero-block (wp:columns) — centering only reads right once
   this sits full-width, stacked above whatever's below it, not
   squeezed into a column beside something else. Direct decision,
   2026-09-08: ship this CSS now, leave the page's block layout alone
   until Reader Demo actually replaces languages-hero-block there. The
   own-column padding note below (the previous version's reasoning for
   zero top padding) no longer applies once this is centered with real
   padding of its own on all sides. */
.gt-call-to-action-block.variant-hero-a {
	--cta-title-size: clamp(2rem, 1.35rem + 2.75vw, 2.75rem);
	--cta-title-lh: 1.14;
	--cta-desc-size: 18px;
	max-width: 860px;
	margin: 0 auto;
	padding: clamp(20px, 3vw, 36px) 0 clamp(28px, 4vw, 40px);
	text-align: center;
}
/* Notion's own hero carries no eyebrow at all — the headline does the
   whole job. Visually hidden rather than removed from the markup, so a
   visitor profile match that only overrides `heading`/`description`
   (every alternate today) can't leave a orphaned label with nothing
   above it to introduce. */
.gt-call-to-action-block.variant-hero-a .section__eyebrow {
	display: none;
}
.gt-call-to-action-block.variant-hero-a .section__title {
	margin: 0 0 16px;
	letter-spacing: -.018em;
}
/* Centered multi-line text is measurably harder to scan than
   left-aligned — every line's ragged start moves, so the eye has to
   re-find the left edge each time. Left-aligned tolerated 56ch fine;
   centered wants a tighter column. */
.gt-call-to-action-block.variant-hero-a .section__description {
	max-width: 48ch;
	margin: 0 auto 28px;
	line-height: 1.65;
}
.gt-call-to-action-block.variant-hero-a .call-to-action__actions {
	gap: 22px;
	justify-content: center;
}

/* default — inline */
.gt-call-to-action-block.variant-default {
	--cta-title-size: 19px;
	--cta-desc-size: 15px;
	padding: 0;
	margin-block-start: 22px;
}
.gt-call-to-action-block.variant-default .section__title {
	margin: 0 0 6px;
}
.gt-call-to-action-block.variant-default .section__description {
	margin: 0 0 14px;
	max-width: 56ch;
}

/* a — ink */
.gt-call-to-action-block.variant-a {
	/* The Ink band keeps its look in both modes: its ground has a dark counterpart (--band-a-bg) and everything drawn on it
	   is a --fixed-* tone, so none of it flips with the site's mode. */
	--cta-surface: var(--band-a-bg);
	--cta-radius: 8px;
	--cta-pad-y: 32px;
	--cta-pad-x: 24px;
	--cta-eyebrow: var(--fixed-stone-400);
	--cta-title: var(--fixed-bg);
	--cta-desc: var(--fixed-border);
	--cta-fill-bg: var(--fixed-white);
	--cta-fill-fg: var(--fixed-ink);
	--cta-fill-bg-hover: var(--fixed-border);
	--cta-fill-bg-active: var(--fixed-stone-4);
	--cta-outline-fg: var(--fixed-white);
	--cta-outline-bd: var(--fixed-white);
	--cta-outline-bg-hover: var(--fixed-white);
	--cta-outline-fg-hover: var(--fixed-ink);
	--cta-link-fg: var(--fixed-white);
	--cta-link-rule: rgba(255, 255, 255, .4);
	--cta-focus: var(--fixed-white);
}

/* b — off-white (default panel) */
.gt-call-to-action-block.variant-b {
	--cta-surface: var(--color-bg);
	--cta-radius: 8px;
	--cta-pad-y: 32px;
	--cta-pad-x: 24px;
	--cta-eyebrow: var(--color-muted);
}

/* c — outlined */
.gt-call-to-action-block.variant-c {
	/* The bare .variant-c in style.css is the amber band and pins its text to a fixed ink; this block's c is an outlined panel on a surface. */
	color: var(--color-text);
	--cta-surface: var(--color-surface);
	--cta-border-w: 1px;
	--cta-border-c: var(--color-border);
	--cta-radius: 8px;
	--cta-pad-y: 32px;
	--cta-pad-x: 24px;
	--cta-eyebrow: var(--color-muted);
}

/* d — minimal. The class is deliberately duplicated
   (.gt-call-to-action-block.gt-call-to-action-block, giving 0-3-0) — d is
   the one variant with its own literal, non-token padding/border here
   (every other variant's padding routes through --cta-pad-y/--cta-pad-x,
   which LAYER 2's compound rule reads correctly regardless of which of
   the two rules technically wins). Plain 0-2-0 already loses to that
   compound rule's own body-prefixed 0-2-1 — confirmed live: both this
   padding AND the top/bottom border (border-top/-bottom reset by LAYER
   2's own `border` shorthand once it wins) silently disappeared. */
.gt-call-to-action-block.gt-call-to-action-block.variant-d {
	--cta-title-size: 20px;
	--cta-desc-size: 15px;
	--cta-eyebrow: var(--color-muted);
	padding: 26px 0;
	border-top: 1px solid var(--color-border);
	border-bottom: 1px solid var(--color-border);
}
.gt-call-to-action-block.variant-d .section__title {
	margin: 0 0 6px;
}
.gt-call-to-action-block.variant-d .section__description {
	margin: 0 0 16px;
}

/* level-check — the level check's card (planner-509). A structural variant like hero-a, CTA-exclusive (not one of the shared a–f names, so
   no `body` guard is needed): the assessment's own dial on the left (a fixed example, static markup from omorphos-assessment, decorative),
   the heading, description and button on the right. Panel, border and text come from role tokens; the dial's colors are the --dial-* roles
   (style.css). Stacks under 600px. The markup is built in render.php; rules: omorphos-assessment docs/CLAUDE-level-dial.md. */
.gt-call-to-action-block.variant-level-check {
	color: var(--color-text);
	--cta-surface: var(--color-surface);
	--cta-border-w: 1px;
	--cta-border-c: var(--color-border);
	--cta-radius: 10px;
	--cta-title-size: 21px;
	--cta-desc-size: 14px;
	--cta-eyebrow: var(--color-muted);
	display: grid;
	grid-template-columns: 230px minmax(0, 1fr);
	overflow: hidden;
}
.gt-call-to-action-block.variant-level-check .level-check__visual {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px 18px;
	background: var(--color-surface-alt);
	border-right: 1px solid var(--color-border);
}
.gt-call-to-action-block.variant-level-check .level-check__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	padding: 20px 26px;
}
.gt-call-to-action-block.variant-level-check .section__title {
	margin: 0 0 4px;
}
.gt-call-to-action-block.variant-level-check .section__description {
	margin: 0 0 14px;
}
/* Without the dial (the assessment plugin is off) the text and button take the whole card. */
.gt-call-to-action-block.variant-level-check:not(:has(.level-check__visual)) {
	grid-template-columns: minmax(0, 1fr);
}

/* ── LAYER 5 — responsive and motion ── */
@media (min-width: 768px) {
	.gt-call-to-action-block.variant-a,
	.gt-call-to-action-block.variant-b,
	.gt-call-to-action-block.variant-c {
		--cta-pad-y: 44px;
		--cta-pad-x: 48px;
	}
}

@media (max-width: 620px) {
	.gt-call-to-action-block.variant-hero-a {
		padding: 0 0 26px;
		--cta-desc-size: 16.5px;
	}
	.gt-call-to-action-block.variant-hero-a .section__description {
		margin-bottom: 24px;
	}
	.gt-call-to-action-block.variant-hero-a .call-to-action__actions {
		gap: 14px;
	}
	.gt-call-to-action-block {
		--cta-title-size: 24px;
	}
	.gt-call-to-action-block .call-to-action__actions {
		gap: 16px;
	}
	.gt-call-to-action-block.gt-call-to-action-block.variant-d {
		padding: 22px 0;
		--cta-title-size: 19px;
	}
}

@media (max-width: 599px) {
	.gt-call-to-action-block.variant-level-check {
		grid-template-columns: minmax(0, 1fr);
	}
	.gt-call-to-action-block.variant-level-check .level-check__visual {
		padding: 14px 16px;
		border-right: 0;
		border-bottom: 1px solid var(--color-border);
	}
	.gt-call-to-action-block.variant-level-check .level-check__body {
		padding: 18px 18px 20px;
	}
	.gt-call-to-action-block.variant-level-check .call-to-action__actions {
		width: 100%;
	}
	.call-to-action__actions {
		flex-direction: column;
		gap: var(--space-2);
	}
	.call-to-action__button-primary,
	.call-to-action__button-secondary,
	.call-to-action__button-text {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.call-to-action__button-primary,
	.call-to-action__button-secondary,
	.call-to-action__button-text {
		transition: none;
	}
}
