/**
 * NewMetro
 * Global theme styles: The Shop Window.
 *
 * Design tokens, fonts, reset, typography, buttons and the components
 * shared by several blocks. Loaded on the front end and in the block editor.
 * See DESIGN.md for the rules behind these values.
 */


/* ==========================
   Fonts (self-hosted)
========================== */

@font-face {
	font-family: "Young Serif";
	src: url("../fonts/young-serif-latin.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Hanken Grotesk";
	src: url("../fonts/hanken-grotesk-latin.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}


/* ==========================
   Design Tokens
========================== */

:root {
	--fascia: #12352A;
	--fascia-deep: #0C271F;
	--fascia-line: #2A4D40;
	--fascia-lift: #1B4537;
	--ground: #F3F5F2;
	--paper: #FFFFFF;
	--ink: #14201B;
	--ink-soft: #46574F;
	--mist: #DDE5E0;
	--mist-deep: #C5D1CA;
	--gold: #D4A72C;        /* actions only */
	--gold-hover: #E2B63B;
	--error: #B3261E;
	--on-fascia: #F3F5F2;
	--on-fascia-soft: #B8CBC1;

	--serif: "Young Serif", Georgia, "Times New Roman", serif;
	--sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

	--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	--ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

	--max: 1280px;
	--gutter: clamp(16px, 4vw, 40px);
	--section: clamp(72px, 9vw, 128px);
	--radius: 6px;
	--header-h: 72px;
}


/* ==========================
   Reset
========================== */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-h) + 16px);
	scrollbar-color: var(--mist-deep) var(--ground);
}

body {
	margin: 0;
	background: var(--ground);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 1.125rem;
	line-height: 1.6;
	font-kerning: normal;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	caret-color: var(--fascia);
}

::selection {
	background: var(--fascia);
	color: var(--on-fascia);
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote {
	margin: 0;
}

img,
svg,
video {
	display: block;
	max-width: 100%;
	height: auto;
}

button,
input,
textarea,
select {
	font: inherit;
	color: inherit;
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
}

/* Theme component lists carry no bullets; each block resets its own lists. */
.nav__list,
.footer ul,
.crumbs ol {
	margin: 0;
	padding: 0;
	list-style: none;
}


/* ==========================
   Accessibility
========================== */

:focus-visible {
	outline: 2px solid var(--fascia);
	outline-offset: 3px;
	border-radius: 2px;
}

/* On green surfaces the focus ring turns gold. */
:where(.fascia, .footer, .is-fascia, .signboard) :focus-visible {
	outline-color: var(--gold);
}

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

.skip-link {
	position: absolute;
	left: var(--gutter);
	top: -100px;
	z-index: 100;
	padding: 12px 18px;
	background: var(--gold);
	color: var(--ink);
	font-weight: 600;
	border-radius: var(--radius);
	text-decoration: none;
}

.skip-link:focus {
	top: 12px;
}


/* ==========================
   Layout
========================== */

.site-main {
	width: 100%;
}

.nm-wrap {
	width: 100%;
	max-width: var(--max);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.section {
	padding-block: var(--section);
}

/* Surfaces a block can choose. */
.is-ground { background: var(--ground); }
.is-paper  { background: var(--paper); border-block: 1px solid var(--mist); }
.is-fascia { background: var(--fascia); color: var(--on-fascia); }

/*
 * Two consecutive blocks on the same light surface share one section's spacing,
 * split evenly around the hairline between them (half below the first, half above the second).
 * Real selectors, not :where(): at zero specificity .section's padding always won and the gap doubled.
 * The owner's FAQ plugin output is a paper band too (doubled class beats its own padding rule),
 * and the plugin prints its FAQ schema <script> straight after it.
 */
.is-ground:has(+ .is-ground),
:is(.is-paper, .dna_accordion_container.dna_accordion_container):has(+ :is(.is-paper, .dna_accordion_container)),
.dna_accordion_container.dna_accordion_container:has(+ script + .is-paper) {
	padding-bottom: calc(var(--section) / 2);
}

.is-ground + .is-ground,
:is(.is-paper, .dna_accordion_container) + :is(.is-paper, .dna_accordion_container.dna_accordion_container),
.dna_accordion_container + script + .is-paper {
	padding-top: calc(var(--section) / 2);
	border-top: 0;
}


/* ==========================
   Icons
========================== */

.icon {
	width: 1.15em;
	height: 1.15em;
	flex: none;
	vertical-align: -0.2em;
}


/* ==========================
   Section headings
========================== */

.section__head {
	max-width: 760px;
	margin-bottom: clamp(32px, 4vw, 52px);
}

.section__head--row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px 32px;
	max-width: none;
}

.display-title {
	font-family: var(--serif);
	font-weight: 400;
	font-size: clamp(2.375rem, 4.1vw, 3.75rem);
	line-height: 1.06;
	letter-spacing: -0.02em;
	text-wrap: balance;
	color: var(--fascia);
}

.section__title {
	font-family: var(--serif);
	font-weight: 400;
	font-size: clamp(2rem, 3.2vw, 2.875rem);
	line-height: 1.1;
	letter-spacing: -0.015em;
	text-wrap: balance;
	color: var(--fascia);
}

.section__answer {
	margin-top: 16px;
	max-width: 60ch;
	font-size: 1.1875rem;
	color: var(--ink-soft);
	text-wrap: pretty;
}

.section__answer > * + * {
	margin-top: 0.8em;
}

.lede {
	margin-top: 28px;
	max-width: 58ch;
	font-size: clamp(1.125rem, 1.4vw, 1.25rem);
	line-height: 1.6;
	color: var(--ink-soft);
	text-wrap: pretty;
}

.lede > * + * {
	margin-top: 0.8em;
}

.is-fascia :where(.section__title, .display-title) { color: var(--on-fascia); }
.is-fascia :where(.section__answer, .lede) { color: var(--on-fascia-soft); }


/* ==========================
   Buttons and links
========================== */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	min-height: 44px;
	padding: 0 20px;
	border: 0;
	border-radius: var(--radius);
	font-family: var(--sans);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: transform 160ms var(--ease-out), background-color 160ms ease;
}

.btn:active {
	transform: scale(0.97);
}

.btn--gold {
	background: var(--gold);
	color: var(--ink);
}

.btn--lg {
	min-height: 52px;
	padding: 0 26px;
	font-size: 1.0625rem;
}

/* Secondary action: outlined in fascia green (gold stays for the main action). */
.btn--outline {
	background: transparent;
	color: var(--fascia);
	box-shadow: inset 0 0 0 2px var(--fascia);
}

.is-fascia .btn--outline {
	color: var(--on-fascia);
	box-shadow: inset 0 0 0 2px var(--on-fascia-soft);
}

@media (hover: hover) and (pointer: fine) {
	.btn--outline:hover { background: var(--fascia); color: var(--on-fascia); }
	.is-fascia .btn--outline:hover { background: var(--on-fascia); color: var(--fascia); }
}

.btn .icon {
	transition: transform 160ms var(--ease-out);
}

.actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 28px;
	margin-top: 36px;
}

.phone-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	min-height: 44px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	text-decoration: none;
	color: var(--fascia);
}

.phone-link--light,
.is-fascia .phone-link {
	color: var(--on-fascia);
}

.text-link {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	min-height: 44px;
	font-weight: 600;
	color: var(--fascia);
	text-decoration: underline;
	text-decoration-color: var(--mist-deep);
}

.text-link .icon {
	transition: transform 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
	.btn--gold:hover { background: var(--gold-hover); }
	.btn:hover .icon { transform: translateX(2px); }
	.phone-link:hover { text-decoration: underline; }
	.text-link:hover { text-decoration-color: currentColor; }
	.text-link:hover .icon { transform: translateX(3px); }
}


/* ==========================
   Ticks (checked list)
========================== */

.ticks {
	display: grid;
	gap: 14px;
	margin: 28px 0 24px;
	padding: 0;
	list-style: none;
}

.ticks li {
	display: grid;
	grid-template-columns: 24px 1fr;
	gap: 14px;
	max-width: 60ch;
}

.ticks .icon {
	width: 22px;
	height: 22px;
	margin-top: 3px;
	color: var(--fascia);
}


/* ==========================
   Unlit glass (placeholders, editor only)
========================== */

.unlit {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 4px;
	padding: 24px;
	background: linear-gradient(160deg, var(--fascia-lift) 0%, var(--fascia) 45%, var(--fascia-deep) 100%);
	border-radius: var(--radius);
	color: var(--on-fascia-soft);
}

.unlit__tag {
	position: absolute;
	top: 14px;
	left: 14px;
	padding: 4px 8px;
	border: 1px solid var(--fascia-line);
	border-radius: 3px;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--on-fascia-soft);
}

.unlit__title {
	font-family: var(--serif);
	font-size: 1.375rem;
	line-height: 1.2;
	color: var(--on-fascia);
}

.unlit__note {
	font-size: 0.9375rem;
	line-height: 1.45;
}

.unlit--card     { aspect-ratio: 4 / 3; }
.unlit--portrait { aspect-ratio: 4 / 5; }
.unlit--quote    { min-height: 220px; justify-content: center; align-items: center; text-align: center; }
.unlit--wide     { min-height: 160px; }
.unlit--screen   { height: 100%; padding: 28px; border-radius: 0; }
.unlit--screen .unlit__title { font-size: clamp(1.5rem, 2.2vw, 2rem); }
.unlit--screen .unlit__tag   { top: 22px; left: 28px; }


/* ==========================
   Corner brackets: the frame is the hover and focus state
========================== */

.brackets {
	position: relative;
}

.brackets::after {
	--b: var(--fascia);
	content: "";
	position: absolute;
	inset: -8px;
	pointer-events: none;
	background:
		linear-gradient(var(--b), var(--b)) top left / 22px 2px,
		linear-gradient(var(--b), var(--b)) top left / 2px 22px,
		linear-gradient(var(--b), var(--b)) top right / 22px 2px,
		linear-gradient(var(--b), var(--b)) top right / 2px 22px,
		linear-gradient(var(--b), var(--b)) bottom left / 22px 2px,
		linear-gradient(var(--b), var(--b)) bottom left / 2px 22px,
		linear-gradient(var(--b), var(--b)) bottom right / 22px 2px,
		linear-gradient(var(--b), var(--b)) bottom right / 2px 22px;
	background-repeat: no-repeat;
	opacity: 0;
	transform: scale(1.015);
	transition: opacity 160ms ease, transform 200ms var(--ease-out);
}

.brackets:focus-within::after {
	opacity: 1;
	transform: none;
}

@media (hover: hover) and (pointer: fine) {
	.brackets:has(a):hover::after {
		opacity: 1;
		transform: none;
	}
}


/* ==========================
   Breadcrumb (block and Yoast markup)
========================== */

.crumbs {
	padding-top: 20px;
	font-size: 0.9375rem;
	color: var(--ink-soft);
}

.crumbs ol {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.crumbs li {
	display: inline-flex;
	align-items: center;
}

.crumbs li + li::before,
.crumbs .crumbs__sep {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-inline: 12px;
	border-top: 1.5px solid var(--mist-deep);
	border-right: 1.5px solid var(--mist-deep);
	transform: rotate(45deg);
	font-size: 0;
}

.crumbs a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--fascia);
	text-decoration: underline;
	text-decoration-color: var(--mist-deep);
}

@media (hover: hover) and (pointer: fine) {
	.crumbs a:hover { text-decoration-color: currentColor; }
}


/* ==========================
   Prose (core blocks on pages and posts)
========================== */

.page-content > :where(p, h2, h3, h4, ul, ol, blockquote, table, .wp-block-image, .wp-block-quote, .wp-block-table, .wp-block-embed, .wp-block-buttons, .wp-block-separator) {
	width: 100%;
	max-width: calc(68ch + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.page-content > :where(p, ul, ol) {
	margin-block: 0 1.1em;
	color: var(--ink);
	overflow-wrap: break-word; /* pasted text often joins long words with non-breaking spaces */
}

.page-content > :where(ul, ol) {
	padding-left: calc(var(--gutter) + 1.2em);
}

.page-content > :where(h2, h3, h4) {
	margin-block: 1.8em 0.6em;
	font-family: var(--serif);
	font-weight: 400;
	line-height: 1.15;
	color: var(--fascia);
	text-wrap: balance;
}

.page-content > h2 { font-size: clamp(1.75rem, 2.6vw, 2.25rem); }
.page-content > h3 { font-size: clamp(1.375rem, 2vw, 1.625rem); }
.page-content > h4 { font-size: 1.25rem; }

.page-content > :where(p, ul, ol) a {
	color: var(--fascia);
	text-decoration-color: var(--mist-deep);
}

.page-content > :where(p, ul, ol) a:hover {
	text-decoration-color: currentColor;
}

.page-content > :where(.wp-block-image, figure) img {
	border-radius: var(--radius);
}

.page-content > :where(blockquote, .wp-block-quote) {
	margin-block: 1.6em;
	font-family: var(--serif);
	font-size: 1.375rem;
	line-height: 1.35;
	color: var(--fascia);
}


/* ==========================
   Reduced motion
========================== */

@media (prefers-reduced-motion: reduce) {

	.btn:active { transform: none; }

	.brackets::after {
		transform: none;
		transition: opacity 160ms ease;
	}

	*, *::before, *::after {
		scroll-behavior: auto !important;
	}
}

/* A section heading with nothing after it keeps no bottom gap. */
.section__head--last {
	margin-bottom: 0;
}
