/* ==========================================================================
   THE SEO GENIUS — base layer
   Tokens come from theme.json (--wp--preset--*, --wp--custom--*).
   This file adds behaviour theme.json can't express: focus, environments,
   header/footer frame, typography details and reduced motion.
   ========================================================================== */

:root {
	--tsg-focus: var(--wp--preset--color--genius-blue);
	--tsg-text-quiet: var(--wp--preset--color--slate);
	--tsg-header-offset: 64px;
}

/* WordPress defines the root padding on body, so the gutters are read there. */
body {
	--tsg-gutter-l: var(--wp--style--root--padding-left, 1.25rem);
	--tsg-gutter-r: var(--wp--style--root--padding-right, 1.25rem);
}

@media (min-width: 1024px) {
	:root {
		--tsg-header-offset: var(--wp--custom--header--height);
	}
}

html {
	scroll-padding-top: calc(var(--tsg-header-offset) + 1rem);
	-webkit-text-size-adjust: 100%;
}

html.tsg-menu-open {
	overflow: hidden;
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
	text-wrap: balance;
}

p, li, figcaption {
	text-wrap: pretty;
}

a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

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

::selection {
	background: var(--wp--preset--color--signal-lime);
	color: var(--wp--preset--color--ink);
}

/* Eyebrow: a small label that orients, never shouts. Sentence case. */
.is-style-eyebrow {
	color: var(--wp--preset--color--genius-blue);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.3;
}

.is-style-lead {
	font-size: var(--wp--preset--font-size--lead);
	line-height: 1.55;
	max-width: var(--wp--custom--measure);
}

/* Progressive breaking: editor line breaks apply on wide screens only;
   small screens let the line balance itself. */
@media (max-width: 781.98px) {
	.is-style-desktop-breaks br {
		content: "";
	}
	.is-style-desktop-breaks br::after {
		content: " ";
	}
}

/* Focus ------------------------------------------------------------------- */

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

:where(.wp-element-button, .wp-block-button__link):focus-visible {
	outline: 3px solid var(--tsg-focus);
	outline-offset: 3px;
}

/* Skip link (WordPress adds it for block themes). */
.skip-link.screen-reader-text:focus {
	top: 0.75rem;
	left: 0.75rem;
	z-index: 100000;
	padding: 0.75rem 1.25rem;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--white);
	font-weight: 600;
	text-decoration: none;
	box-shadow: var(--wp--preset--shadow--lift);
}

/* Environments -------------------------------------------------------------
   Colour comes from the section styles (styles/sections/*.json).
   Here: the focus ring, quiet text and outline buttons for each one.
   Signal Lime is the focus ring on Blue and Ink: the active point. */

[class*="is-style-section-blue"],
[class*="is-style-section-ink"] {
	--tsg-focus: var(--wp--preset--color--signal-lime);
}

[class*="is-style-section-ink"] {
	--tsg-text-quiet: #A9B4C6;
}

[class*="is-style-section-blue"] {
	--tsg-text-quiet: var(--wp--preset--color--white);
}

[class*="is-style-section-blue"] .is-style-eyebrow,
[class*="is-style-section-ink"] .is-style-eyebrow {
	color: inherit;
}

/* Buttons ----------------------------------------------------------------- */

.wp-element-button,
.wp-block-button__link {
	transition:
		background-color var(--wp--custom--motion--quick) ease,
		border-color var(--wp--custom--motion--quick) ease,
		color var(--wp--custom--motion--quick) ease;
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	border-color: currentColor;
	background: transparent;
	color: var(--wp--preset--color--ink);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--white);
}

[class*="is-style-section-blue"] .wp-block-button.is-style-outline > .wp-block-button__link,
[class*="is-style-section-ink"] .wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--wp--preset--color--white);
}

[class*="is-style-section-blue"] .wp-block-button.is-style-outline > .wp-block-button__link:hover,
[class*="is-style-section-ink"] .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--white);
	border-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
}

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

.tsg-site-header {
	position: relative;
	z-index: 50;
	background: var(--wp--preset--color--white);
	border-bottom: 1px solid var(--wp--preset--color--line);
}

/* Sticky only once the menu script is running, so a no-JS menu can never cover the page. */
.tsg-site-header:has(.tsg-nav.is-enhanced) {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
}

.tsg-header {
	box-sizing: border-box;
	min-height: var(--tsg-header-offset);
	padding-inline: max(var(--tsg-gutter-l), calc((100% - var(--wp--style--global--wide-size)) / 2));
	gap: 1rem;
}

.tsg-header__brand {
	gap: 1.25rem;
	min-width: 0;
}

/* Descriptor: Brand · Web · Growth, beside the logo on wide screens. */
.tsg-descriptor {
	margin: 0;
	padding-left: 1.25rem;
	border-left: 1px solid var(--wp--preset--color--line);
	color: var(--wp--preset--color--slate);
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 500;
	white-space: nowrap;
}

@media (max-width: 1279.98px) {
	.tsg-header .tsg-descriptor {
		display: none;
	}
}

@media (max-width: 479.98px) {
	.tsg-header .tsg-logo img {
		width: 160px;
	}
}

/* Page frame: the footer sits at the bottom even on short pages. ----------- */

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

.wp-site-blocks > * {
	margin-block-start: 0;
}

.tsg-main {
	flex: 1 0 auto;
	margin-block: 0;
}

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

.tsg-footer {
	--tsg-text-quiet: #A9B4C6;
	padding-inline: max(var(--tsg-gutter-l), calc((100% - var(--wp--style--global--wide-size)) / 2));
}

.tsg-footer a:not(.wp-element-button) {
	color: inherit;
}

.tsg-footer__intro {
	color: var(--tsg-text-quiet);
	font-size: var(--wp--preset--font-size--small);
	max-width: 32ch;
}

.tsg-footer__base {
	border-top: 1px solid rgb(255 255 255 / 0.14);
	color: var(--tsg-text-quiet);
	font-size: var(--wp--preset--font-size--caption);
}

.tsg-footer__base a {
	text-decoration: none;
}

.tsg-footer__base a:hover {
	text-decoration: underline;
}

.tsg-footer__legal {
	gap: 0.25rem 1.25rem;
}

/* Small helpers ------------------------------------------------------------ */

.tsg-measure {
	max-width: var(--wp--custom--measure);
}

/* Reduced motion: the state changes still happen, just without travel. */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
