/* ==========================================================================
   Pistical — main stylesheet
   Palette: pistachio + shell + cream + ink. Fonts: Fraunces / Karla.
   ========================================================================== */

@font-face {
	font-family: "Fraunces";
	src: url("../fonts/fraunces-latin-wght-normal.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Fraunces";
	src: url("../fonts/fraunces-latin-wght-italic.woff2") format("woff2");
	font-weight: 100 900;
	font-style: italic;
	font-display: swap;
}
@font-face {
	font-family: "Karla";
	src: url("../fonts/karla-latin-wght-normal.woff2") format("woff2");
	font-weight: 200 800;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Karla";
	src: url("../fonts/karla-latin-wght-italic.woff2") format("woff2");
	font-weight: 200 800;
	font-style: italic;
	font-display: swap;
}

/* Size-matched local fallbacks: text keeps the same width/height while the web fonts load. */
@font-face {
	font-family: "Fraunces Fallback";
	src: local("Times New Roman Bold"), local("TimesNewRomanPS-BoldMT"), local("Liberation Serif Bold"), local("Tinos Bold");
	font-weight: 500 900;
	size-adjust: 111.8%;
	ascent-override: 87.48%;
	descent-override: 22.81%;
	line-gap-override: 0%;
}
@font-face {
	font-family: "Fraunces Fallback";
	src: local("Times New Roman"), local("TimesNewRomanPSMT"), local("Liberation Serif"), local("Tinos");
	font-weight: 100 499;
	size-adjust: 111.8%;
	ascent-override: 87.48%;
	descent-override: 22.81%;
	line-gap-override: 0%;
}
@font-face {
	font-family: "Fraunces Fallback";
	src: local("Times New Roman Italic"), local("TimesNewRomanPS-ItalicMT"), local("Liberation Serif Italic"), local("Tinos Italic");
	font-style: italic;
	font-weight: 100 900;
	size-adjust: 111.72%;
	ascent-override: 87.54%;
	descent-override: 22.82%;
	line-gap-override: 0%;
}
@font-face {
	font-family: "Karla Fallback";
	src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Arimo"), local("Helvetica");
	size-adjust: 101.66%;
	ascent-override: 90.2%;
	descent-override: 24.79%;
	line-gap-override: 0%;
}

/* Android has no Times/Arial: matching fallbacks for Noto Serif and Roboto. */
@font-face {
	font-family: "Fraunces Fallback Android";
	src: local("Noto Serif Bold"), local("NotoSerif-Bold");
	font-weight: 500 900;
	size-adjust: 95.34%;
	ascent-override: 102.58%;
	descent-override: 26.75%;
	line-gap-override: 0%;
}
@font-face {
	font-family: "Fraunces Fallback Android";
	src: local("Noto Serif"), local("NotoSerif-Regular"), local("NotoSerif");
	font-weight: 100 499;
	size-adjust: 95.34%;
	ascent-override: 102.58%;
	descent-override: 26.75%;
	line-gap-override: 0%;
}
@font-face {
	font-family: "Fraunces Fallback Android";
	src: local("Noto Serif Italic"), local("NotoSerif-Italic");
	font-style: italic;
	font-weight: 100 900;
	size-adjust: 97.70%;
	ascent-override: 100.10%;
	descent-override: 26.10%;
	line-gap-override: 0%;
}
@font-face {
	font-family: "Karla Fallback Android";
	src: local("Roboto"), local("Roboto-Regular");
	size-adjust: 102.77%;
	ascent-override: 89.23%;
	descent-override: 24.52%;
	line-gap-override: 0%;
}

:root {
	/* Primitives */
	--c-cream: #fbf7ef;
	--c-paper: #ffffff;
	--c-ink: #1f2b1a;
	--c-ink-soft: #4a5544;
	--c-pistachio: #8cb04e;
	--c-pistachio-deep: #4e6b26;
	--c-pistachio-tint: #eef3e0;
	--c-shell: #ead5a8;
	--c-shell-tint: #f6eedc;
	--c-terracotta: #b4472c;
	--c-terracotta-dark: #933520;
	--c-line: #e7dfcc;

	/* Semantic */
	--bg: var(--c-cream);
	--surface: var(--c-paper);
	--text: var(--c-ink);
	--text-muted: var(--c-ink-soft);
	--accent: var(--c-pistachio-deep);
	--cta: var(--c-terracotta);
	--cta-hover: var(--c-terracotta-dark);
	--border: var(--c-line);
	--focus: #2f6fdb;

	--font-display: "Fraunces", "Fraunces Fallback", "Fraunces Fallback Android", Georgia, serif;
	--font-body: "Karla", "Karla Fallback", "Karla Fallback Android", Arial, sans-serif;
	--gutter: 20px;

	--radius-s: 10px;
	--radius-m: 18px;
	--radius-l: 28px;
	--shadow-s: 0 1px 2px rgb(31 43 26 / 6%), 0 2px 8px rgb(31 43 26 / 5%);
	--shadow-m: 0 10px 30px -12px rgb(31 43 26 / 22%);

	--space-1: 4px;
	--space-2: 8px;
	--space-3: 12px;
	--space-4: 16px;
	--space-5: 24px;
	--space-6: 32px;
	--space-7: 48px;
	--space-8: 72px;
	--space-9: 104px;

	--ease: cubic-bezier(.2, .7, .2, 1);

	/* Pistachio pattern: shown behind every card image while it loads, and as the no-image tile */
	--pattern:
		radial-gradient(circle at 20% 25%, rgb(140 176 78 / 35%) 0 14%, transparent 15%),
		radial-gradient(circle at 78% 70%, rgb(234 213 168 / 90%) 0 18%, transparent 19%),
		radial-gradient(circle at 70% 18%, rgb(140 176 78 / 20%) 0 8%, transparent 9%),
		var(--c-pistachio-tint);
	--header-h: 76px;
}

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

html { -webkit-text-size-adjust: 100%; }
@media (min-width: 1025px) { html { scroll-padding-top: calc(var(--header-h) + 16px); } }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img, svg, video, iframe, embed, object { max-width: 100%; }
img, svg, video { height: auto; display: block; }
figure { margin: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

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

h1, h2, h3, h4 {
	overflow-wrap: break-word;
	font-family: var(--font-display);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.01em;
	margin: 0 0 var(--space-4);
	text-wrap: balance;
	font-variation-settings: "SOFT" 100;
}

p { margin: 0 0 var(--space-4); }

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

.skip-link {
	position: absolute; left: 16px; top: -60px; z-index: 1000;
	background: var(--c-ink); color: var(--c-cream);
	padding: 10px 16px; border-radius: var(--radius-s);
	font-weight: 700; text-decoration: none;
	transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; color: var(--c-cream); }

.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 780px; }
.container--wide { max-width: 1100px; }
@media (min-width: 768px) { .container { padding-inline: 32px; } :root { --gutter: 32px; } }

.site-main { display: block; outline: none; min-height: 50vh; container-type: inline-size; container-name: main; }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 46px; padding: 10px 22px;
	border-radius: 999px; border: 2px solid transparent;
	font: 700 0.95rem/1 var(--font-body); letter-spacing: .02em;
	text-decoration: none; cursor: pointer;
	transition: background-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease), border-color .18s var(--ease);
}
.btn--primary { background: var(--cta); color: #fff; }
.btn--primary:hover,
a:hover > .btn--primary { background: var(--cta-hover); color: #fff; transform: translateY(-1px); }
.btn--ghost { border-color: var(--c-ink); color: var(--c-ink); background: transparent; }
.btn--ghost:hover { background: var(--c-ink); color: var(--c-cream); }

.eyebrow {
	display: inline-flex; align-items: center; gap: 8px;
	margin: 0 0 var(--space-3);
	font: 700 .78rem/1.2 var(--font-body); letter-spacing: .14em; text-transform: uppercase;
	color: var(--accent);
}
.eyebrow::before {
	content: ""; width: 10px; height: 14px; border-radius: 50%;
	background: var(--c-pistachio); transform: rotate(-25deg);
}

/* ---------- Header ---------- */
.site-header {
	position: relative; z-index: 100;
	background: rgb(251 247 239 / 92%);
	backdrop-filter: saturate(1.4) blur(10px);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--border);
}
@media (min-width: 1025px) {
	.site-header { position: sticky; top: 0; }
	.admin-bar .site-header { top: 32px; }
}

.site-header__inner {
	display: flex; align-items: center; gap: var(--space-5);
	min-height: var(--header-h);
}
.site-branding { flex: 0 0 auto; }
.site-logo { display: inline-flex; align-items: center; text-decoration: none; }
.site-logo__img { height: 42px; width: auto; }
@media (min-width: 1024px) { .site-logo__img { height: 46px; } }

.primary-nav { margin-left: auto; }
.primary-nav .menu {
	display: flex; align-items: center; gap: var(--space-2);
	list-style: none; margin: 0; padding: 0;
}
.primary-nav .menu > li { position: relative; }
.primary-nav a {
	display: inline-flex; align-items: center; min-height: 44px;
	padding: 0 14px; border-radius: 999px;
	font-weight: 600; font-size: .98rem; text-decoration: none;
	color: var(--text);
	transition: background-color .18s var(--ease), color .18s var(--ease);
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a { background: var(--c-pistachio-tint); color: var(--c-pistachio-deep); }
.primary-nav .sub-menu {
	position: absolute; top: 100%; left: 0; min-width: 220px;
	list-style: none; margin: 0; padding: 8px;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
	box-shadow: var(--shadow-m);
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.primary-nav .sub-menu a { width: 100%; border-radius: var(--radius-s); }

.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.icon-btn {
	display: inline-grid; place-items: center;
	width: 44px; height: 44px; padding: 0;
	border: 0; border-radius: 50%; background: transparent; color: var(--text);
	cursor: pointer; transition: background-color .18s var(--ease);
}
.icon-btn:hover { background: var(--c-pistachio-tint); }
.menu-toggle { display: none; }
.menu-toggle__bars { display: grid; gap: 5px; width: 22px; }
.menu-toggle__bars span { height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s var(--ease), opacity .2s; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.header-search { border-top: 1px solid var(--border); padding: var(--space-4) 0; background: var(--bg); }
.header-search[hidden] { display: none; }

@media (max-width: 900px) {
	.site-header__inner { gap: var(--space-3); }
	.header-actions { margin-left: auto; }
	.menu-toggle { display: inline-grid; }
	.primary-nav {
		position: absolute; left: 0; right: 0; top: 100%;
		margin: 0; padding: var(--space-4) 20px var(--space-5);
		background: var(--bg); border-bottom: 1px solid var(--border);
		box-shadow: var(--shadow-m);
		display: none;
	}
	.primary-nav.is-open { display: block; }
	.primary-nav .menu { flex-direction: column; align-items: stretch; gap: 2px; }
	.primary-nav a { width: 100%; font-size: 1.05rem; border-radius: var(--radius-s); }
	.primary-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 16px; background: transparent; }
}


/* Header widget area (ad units / banners) */
.header-widgets { padding: var(--space-4) 0; text-align: center; }
.header-widget { margin-inline: auto; max-width: 100%; }
.header-widget + .header-widget { margin-top: var(--space-3); }

/* ---------- Search form ---------- */
.search-form { display: flex; gap: var(--space-2); max-width: 640px; margin-inline: auto; }
.search-form__input {
	flex: 1; min-width: 0; min-height: 48px;
	padding: 10px 18px;
	border: 2px solid var(--border); border-radius: 999px;
	background: var(--surface); color: var(--text);
	font: 500 1rem var(--font-body);
	transition: border-color .18s var(--ease);
}
.search-form__input:focus { outline: none; border-color: var(--c-pistachio-deep); box-shadow: 0 0 0 4px rgb(140 176 78 / 25%); }

/* ---------- Page hero (archives, search) ---------- */
.page-hero { padding: var(--space-8) 0 var(--space-6); text-align: center; }
.page-title { font-size: clamp(2.1rem, 4.5vw, 3.4rem); margin-bottom: var(--space-3); }
.page-intro { max-width: 640px; margin: 0 auto; color: var(--text-muted); }

/* ---------- Feature (latest post) ---------- */
.feature {
	display: grid; gap: var(--space-6); align-items: center;
	padding: var(--space-7) 0 var(--space-8);
}
.feature__media {
	position: relative; display: block; aspect-ratio: 4 / 3;
	border-radius: var(--radius-l); background: var(--pattern);
	box-shadow: var(--shadow-m);
}
.feature__media .card-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; transition: filter .3s var(--ease); }
.feature a:hover .card-img { filter: brightness(1.05) saturate(1.08); }
.feature__title { font-size: clamp(2rem, 4.2vw, 3.3rem); margin-bottom: var(--space-4); }
.feature__title a { text-decoration: none; }
.feature__title a:hover { color: var(--accent); }
.feature__excerpt { font-size: 1.15rem; color: var(--text-muted); max-width: 52ch; }
.feature .post-meta { margin-bottom: var(--space-5); }
.feature__body > a { text-decoration: none; display: inline-block; }
@media (min-width: 900px) {
	.feature { grid-template-columns: 1.15fr 1fr; gap: var(--space-8); }
	.feature__media { position: relative; }
	.feature > a { position: relative; }
	.feature > a::before {
		content: ""; position: absolute; z-index: -1;
		inset: auto -22px -22px auto; width: 55%; height: 60%;
		border-radius: var(--radius-l); background: var(--c-pistachio-tint);
	}
}

/* ---------- Section heads ---------- */
.section-head { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-2) var(--space-5); margin-bottom: var(--space-6); }
.section-head .eyebrow { width: 100%; margin-bottom: 0; }
.section-title { font-size: clamp(1.7rem, 3vw, 2.4rem); margin: 0; }
.section-head--inline { border-top: 1px solid var(--border); padding-top: var(--space-6); }
.section-link {
	margin-left: auto; font-weight: 700; color: var(--accent);
	text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
}
.section-link::after { content: "→"; transition: transform .18s var(--ease); }
.section-link:hover::after { transform: translateX(3px); }

/* ---------- Cards ---------- */
.card-grid { display: grid; gap: var(--space-6) var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }

.card { display: flex; flex-direction: column; }
.card > a { display: block; text-decoration: none; }
.card__media {
	display: block; aspect-ratio: 4 / 3;
	border-radius: var(--radius-m); background: var(--pattern);
}
.card__media .card-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; transition: filter .3s var(--ease); }
.card:hover .card__media .card-img { filter: brightness(1.05) saturate(1.08); }
.card__body { padding: var(--space-4) 2px 0; display: flex; flex-direction: column; flex: 1; }
.card__title { font-size: 1.35rem; margin-bottom: var(--space-2); overflow-wrap: anywhere; }
.card__title a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .3s var(--ease); }
.card__title a:hover { background-size: 100% 1px; color: var(--text); }
.card__excerpt { color: var(--text-muted); font-size: 1rem; margin-bottom: var(--space-3); }
.card .post-meta { margin-top: auto; }

.post-meta {
	display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
	margin: 0; font-size: .88rem; font-weight: 600; color: var(--text-muted);
	letter-spacing: .02em;
}

/* Placeholder image: designed tile, never an empty box */
.card-img--placeholder {
	display: grid; place-items: center; width: 100%; height: 100%;
	background: var(--pattern);
}
.card-img--placeholder span {
	font: 600 clamp(2.5rem, 6vw, 4rem)/1 var(--font-display);
	color: var(--c-pistachio-deep);
}

/* ---------- Pagination ---------- */
.pagination { margin: var(--space-8) 0 var(--space-7); }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.page-numbers {
	display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px;
	border-radius: 999px; font-weight: 700; text-decoration: none;
	background: var(--surface); border: 1px solid var(--border);
	transition: background-color .18s var(--ease), color .18s var(--ease);
}
a.page-numbers:hover { background: var(--c-pistachio-tint); color: var(--c-pistachio-deep); }
.page-numbers.current { background: var(--c-ink); color: var(--c-cream); border-color: var(--c-ink); }
.page-numbers.dots { background: transparent; border: 0; }

/* ---------- Popular Topics ---------- */
.popular-topics {
	position: relative;
	margin-top: var(--space-8);
	padding: var(--space-9) 0 var(--space-8);
	background: var(--c-pistachio-tint);
}
.popular-topics::before {
	/* scalloped top edge */
	content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 22px;
	background: radial-gradient(circle at 18px -6px, var(--bg) 20px, transparent 21px) 0 0 / 36px 22px repeat-x;
}
.single .popular-topics, .error404 .popular-topics { margin-top: var(--space-7); }

.topic-grid {
	list-style: none; margin: 0; padding: 0;
	display: grid; gap: var(--space-5) var(--space-4);
	grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 900px) { .topic-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-6) var(--space-5); } }

.topic-card { counter-increment: topic; }
.topic-card > a {
	display: flex; flex-direction: column; height: 100%;
	background: var(--surface); border-radius: var(--radius-m);
	text-decoration: none; color: var(--text);
	box-shadow: var(--shadow-s);
	transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.topic-card > a:hover { transform: translateY(-4px); box-shadow: var(--shadow-m); color: var(--text); }
.topic-card__media { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: var(--radius-m) var(--radius-m) 0 0; background: var(--pattern); }
.topic-card__media .card-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; transition: filter .3s var(--ease); }
.topic-card > a:hover .card-img { filter: brightness(1.05) saturate(1.08); }
.topic-card__media::after {
	content: counter(topic, decimal-leading-zero);
	position: absolute; left: 12px; top: 12px;
	min-width: 38px; height: 30px; padding: 0 10px; border-radius: 999px;
	display: grid; place-items: center;
	background: rgb(251 247 239 / 92%); color: var(--c-ink);
	font: 700 .8rem/1 var(--font-body); letter-spacing: .06em;
}
.topic-grid { counter-reset: topic; }
.topic-card__body { display: flex; flex-direction: column; gap: 6px; padding: var(--space-4); flex: 1; }
.topic-card__title {
	overflow-wrap: anywhere;
	font: 600 1.08rem/1.25 var(--font-display);
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.topic-card__meta { margin-top: auto; font-size: .82rem; font-weight: 600; color: var(--text-muted); }
@media (min-width: 900px) { .topic-card__title { font-size: 1.18rem; } }

/* ---------- Single entry ---------- */
.entry-header { padding-top: var(--space-8); padding-bottom: var(--space-6); text-align: center; }
.entry-title { font-size: clamp(2.2rem, 5vw, 3.6rem); margin-bottom: var(--space-4); }
.entry-lede { font-size: 1.2rem; color: var(--text-muted); max-width: 60ch; margin-inline: auto; }
.entry-header .post-meta { justify-content: center; }

.post-toolbar {
	display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: var(--space-3);
	margin-top: var(--space-5);
}
.toc {
	text-align: left; background: var(--surface); border: 1px solid var(--border);
	border-radius: 24px; min-width: min(100%, 320px);
}
.toc summary {
	cursor: pointer; list-style: none; min-height: 46px; padding: 0 22px;
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	font-weight: 700; font-size: .95rem;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--accent); }
.toc[open] summary::after { content: "–"; }
.toc ol { margin: 0; padding: 0 22px 16px 40px; font-size: .98rem; }
.toc li { padding: 4px 0; }
.toc-link { text-decoration: none; color: var(--text-muted); }
.toc-link:hover { color: var(--accent); text-decoration: underline; }

.entry-media { margin-bottom: var(--space-7); }
.entry-media img { width: 100%; max-height: 720px; object-fit: cover; border-radius: var(--radius-l); box-shadow: var(--shadow-m); }

.entry-content { font-size: 1.125rem; overflow-wrap: anywhere; }
.entry-content > * + * { margin-top: 0; }
.entry-content h2 {
	font-size: clamp(1.6rem, 3vw, 2.1rem);
	margin: var(--space-7) 0 var(--space-4);
	padding-top: var(--space-2);
}
.entry-content h2::before {
	content: ""; display: block; width: 44px; height: 6px; margin-bottom: var(--space-3);
	border-radius: 6px; background: linear-gradient(90deg, var(--c-pistachio) 0 60%, var(--c-shell) 60%);
}
.entry-content h3 { font-size: 1.35rem; margin: var(--space-6) 0 var(--space-3); }
.entry-content a { color: var(--accent); font-weight: 600; }
.entry-content img { border-radius: var(--radius-m); }
.entry-content figure, .entry-content .wp-block-image { margin: var(--space-6) 0; }
.entry-content figcaption { font-size: .9rem; color: var(--text-muted); text-align: center; margin-top: var(--space-2); }

.entry-content ul, .entry-content ol { padding-left: 0; margin: 0 0 var(--space-5); list-style: none; }
.entry-content li { position: relative; margin-bottom: var(--space-2); }
.entry-content ul > li { padding-left: 28px; }
.entry-content ul > li::before {
	content: ""; position: absolute; left: 4px; top: .55em;
	width: 10px; height: 13px; border-radius: 50%; background: var(--c-pistachio);
	transform: rotate(-25deg);
}
.entry-content ol { counter-reset: step; }
.entry-content ol > li { counter-increment: step; padding-left: 48px; min-height: 34px; margin-bottom: var(--space-4); }
.entry-content ol > li::before {
	content: counter(step); position: absolute; left: 0; top: -1px;
	width: 34px; height: 34px; border-radius: 50%;
	display: grid; place-items: center;
	background: var(--c-ink); color: var(--c-cream);
	font: 700 .9rem/1 var(--font-body);
}

/* Ingredient lists become tappable checklists (class added by main.js) */
.entry-content ul.is-ingredients {
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
	padding: var(--space-3) var(--space-5);
}
.entry-content ul.is-ingredients > li { padding: 10px 0 10px 36px; margin: 0; border-bottom: 1px dashed var(--border); cursor: pointer; }
.entry-content ul.is-ingredients > li:last-child { border-bottom: 0; }
.entry-content ul.is-ingredients > li::before {
	left: 0; top: 12px; width: 22px; height: 22px; border-radius: 7px; transform: none;
	background: transparent; border: 2px solid var(--c-pistachio-deep);
}
.entry-content ul.is-ingredients > li.is-checked { color: var(--text-muted); text-decoration: line-through; }
.entry-content ul.is-ingredients > li.is-checked::before {
	background: var(--c-pistachio-deep) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.entry-content blockquote {
	margin: var(--space-6) 0; padding: var(--space-5) var(--space-6);
	background: var(--c-shell-tint); border-radius: var(--radius-m);
	font: italic 500 1.25rem/1.5 var(--font-display);
}
.entry-content blockquote p:last-child { margin: 0; }
/* Wide tables scroll inside their own box (wrapper added in inc/content.php), never the page */
.entry-content .table-scroll,
.entry-content .wp-block-table { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: var(--space-5) 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 0; font-size: 1rem; overflow-wrap: normal; }
.entry-content pre { max-width: 100%; overflow-x: auto; padding: var(--space-4); background: var(--c-shell-tint); border-radius: var(--radius-s); font-size: .9rem; overflow-wrap: normal; }
.entry-content iframe, .entry-content video, .entry-content embed, .entry-content object { max-width: 100%; }
.entry-content iframe:not(.wp-block-embed__wrapper iframe)[width] { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.entry-content th, .entry-content td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.entry-content hr { border: 0; height: 1px; background: var(--border); margin: var(--space-7) 0; }
/* Wide/full blocks: sized from the main column (cqw excludes the scrollbar; 100vw does not) */
.entry-content .alignwide { max-width: none; width: auto; margin-inline: calc(50% - min(530px, 50cqw - var(--gutter))); }
.entry-content .alignfull { max-width: none; width: auto; margin-inline: calc(50% - 50cqw); }
.entry-content .alignwide img, .entry-content .alignfull img { width: 100%; }
.entry-content .alignfull img { border-radius: 0; }


.entry-footer { padding-top: var(--space-6); }
.post-nav { display: grid; gap: var(--space-4); grid-template-columns: 1fr; border-top: 1px solid var(--border); padding-top: var(--space-6); }
@media (min-width: 640px) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav__item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m); padding: var(--space-4) var(--space-5); }
.post-nav__item--next { text-align: right; }
.post-nav__label { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.post-nav__item a { font: 600 1.1rem/1.3 var(--font-display); text-decoration: none; }

.page-links { margin: var(--space-5) 0; font-weight: 700; }

/* ---------- Comments ---------- */
.comments { margin-top: var(--space-7); }
.comment-list { list-style: none; padding: 0; margin: 0 0 var(--space-6); }
.comment-list .children { list-style: none; padding-left: clamp(12px, 4vw, var(--space-6)); }
.comment-content { overflow-wrap: anywhere; }
.comment-body { padding: var(--space-4) 0; border-bottom: 1px solid var(--border); }
.comment-author img { float: left; margin-right: 12px; border-radius: 50%; }
.comment-metadata { font-size: .85rem; color: var(--text-muted); }
.comment-metadata a { text-decoration: none; }
.comment-form label { display: block; font-weight: 700; margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 12px 14px; border: 2px solid var(--border); border-radius: var(--radius-s);
	background: var(--surface); font: inherit;
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--c-pistachio-deep); }

/* ---------- Empty / 404 ---------- */
.empty-state .page-title { font-size: clamp(2rem, 4vw, 2.6rem); }
.empty-state { text-align: center; padding: var(--space-8) 0; max-width: 620px; margin-inline: auto; }
.empty-state img { margin: 0 auto var(--space-4); }
.empty-state .search-form { margin: var(--space-5) auto; }

/* ---------- Footer ---------- */
.site-footer { background: var(--c-ink); color: #e9e4d6; padding-top: var(--space-8); }
.popular-topics + .site-footer, .site-main:has(.popular-topics:last-child) + .site-footer { margin-top: 0; }
.site-footer__inner { display: grid; gap: var(--space-6); padding-bottom: var(--space-7); }
@media (min-width: 900px) { .site-footer__inner { grid-template-columns: 1fr auto; align-items: start; } }
.site-footer .site-logo__img { height: 44px; }
.site-footer__tagline { margin-top: var(--space-4); max-width: 34ch; font: italic 500 1.15rem/1.5 var(--font-display); color: #d6d1c1; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.footer-menu a {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
	color: #e9e4d6; text-decoration: none; font-weight: 600; border-radius: 999px;
}
.footer-menu a:hover { background: rgb(255 255 255 / 8%); color: #fff; }
.site-footer__bottom {
	display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3);
	border-top: 1px solid rgb(255 255 255 / 12%); padding-top: var(--space-5); padding-bottom: var(--space-5);
	font-size: .9rem; color: #bdb8a8;
}
.site-footer__bottom p { margin: 0; }
.back-to-top { color: #e9e4d6; text-decoration: none; font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.back-to-top:hover { color: var(--c-pistachio); }

/* ---------- Google Auto Ads ---------- */
/* An auto ad dropped into a grid takes a full row of its own. */
.google-auto-placed,
ins.adsbygoogle:not([data-anchor-status]) {
	grid-column: 1 / -1;
	min-width: 0;
	clear: both;
}
.google-auto-placed { flex: 0 0 auto; width: 100%; max-width: 100%; margin-block: var(--space-5); }
.card-grid > .google-auto-placed,
.topic-grid > .google-auto-placed { margin-block: 0; }
/* …and in a row layout (flex) it wraps onto its own line instead of squeezing the items. */
:is(.site-header__inner, .header-actions, .section-head, .post-toolbar, .site-footer__bottom, .footer-menu, .primary-nav .menu, .pagination .nav-links, .search-form, .is-layout-flex, .wp-block-columns, .wp-block-buttons):has(> .google-auto-placed, > ins.adsbygoogle:not([data-anchor-status])) {
	flex-wrap: wrap;
}
:is(.site-header__inner, .header-actions, .section-head, .post-toolbar, .site-footer__bottom, .footer-menu, .primary-nav .menu, .pagination .nav-links, .search-form, .is-layout-flex, .wp-block-columns, .wp-block-buttons) > :is(.google-auto-placed, ins.adsbygoogle:not([data-anchor-status])) {
	flex: 0 0 100%;
}
/* Unfilled slots take no space. */
ins.adsbygoogle[data-ad-status="unfilled"],
.google-auto-placed:has(> ins.adsbygoogle[data-ad-status="unfilled"]) { display: none !important; }

/* ---------- WordPress core classes ---------- */
.alignleft { float: left; margin: 0 var(--space-5) var(--space-4) 0; }
.alignright { float: right; margin: 0 0 var(--space-4) var(--space-5); }
.aligncenter { margin-inline: auto; }
.wp-caption-text { font-size: .9rem; color: var(--text-muted); }
.sticky .card__title::after { content: " ★"; color: var(--c-pistachio-deep); }
.bypostauthor > .comment-body .fn::after { content: " ·"; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

/* ---------- Print (recipes) ---------- */
@media print {
	.site-header, .header-widgets, .popular-topics, .site-footer, .post-toolbar, .post-nav, .comments { display: none !important; }
	body { background: #fff; font-size: 12pt; }
	.entry-media img { box-shadow: none; max-height: 320px; }
}
