/*
Component classes the core blocks can't express on their own — ported from the
Broadsheet design system (design/_ds/styles.css). Colors/spacing reference the
theme.json presets rather than raw hex, so editing global styles stays in sync.
Add these as "Additional CSS Class(es)" on the matching block in the editor.
*/

/* — content utility classes —
   Applied via className only (no per-block inline "style" attribute) so the
   block editor can always cleanly round-trip this content: any inline style
   the editor can't reconstruct from a block's own declared attributes gets
   flagged "invalid content" and, worse, gets destructively re-wrapped on
   next save. Keeping all one-off CSS in classes here avoids that entirely. */

/* type scale (font-size + line-height + tracking, paired as used in the design) */
.type-hero { font-size: clamp(2.125rem, 4.5vw, 3.5rem); line-height: 1.1; letter-spacing: -0.02em; }
.type-hero-lg { font-size: clamp(2.125rem, 5vw, 4rem); line-height: 1.08; letter-spacing: -0.02em; }
.type-h2-lg { font-size: 32px; line-height: 42px; letter-spacing: -0.015em; }
.type-h2 { font-size: 24px; line-height: 28px; letter-spacing: -0.01em; }
.type-h3 { font-size: 24px; line-height: 28px; }
.type-post-title { font-size: 19px; line-height: 1.3; letter-spacing: -0.01em; }
.type-intro { font-size: 18px; line-height: 28px; }
.type-body { font-size: 16px; line-height: 28px; }
.type-body-sm { font-size: 15.5px; line-height: 28px; }
.type-caption { font-size: 15px; line-height: 28px; }
.type-direct { font-size: 17px; line-height: 28px; }
.type-meta { font-size: 14px; }
.type-small { font-size: 13px; }

/* muted ink (color-mix opacity tiers used throughout) */
.ink-65 { color: color-mix(in srgb, var(--wp--preset--color--text) 65%, transparent); }
.ink-70 { color: color-mix(in srgb, var(--wp--preset--color--text) 70%, transparent); }
.ink-78 { color: color-mix(in srgb, var(--wp--preset--color--text) 78%, transparent); }
.ink-82 { color: color-mix(in srgb, var(--wp--preset--color--text) 82%, transparent); }
.ink-85 { color: color-mix(in srgb, var(--wp--preset--color--text) 85%, transparent); }

/* spacing */
.mt-14 { margin-top: 14px; }
.mt-28 { margin-top: 28px; }
.mt-42 { margin-top: 42px; }
.mt-56 { margin-top: 56px; }

/* measure (max-width caps for readable line length) */
.measure-34 { max-width: 34ch; }
.measure-48 { max-width: 48ch; }
.measure-56 { max-width: 56ch; }
.measure-58 { max-width: var(--wp--custom--measure); }
.measure-64 { max-width: 64ch; }
.measure-72 { max-width: 72ch; }

/* justified body copy with hyphenation */
.justify-hyphens { text-align: justify; hyphens: auto; }

/* image-slot placeholder box — centers its caption via plain CSS rather than
   the block's own "layout" attribute, so there's no WP-generated layout
   class (is-layout-flex, is-content-justification-*, etc.) to mismatch */
.placeholder-box { display: flex; align-items: center; justify-content: center; }
/* likewise, background-color/border-radius/aspect-ratio here are plain CSS
   classes rather than a block "style" JSON attribute — a block with a
   "color.background" style gets an auto-incrementing "wp-elements-N" class
   from WordPress that can't be predicted/hand-authored reliably */
.portrait-frame { aspect-ratio: 4/5; background-color: #d7d3d3; border-radius: 2px; }
.portrait-frame-wide { aspect-ratio: 3/2; background-color: #d7d3d3; border-radius: 2px; }

/* degrees/positions list rows (About, Home dossier-style lists) */
.divider-row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--wp--custom--divider); }
.divider-row-last { padding-bottom: 14px; border-bottom: 1px solid var(--wp--custom--divider); }

/* — pull quote (Home) — plain Custom HTML rather than core/quote, since the
   hanging citation styling doesn't map cleanly onto that block's expected
   save() output for hand-authored content */
.pull-quote {
	margin: 0;
	font-family: var(--wp--preset--font-family--body);
	font-style: italic;
	font-size: clamp(1.5rem, 2.6vw, 2.125rem);
	line-height: 42px;
	letter-spacing: -0.01em;
	max-width: 34ch;
}
.pull-quote p { margin: 0; }
.pull-quote cite {
	display: block;
	margin-top: 42px;
	font-size: 15.5px;
	line-height: 28px;
	font-style: normal;
	color: color-mix(in srgb, var(--wp--preset--color--text) 70%, transparent);
}

/* — hero pattern background (Home, first section) — tiled image, draft pass.
   Text inside needs light-on-dark overrides since the rest of the page
   assumes the light page background. */
/* background image is set on the block itself via the editor's own
   Background panel now — this just adds internal inset (the block had
   only ever had top/bottom padding, relying on the page wrapper for
   horizontal inset, which was invisible until the block had a visible
   background box of its own) and keeps text legible over a dark image. */
.hero-pattern {
	padding-left: var(--wp--custom--edge);
	padding-right: var(--wp--custom--edge);
}
.hero-pattern .kicker,
.hero-pattern .ink-82 {
	color: color-mix(in srgb, #ffffff 78%, transparent);
}
.hero-pattern h1 {
	color: #ffffff;
}
.hero-pattern .btn-ghost .wp-block-button__link {
	color: var(--wp--preset--color--accent-300);
}
.hero-pattern .btn-ghost .wp-block-button__link:hover {
	background: color-mix(in srgb, #ffffff 12%, transparent);
}

/* — kickers (small uppercase eyebrow labels) — */
.kicker {
	display: block;
	font-size: 13px;
	line-height: var(--wp--preset--spacing--50);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: color-mix(in srgb, var(--wp--preset--color--text) 70%, transparent);
	margin-bottom: calc(var(--wp--preset--spacing--70) - var(--wp--preset--spacing--50));
}
.kicker-accent { color: var(--wp--preset--color--accent-700) !important; }
.kicker-accent-2 { color: var(--wp--preset--color--accent-2-700) !important; }

/* — sticky site header — the wp:template-part wrapper (not the inner group)
   is what gets sticky positioning, since it's the wrapper that has room to
   stick within .wp-site-blocks; the inner group is exactly its own height,
   giving position:sticky nowhere to stick if applied there directly. */
header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 20;
	background-color: var(--wp--preset--color--background);
	border-bottom: 1px solid var(--wp--custom--divider);
}

/* header row layout — plain CSS flex rather than the block's own "layout"
   attribute, avoiding the same is-layout-flex/is-content-justification-*
   class-matching risk described above */
.header-flex { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }

/* — navigation brand mark — */
.nav-brand .wp-block-navigation-item__label::before,
.nav-brand::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	background: var(--wp--preset--color--accent);
	border-radius: 1px;
	margin-right: 8px;
	vertical-align: middle;
}

/* — buttons — */
.wp-block-button__link {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 600;
	border-radius: 2px;
}
.btn-ghost .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--accent);
	padding-left: 5px;
	padding-right: 5px;
}
.btn-ghost .wp-block-button__link:hover {
	background: color-mix(in srgb, var(--wp--preset--color--accent) 10%, transparent);
}

/* — cards (Work page) — */
.plist {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--wp--preset--spacing--40);
	list-style: none;
	margin: 0;
	padding: 0;
}
@media (max-width: 760px) {
	.plist { grid-template-columns: 1fr; }
}
/* applied to the Post Template's own <li> wrapper rather than an extra
   hand-authored Group inside it — nesting a static Group around dynamic
   blocks (post-title/post-excerpt) and block-bound paragraphs confuses the
   editor's block validator (it can't compute the Group's "expected" content
   since its children are dynamic/bound, not static), which flags the whole
   thing invalid even though the saved markup is perfectly correct. */
.plist > li {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
	padding: var(--wp--preset--spacing--30);
	border-radius: 2px;
	background: var(--wp--preset--color--surface);
	box-shadow: 0 1px 2px color-mix(in srgb, var(--wp--preset--color--neutral-900) 14%, transparent);
	/* core's flow-layout block-gap margin (margin-top on every child but the
	   first) still applies to grid children and misaligns row tops — the
	   grid's own `gap` already handles spacing, so cancel it. */
	margin-top: 0;
}
.card-kicker {
	font-size: 10px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	display: block;
}
.card-title {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 600;
	font-size: 17px;
	line-height: 1.2;
	margin: 0;
}
.card-body {
	margin: 0;
	font-size: 13px;
	opacity: 0.8;
	flex: 1;
}
.card-meta {
	display: block;
	font-size: 11px;
	color: color-mix(in srgb, var(--wp--preset--color--text) 50%, transparent);
}

/* — tags (News page) — */
.tag {
	display: inline-flex;
	align-items: center;
	font-size: 11px;
	letter-spacing: 0.02em;
	padding: 3px 10px;
	border-radius: 1.5px;
}
.tag-accent { background: var(--wp--preset--color--accent-100); color: var(--wp--preset--color--accent-800); }
.tag-accent-2 { background: var(--wp--preset--color--accent-2-100); color: var(--wp--preset--color--accent-2-800); }
/* square color harmony (90° hue steps) derived from --accent's hue (217°) */
.tag-harmony-2 { background: #feebfc; color: #7a1a6f; } /* hue 307° */
.tag-harmony-3 { background: #fef7eb; color: #7a551a; } /* hue 37° */
.tag-harmony-4 { background: #ebfeed; color: #1a7a25; } /* hue 127°, reserved for a future 4th tag */
.tag a { color: inherit; text-decoration: none; }

/* season/year meta — rendered server-side as "Season Year" via
   evansresearch_post_date_season() in functions.php. Default treatment sits
   inline next to the tag pill (single post view); the News list overrides
   this to sit on its own line below the title (see .post-date-under-title). */
.post-date-season {
	display: inline-flex;
	align-items: center;
	font-size: 11px;
	letter-spacing: 0.02em;
	margin-left: 10px;
	color: color-mix(in srgb, var(--wp--preset--color--text) 60%, transparent);
}
.post-date-under-title {
	display: block;
	margin-left: 0;
	font-size: 13px;
}

/* post-title links (News list) read as plain dark headings, not link-blue */
.wp-block-post-title a { color: var(--wp--preset--color--text); text-decoration: none; }
.wp-block-post-title a:hover { color: var(--wp--preset--color--accent-700); }

/* — single post body (News single view) — */
/* cap any image, list, quote, or embedded video dropped into a post's
   content at the same width as its body copy (.measure-64, 64ch) instead of
   the full content column, so this applies automatically to every post —
   past and future — without needing a className on each block. */
.wp-block-post-content .wp-block-image,
.wp-block-post-content .wp-block-list,
.wp-block-post-content .wp-block-quote,
.wp-block-post-content .video-frame {
	max-width: 64ch;
	margin-left: 0;
	margin-right: 0;
}

/* — news post list — three-up card grid, landscape image over title/date/
   excerpt (evansresearch.org's live Publications section, adapted to this
   theme). All five blocks (image, tag, title, date, excerpt) stay flat,
   direct children of the Post Template's own <li> — no wrapping Group/
   Columns — since a static wrapper can't serialize dynamic Query Loop
   children (see .plist notes above); the card look comes entirely from
   grid placement and stacking these siblings, no extra markup needed. */
.wp-block-post-template.post-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	column-gap: 28px;
	row-gap: 42px;
}
@media (max-width: 900px) {
	.wp-block-post-template.post-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.wp-block-post-template.post-list { grid-template-columns: 1fr; }
}
.post-list > li {
	display: flex;
	flex-direction: column;
	/* core's flow-layout block-gap margin (margin-top on every child but the
	   first) misaligns grid rows the same way it did for .plist — the grid's
	   own row-gap already handles spacing, so cancel it (see .plist notes). */
	margin-top: 0;
}
.post-list > li > .post-thumb {
	margin: 0;
	overflow: hidden;
}
.post-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 2px;
}
/* rendered by evansresearch_post_thumb_placeholder() when a post has no
   featured image, so every card in the grid still starts with an
   image-sized block and rows stay aligned */
.post-thumb-placeholder {
	margin: 0;
	width: 100%;
	aspect-ratio: 3/2;
	background-color: var(--wp--preset--color--neutral-300);
	border-radius: 2px;
}
.news-pagination {
	display: flex;
	justify-content: space-between;
	margin-top: var(--wp--preset--spacing--70);
	font-size: 14px;
}
.news-pagination a {
	color: var(--wp--preset--color--accent);
	text-decoration: none;
}
.news-pagination a:hover {
	color: var(--wp--preset--color--accent-700);
}
.video-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16/9;
	background: var(--wp--preset--color--neutral-800);
	border-radius: 1px;
	overflow: hidden;
	margin-top: var(--wp--preset--spacing--70);
}
.video-frame iframe,
.video-frame .wp-block-embed__wrapper {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
.video-frame .wp-block-embed__wrapper iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* — contact form — */
.field > label {
	display: block;
	font-size: 12px;
	margin-bottom: 5px;
	color: color-mix(in srgb, var(--wp--preset--color--text) 70%, transparent);
}
.input {
	width: 100%;
	min-height: 36px;
	padding: 6px 10px;
	font: inherit;
	font-size: 14px;
	color: var(--wp--preset--color--text);
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--custom--divider);
	border-radius: 2px;
}
textarea.input { min-height: 90px; resize: vertical; }
.input:focus-visible { border-color: var(--wp--preset--color--accent); outline-offset: 0; }
.field + .field { margin-top: 20px; }
.wpcf7-form .wpcf7-submit { margin-top: 20px; }
.wpcf7-not-valid-tip { display: block; margin-top: 5px; font-size: 12px; color: var(--wp--preset--color--accent-2-700); }
.wpcf7-response-output { margin: 20px 0 0; padding: 10px 14px; font-size: 13px; border-radius: 2px; border: 1px solid var(--wp--custom--divider); }
.wpcf7-mail-sent-ok { border-color: var(--wp--preset--color--accent-700); color: var(--wp--preset--color--accent-700); }
.wpcf7-validation-errors,
.wpcf7-mail-sent-ng { border-color: var(--wp--preset--color--accent-2-700); color: var(--wp--preset--color--accent-2-700); }
.wpcf7-spinner { margin-left: 10px; }
.hp-field {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* — core Table block, styled to match the design's .table — */
.wp-block-table table {
	font-size: 14px;
	border-collapse: collapse;
}
.wp-block-table th {
	text-align: left;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: color-mix(in srgb, var(--wp--preset--color--text) 60%, transparent);
	border-bottom: 1px solid var(--wp--custom--divider);
}
.wp-block-table td {
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--text) 8%, transparent);
}
.wp-block-table tbody tr:hover {
	background: color-mix(in srgb, var(--wp--preset--color--text) 4%, transparent);
}

/* — CoCom list scans (Resources page) — */
.cocom-scan-col { flex-grow: 0; }
.cocom-scan {
	margin: 0;
}
.cocom-scan img {
	display: block;
	width: 100%;
	height: auto;
	border: 1px solid var(--wp--custom--divider);
}
