/*
 * Mia Dunlap theme styles. theme.json carries palette, fonts and element styles; this file holds only
 * what theme.json cannot express: responsive heading sizes, the 7sixty3 plugin token bridge, the skip
 * link, form-field floor and reduced motion.
 */

:root {
	color-scheme: light;

	/* Body text: 15px on phones, 18px from 480px (measured on the live site). */
	--miadunlap-fs-body: 15px;

	/* Headings: h1 and h2 are 95px on phones and tablets, 65px from 1025px up; h3 is 40 to 56px. */
	--miadunlap-fs-h1: clamp(3.5rem, 25.3vw, 5.9375rem);
	--miadunlap-fs-h3: clamp(2.5rem, 12.4vw, 3.4875rem);

	/* Bridge to the 7sixty3 plugins: they read these tokens, so setting them once restyles every plugin. */
	--sst-accent: var(--wp--preset--color--gold);
	--sst-accent-contrast: var(--wp--preset--color--contrast);
	--sst-text: var(--wp--preset--color--contrast);
	--sst-surface: var(--wp--preset--color--base);
	--sst-surface-alt: var(--wp--preset--color--soft);
	--sst-muted: var(--wp--preset--color--muted);
	--sst-border: var(--wp--preset--color--line);
	--sst-radius: 6px;
	--sst-font: var(--wp--preset--font-family--body);
}

@media (min-width: 480px) {
	:root {
		--miadunlap-fs-body: 18px;
	}
}

@media (min-width: 1025px) {
	:root {
		--miadunlap-fs-h1: 4.0625rem;
	}
}

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

body {
	-webkit-font-smoothing: antialiased;
}

/* Floor so iOS Safari never auto-zooms a focused field. */
input,
select,
textarea {
	font-size: 16px;
}

/* A bold heading is a faux bold of a single weight brush face; keep it one weight. */
:is(h1, h2, h3, h4, h5, h6) :is(strong, b) {
	font-weight: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: break-word;
}

/* Post bodies: every body heading is a 28px left aligned heading with 30px around it. */
.miadunlap-post-body :is(h2, h3, h4) {
	font-size: var(--wp--preset--font-size--post-heading);
	line-height: 1.3;
	margin-block: 30px;
	text-align: left;
}

.miadunlap-post-body img {
	height: auto;
	max-width: 100%;
}

:focus-visible {
	outline: 2px solid var(--wp--preset--color--gold);
	outline-offset: 2px;
}

/* Skip link: first thing a keyboard visitor reaches. */
.miadunlap-skip {
	background: var(--wp--preset--color--black);
	color: var(--wp--preset--color--base);
	left: 0.5rem;
	padding: 0.75rem 1rem;
	position: absolute;
	top: -4rem;
	z-index: 100000;
}

.miadunlap-skip:focus {
	top: 0.5rem;
}

.miadunlap-sr-only {
	border: 0;
	clip: rect(0, 0, 0, 0);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

/* Blog cards: a quiet bordered card with a soft lift on hover. */
.miadunlap-card {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 0.5rem;
	box-sizing: border-box;
	height: 100%;
	overflow: hidden;
	transition: box-shadow 200ms ease;
}

.miadunlap-card:hover {
	box-shadow: 0 4px 14px rgb(0 0 0 / 0.1);
}

.miadunlap-main {
	padding-bottom: 2rem;
	padding-top: 2rem;
}

.miadunlap-card__body {
	padding: 1.25rem;
}

/* Two columns from 640px, one column below it. */
@media (max-width: 639px) {
	.wp-block-post-template.is-layout-grid {
		grid-template-columns: 1fr;
	}
}

.miadunlap-card .wp-block-post-title a {
	color: inherit;
	text-decoration: none;
}

/* Footer: a hairline above, tight vertical rhythm. */
.miadunlap-footer {
	border-top: 1px solid var(--wp--preset--color--line);
}

.miadunlap-legal a {
	align-items: center;
	color: var(--wp--preset--color--muted);
	display: inline-flex;
	font-size: 0.75rem;
	font-weight: 400;
	min-height: 44px;
	text-decoration: none;
}

.miadunlap-legal a:hover {
	color: var(--wp--preset--color--contrast);
	text-decoration: underline;
}

/* The consent plugin's "Cookie settings" button reads like the two links beside it. */
.miadunlap-legal .sst-consent-link {
	color: var(--wp--preset--color--muted);
	font-size: 0.75rem;
	font-weight: 400;
	min-height: 44px;
	text-decoration: none;
}

.miadunlap-legal .sst-consent-link:hover {
	color: var(--wp--preset--color--contrast);
	text-decoration: underline;
}

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

/* Tiles plugin: match the live matrix (plain 28px headings, Stay Rad signature, white headings on colour). */
.sst-tiles .sst-tile__title {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 400;
	line-height: 1.3;
}
.sst-tiles .sst-tile:not(.sst-tile--signature) .sst-tile__title {
	color: #fff;
}
.sst-tiles .sst-tile--signature .sst-tile__title {
	font-family: var(--wp--preset--font-family--display);
	line-height: 1.3;
	color: #000;
}
.sst-tiles .sst-tile__body {
	font-size: 0.9375rem;
	line-height: 1.6;
}

/* Home page sections that come from plugin blocks: newsletter band, testimonials. */
.wp-block-cover.miadunlap-newsletter {
	width: 100%;
	max-width: 80%;
	min-height: 380px;
	margin-inline: auto;
	padding: 1.5rem;
	border-radius: 6px;
}
.miadunlap-newsletter h2 {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 700;
	font-size: 1.5rem;
	line-height: 1.3;
	color: #fff;
}
.miadunlap-newsletter .sst-newsletter__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}
.miadunlap-newsletter .sst-newsletter__consent,
.miadunlap-newsletter .sst-newsletter__consent a {
	color: #fff;
	font-size: 0.875rem;
}
.miadunlap-testimonials {
	padding-block: 4rem;
}
.miadunlap-newsletter .wp-block-cover__image-background {
	object-position: 50% 44%;
}
.miadunlap-newsletter .wp-block-columns {
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 1.25rem;
	text-align: center;
}
.miadunlap-newsletter h2 {
	max-width: 22ch;
	margin-inline: auto;
	text-wrap: balance;
}
.miadunlap-newsletter .wp-block-column {
	flex: 0 1 auto !important;
}
.wp-block-cover.miadunlap-newsletter .wp-block-cover__background.has-background-dim {
	opacity: 0.45;
}
@media (max-width: 767px) {
	.wp-block-cover.miadunlap-newsletter {
		max-width: 100%;
	}
}
.miadunlap-newsletter h2 {
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}
