/* Global presentation that theme.json can't express. Tokens only. */

html {
	scroll-behavior: smooth;
	scroll-padding-top: var(--wp--custom--layout--header-height);
	-webkit-text-size-adjust: 100%;
}

@media (min-width: 1024px) {
	html {
		scroll-padding-top: var(--wp--custom--layout--header-height-desktop);
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

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

::selection {
	background: var(--wp--preset--color--edge-orange);
	color: var(--wp--preset--color--ink);
}

img {
	max-width: 100%;
	height: auto;
}

/* Full-bleed main: sections handle their own gutters. */
.wp-site-blocks > main {
	margin-block: 0;
}

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

:where(.wp-site-blocks) :focus-visible {
	outline: 2px solid var(--wp--preset--color--edge-orange);
	outline-offset: 2px;
}

/* ── Long-form content (page, post, project description) ─────────────────── */
/* Not in the Figma file: built from the type scale, one step down for article headings. */

.met-prose {
	padding-block: var(--wp--preset--spacing--64) var(--wp--custom--section--sm);
}

.met-prose:empty {
	display: none;
}

/* Pages built from section blocks run edge to edge without extra padding. */
.met-prose:has(> .met-section:first-child) {
	padding-top: 0;
}

.met-prose:has(> .met-section:last-child) {
	padding-bottom: 0;
}

.met-prose > :where(p, ul, ol) {
	margin-block: 0 var(--wp--preset--spacing--24);
}

.met-prose > :where(h2, h3, h4) {
	margin-block: var(--wp--preset--spacing--48) var(--wp--preset--spacing--16);
}

.met-prose > h2 {
	font-size: var(--wp--custom--type--heading-3--size);
	font-weight: var(--wp--custom--type--heading-3--weight);
	line-height: var(--wp--custom--type--heading-3--line-height);
	letter-spacing: var(--wp--custom--type--heading-3--letter-spacing);
}

.met-prose > h3 {
	font-size: var(--wp--custom--type--heading-4--size);
	font-weight: var(--wp--custom--type--heading-4--weight);
	line-height: var(--wp--custom--type--heading-4--line-height);
	letter-spacing: var(--wp--custom--type--heading-4--letter-spacing);
}

.met-prose > h4 {
	font-size: var(--wp--custom--type--tagline--size);
	line-height: var(--wp--custom--type--tagline--line-height);
}

.met-prose :where(ul, ol) {
	padding-inline-start: 1.25em;
}

.met-prose :where(li) + li {
	margin-top: var(--wp--preset--spacing--8);
}

.met-prose li::marker {
	color: var(--wp--preset--color--edge-orange);
}

.met-prose > :where(.wp-block-image, .wp-block-embed, .wp-block-table, .wp-block-quote) {
	margin-block: var(--wp--preset--spacing--48);
}

.met-prose .wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--wp--custom--type--body-small--size);
	line-height: var(--wp--custom--type--body-small--line-height);
}

.met-prose .wp-block-table :where(th, td) {
	padding: var(--wp--preset--spacing--12) var(--wp--preset--spacing--16);
	border: 1px solid var(--wp--custom--color--grout-14);
	text-align: left;
}

.met-prose .wp-block-table th {
	color: var(--wp--preset--color--white);
	font-family: var(--wp--custom--type--eyebrow--family);
	font-size: var(--wp--custom--type--eyebrow--size);
	letter-spacing: var(--wp--custom--type--eyebrow--letter-spacing);
	text-transform: uppercase;
}

.met-prose figcaption {
	margin-top: var(--wp--preset--spacing--12);
}

/* ── Article (journal post) ────────────────────────────────────────────────── */

.met-article {
	padding-top: var(--wp--preset--spacing--48);
}

.met-article__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.met-article__footer {
	gap: var(--wp--preset--spacing--24);
	padding-block: var(--wp--preset--spacing--32) var(--wp--custom--section--sm);
	border-top: 1px solid var(--wp--custom--color--grout-12);
	font-family: var(--wp--custom--type--button--family);
	font-size: var(--wp--custom--type--button--size);
	font-weight: var(--wp--custom--type--button--weight);
	letter-spacing: var(--wp--custom--type--button--letter-spacing);
}

.met-article__footer a {
	color: var(--wp--preset--color--marble);
	text-decoration: none;
}

.met-article__footer a:hover {
	color: var(--wp--preset--color--white);
}

/* ── Journal grid (index / archives) ─────────────────────────────────────── */

.met-posts,
.met-search {
	padding-block: var(--wp--custom--section--sm);
}

.wp-block-post-template.met-post-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--48) var(--wp--preset--spacing--24);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.wp-block-post-template.met-post-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.wp-block-post-template.met-post-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.met-post-grid > li {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--12);
	margin: 0;
}

.met-post-grid > li > * {
	margin: 0;
}

.met-post-card__image {
	margin-bottom: var(--wp--preset--spacing--8);
	overflow: hidden;
	background: var(--wp--preset--color--slate);
}

.met-post-card__image img {
	transition: scale var(--wp--custom--motion--duration--card) var(--wp--custom--motion--easing--out);
}

.met-post-card__image a:hover img {
	scale: 1.04;
}

.met-post-card__date {
	color: var(--wp--preset--color--edge-orange);
	font-family: var(--wp--custom--type--label--family);
	font-size: var(--wp--custom--type--label--size);
	letter-spacing: var(--wp--custom--type--label--letter-spacing);
	line-height: var(--wp--custom--type--label--line-height);
	text-transform: uppercase;
}

.met-post-card__title {
	font-size: var(--wp--custom--type--heading-4--size);
	font-weight: var(--wp--custom--type--heading-4--weight);
	line-height: var(--wp--custom--type--heading-4--line-height);
	letter-spacing: var(--wp--custom--type--heading-4--letter-spacing);
}

.met-post-card__title a,
.met-search__title a {
	color: var(--wp--preset--color--white);
	text-decoration: none;
}

.met-post-card__title a:hover,
.met-search__title a:hover {
	color: var(--wp--custom--color--edge-orange-text);
}

.met-post-card__excerpt,
.met-search__excerpt {
	font-size: var(--wp--custom--type--body-small--size);
	line-height: var(--wp--custom--type--body-small--line-height);
}

.met-post-card__excerpt .wp-block-post-excerpt__excerpt,
.met-search__excerpt .wp-block-post-excerpt__excerpt {
	margin: 0;
}

/* ── Search ────────────────────────────────────────────────────────────────── */

.met-search__form .wp-block-search__inside-wrapper {
	gap: var(--wp--preset--spacing--12);
	padding: 0;
	border: 0;
}

.met-search__form .wp-block-search__input {
	box-sizing: border-box;
	min-height: 56px;
	padding: 0 var(--wp--preset--spacing--16);
	border: 1px solid var(--wp--custom--color--grout-25);
	border-radius: 0;
	background: var(--wp--custom--color--white-3);
	color: var(--wp--preset--color--white);
	font: inherit;
}

.met-search__form .wp-block-search__input::placeholder {
	color: var(--wp--preset--color--stone);
}

.met-search__form .wp-block-search__input:focus-visible {
	outline: 2px solid var(--wp--preset--color--edge-orange);
	outline-offset: 0;
}

.met-search__form .wp-block-search__button {
	margin: 0;
}

.met-search__results {
	margin-top: var(--wp--preset--spacing--48);
}

.met-search__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.met-search__list > li {
	padding-block: var(--wp--preset--spacing--24);
	border-top: 1px solid var(--wp--custom--color--grout-12);
}

.met-search__title {
	margin: 0 0 var(--wp--preset--spacing--8);
	font-size: var(--wp--custom--type--heading-4--size);
	line-height: var(--wp--custom--type--heading-4--line-height);
}

.met-404 .wp-block-buttons {
	margin-bottom: var(--wp--preset--spacing--48);
}

.met-empty {
	color: var(--wp--preset--color--stone);
}

/* ── Pagination ────────────────────────────────────────────────────────────── */

.met-pagination {
	margin-top: var(--wp--preset--spacing--64);
	font-family: var(--wp--custom--type--button--family);
	font-size: var(--wp--custom--type--button--size);
	font-weight: var(--wp--custom--type--button--weight);
}

.met-pagination a,
.met-pagination .page-numbers {
	color: var(--wp--preset--color--marble);
	text-decoration: none;
}

.met-pagination .page-numbers.current {
	color: var(--wp--preset--color--edge-orange);
}
