/*!
 * AI Executive theme stylesheet.
 * Only what theme.json cannot express: the dark scheme remap, header and
 * navigation behaviour, template-internal editorial layout, the reveal
 * behaviour and accessibility foundations. Every value is a theme.json token.
 */

/* ============================================================
   DARK SCHEME: remaps the palette presets to settings.custom.dark
   while <html data-theme="dark"> (set before paint by the boot script).
   ============================================================ */
:root[data-theme="dark"] {
	color-scheme: dark;
	--wp--preset--color--base: var(--wp--custom--dark--base);
	--wp--preset--color--contrast: var(--wp--custom--dark--contrast);
	--wp--preset--color--deep-ink: var(--wp--custom--dark--deep-ink);
	--wp--preset--color--accent: var(--wp--custom--dark--accent);
	--wp--preset--color--meta: var(--wp--custom--dark--meta);
	--wp--preset--color--faint: var(--wp--custom--dark--faint);
	--wp--preset--color--surface-1: var(--wp--custom--dark--surface-1);
	--wp--preset--color--surface-2: var(--wp--custom--dark--surface-2);
	--wp--preset--color--surface-3: var(--wp--custom--dark--surface-3);
	--wp--preset--color--line: var(--wp--custom--dark--line);
	--wp--preset--color--gold-strong: var(--wp--custom--dark--gold-strong);
	--wp--preset--color--primary: var(--wp--custom--dark--primary);
	--wp--preset--color--dark-2: var(--wp--custom--dark--dark-2);
	--wp--preset--color--dark-3: var(--wp--custom--dark--dark-3);
	--wp--preset--color--dark-text: var(--wp--custom--dark--dark-text);
	--wp--preset--shadow--sm: var(--wp--custom--dark--shadow-sm);
	--wp--preset--shadow--md: var(--wp--custom--dark--shadow-md);
	--wp--preset--shadow--lg: var(--wp--custom--dark--shadow-lg);
	--wp--custom--gold-soft: var(--wp--custom--dark--gold-soft);
	--wp--custom--header-bg: var(--wp--custom--dark--header-bg);
	--wp--custom--card-bg: var(--wp--custom--dark--card-bg);
	--wp--custom--band: var(--wp--custom--dark--band);
	--wp--custom--gold-button--hover-bg: var(--wp--custom--dark--gold-button--hover-bg);
	--wp--custom--gold-button--hover-text: var(--wp--custom--dark--gold-button--hover-text);
}

/* ============================================================
   BASE
   ============================================================ */
html {
	scroll-padding-top: 90px;
}

body {
	overflow-x: clip;
	transition: background var(--wp--custom--transition), color var(--wp--custom--transition);
}

h1, h2, h3, h4, h5, h6, blockquote, figcaption, p {
	text-wrap: pretty;
}

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

.skip-link {
	position: absolute;
	top: -60px;
	left: 0;
	z-index: 100;
	padding: 12px 20px;
	border-radius: 0 0 var(--wp--preset--border-radius--sm) 0;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	text-decoration: none;
	transition: top 160ms ease-out;
}
.skip-link:focus {
	top: 0;
	clip-path: none;
	width: auto;
	height: auto;
	margin: 0;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
	border-radius: 2px;
}

/* ============================================================
   HEADER: sticky masthead with blur
   ============================================================ */
.site-header {
	position: sticky;
	top: 0;
	z-index: 90;
	-webkit-backdrop-filter: blur(16px);
	backdrop-filter: blur(16px);
	background: var(--wp--custom--header-bg);
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 8%, transparent);
	transition: background var(--wp--custom--transition), border-color var(--wp--custom--transition);
}
body.admin-bar .site-header {
	top: var(--wp-admin--admin-bar--height, 0);
}

/* A filtered ancestor becomes the containing block for position:fixed and
   would clip the mobile overlay to the header box. */
.site-header:has(.wp-block-navigation__responsive-container.is-menu-open) {
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	background: var(--wp--preset--color--surface-1);
}

.site-brand {
	flex-shrink: 0;
}
.site-brand .wp-block-site-logo img {
	width: 44px;
	height: 44px;
	object-fit: contain;
}
.site-brand .wp-block-site-title {
	margin: 0;
	line-height: 1;
	white-space: nowrap;
}

.site-nav .wp-block-navigation-item__content {
	padding-block: 6px;
	white-space: nowrap;
	transition: color var(--wp--custom--transition);
}
.site-nav .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
}

/* Header call-to-action menu: each item renders as a gold pill button. */
.site-nav .site-nav__cta .wp-block-navigation-item__content {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0.55rem 1.1rem;
	border-radius: var(--wp--preset--border-radius--full);
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--deep-ink);
	font-weight: 700;
	white-space: nowrap;
	transition: background var(--wp--custom--transition), color var(--wp--custom--transition);
}
.site-nav .site-nav__cta .wp-block-navigation-item__content:hover,
.site-nav .site-nav__cta .wp-block-navigation-item__content:focus-visible {
	background: var(--wp--custom--gold-button--hover-bg);
	color: var(--wp--custom--gold-button--hover-text);
}

/* Theme toggle: shown only when the script runs, since it needs it. */
.theme-toggle {
	display: none;
	width: 40px;
	height: 40px;
	padding: 0;
	place-items: center;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 10%, transparent);
	border-radius: var(--wp--preset--border-radius--full);
	background: color-mix(in srgb, var(--wp--preset--color--surface-1) 76%, transparent);
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
	transition: border-color var(--wp--custom--transition);
}
.js .theme-toggle {
	display: grid;
}
.theme-toggle:hover {
	border-color: color-mix(in srgb, var(--wp--preset--color--accent) 50%, transparent);
}
.theme-toggle svg {
	display: block;
	pointer-events: none;
}

/* Mobile navigation: round open and close buttons, full overlay list. */
.site-nav .wp-block-navigation__responsive-container-open,
.site-nav .wp-block-navigation__responsive-container-close {
	width: 44px;
	height: 44px;
	padding: 0;
	align-items: center;
	justify-content: center;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--accent) 40%, transparent);
	border-radius: var(--wp--preset--border-radius--full);
	background: var(--wp--custom--gold-soft);
	color: var(--wp--preset--color--contrast);
}
.site-nav .wp-block-navigation__responsive-container-open:hover,
.site-nav .wp-block-navigation__responsive-container-close:hover {
	border-color: var(--wp--preset--color--accent);
}
.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	display: flex;
}
.site-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--surface-1);
}
.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: stretch;
	width: 100%;
	gap: 4px;
}
.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	width: 100%;
}
.site-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	padding: 14px 16px;
	border-bottom: 1px solid var(--wp--preset--color--line);
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
}

/* ============================================================
   DARK BAND: styles nested in a band. WordPress prints every block
   style inside :where(), so one style cannot reliably override
   another from theme.json; these rules carry real specificity.
   ============================================================ */
.is-style-dark-band .is-style-eyebrow {
	color: var(--wp--custom--band-text-muted);
}
.is-style-dark-band .is-style-kicker,
.is-style-dark-band :is(h1, h2, h3, h4, h5, h6, p) em {
	color: var(--wp--preset--color--accent);
}
.is-style-dark-band .wp-block-button.is-style-secondary .wp-block-button__link {
	background: color-mix(in srgb, var(--wp--preset--color--dark-text) 6%, transparent);
	border-color: color-mix(in srgb, var(--wp--preset--color--dark-text) 16%, transparent);
	color: var(--wp--preset--color--dark-text);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 8%, transparent);
}
.site-footer__heading {
	color: var(--wp--preset--color--meta);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
.site-footer__menu .wp-block-navigation-item__content {
	padding: 0;
	color: var(--wp--preset--color--contrast);
}
.site-footer__bottom {
	border-top: 1px solid var(--wp--preset--color--line);
}

/* ============================================================
   PUBLICATION FACTS: meta rows in single and list templates.
   A bound fact that is not set renders empty and is hidden.
   ============================================================ */
.aiexec-meta {
	gap: 0.65rem 1rem;
	color: var(--wp--preset--color--meta);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.aiexec-meta > * {
	margin: 0;
}
.aiexec-meta a {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}
.aiexec-meta a:hover {
	text-decoration: underline;
	text-underline-offset: 0.18em;
}
.aiexec-meta > * + *::before {
	content: "";
	display: inline-block;
	width: 4px;
	height: 4px;
	margin-right: 1rem;
	vertical-align: middle;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
}
.aiexec-fact:empty,
.aiexec-day-phrase:empty {
	display: none;
}

/* ============================================================
   SINGLE POST: editorial hero and reading column. Post content is
   plain blocks; this is where they receive the brand treatment.
   ============================================================ */
.aiexec-single__hero {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(circle at 88% 12%, var(--wp--custom--gold-soft), transparent 34%),
		linear-gradient(180deg, color-mix(in srgb, var(--wp--preset--color--surface-1) 78%, transparent), transparent);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.aiexec-single__hero::after {
	content: "";
	position: absolute;
	right: clamp(1.5rem, 6vw, 7rem);
	bottom: -5.5rem;
	width: clamp(9rem, 18vw, 15rem);
	aspect-ratio: 1;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--accent) 26%, transparent);
	border-radius: 50%;
	pointer-events: none;
}
.aiexec-single__hero > * {
	position: relative;
	z-index: 1;
}
.aiexec-single__title {
	max-width: 18ch;
	font-size: clamp(2.75rem, 6.4vw, 6.25rem);
	line-height: 0.95;
	letter-spacing: -0.055em;
	text-wrap: balance;
}
.aiexec-single__standfirst {
	max-width: 62ch;
	color: var(--wp--preset--color--meta);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.55;
}
.aiexec-single__content {
	color: color-mix(in srgb, var(--wp--preset--color--contrast) 88%, var(--wp--preset--color--meta));
	font-size: clamp(1.05rem, 0.98rem + 0.25vw, 1.2rem);
	line-height: 1.75;
}
.aiexec-single__content > :first-child {
	margin-top: 0;
}
.aiexec-single__content h2 {
	position: relative;
	margin-top: clamp(3.5rem, 8vw, 6rem);
	margin-bottom: 1.4rem;
	padding-top: 1.25rem;
	font-size: clamp(2rem, 1.45rem + 2vw, 3.25rem);
	line-height: 1.04;
	letter-spacing: -0.04em;
	text-wrap: balance;
}
.aiexec-single__content h2::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 52px;
	height: 2px;
	border-radius: 99px;
	background: var(--wp--preset--color--accent);
}
.aiexec-single__content h3 {
	margin-top: 2.75rem;
	margin-bottom: 1rem;
	font-size: clamp(1.35rem, 1.18rem + 0.65vw, 1.75rem);
}
.aiexec-single__content li + li {
	margin-top: 0.65rem;
}
.aiexec-single__content :not(pre) > code {
	padding: 0.12em 0.35em;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--preset--border-radius--sm);
	background: var(--wp--preset--color--surface-2);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.9em;
}
.aiexec-single__content a:not(.wp-element-button) {
	text-decoration-color: color-mix(in srgb, var(--wp--preset--color--accent) 60%, transparent);
	text-underline-offset: 0.18em;
}
.aiexec-day-phrase {
	box-sizing: border-box;
	margin-top: clamp(2.5rem, 6vw, 4rem);
	padding: 0.75rem 0 0.75rem 1.5rem;
	border-left: 3px solid var(--wp--preset--color--accent);
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.4rem, 0.95rem + 1.6vw, 2.2rem);
	line-height: 1.18;
	letter-spacing: -0.025em;
}
.aiexec-single__nav {
	border-top: 1px solid var(--wp--preset--color--line);
}
.aiexec-single__nav .wp-block-post-navigation-link {
	max-width: 46%;
}
.aiexec-single__nav a {
	display: block;
	color: var(--wp--preset--color--contrast);
	font-weight: 650;
	line-height: 1.35;
	text-decoration-color: color-mix(in srgb, var(--wp--preset--color--accent) 45%, transparent);
	text-underline-offset: 0.2em;
}
.aiexec-single__nav .post-navigation-link__label {
	display: block;
	margin-bottom: 0.45rem;
	color: var(--wp--preset--color--meta);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* ============================================================
   POST LISTS: blog, category and search archives.
   ============================================================ */
.aiexec-post-list {
	margin: 0;
	padding: 0;
}
.aiexec-post-card {
	position: relative;
	display: grid;
	grid-template-columns: minmax(150px, 0.34fr) minmax(0, 1fr);
	gap: clamp(1.5rem, 5vw, 5rem);
	padding: clamp(2rem, 5vw, 3.75rem) 0;
	border-top: 1px solid var(--wp--preset--color--line);
}
.aiexec-post-list > li:last-child .aiexec-post-card {
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.aiexec-post-card::before {
	content: "";
	position: absolute;
	top: -1px;
	left: 0;
	width: 0;
	height: 2px;
	background: var(--wp--preset--color--accent);
	transition: width 420ms cubic-bezier(0.16, 1, 0.3, 1);
}
.aiexec-post-card:hover::before,
.aiexec-post-card:focus-within::before {
	width: 100%;
}
.aiexec-post-card .aiexec-meta {
	flex-direction: column;
	align-items: flex-start;
}
.aiexec-post-card .aiexec-meta > * + *::before {
	display: none;
}
.aiexec-post-card .wp-block-post-title {
	margin: 0;
	font-size: clamp(1.85rem, 1.35rem + 1.65vw, 3.1rem);
	line-height: 1.05;
	letter-spacing: -0.04em;
	text-wrap: balance;
}
.aiexec-post-card .wp-block-post-excerpt {
	max-width: 66ch;
	color: var(--wp--preset--color--meta);
}
.aiexec-post-card .wp-block-post-excerpt__more-link {
	display: inline-flex;
	align-items: center;
	margin-top: 1rem;
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	text-decoration-color: var(--wp--preset--color--accent);
	text-underline-offset: 0.24em;
}
.aiexec-post-card .wp-block-post-excerpt__more-link::after {
	content: "\2192";
	margin-left: 0.5rem;
	color: var(--wp--preset--color--primary);
}
.aiexec-pagination a {
	color: var(--wp--preset--color--contrast);
	font-weight: 650;
}
.aiexec-empty {
	color: var(--wp--preset--color--meta);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.04em;
}

/* ============================================================
   FORMS: search and embedded sign-up forms.
   ============================================================ */
.wp-block-search__input,
.aiexec-form :where(input:not([type="submit"], [type="checkbox"], [type="radio"]), textarea, select) {
	width: 100%;
	padding: 0.85rem 1rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--preset--border-radius--md);
	background: var(--wp--preset--color--surface-1);
	color: var(--wp--preset--color--contrast);
	font: inherit;
}
.wp-block-search__input:focus,
.aiexec-form :where(input, textarea, select):focus {
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 3px var(--wp--custom--gold-soft);
}

/* ============================================================
   REVEAL: progressive enhancement; the script adds js-reveal.
   ============================================================ */
.js-reveal .aiexec-reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}
.js-reveal .aiexec-reveal.is-visible {
	opacity: 1;
	transform: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
	.site-header__row {
		padding-block: 10px !important;
	}
	.site-nav {
		gap: 10px !important;
	}
	/* The logo carries the brand on small screens; the title stays for assistive technology. */
	.site-brand .wp-block-site-logo + .wp-block-site-title {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
	.site-nav .site-nav__cta .wp-block-navigation-item__content {
		min-height: 36px;
		padding: 0.4rem 0.9rem;
	}
}

@media (max-width: 700px) {
	.aiexec-single__hero::after {
		right: -3rem;
		opacity: 0.7;
	}
	.aiexec-single__title {
		font-size: clamp(2.55rem, 12vw, 4.2rem);
	}
	.aiexec-single__nav {
		flex-direction: column;
	}
	.aiexec-single__nav .wp-block-post-navigation-link {
		max-width: 100%;
		text-align: left;
	}
	.aiexec-post-card {
		grid-template-columns: 1fr;
		gap: 1.25rem;
	}
	.aiexec-post-card .aiexec-meta {
		flex-direction: row;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
	}
	.js-reveal .aiexec-reveal {
		opacity: 1;
		transform: none;
	}
}
