/**
 * Global design tokens and base styles: reset, typography, links, buttons,
 * cards, focus states, and the header/footer blocks.
 *
 * Boundary: no blog-specific rules (assets/css/blog.css), no tool/
 * calculator rules (assets/css/tools.css), and no homepage rules
 * (assets/css/home.css) — those load conditionally.
 *
 * Contrast note: #FF6B00 fails WCAG AA as a text color on white/cream and
 * even as a button background paired with white text (see Phase 2 writeup).
 * It is used here only as a background/border/decoration color, always
 * paired with --ink text on top of it.
 *
 * CHANGE LOG (homepage redesign pass):
 *   - Section 8: .btn gains position: relative; new .btn__arrow component.
 *   - Section 11 (old "Primary nav collapse") DELETED — it was superseded
 *     by the Site header block but never removed, and its rules were
 *     winning on source order and breaking the new header.
 *   - Section 11b: .newsletter-cta given a background + border; it had
 *     padding and a radius but no surface, so the panel was invisible.
 */

/* ---------------------------------------------------------------------
   1. Self-hosted fonts
   Files below are NOT included in this delivery (binary assets) — place
   Poppins SemiBold/ExtraBold and Inter Regular/Medium/Bold .woff2 files
   at these exact paths in assets/fonts/.
   ------------------------------------------------------------------ */

@font-face {
	font-family: 'Poppins';
	src: url('../fonts/poppins-semibold.woff2') format('woff2');
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Poppins';
	src: url('../fonts/poppins-extrabold.woff2') format('woff2');
	font-weight: 800;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Inter';
	src: url('../fonts/inter-regular.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Inter';
	src: url('../fonts/inter-medium.woff2') format('woff2');
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Inter';
	src: url('../fonts/inter-bold.woff2') format('woff2');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

/* ---------------------------------------------------------------------
   2. Design tokens — mirror theme.json's palette exactly; the two must
   never drift apart.
   ------------------------------------------------------------------ */

:root {
	--hashir-orange: #FF6B00;
	--ink: #111111;
	--white: #FFFFFF;
	--signal-purple: #7C3AED;
	--slate: #6B7280;
	--cream: #FAF7F2;

	/* Homepage pillar accents (approved, see homepage build). Fixed
	   background+text pairs, same pattern as --hashir-orange/--ink —
	   self-contained contrast, no dark-mode override needed:
	   yellow 9.85:1, teal 7.59:1, coral 5.14:1 with ink text;
	   navy 5.17:1 with white text. Used as accent fills only, never as
	   direct body/link text color. */
	--highlighter-yellow: #EAB308;
	--mint-teal: #14B8A6;
	--coral-pink: #F43F5E;
	--soft-navy: #2563EB;

	/* Focus rings: --ink on light surfaces, --white on dark surfaces.
	   Not a brand fact — a gap-fill, flagged at Phase 1. */
	--focus-ring-on-light: var(--ink);
	--focus-ring-on-dark: var(--white);

	--font-heading: 'Poppins', sans-serif;
	--font-body: 'Inter', sans-serif;

	--content-width: 760px;
	--wide-width: 1100px;
	--space-1: 0.5rem;
	--space-2: 1rem;
	--space-3: 1.5rem;
	--space-4: 2.5rem;

	/* Semantic roles — map to brand tokens by default (light mode).
	   Every rule below should reach for one of these, not the raw brand
	   token, whenever a color changes with the color scheme. */
	--color-bg: var(--white);
	--color-surface: var(--cream);
	--color-text: var(--ink);
	--color-text-muted: var(--slate);
	--color-focus-ring: var(--ink);
}

/* ---------------------------------------------------------------------
   2b. Dark mode — respects the OS preference by default; dark-mode.js
   (Phase 6) sets data-theme to let a visitor override it manually. No
   "elevated dark surface" color exists in the brand palette, so surfaces
   reuse --ink and rely on a subtle border for separation instead of
   inventing a new shade. --color-text-muted becomes an rgba() value
   (not --slate) because slate-on-ink is only 3.9:1 (fails AA); white at
   75% over ink resolves to roughly 9.5:1.
   ------------------------------------------------------------------ */

@media ( prefers-color-scheme: dark ) {
	:root:not( [data-theme='light'] ) {
		--color-bg: var(--ink);
		--color-surface: var(--ink);
		--color-text: var(--white);
		--color-text-muted: rgba( 255, 255, 255, 0.75 );
		--color-focus-ring: var(--white);
	}

	:root:not( [data-theme='light'] ) .card {
		border: 1px solid rgba( 255, 255, 255, 0.12 );
	}

	/* AI badge: purple-as-text clears AA on light surfaces (5.4-5.8:1) but
	   drops to 3.25:1 on ink. Swap to purple-background/white-text
	   instead — 5.8:1 — same token, different role, same fix pattern
	   used for orange since Phase 2. */
	:root:not( [data-theme='light'] ) .badge--ai {
		color: var(--white);
		background-color: var(--signal-purple);
		border-color: var(--signal-purple);
	}

	/* .btn--secondary text is white here (via --color-text); the light-mode
	   cream hover fill would put light text on a light background, so
	   dark mode gets its own subtle-light-tint hover instead. */
	:root:not( [data-theme='light'] ) .btn--secondary:hover {
		background-color: rgba( 255, 255, 255, 0.08 );
	}
}

:root[data-theme='dark'] {
	--color-bg: var(--ink);
	--color-surface: var(--ink);
	--color-text: var(--white);
	--color-text-muted: rgba( 255, 255, 255, 0.75 );
	--color-focus-ring: var(--white);
}

:root[data-theme='dark'] .card {
	border: 1px solid rgba( 255, 255, 255, 0.12 );
}

:root[data-theme='dark'] .badge--ai {
	color: var(--white);
	background-color: var(--signal-purple);
	border-color: var(--signal-purple);
}

:root[data-theme='dark'] .btn--secondary:hover {
	background-color: rgba( 255, 255, 255, 0.08 );
}

/* ---------------------------------------------------------------------
   3. Reset — minimal, not a full normalize; HTML5 elements already have
   sane defaults in evergreen browsers.
   ------------------------------------------------------------------ */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background-color: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.6;
}

img,
picture,
svg {
	max-width: 100%;
	display: block;
}

/* Every <img> in this theme must carry meaningful alt text, or alt="" when
   decorative — enforced in markup, not here (see per-template notes). */

/* ---------------------------------------------------------------------
   4. Typography
   ------------------------------------------------------------------ */

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-heading);
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 var(--space-2);
	color: var(--color-text);
}

h1 {
	font-weight: 800;
	font-size: clamp( 1.75rem, 1.4rem + 1.5vw, 2.75rem );
}

h2 {
	font-size: clamp( 1.4rem, 1.2rem + 1vw, 2rem );
}

h3 {
	font-size: clamp( 1.15rem, 1.05rem + 0.5vw, 1.5rem );
}

p {
	margin: 0 0 var(--space-2);
}

.site-description,
.entry-meta,
.card__meta {
	color: var(--color-text-muted);
	font-size: 0.9rem;
}

/* ---------------------------------------------------------------------
   5. Links — ink text with an orange underline (decorative accent only;
   text color itself never carries the AA burden with orange).
   ------------------------------------------------------------------ */

a {
	color: var(--color-text);
	text-decoration-line: underline;
	text-decoration-color: var(--hashir-orange);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.15em;
}

a:hover {
	text-decoration-thickness: 3px;
}

.site-title a,
.site-branding a {
	text-decoration: none;
	font-family: var(--font-heading);
	font-weight: 800;
}

/* ---------------------------------------------------------------------
   6. Focus states — never remove the outline without an equally visible
   replacement (WCAG 2.4.11).
   ------------------------------------------------------------------ */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
	outline: 3px solid var(--color-focus-ring);
	outline-offset: 2px;
}

/* ---------------------------------------------------------------------
   7. Skip link — hidden off-screen until keyboard-focused.
   ------------------------------------------------------------------ */

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect( 1px, 1px, 1px, 1px );
	white-space: nowrap;
}

.skip-link.screen-reader-text:focus {
	position: fixed;
	top: var(--space-1);
	left: var(--space-1);
	width: auto;
	height: auto;
	clip: auto;
	overflow: visible;
	z-index: 1000;
	background: var(--ink);
	color: var(--white);
	padding: var(--space-1) var(--space-2);
	border-radius: 4px;
	text-decoration: none;
}

/* ---------------------------------------------------------------------
   8. Buttons — orange background always paired with ink text (6.6:1).
   Hover feedback uses shadow/transform, never a text-color swap, so the
   AA-passing pairing can't accidentally regress in an interactive state.
   ------------------------------------------------------------------ */

.btn {
	/* Contains absolutely-positioned children — specifically the
	   .screen-reader-text "(opens in a new tab)" label inside the
	   homepage WhatsApp CTA. Without this the span resolves against a
	   distant ancestor and can produce a stray scroll artifact. */
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-1);
	padding: 0.75rem 1.5rem;
	border-radius: 6px;
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 1rem;
	text-decoration: none;
	border: 2px solid transparent;
	cursor: pointer;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.btn--primary {
	background-color: var(--hashir-orange);
	color: var(--ink);
}

.btn--primary:hover {
	box-shadow: 0 4px 12px rgba( 17, 17, 17, 0.2 );
	transform: translateY( -1px );
}

.btn--secondary {
	background-color: transparent;
	color: var(--color-text);
	border-color: var(--color-text);
}

.btn--secondary:hover {
	background-color: var(--cream);
}

/* Arrow affordance inside a button: <span class="btn__arrow">&rarr;</span>.
   Lives here rather than in home.css because .btn is global — the header
   CTA and the footer buttons use the same span. The transition is already
   neutralised by the reduced-motion block at the end of this file. */
.btn__arrow {
	display: inline-block;
	transition: transform 0.15s ease;
}

.btn:hover .btn__arrow,
.btn:focus-visible .btn__arrow {
	transform: translateX( 3px );
}

/* ---------------------------------------------------------------------
   9. Cards — presentational shell only; card-post.php / card-tool.php
   (Phase 3/4) supply the markup and links that use these classes.
   ------------------------------------------------------------------ */

.card {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	padding: var(--space-3);
	background-color: var(--color-surface);
	border-radius: 8px;
}

.card__title {
	margin: 0;
}

.card__excerpt {
	color: var(--color-text);
	margin: 0;
}

.card__thumbnail img,
.entry-thumbnail img {
	border-radius: 8px;
}

.card-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 260px, 1fr ) );
	gap: var(--space-3);
	margin-bottom: var(--space-4);
}

/* Generic category/taxonomy pill — used by both blog category badges and
   tool_category badges. .badge--ai below is the AI-pillar-only override. */
.badge {
	display: inline-block;
	color: var(--color-text);
	background-color: var(--color-surface);
	border: 1px solid var(--color-text-muted);
	border-radius: 999px;
	padding: 0.15rem 0.6rem;
	font-size: 0.8rem;
	font-weight: 500;
	text-decoration: none;
}

/* AI-pillar accent — signal-purple passes AA as text (5.4:1 on cream,
   5.8:1 on white), unlike orange, but stays scoped to AI contexts only. */
.badge--ai {
	display: inline-block;
	color: var(--signal-purple);
	border: 1px solid var(--signal-purple);
	border-radius: 999px;
	padding: 0.15rem 0.6rem;
	font-size: 0.8rem;
	font-weight: 500;
}

/* ---------------------------------------------------------------------
   9b. Archive/listing chrome — shared by blog archives and the tool
   archive (both use card-grid + this heading treatment + pagination).
   ------------------------------------------------------------------ */

.site-main--wide {
	width: 100%;
	max-width: 100%;
	margin: 0;
}

.page-title {
	font-size: clamp( 1.6rem, 1.3rem + 1.2vw, 2.25rem );
}

.archive-header {
	margin-bottom: var(--space-4);
}

.archive-description {
	color: var(--color-text-muted);
}

.pagination .nav-links {
	display: flex;
	gap: var(--space-1);
	flex-wrap: wrap;
	margin-top: var(--space-3);
}

.pagination .page-numbers {
	display: inline-block;
	padding: 0.5rem 0.9rem;
	border-radius: 6px;
	text-decoration: none;
	border: 1px solid var(--slate);
}

.pagination .page-numbers.current {
	background-color: var(--ink);
	color: var(--white);
	border-color: var(--ink);
}

/* Breadcrumbs — muted (slate) treatment distinguishes them from primary
   body links; slate-on-white is 4.83:1, passes AA. */
.breadcrumbs {
	margin-bottom: var(--space-2);
	font-size: 0.85rem;
	color: var(--color-text-muted);
}

.breadcrumbs ol {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	padding: 0;
	margin: 0;
}

.breadcrumbs li:not( :last-child )::after {
	content: '/';
	margin-left: 0.4rem;
	color: var(--color-text-muted);
}

.breadcrumbs a {
	color: var(--color-text-muted);
	text-decoration-color: var(--color-text-muted);
}

/* ---------------------------------------------------------------------
   10. Layout shell
   ------------------------------------------------------------------ */

.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-content {
	flex: 1 0 auto;
	width: 100%;
	max-width: var(--wide-width);
	margin-inline: auto;
	padding: var(--space-3);
}

/* Homepage — front-page.php releases the container so each .home-section
   wrapper can run full-bleed and own its own gutter (see home.css). */
.home .site-content {
	max-width: 100%;
	padding: 0;
}

.home .site-main {
	max-width: 100%;
	margin: 0;
}

.site-main {
	max-width: var(--content-width);
	margin-inline: auto;
}

/**
 * Site header — complete block.
 *
 * Progressive enhancement contract: `html.js` is added by the inline
 * script in header.php. Without it the menu is a plain, always visible
 * list — the mobile panel, the accordion and the icon buttons all stay
 * out of the way. `aria-expanded` remains the single source of truth for
 * every disclosure; `.is-menu-open` / `.is-condensed` are styling hooks
 * only, set by nav-toggle.js.
 *
 * Dark mode: no overrides needed. Every surface here is built from
 * --color-bg / --color-text / --color-surface, and the hairlines and
 * hover tints are color-mix() over --color-text, so they invert with the
 * scheme automatically. Plain rgba() fallbacks precede each color-mix()
 * for browsers that do not support it.
 *
 * Contrast: --hashir-orange appears only as the brand-mark fill and the
 * .btn--primary fill, both paired with --ink text (6.6:1), and as the
 * active-item underline. It is never used as text.
 */

/* ---------------------------------------------------------------------
   H1. Header shell + header-scoped tokens
   ------------------------------------------------------------------ */

.site-header {
	--header-container: 1280px;
	--header-height: 76px;
	--header-height-condensed: 64px;
	--header-gutter: clamp( 1.25rem, 4vw, 3rem ); /* 20 -> 48px */
	--header-gap: var(--space-3); /* 24px, brand <-> nav */
	--nav-gap: 2rem; /* 32px between nav items */
	--action-gap: 1rem; /* 16px between buttons */

	--header-rule: rgba( 17, 17, 17, 0.1 );
	--header-rule: color-mix( in srgb, var(--color-text) 12%, transparent );
	--header-hover: rgba( 17, 17, 17, 0.06 );
	--header-hover: color-mix( in srgb, var(--color-text) 7%, transparent );
	--header-veil: rgba( 255, 255, 255, 0.72 );
	--header-veil: color-mix( in srgb, var(--color-bg) 78%, transparent );

	position: sticky;
	inset-block-start: 0;
	z-index: 100;
	isolation: isolate;
}

/* The backdrop lives on a pseudo-element, not on .site-header itself:
   backdrop-filter on the header would make it a containing block and the
   fixed mobile panel inside it would stop covering the viewport. */
.site-header::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background-color: var(--color-bg);
	border-block-end: 1px solid transparent;
	transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header.is-condensed::before {
	background-color: var(--header-veil);
	border-block-end-color: var(--header-rule);
	box-shadow: 0 6px 24px rgba( 17, 17, 17, 0.06 );
	-webkit-backdrop-filter: blur( 14px ) saturate( 160% );
	backdrop-filter: blur( 14px ) saturate( 160% );
}

.site-header__inner {
	display: flex;
	align-items: center;
	gap: var(--header-gap);
	inline-size: 100%;
	max-inline-size: var(--header-container);
	min-block-size: var(--header-height);
	margin-inline: auto;
	padding-inline: var(--header-gutter);
	transition: min-block-size 0.2s ease;
}

.site-header.is-condensed .site-header__inner {
	min-block-size: var(--header-height-condensed);
}

/* Anchor links must not land under the sticky header. This is the single
   owner of scroll offset — the homepage section anchors in front-page.php
   rely on it and home.css deliberately adds no scroll-margin of its own. */
html {
	scroll-padding-block-start: calc( 76px + 1.5rem );
}

/* ---------------------------------------------------------------------
   H2. Brand
   ------------------------------------------------------------------ */

.site-branding {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	margin-inline-end: var(--space-1);
}

.site-title {
	margin: 0;
	font-size: 1rem;
	line-height: 1;
}

.site-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
}

.site-brand__mark {
	display: grid;
	place-items: center;
	inline-size: 2rem;
	block-size: 2rem;
	border-radius: 10px;
	background-color: var(--hashir-orange);
	color: var(--ink);
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: 0.8125rem;
	letter-spacing: 0.02em;
	line-height: 1;
}

.site-brand__name {
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: 1.0625rem;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

.custom-logo-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.custom-logo {
	inline-size: auto;
	max-block-size: 36px;
	transition: max-block-size 0.2s ease;
}

.site-header.is-condensed .custom-logo {
	max-block-size: 30px;
}

/* ---------------------------------------------------------------------
   H3. Navigation — base (also the no-JS and no-CSS-support layout)
   ------------------------------------------------------------------ */

.site-menu {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	gap: var(--space-3);
}

.main-navigation ul {
	display: flex;
	align-items: center;
	gap: var(--nav-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.main-navigation a {
	text-decoration: none;
}

.main-navigation > ul > li {
	display: flex;
	align-items: center;
	gap: 0.125rem;
}

.main-navigation > ul > li > a {
	position: relative;
	display: inline-flex;
	align-items: center;
	padding-block: 0.375rem;
	font-family: var(--font-heading);
	font-weight: 500;
	font-size: 0.9375rem;
	color: var(--color-text-muted);
	transition: color 0.15s ease;
}

.main-navigation > ul > li > a:hover,
.main-navigation > ul > li > a:focus-visible {
	color: var(--color-text);
}

/* Current item — orange as a 2px indicator only, never as text color. */
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-ancestor > a,
.main-navigation .current-menu-parent > a {
	color: var(--color-text);
}

.main-navigation > ul > .current-menu-item > a::after,
.main-navigation > ul > .current_page_item > a::after,
.main-navigation > ul > .current-menu-ancestor > a::after,
.main-navigation > ul > .current-menu-parent > a::after {
	content: '';
	position: absolute;
	inset-block-end: -0.125rem;
	inset-inline: 0;
	block-size: 2px;
	border-radius: 2px;
	background-color: var(--hashir-orange);
}

/* .menu-item-has-children is WordPress core's own class, auto-added by
   Walker_Nav_Menu to any <li> with a sub-menu — not one we invent. */
.menu-item-has-children {
	position: relative;
}

/* Sub-menu, unenhanced: a plain indented list. H5 and H6 turn it into a
   floating card on desktop and an accordion on mobile. */
.main-navigation .sub-menu {
	flex-direction: column;
	align-items: stretch;
	gap: 0.125rem;
	inline-size: 100%;
	padding-inline-start: var(--space-2);
}

.main-navigation .sub-menu a {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	inline-size: 100%;
	padding: 0.625rem 0.75rem;
	border-radius: 10px;
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--color-text);
	transition: background-color 0.15s ease;
}

.main-navigation .sub-menu a:hover,
.main-navigation .sub-menu a:focus-visible {
	background-color: var(--header-hover);
}

/* "View All Articles" — add the CSS class `menu-item--view-all` to that
   menu item in Appearance -> Menus to get the divider and the arrow. */
.main-navigation .menu-item--view-all {
	margin-block-start: 0.5rem;
	padding-block-start: 0.5rem;
	border-block-start: 1px solid var(--header-rule);
}

.main-navigation .menu-item--view-all > a {
	font-family: var(--font-heading);
	font-weight: 600;
}

.main-navigation .menu-item--view-all > a::after {
	content: '\2192';
	margin-inline-start: auto;
	transition: transform 0.15s ease;
}

.main-navigation .menu-item--view-all > a:hover::after,
.main-navigation .menu-item--view-all > a:focus-visible::after {
	transform: translateX( 3px );
}

/* ---------------------------------------------------------------------
   H4. Buttons in the header — icon buttons, CTA sizing, panel extras
   ------------------------------------------------------------------ */

.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	inline-size: 40px;
	block-size: 40px;
	padding: 0;
	border: 1px solid var(--header-rule);
	border-radius: 999px;
	background-color: transparent;
	color: var(--color-text);
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
	background-color: var(--header-hover);
}

/* Both toggles are inert without JS, so they stay hidden until the
   `js` class lands. H5 and H6 reveal the right instance per breakpoint. */
.dark-mode-toggle,
.menu-toggle {
	display: none;
}

.theme-icon {
	pointer-events: none;
}

/* Icon state follows the same cascade order as section 2b: OS preference
   first, explicit data-theme override after. */
.theme-icon--sun {
	display: none;
}

@media ( prefers-color-scheme: dark ) {
	:root:not( [data-theme='light'] ) .theme-icon--moon {
		display: none;
	}

	:root:not( [data-theme='light'] ) .theme-icon--sun {
		display: block;
	}
}

:root[data-theme='dark'] .theme-icon--moon {
	display: none;
}

:root[data-theme='dark'] .theme-icon--sun {
	display: block;
}

:root[data-theme='light'] .theme-icon--moon {
	display: block;
}

:root[data-theme='light'] .theme-icon--sun {
	display: none;
}

/* Hamburger — two bars that cross into an X, driven by aria-expanded. */
.menu-toggle__bars {
	display: grid;
	gap: 5px;
	inline-size: 18px;
}

.menu-toggle__bars span {
	block-size: 2px;
	border-radius: 2px;
	background-color: currentColor;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle[aria-expanded='true'] .menu-toggle__bars span:first-child {
	transform: translateY( 3.5px ) rotate( 45deg );
}

.menu-toggle[aria-expanded='true'] .menu-toggle__bars span:last-child {
	transform: translateY( -3.5px ) rotate( -45deg );
}

.site-header__actions {
	display: flex;
	align-items: center;
	gap: var(--action-gap);
	margin-inline-start: auto;
	flex-shrink: 0;
}

/* Compact CTA so the row holds the 64-76px height without crowding. */
.site-header .btn {
	padding: 0.5625rem 1.125rem;
	border-radius: 10px;
	font-size: 0.9375rem;
	white-space: nowrap;
}

/* Panel extras are mobile-only; H5 hides them on desktop. */
.site-menu__extras {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
}

.site-menu__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-2);
}

.site-menu__label {
	font-family: var(--font-heading);
	font-weight: 500;
	font-size: 0.875rem;
	color: var(--color-text-muted);
}

.site-menu__cta {
	inline-size: 100%;
}

/* ---------------------------------------------------------------------
   H5. Desktop — centered nav, floating dropdown card
   ------------------------------------------------------------------ */

@media ( min-width: 900px ) {
	.site-menu__extras {
		display: none;
	}

	html.js .site-header__actions .dark-mode-toggle {
		display: inline-flex;
	}

	.main-navigation .sub-menu {
		position: absolute;
		inset-block-start: 100%;
		inset-inline-start: 50%;
		z-index: 10;
		inline-size: max-content;
		min-inline-size: 268px;
		max-inline-size: 320px;
		margin-block-start: 0.75rem;
		padding: var(--space-1);
		background-color: var(--color-bg);
		border: 1px solid var(--header-rule);
		border-radius: 16px;
		box-shadow: 0 24px 48px rgba( 17, 17, 17, 0.14 ), 0 2px 8px rgba( 17, 17, 17, 0.06 );
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transform: translateX( -50% ) translateY( -8px );
		transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
	}

	/* Invisible bridge across the 12px gap so the card survives the
	   pointer travelling from the trigger down into it. */
	.main-navigation .sub-menu::before {
		content: '';
		position: absolute;
		inset-block-start: -0.75rem;
		inset-inline: 0;
		block-size: 0.75rem;
	}

	.menu-item-has-children:hover > .sub-menu,
	.menu-item-has-children:focus-within > .sub-menu,
	.sub-toggle[aria-expanded='true'] + .sub-menu {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translateX( -50% );
	}
}

/* ---------------------------------------------------------------------
   H6. Mobile — full-screen panel + accordion (JS-enhanced only)
   ------------------------------------------------------------------ */

@media ( max-width: 899px ) {
	html.js .menu-toggle {
		display: inline-flex;
	}

	html.js .site-menu__extras .dark-mode-toggle {
		display: inline-flex;
	}

	/* The CTA is the only thing that stays beside the hamburger. */
	html.js .site-header__actions .dark-mode-toggle {
		display: none;
	}

	html.js .site-menu {
		position: fixed;
		inset: 0;
		z-index: 90;
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: var(--space-4);
		padding: calc( var(--header-height) + var(--space-3) ) var(--header-gutter) var(--space-4);
		background-color: var(--color-bg);
		overflow-y: auto;
		overscroll-behavior: contain;
		opacity: 0;
		visibility: hidden;
		transform: translateY( -0.75rem );
		transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
	}

	html.js .site-header.is-menu-open .site-menu {
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	html.js .main-navigation ul {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	html.js .main-navigation > ul > li {
		flex-wrap: wrap;
		justify-content: space-between;
		border-block-end: 1px solid var(--header-rule);
	}

	html.js .main-navigation > ul > li > a {
		flex: 1 1 auto;
		padding-block: 0.9375rem;
		font-size: 1.125rem;
		font-weight: 600;
		color: var(--color-text);
	}

	html.js .main-navigation > ul > .current-menu-item > a::after,
	html.js .main-navigation > ul > .current_page_item > a::after,
	html.js .main-navigation > ul > .current-menu-ancestor > a::after,
	html.js .main-navigation > ul > .current-menu-parent > a::after {
		inset-block-end: 0.75rem;
		inset-inline-end: auto;
		inline-size: 1.25rem;
	}

	html.js .main-navigation .sub-menu {
		display: none;
		inline-size: 100%;
		padding-block-end: var(--space-2);
		padding-inline-start: 0;
	}

	html.js .sub-toggle[aria-expanded='true'] + .sub-menu {
		display: flex;
	}

	html.js .main-navigation .sub-menu a {
		padding-block: 0.75rem;
		color: var(--color-text-muted);
	}

	html.js .main-navigation .sub-menu a:hover,
	html.js .main-navigation .sub-menu a:focus-visible {
		color: var(--color-text);
	}
}

/* Very small screens: the header keeps the brand and the hamburger only. */
@media ( max-width: 480px ) {
	html.js .site-header__actions .nav-cta {
		display: none;
	}
}

/* ---------------------------------------------------------------------
   H7. Sub-menu trigger — injected by nav-toggle.js, so it is hidden
   whenever JS has not run.
   ------------------------------------------------------------------ */

.sub-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	inline-size: 1.75rem;
	block-size: 1.75rem;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: none;
	color: var(--color-text-muted);
	cursor: pointer;
}

html.js .sub-toggle {
	display: inline-flex;
}

.sub-toggle::after {
	content: '';
	inline-size: 0.4rem;
	block-size: 0.4rem;
	border-inline-end: 2px solid currentColor;
	border-block-end: 2px solid currentColor;
	transform: translateY( -0.1rem ) rotate( 45deg );
	transition: transform 0.2s ease;
}

.sub-toggle[aria-expanded='true']::after {
	transform: translateY( 0.05rem ) rotate( 225deg );
}

.sub-toggle:hover,
.menu-item-has-children:hover > .sub-toggle {
	color: var(--color-text);
}

@media ( max-width: 899px ) {
	html.js .sub-toggle {
		inline-size: 44px;
		block-size: 44px;
		color: var(--color-text);
	}
}

/* ---------------------------------------------------------------------
   H8. Scroll lock while the mobile panel is open
   ------------------------------------------------------------------ */

html.has-menu-open,
html.has-menu-open body {
	overflow: hidden;
}

/**
 * Site footer — complete block.
 *
 * Dark mode: the footer is a fixed dark surface in both color schemes
 * (--ink background, --white text), so it needs no @media override. All
 * secondary text uses white-at-72% over ink (~9.5:1) rather than --slate,
 * which fails AA on ink — the same substitution section 2b makes for
 * --color-text-muted.
 *
 * Contrast: --hashir-orange appears only as an underline/decoration color
 * and as the .btn--primary fill (paired with --ink text), never as text.
 *
 * Note for the homepage: final-cta.php renders an inked band immediately
 * above this footer. home.css closes that seam deliberately — see the
 * "Section shell" notes there.
 */

/* ---------------------------------------------------------------------
   F1. Shell + footer-scoped tokens
   ------------------------------------------------------------------ */

.site-footer {
	--footer-container: 1200px;
	--footer-gutter: clamp( 1.25rem, 5vw, 2.5rem );
	--footer-space: clamp( 3.5rem, 7vw, 5.5rem );
	--footer-band-gap: clamp( 2.5rem, 5vw, 4rem );
	--footer-col-gap: clamp( 2rem, 4vw, 3rem );
	--footer-rule: rgba( 255, 255, 255, 0.12 );
	--footer-muted: rgba( 255, 255, 255, 0.72 );

	padding-block: var(--footer-space);
	padding-inline: var(--footer-gutter);
	background-color: var(--ink);
	color: var(--white);
	border-block-start: 1px solid var(--footer-rule);
}

.site-footer__inner {
	display: grid;
	gap: var(--footer-band-gap);
	inline-size: 100%;
	max-inline-size: var(--footer-container);
	margin-inline: auto;
}

/* ---------------------------------------------------------------------
   F2. Links + buttons on the dark surface
   Footer links drop the global orange underline and pick it up on
   interaction instead, so the columns read as a quiet list.
   ------------------------------------------------------------------ */

.site-footer a {
	color: var(--white);
	text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
	text-decoration: underline;
	text-decoration-color: var(--hashir-orange);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.15em;
}

.site-footer :focus-visible {
	outline-color: var(--focus-ring-on-dark);
}

/* `.site-footer a` would otherwise win over `.btn--primary` on
   specificity and put white text on the orange fill. */
.site-footer .btn--primary {
	color: var(--ink);
}

.site-footer .btn--secondary {
	color: var(--white);
	border-color: rgba( 255, 255, 255, 0.4 );
}

.site-footer .btn:hover,
.site-footer .btn:focus-visible {
	text-decoration: none;
}

.site-footer .btn--secondary:hover {
	background-color: rgba( 255, 255, 255, 0.08 );
}

/* Placeholder label for a link whose destination is not published yet. */
.site-footer__muted {
	color: rgba( 255, 255, 255, 0.45 );
}

/* ---------------------------------------------------------------------
   F3. Brand band — identity left, WhatsApp CTA right on desktop
   ------------------------------------------------------------------ */

.site-footer__brand {
	display: grid;
	gap: var(--footer-col-gap);
	align-items: start;
	padding-block-end: var(--footer-band-gap);
	border-block-end: 1px solid var(--footer-rule);
}

.site-footer__name {
	margin: 0 0 var(--space-1);
	font-family: var(--font-heading);
	font-weight: 800;
	font-size: clamp( 1.375rem, 1.15rem + 0.9vw, 1.75rem );
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.site-footer__name a:hover,
.site-footer__name a:focus-visible {
	text-decoration-thickness: 3px;
}

.site-footer__tagline {
	margin: 0;
	max-inline-size: 46ch;
	color: var(--footer-muted);
	line-height: 1.7;
}

.site-footer__cta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
}

/* ---------------------------------------------------------------------
   F4. Sitemap — 1 / 2 / 4 columns
   ------------------------------------------------------------------ */

.site-footer__grid {
	display: grid;
	grid-template-columns: minmax( 0, 1fr );
	gap: var(--footer-col-gap);
}

.site-footer__col {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-2);
}

.site-footer__heading {
	margin: 0;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--footer-muted);
}

.site-footer__links {
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	inline-size: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.95rem;
}

/* Declared after `.site-footer a` so the muted resting state wins at
   equal specificity. */
.site-footer__links a {
	color: var(--footer-muted);
	transition: color 0.15s ease;
}

.site-footer__links a:hover,
.site-footer__links a:focus-visible {
	color: var(--white);
}

/* "View all tools" — the one accented link in the sitemap. */
.site-footer__more {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-block-start: auto;
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 0.9rem;
	text-decoration: underline;
	text-decoration-color: var(--hashir-orange);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}

.site-footer__more-arrow {
	transition: transform 0.15s ease;
}

.site-footer__more:hover .site-footer__more-arrow,
.site-footer__more:focus-visible .site-footer__more-arrow {
	transform: translateX( 3px );
}

/* ---------------------------------------------------------------------
   F5. Bottom bar
   ------------------------------------------------------------------ */

.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-2) var(--footer-col-gap);
	padding-block-start: clamp( 1.5rem, 3vw, 2rem );
	border-block-start: 1px solid var(--footer-rule);
	font-size: 0.875rem;
	color: var(--footer-muted);
}

.site-footer__copyright,
.site-footer__note {
	margin: 0;
}

.site-footer__note {
	max-inline-size: 48ch;
}

/* ---------------------------------------------------------------------
   F6. Breakpoints — 600px (2 columns), 900px (4 columns + split brand band)
   ------------------------------------------------------------------ */

@media ( min-width: 600px ) {
	.site-footer__grid {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( min-width: 900px ) {
	.site-footer__brand {
		grid-template-columns: minmax( 0, 1fr ) auto;
		align-items: center;
	}

	.site-footer__cta {
		justify-self: end;
	}

	.site-footer__grid {
		grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
	}

	.site-footer__note {
		text-align: end;
	}
}

/* ---------------------------------------------------------------------
   11. (REMOVED) Primary nav collapse.
   The old collapse/dropdown block that lived here was superseded by the
   Site header block above but never deleted, so its rules were winning on
   source order: a 767px breakpoint fighting the header's 899px one, a
   bordered .menu-toggle overriding .icon-btn, a left-aligned absolute
   .sub-menu defeating the centered dropdown, and a 16px nav gap
   overriding --nav-gap. Nothing else in the theme referenced it.
   ------------------------------------------------------------------ */

/* ---------------------------------------------------------------------
   11b. Block patterns — content inserted via patterns/newsletter-cta.php
   and patterns/faq-section.php (Phase 6). Constrained to readable width
   here directly rather than relying on Gutenberg's own layout-constraint
   classes, since this file writes the pattern markup by hand.

   Homepage note: front-page.php's FAQ section reuses .faq-section and
   .faq-item so accordion.js has one code path. It inherits the
   --content-width measure below (correct for FAQ text) but home.css
   zeroes the margin-block inside .home-section, since the section wrapper
   owns vertical rhythm there. Post/page instances keep their margins.
   ------------------------------------------------------------------ */

.newsletter-cta,
.faq-section {
	max-width: var(--content-width);
	margin-inline: auto;
}

.newsletter-cta {
	padding: var(--space-4);
	border-radius: 12px;
	margin-block: var(--space-4);
	/* The panel had padding and a radius but no surface, so it read as
	   loose text with odd spacing rather than a card. */
	background-color: var(--color-surface);
	border: 1px solid var(--color-text-muted);
}

.faq-section {
	margin-block: var(--space-4);
}

.faq-item {
	border-bottom: 1px solid var(--color-text-muted);
	padding: var(--space-2) 0;
}

.faq-item__question {
	margin: 0;
}

/* JS-generated toggle (accordion.js); the plain heading text before
   enhancement needs none of this. */
.faq-item__toggle {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	width: 100%;
	font: inherit;
	font-weight: 600;
	color: var(--color-text);
	text-align: left;
	cursor: pointer;
}

.faq-item__toggle::after {
	content: '+';
	float: right;
}

.faq-item__toggle[aria-expanded='true']::after {
	content: '\2212';
}

.faq-item__answer {
	margin-top: var(--space-1);
}

/* ---------------------------------------------------------------------
   2c. Purple as second brand colour.

   Contrast facts, unchanged from the Phase 2 audit: #7C3AED as TEXT is
   5.8:1 on white and 5.4:1 on cream — passes AA. On ink it is 3.25:1 —
   fails. So dark mode uses #A78BFA (8.9:1 on ink) for text roles, while
   background roles keep #7C3AED with white text on top.

   Palette discipline: orange = action (buttons, link underlines, the
   nav active indicator). Purple = AI subject matter (badges, the two AI
   pillar lanes, the hero emphasis word, section eyebrows). Never both
   on one element.
   ------------------------------------------------------------------ */

:root {
	/* Not a new brand colour — a contrast-corrected variant of
	   --signal-purple, exactly the relationship --color-text-muted has
	   to --slate in section 2b. */
	--signal-purple-light: #A78BFA;

	/* Semantic role, so rules reach for this rather than choosing the
	   right purple by hand at each call site. */
	--color-accent-ai: var(--signal-purple);
}

@media ( prefers-color-scheme: dark ) {
	:root:not( [data-theme='light'] ) {
		--color-accent-ai: var(--signal-purple-light);
	}
}

:root[data-theme='dark'] {
	--color-accent-ai: var(--signal-purple-light);
}

/* Purple button variant, for AI-specific CTAs only — an AI toolkit
   download, a prompt-library link. White on #7C3AED is 5.8:1, passes AA.
   Do NOT use it for the hero CTA; orange remains the action colour. */
.btn--ai {
	background-color: var(--signal-purple);
	color: var(--white);
	border-color: var(--signal-purple);
}

.btn--ai:hover {
	box-shadow: 0 4px 12px rgba( 124, 58, 237, 0.35 );
	transform: translateY( -1px );
}

/* Section eyebrow — small uppercase label above a heading. Lives here
   rather than home.css because inner pages will want it too. */
.eyebrow {
	display: block;
	margin-block-end: var(--space-1);
	font-family: var(--font-heading);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-accent-ai);
}

/* ---------------------------------------------------------------------
   12. Reduced motion — respected by every transition/animation added in
   this file, in home.css, and in Phase 6's JS modules. Must stay last.
   ------------------------------------------------------------------ */

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