/* diego.horse additions on top of kanso.css: the bits WordPress's JS used to do,
   and the markup the static build generates itself. */

/* Typography, NYT-style (Diego, Sep 2026). The Times sets articles in Cheltenham
   (headlines) and Imperial (body), both licensed to them; its own CSS falls back
   to Georgia, which every Mac, iPhone and Windows machine has. So: Georgia for
   reading, bold headlines, ~20px body with ~1.55 leading, and the system sans for
   small interface text (the Times uses Franklin there). No web fonts. */
:root {
	--dh-serif: Georgia, "Times New Roman", Times, serif;
	--dh-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--wp--preset--font-family--inter: var(--dh-serif);
	--wp--preset--font-family--noto-serif: var(--dh-serif);
	--wp--preset--font-size--medium: clamp(1.125rem, 1.04rem + 0.35vw, 1.25rem);   /* body: 18 → 20px */
	--wp--preset--font-size--small: clamp(0.9rem, 0.87rem + 0.12vw, 0.95rem);
	--wp--preset--font-size--large: clamp(1.35rem, 1.25rem + 0.5vw, 1.6rem);
	--wp--preset--font-size--x-large: clamp(1.7rem, 1.5rem + 1vw, 2.25rem);
}
body { line-height: 1.6; }   /* light text on a dark page wants a touch more than the Times' 1.5 */

/* Reading rhythm. Measured on /listening/ (Sep 2026): paragraphs sat 16px apart
   with 20px text, less than a line, so they ran together; a 36px title sat 16px
   above the text; #EEE Georgia on #24282B glared; thick link underlines crashed
   into descenders. */
.wp-block-post-content :where(p, ul, ol, blockquote, .wp-block-quote, pre, .wp-block-details):not(:first-child) {
	margin-block-start: 1.15em;
}
.wp-block-post-content li + li { margin-top: .35em; }
/* Nested lists (Now updates: "Life" › items): the sub-list hugs its label, and
   the next labelled section gets a paragraph's worth of room above it. */
.wp-block-post-content li > :is(ul, ol):not(:first-child) { margin-block-start: .35em; }   /* outranks the paragraph rule above */
.wp-block-post-content li:has(> :is(ul, ol)):not(:first-child) { margin-top: 1.15em; }
main > .wp-block-group:first-child + .wp-block-post-content { margin-block-start: 1.75rem; }
.wp-block-post-content :is(p, li, blockquote, figcaption, .wp-block-details) {
	color: color-mix(in srgb, var(--wp--preset--color--theme-6) 86%, var(--wp--preset--color--theme-1));
}
.wp-block-post-content a:where(:not(.wp-element-button)) {
	text-decoration-thickness: 1px;
	text-underline-offset: .22em;
	text-decoration-color: color-mix(in srgb, currentColor 50%, transparent);
}
.wp-block-post-content a:where(:not(.wp-element-button)):hover { text-decoration-color: currentColor; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.2; letter-spacing: -0.005em; }
h1, .wp-block-post-title { letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 1.6rem + 2vw, 2.75rem); }
h2 { font-size: clamp(1.45rem, 1.3rem + 0.8vw, 1.85rem); }
.wp-block-heading { margin-top: 1.4em; }
/* Post and page titles: a big, dim, wide, centred display headline. Size steps down with length
   so "Scoutel Slept in the Amazon, Woke Up Fluent in Bug Repellent" doesn't
   become a six-line wall. The dim grey still clears WCAG's 3:1 for large text. */
.dh-post-title {
	padding-top: clamp(1.5rem, 1rem + 7vw, 7rem);   /* padding: WordPress zeroes a first child's top margin */
	margin-bottom: .35em;
	line-height: 1.02;
	letter-spacing: -0.025em;
	color: color-mix(in srgb, var(--wp--preset--color--theme-6) 45%, var(--wp--preset--color--theme-1));
	text-wrap: balance;
	text-align: center;
}
.dh-title-short  { font-size: clamp(2.6rem, 1rem + 8vw, 6.5rem); }
.dh-title-medium { font-size: clamp(2.2rem, 1rem + 5.5vw, 4.75rem); }
.dh-title-long   { font-size: clamp(1.9rem, 1rem + 3.8vw, 3.5rem); line-height: 1.08; }

/* Lists of titles (home, "You may also enjoy…", /now/ thumbnails) read as links, not headlines */
.dh-row .wp-block-post-title, h3.truncate.wp-block-post-title, .dh-thumbs .wp-block-post-title { font-weight: 400; letter-spacing: 0; }
/* Interface text: sans, like the Times */
.wp-block-navigation, .wp-block-post-date, .wp-block-post-terms, figcaption, .wp-element-caption,
.has-small-font-size, .is-style-text-subtitle, button, .wp-element-button, .dh-adj-meta, .dh-count,
.dh-archive time, .dh-hit time, #search-status, .dh-pagination, .video-tile h3, .dh-updated {
	font-family: var(--dh-sans);
}

/* Wide blocks (galleries, framed images, two-up photos) sit a bit wider than the
   620px text column. Kanso's 720px was barely noticeable. */
:root { --wp--style--global--wide-size: 880px; }

/* Lightbox (static/js/site.js): any large content image */
.dh-zoom { cursor: zoom-in; }
.dh-overlay {
	position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
	background: color-mix(in srgb, var(--wp--preset--color--theme-1, #fff) 97%, transparent); backdrop-filter: blur(10px);
	cursor: zoom-out; padding: 3vmin; animation: dh-fade .2s ease-out;
}
.dh-overlay img {
	width: auto; height: auto; max-width: 92vw; max-height: 84vh; /* the whole picture, always */
	object-fit: contain; border-radius: 8px; animation: dh-zoom .25s ease-out;
}
.dh-overlay figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: 100%; max-height: 100%; }
.dh-overlay figcaption { margin-top: .6em; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--theme-5); text-align: center; }
.dh-nav {
	position: absolute; top: 50%; translate: 0 -50%; width: 48px; height: 48px; border-radius: 50%;
	border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
	background: color-mix(in srgb, var(--wp--preset--color--theme-1, #fff) 80%, transparent);
	color: inherit; font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center;
	transition: transform .15s ease;
}
.dh-nav:hover { transform: scale(1.08); }
.dh-prev { left: 2vmin; }
.dh-next { right: 2vmin; }
.dh-count { position: absolute; bottom: 2vmin; left: 50%; translate: -50% 0; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--theme-5); }
@keyframes dh-fade { from { opacity: 0; } }
@keyframes dh-zoom { from { transform: scale(.96); } }

/* "More" submenu opened by tap (hover already works through kanso.css) */
.wp-block-navigation .has-child.dh-open > .wp-block-navigation__submenu-container {
	height: auto; min-width: 200px; opacity: 1; overflow: visible; visibility: visible; width: auto;
}

/* Embeds: full width, 16:9, whatever the iframe's own width attribute says */
.wp-block-embed__wrapper iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; }

/* Archive lists and pagination */
.dh-list { list-style: none; padding: 0; margin: 0; }
.dh-list .wp-block-post-title { margin-bottom: .4em; }
.dh-pagination { display: flex; justify-content: space-between; align-items: center; margin-top: var(--wp--preset--spacing--40); }
.dh-pagination a { text-decoration: none; }

/* A post embedded in a page (home's Listening/Now, /now/) carries its own
   constrained layout; the list around it must not cap it at text width, or its
   wide blocks can't be wide. */
.is-layout-constrained > .wp-block-query:has(.wp-block-post-content) { max-width: none; }

/* /now/ grid of earlier updates */
.dh-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: var(--wp--preset--spacing--20); list-style: none; padding: 0; }
.dh-thumb { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 16px; }
.dh-updated { margin-bottom: .5em; }
.dh-stack > * + * { margin-top: .5em; }

.dh-comments { list-style: none; padding: 0; }
.dh-comments li { margin-bottom: var(--wp--preset--spacing--30); }

.dh-draft-banner {
	margin: 0; padding: .6em 1em; text-align: center; font-size: var(--wp--preset--font-size--small);
	background: #fff3c4; color: #5b4500;
}


/* Home page lists: WordPress's layout classes zeroed these margins */
.dh-row .wp-block-post-title { margin: 0; }
.dh-stack .wp-block-post-title { margin: 0; }


/* /listening/ + /watching/ video grids (from thesunrise.org) */
.videos { margin-block: var(--wp--preset--spacing--30); }
.video-grid { display: grid; gap: var(--wp--preset--spacing--20); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.video-thumb { position: relative; display: block; width: 100%; height: auto; min-height: 0; aspect-ratio: 16 / 9; padding: 0; border: 0; background: #000; cursor: pointer; border-radius: 12px; overflow: hidden; }
/* hqdefault thumbnails are 4:3 with black bars baked in; cover crops them to 16:9 */
.video-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .25); transition: background .15s ease; }
.video-play::after { content: ""; border-left: 20px solid #fff; border-top: 12px solid transparent; border-bottom: 12px solid transparent; margin-left: 5px; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .5)); }
.video-thumb:hover .video-play { background: rgba(0, 0, 0, .1); }
.video-tile h3 { font-size: var(--wp--preset--font-size--small); font-weight: 500; line-height: 1.35; margin: .6em 0 0; }
.video-player { position: relative; aspect-ratio: 16 / 9; }
.video-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 12px; }
.video-fallback, .video-loading { color: var(--wp--preset--color--theme-5); font-size: var(--wp--preset--font-size--small); }

/* Previous / next post, above "You may also enjoy…" */
.dh-adjacent { display: grid; grid-template-columns: 1fr 1fr; gap: var(--wp--preset--spacing--20); margin-block: var(--wp--preset--spacing--30); }
.dh-adjacent a {
	display: flex; flex-direction: column; gap: .35em; padding: var(--wp--preset--spacing--20);
	border: 1px solid color-mix(in srgb, currentColor 15%, transparent); border-radius: 16px;
	text-decoration: none; transition: border-color .15s ease, transform .15s ease;
}
.dh-adjacent a:hover { border-color: color-mix(in srgb, currentColor 40%, transparent); transform: translateY(-2px); }
.dh-adjacent .dh-next-post { text-align: right; grid-column: 2; }
.dh-adjacent img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; margin-bottom: .3em; }
.dh-adjacent small { color: var(--wp--preset--color--theme-5); font-size: var(--wp--preset--font-size--small); }
/* label and date share a line, the label on the card's outer edge */
.dh-adj-meta { display: flex; justify-content: space-between; gap: 1em; margin-top: auto; padding-top: .2em; }
.dh-next-post .dh-adj-meta { flex-direction: row-reverse; }
.dh-adjacent strong { font-weight: 500; line-height: 1.3; }
@media (max-width: 600px) { .dh-adjacent { grid-template-columns: 1fr; } .dh-adjacent .dh-next-post { grid-column: 1; } }

/* /archive/: every post, by year */
.dh-archive h2 { margin-top: var(--wp--preset--spacing--40); }
.dh-archive ul { list-style: none; padding: 0; margin: 0; }
.dh-archive li { display: flex; justify-content: space-between; gap: 1em; padding: .45em 0; border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent); }
.dh-archive li a { text-decoration: none; }
.dh-archive li a:hover { text-decoration: underline; }
.dh-archive time { color: var(--wp--preset--color--theme-5); font-size: var(--wp--preset--font-size--small); white-space: nowrap; }

/* /search/ (static/js/search.js) */
.dh-search { position: relative; display: flex; align-items: center; }
.dh-search svg { position: absolute; left: 16px; color: var(--wp--preset--color--theme-5); pointer-events: none; }
/* By id: Kanso's `input:not([type=submit]):not([type=checkbox])` outranks a class selector */
.dh-search #q {
	width: 100%; box-sizing: border-box; padding: 14px 16px 14px 44px; font: inherit; color: inherit;
	background: transparent; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-radius: 12px;
}
.dh-search #q:focus { outline: none; border-color: color-mix(in srgb, currentColor 60%, transparent); }
.dh-hits { list-style: none; padding: 0; margin: 0; }
.dh-hit { padding: var(--wp--preset--spacing--20) 0; border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent); }
.dh-hit h2 { margin: 0 0 .3em; }
.dh-hit h2 a { text-decoration: none; }
.dh-hit h2 a:hover { text-decoration: underline; }
.dh-hit p { margin: 0; }
.dh-hit time { display: block; margin-top: .4em; color: var(--wp--preset--color--theme-5); }
.dh-hit mark { background: color-mix(in srgb, currentColor 22%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.dh-more {
	margin-top: var(--wp--preset--spacing--30); width: 100%; padding: 12px; font: inherit; color: inherit; cursor: pointer;
	background: transparent; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); border-radius: 12px;
}
.dh-draft-banner a { color: inherit; text-decoration: underline; }

/* This year's goals (data/goals.yml): emoji, goal, and an optional note under it */
.dh-goal-list { list-style: none; padding: 0; margin: 0; }
.dh-goal-list li { display: grid; grid-template-columns: 1.6em 1fr; column-gap: .35em; margin: 0; }
.dh-goal-list li + li { margin-top: .5em; }
.dh-goal-name { display: block; }
.dh-goal-note {
	display: block; margin-top: .1em;
	font-size: var(--wp--preset--font-size--small); line-height: 1.45;
	color: var(--wp--preset--color--theme-5);
}
