/*
Theme Name: Cooking with Lily
Theme URI: https://cookingwithlily.com
Author: Cooking with Lily
Description: A fast, mobile-first recipe blog theme with soft animations, a phone tab bar, tappable ingredient checklists and a clean reading layout. No ads, no page builders, no external requests.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cooking-with-lily
*/

/* ---------- Tokens ---------- */
:root {
	--bg: #fdf9f3;
	--surface: #ffffff;
	--cream: #f7eedf;
	--ink: #2b2118;
	--muted: #75675a;
	--line: #ecdfcd;
	--accent: #c2401b;
	--accent-dark: #9a2f10;
	--accent-soft: #fbe4da;
	--sage: #56621c;
	--sage-soft: #ecefd8;
	--heading: #2b2118;
	--btn-text: #ffffff;
	--header-bg: #fdf9f3;
	--footer-bg: #2b2118;
	--footer-text: #e9dccb;

	--font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
	--font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-logo: var(--font-display);
	--fs-body: 17px;
	--fs-content: 18px;
	--logo-size: 20px;
	--logo-img: 50px;
	--hs: 1; /* heading scale */
	--hw: 600; /* heading weight */
	--lh: 1.7;

	--radius: 22px;
	--radius-sm: calc(var(--radius) * 0.64);
	--shadow: 0 1px 2px rgba(74, 48, 24, 0.05), 0 10px 30px -12px rgba(74, 48, 24, 0.18);
	--shadow-lg: 0 24px 50px -20px rgba(74, 48, 24, 0.35);
	--ease: cubic-bezier(0.22, 0.8, 0.26, 1);

	--gutter: 16px;
	--container: 1200px;
	--content: 720px;
	--header-h: 60px;
	--tabbar-h: 62px;
	--safe-b: env(safe-area-inset-bottom, 0px);
	--cols: 3;
	--card-ratio: 4 / 3;
	--hero-h: 76svh;
	--hero-shade: 1;
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: var(--fs-body);
	line-height: var(--lh);
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
	padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
}

img, svg, video, iframe { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }

h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: var(--hw);
	color: var(--heading);
	line-height: 1.15;
	letter-spacing: -0.015em;
	margin: 0 0 0.5em;
	text-wrap: balance;
}
p { margin: 0 0 1.2em; }

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

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
.cwl-skip:focus {
	clip-path: none; width: auto; height: auto;
	z-index: 200; top: 8px; left: 8px;
	background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px;
}

.cwl-container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: var(--gutter);
}
.cwl-center { text-align: center; }
.cwl-icon { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Buttons, badges ---------- */
.cwl-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px;
	padding: 0 24px;
	border: 0; border-radius: 999px;
	background: var(--accent); color: var(--btn-text);
	font-weight: 700; font-size: 1rem; text-decoration: none;
	box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--accent) 75%, transparent);
	transition: transform 0.25s var(--ease), background 0.2s, box-shadow 0.25s;
}
.cwl-btn:hover { filter: brightness(0.9); transform: translateY(-2px); }
.cwl-btn:active { transform: scale(0.96); }
.cwl-btn-ghost, .cwl-btn-ghost:hover {
	filter: none;
}
.cwl-btn-ghost {
	background: rgba(255, 255, 255, 0.16); color: #fff;
	box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.7);
	backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.cwl-btn-ghost:hover { background: rgba(255, 255, 255, 0.28); }
.cwl-btn-soft { background: var(--accent-soft); color: var(--accent-dark); box-shadow: none; }
.cwl-btn-soft:hover { filter: brightness(0.95); }

.cwl-icon-btn {
	display: inline-grid; place-items: center;
	width: 44px; height: 44px;
	border: 0; border-radius: 50%;
	background: transparent; color: var(--ink);
	transition: background 0.2s, transform 0.2s var(--ease);
}
.cwl-icon-btn:hover { background: var(--cream); }
.cwl-icon-btn:active { transform: scale(0.9); }

.cwl-badge {
	display: inline-block;
	padding: 5px 12px;
	border-radius: 999px;
	background: var(--sage-soft); color: var(--sage);
	font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
	line-height: 1.4;
}
.cwl-eyebrow {
	margin: 0 0 6px;
	color: var(--accent);
	font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.cwl-text-link {
	display: inline-flex; align-items: center; gap: 6px;
	font-weight: 700; text-decoration: none;
}
.cwl-text-link .cwl-icon { transition: transform 0.25s var(--ease); }
.cwl-text-link:hover .cwl-icon { transform: translateX(4px); }

/* ---------- Header ---------- */
.cwl-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--header-bg) 86%, transparent);
	backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
	border-bottom: 1px solid transparent;
	transition: transform 0.35s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.cwl-header.is-stuck { border-color: var(--line); box-shadow: 0 6px 20px -16px rgba(74, 48, 24, 0.5); }
.cwl-header.is-hidden { transform: translateY(-100%); }
.cwl-header-inner { display: flex; align-items: center; gap: 4px; height: var(--header-h); }

.cwl-brand {
	display: inline-flex; align-items: center; gap: 10px;
	margin-right: auto;
	color: var(--ink); text-decoration: none;
}
.cwl-brand-mark {
	display: grid; place-items: center;
	width: 36px; height: 36px; border-radius: 50%;
	background: var(--accent); color: var(--btn-text);
	transition: transform 0.5s var(--ease);
}
.cwl-brand:hover .cwl-brand-mark { transform: rotate(-18deg); }
.cwl-brand-logo { width: auto; height: var(--logo-img); max-height: calc(var(--header-h) - 8px); max-width: 60vw; object-fit: contain; transition: transform 0.5s var(--ease); }
.cwl-brand:hover .cwl-brand-logo { transform: rotate(-6deg) scale(1.04); }
.cwl-footer .cwl-brand-logo { height: calc(var(--logo-img) * 1.5); max-height: none; }
.cwl-brand-name { font-family: var(--font-logo); font-weight: var(--hw); font-size: var(--logo-size); line-height: 1.2; letter-spacing: -0.02em; white-space: nowrap; color: var(--heading); }
.cwl-brand-name em { color: var(--accent); font-weight: 400; }

.cwl-nav { display: none; }
.cwl-nav ul, .cwl-drawer-nav ul, .cwl-footer ul { list-style: none; margin: 0; padding: 0; }

/* Options (body classes set from the Customizer). */
.cwl-header-static .cwl-header { position: relative; }
.cwl-menu-btn { display: none; }
.cwl-no-tabbar .cwl-menu-btn { display: inline-grid; }
body.cwl-no-tabbar { padding-bottom: 0; }
.cwl-no-tabbar .cwl-tabbar { display: none; }
.cwl-no-tabbar .cwl-to-top { bottom: calc(var(--safe-b) + 16px); }
.cwl-shadow-none { --shadow: 0 0 0 1px var(--line); --shadow-lg: 0 0 0 1px var(--line); }
.cwl-shadow-strong { --shadow: 0 2px 4px rgba(74, 48, 24, 0.08), 0 18px 40px -14px rgba(74, 48, 24, 0.32); }

/* ---------- Tab bar (phones) ---------- */
.cwl-tabbar {
	position: fixed; inset: auto 0 0 0; z-index: 60;
	display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
	height: calc(var(--tabbar-h) + var(--safe-b));
	padding-bottom: var(--safe-b);
	background: color-mix(in srgb, var(--surface) 92%, transparent);
	backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
	border-top: 1px solid var(--line);
}
.cwl-tabbar > * {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
	border: 0; background: none; padding: 0;
	color: var(--muted); text-decoration: none;
	font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em;
	transition: color 0.2s;
}
.cwl-tabbar .cwl-icon { width: 23px; height: 23px; transition: transform 0.3s var(--ease); }
.cwl-tabbar > *:active .cwl-icon { transform: scale(0.82); }
.cwl-tabbar .is-current { color: var(--accent); }
.cwl-tabbar .is-current .cwl-icon { transform: translateY(-1px); }

/* ---------- Drawer, search panel, overlay ---------- */
.cwl-overlay {
	position: fixed; inset: 0; z-index: 70;
	background: rgba(43, 33, 24, 0.45);
	opacity: 0; visibility: hidden;
	transition: opacity 0.3s, visibility 0.3s;
}
.cwl-open-menu .cwl-overlay, .cwl-open-search .cwl-overlay { opacity: 1; visibility: visible; }
.cwl-open-menu, .cwl-open-search { overflow: hidden; }

.cwl-drawer {
	position: fixed; inset: 0 0 0 auto; z-index: 80;
	width: min(88vw, 380px);
	padding: 12px 20px calc(24px + var(--safe-b));
	background: var(--bg);
	border-radius: calc(var(--radius) * 1.27) 0 0 calc(var(--radius) * 1.27);
	box-shadow: var(--shadow-lg);
	overflow-y: auto; overscroll-behavior: contain;
	transform: translateX(105%); visibility: hidden;
	transition: transform 0.45s var(--ease), visibility 0.45s;
}
.cwl-open-menu .cwl-drawer { transform: none; visibility: visible; }
.cwl-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cwl-drawer-nav a {
	display: block; padding: 13px 4px;
	border-bottom: 1px solid var(--line);
	color: var(--ink); text-decoration: none;
	font-family: var(--font-display); font-size: 1.35rem; font-weight: var(--hw);
}
.cwl-drawer-nav .sub-menu a { padding-left: 18px; font-size: 1.05rem; }
.cwl-drawer-nav li { opacity: 0; transform: translateX(24px); transition: opacity 0.4s, transform 0.5s var(--ease); }
.cwl-open-menu .cwl-drawer-nav li { opacity: 1; transform: none; transition-delay: calc(0.08s + var(--i, 0) * 0.04s); }
.cwl-drawer-heading { margin: 26px 0 12px; font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.cwl-drawer .cwl-chips { margin-inline: -20px; padding-inline: 20px; }
.cwl-drawer-mail, .cwl-footer-mail {
	display: inline-flex; align-items: center; gap: 8px;
	font-weight: 700; text-decoration: none; word-break: break-all;
}
.cwl-drawer-mail { margin-top: 22px; }

.cwl-search-panel {
	position: fixed; inset: 0 0 auto 0; z-index: 80;
	padding: 10px 0 18px;
	background: var(--bg);
	border-radius: 0 0 calc(var(--radius) * 1.18) calc(var(--radius) * 1.18);
	box-shadow: var(--shadow-lg);
	transform: translateY(-110%); visibility: hidden;
	transition: transform 0.4s var(--ease), visibility 0.4s;
}
.cwl-open-search .cwl-search-panel { transform: none; visibility: visible; }
.cwl-search-row { display: flex; align-items: center; gap: 6px; }
.cwl-search-row .cwl-search-form { flex: 1; }

.cwl-search-form {
	position: relative;
	display: flex; align-items: center;
	min-height: 52px;
	padding: 4px 4px 4px 46px;
	background: var(--surface);
	border: 1.5px solid var(--line); border-radius: 999px;
	transition: border-color 0.2s, box-shadow 0.2s;
}
.cwl-search-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.cwl-search-form > .cwl-icon { position: absolute; left: 16px; color: var(--muted); }
.cwl-search-form input {
	flex: 1; min-width: 0;
	border: 0; background: none; outline: 0;
	font-size: 1rem; /* 16px+: no zoom-on-focus on iOS */
	-webkit-appearance: none; appearance: none;
}
.cwl-search-form button {
	min-height: 42px; padding: 0 18px;
	border: 0; border-radius: 999px;
	background: var(--ink); color: var(--bg); font-weight: 700; font-size: 0.9rem;
}

/* ---------- Scroll reveal ---------- */
.js .cwl-reveal { opacity: 0; transform: translateY(22px); }
.js .cwl-reveal.is-in {
	opacity: 1; transform: none;
	transition: opacity 0.7s var(--ease), transform 0.8s var(--ease);
	transition-delay: calc(var(--d, 0) * 80ms);
}

/* ---------- Hero ---------- */
.cwl-hero {
	position: relative;
	display: flex; align-items: flex-end;
	min-height: min(var(--hero-h), 720px);
	margin: 4px 10px 0;
	border-radius: calc(var(--radius) * 1.27);
	overflow: hidden;
	color: #fff;
	isolation: isolate;
}
.cwl-hero-media { position: absolute; inset: 0; z-index: -1; background: #c9b69c; }
.cwl-hero-media img {
	width: 100%; height: 100%;
	object-fit: cover; object-position: 64% 20%;
	animation: cwl-kenburns 9s var(--ease) both;
}
.cwl-hero-media::after {
	content: ""; position: absolute; inset: 0;
	opacity: var(--hero-shade);
	background: linear-gradient(180deg, rgba(30, 20, 10, 0) 30%, rgba(30, 20, 10, 0.55) 62%, rgba(30, 20, 10, 0.88) 100%);
}
.cwl-hero-body { padding: 28px 22px 26px; max-width: 620px; }
.cwl-hero-body > * { animation: cwl-rise 0.9s var(--ease) both; }
.cwl-hero-body > :nth-child(2) { animation-delay: 0.1s; }
.cwl-hero-body > :nth-child(3) { animation-delay: 0.2s; }
.cwl-hero-body > :nth-child(4) { animation-delay: 0.3s; }
.cwl-hero .cwl-eyebrow { color: #ffd9c7; }
.cwl-hero-title { color: inherit; font-size: calc(clamp(2.2rem, 9.4vw, 4rem) * var(--hs)); line-height: 1.04; margin-bottom: 12px; }
.cwl-hero-text { font-size: 1.05rem; line-height: 1.55; opacity: 0.94; margin-bottom: 20px; max-width: 34em; }
.cwl-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

@keyframes cwl-kenburns { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes cwl-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */
.cwl-section { margin-top: 48px; }
.cwl-section-head { margin-bottom: 18px; }
.cwl-section-title { font-size: calc(clamp(1.6rem, 6vw, 2.3rem) * var(--hs)); margin: 0; }

/* ---------- Category chips ---------- */
.cwl-chips {
	display: flex; gap: 14px;
	margin-inline: calc(var(--gutter) * -1);
	padding: 4px var(--gutter) 10px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scroll-padding-inline: var(--gutter);
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.cwl-chips::-webkit-scrollbar { display: none; }
.cwl-chip {
	flex: none; width: 84px;
	display: flex; flex-direction: column; align-items: center; gap: 8px;
	scroll-snap-align: start;
	color: var(--ink); text-decoration: none; text-align: center;
	font-size: 0.85rem; font-weight: 700; line-height: 1.25;
}
.cwl-chip-img {
	display: grid; place-items: center;
	width: 80px; height: 80px;
	border-radius: 50%; overflow: hidden;
	background: var(--cream);
	box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px var(--line);
	transition: transform 0.35s var(--ease), box-shadow 0.3s;
}
.cwl-chip-img img { width: 100%; height: 100%; object-fit: cover; }
.cwl-chip-letter { font-family: var(--font-display); font-size: 1.8rem; color: var(--accent); }
.cwl-chip:hover .cwl-chip-img, .cwl-chip.is-current .cwl-chip-img { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.cwl-chip:active .cwl-chip-img { transform: scale(0.92); }
.cwl-chip.is-current { color: var(--accent-dark); }

/* ---------- Cards ---------- */
.cwl-grid { display: grid; gap: 22px; }

.cwl-card {
	position: relative;
	display: flex; flex-direction: column;
	background: var(--surface);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
	transition: transform 0.4s var(--ease), box-shadow 0.4s;
}
.cwl-card:active { transform: scale(0.985); }
.cwl-card-media { position: relative; display: block; aspect-ratio: var(--card-ratio); overflow: hidden; background: var(--cream); }
.cwl-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.cwl-card-empty { display: grid; place-items: center; height: 100%; color: var(--line); }
.cwl-card-empty .cwl-icon { width: 54px; height: 54px; }
.cwl-badge-float {
	position: absolute; left: 14px; top: 14px;
	background: color-mix(in srgb, var(--surface) 94%, transparent); color: var(--ink);
	box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.35);
}
.cwl-card-body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 16px; }
.cwl-card-title { font-size: calc(1.38rem * var(--hs)); margin: 0 0 8px; }
.cwl-card-title a { color: inherit; text-decoration: none; }
/* Whole card is the tap target. */
.cwl-card-title a::after { content: ""; position: absolute; inset: 0; }
.cwl-card-excerpt {
	margin: 0 0 14px;
	color: var(--muted); font-size: 0.97rem; line-height: 1.55;
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.cwl-card-foot {
	display: flex; align-items: center; justify-content: space-between;
	margin-top: auto;
	color: var(--muted); font-size: 0.85rem; font-weight: 700;
}
.cwl-card-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.cwl-card-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.cwl-card-go {
	display: grid; place-items: center;
	width: 38px; height: 38px; border-radius: 50%;
	background: var(--accent-soft); color: var(--accent-dark);
	transition: background 0.3s, color 0.3s, transform 0.4s var(--ease);
}

.cwl-pagination { margin-top: 34px; }
.cwl-pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.cwl-pagination .page-numbers {
	display: grid; place-items: center;
	min-width: 46px; height: 46px; padding: 0 12px;
	border-radius: 999px;
	background: var(--surface); box-shadow: var(--shadow);
	color: var(--ink); font-weight: 700; text-decoration: none;
}
.cwl-pagination .page-numbers.current { background: var(--accent); color: var(--btn-text); }
.cwl-pagination .page-numbers.dots { background: none; box-shadow: none; min-width: 20px; padding: 0; }

.cwl-empty { padding: 40px 20px; text-align: center; color: var(--muted); background: var(--cream); border-radius: var(--radius); }

/* ---------- About band ---------- */
.cwl-about { background: var(--cream); border-radius: calc(var(--radius) * 1.27); overflow: hidden; }
.cwl-about-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 60% 30%; }
.cwl-about-body { padding: 24px 22px 28px; }
.cwl-about-body .cwl-section-title { margin-bottom: 12px; }

/* ---------- Kitchen moments strip ---------- */
.cwl-moments {
	display: flex; gap: 14px;
	padding: 4px var(--gutter) 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: var(--gutter);
	scrollbar-width: none;
}
.cwl-moments::-webkit-scrollbar { display: none; }
.cwl-moment {
	position: relative; flex: none;
	width: min(72vw, 340px); aspect-ratio: 4 / 5;
	margin: 0;
	border-radius: var(--radius); overflow: hidden;
	scroll-snap-align: start;
	background: var(--cream);
}
.cwl-moment img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.cwl-moment figcaption {
	position: absolute; inset: auto 0 0 0;
	padding: 44px 16px 14px;
	background: linear-gradient(180deg, transparent, rgba(30, 20, 10, 0.8));
	color: #fff; font-size: 0.92rem; font-weight: 700; line-height: 1.35;
}

/* ---------- Listing header ---------- */
.cwl-page-head { padding: 26px 0 20px; }
.cwl-page-title { font-size: calc(clamp(2rem, 8vw, 3.2rem) * var(--hs)); margin: 0 0 10px; }
.cwl-page-intro { color: var(--muted); max-width: 40em; }
.cwl-page-intro p:last-child { margin-bottom: 0; }
.cwl-page-head .cwl-search-form { margin-top: 14px; max-width: 520px; }
.cwl-listing { margin-top: 18px; }

/* ---------- Single post ---------- */
.cwl-progress {
	position: fixed; inset: 0 0 auto 0; z-index: 90;
	height: 3px;
	background: linear-gradient(90deg, var(--accent), #e9a13b);
	transform: scaleX(0); transform-origin: 0 50%;
	pointer-events: none;
}

.cwl-single-thumb { margin: 4px 10px 0; border-radius: calc(var(--radius) * 1.18); overflow: hidden; background: var(--cream); }
.cwl-single-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; animation: cwl-kenburns 1.6s var(--ease) both; }
.cwl-single-inner { max-width: calc(var(--content) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

.cwl-single-header { padding: 22px 0 6px; text-align: center; }
.cwl-single-header > * { animation: cwl-rise 0.8s var(--ease) both; }
.cwl-single-header > :nth-child(2) { animation-delay: 0.07s; }
.cwl-single-header > :nth-child(3) { animation-delay: 0.14s; }
.cwl-single-header > :nth-child(4) { animation-delay: 0.21s; }
.cwl-single-title { font-size: calc(clamp(2rem, 8.4vw, 3.1rem) * var(--hs)); margin: 12px 0 14px; }

.cwl-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.cwl-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.cwl-meta-author { color: var(--ink); }
.cwl-avatar { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; }
.cwl-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }

.cwl-facts {
	display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
	list-style: none; margin: 20px 0 0; padding: 14px 6px;
	background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.cwl-facts li { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 6px; color: var(--accent); }
.cwl-facts li + li { border-left: 1px solid var(--line); }
.cwl-facts span { display: flex; flex-direction: column; line-height: 1.3; }
.cwl-facts small { color: var(--muted); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.cwl-facts strong { color: var(--ink); font-size: 1rem; }
.cwl-jump { margin-top: 18px; }

/* ---------- Post content ---------- */
.cwl-content { padding-top: 22px; font-size: var(--fs-content); line-height: calc(var(--lh) + 0.08); overflow-wrap: break-word; }
.cwl-content > * { margin-top: 0; margin-bottom: 1.3em; }
.cwl-content h2 { font-size: calc(1.7rem * var(--hs)); margin: 1.7em 0 0.6em; }
.cwl-content h3 { font-size: calc(1.32rem * var(--hs)); margin: 1.5em 0 0.5em; }
.cwl-content h4 { font-size: calc(1.12rem * var(--hs)); margin: 1.4em 0 0.5em; }
.cwl-content a { font-weight: 700; }
.cwl-content img { border-radius: var(--radius-sm); }
.cwl-content figure { margin-inline: 0; }
.cwl-content figcaption { margin-top: 8px; color: var(--muted); font-size: 0.88rem; text-align: center; }
.cwl-content .alignwide, .cwl-content .alignfull { margin-inline: calc(var(--gutter) * -1); max-width: none; }
.cwl-content .alignfull img, .cwl-content .alignwide img { border-radius: 0; }
.cwl-content .aligncenter { margin-inline: auto; }
.cwl-content iframe { width: 100%; border-radius: var(--radius-sm); }

.cwl-content ul, .cwl-content ol { padding-left: 0; list-style: none; }
.cwl-content li { position: relative; padding: 9px 0 9px 34px; border-bottom: 1px dashed var(--line); }
.cwl-content li:last-child { border-bottom: 0; }
.cwl-content ul > li::before {
	content: ""; position: absolute; left: 8px; top: 1.15em;
	width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.cwl-content ol { counter-reset: step; }
.cwl-content ol > li { counter-increment: step; padding-left: 50px; padding-block: 13px; }
.cwl-content ol > li::before {
	content: counter(step);
	position: absolute; left: 0; top: 11px;
	display: grid; place-items: center;
	width: 34px; height: 34px; border-radius: 50%;
	background: var(--accent); color: var(--btn-text);
	font-family: var(--font-display); font-weight: 600; font-size: 1rem; line-height: 1;
}
.cwl-content li ul, .cwl-content li ol { margin: 6px 0 0; }

/* Ingredient lists become tappable checklists (class added by main.js). */
.cwl-content ul.cwl-checklist { padding: 6px 16px; background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.cwl-checklist > li { padding-left: 40px; cursor: pointer; user-select: none; -webkit-user-select: none; transition: color 0.25s; }
.cwl-content ul.cwl-checklist > li::before {
	left: 2px; top: 0.72em;
	width: 24px; height: 24px; border-radius: 8px;
	background: var(--surface) center / 0 no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.500l4.500 4.500L19 7.500'/%3E%3C/svg%3E");
	border: 2px solid color-mix(in srgb, var(--muted) 45%, var(--line));
	transition: background-color 0.2s, border-color 0.2s, background-size 0.25s var(--ease), transform 0.25s var(--ease);
}
.cwl-content ul.cwl-checklist > li.is-checked { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.cwl-content ul.cwl-checklist > li.is-checked::before { background-color: var(--sage); border-color: var(--sage); background-size: 16px; transform: scale(1.06); }

.cwl-content blockquote {
	margin-inline: 0; padding: 18px 20px;
	background: var(--cream); border-left: 4px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	font-family: var(--font-display); font-size: 1.2rem; line-height: 1.5;
}
.cwl-content blockquote p:last-child { margin-bottom: 0; }
.cwl-content blockquote cite { display: block; margin-top: 8px; font-family: var(--font-body); font-size: 0.88rem; color: var(--muted); font-style: normal; }
.cwl-content table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 0.98rem; }
.cwl-content th, .cwl-content td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.cwl-content th { background: var(--cream); }
.cwl-content hr { border: 0; border-top: 1px solid var(--line); margin-block: 2em; }
.cwl-content pre { overflow-x: auto; padding: 16px; background: var(--cream); border-radius: var(--radius-sm); font-size: 0.9rem; }
.cwl-content .wp-block-button__link { border-radius: 999px; background: var(--accent); color: var(--btn-text); font-weight: 700; text-decoration: none; }

.cwl-page-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 28px; }
.cwl-page-links-label { margin-right: 4px; color: var(--muted); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.cwl-page-links > a, .cwl-page-links > .post-page-numbers { text-decoration: none; }
.cwl-page-num {
	display: grid; place-items: center;
	min-width: 46px; height: 46px; border-radius: 50%;
	background: var(--surface); box-shadow: var(--shadow); color: var(--ink); font-weight: 700;
}
.cwl-page-links .current .cwl-page-num { background: var(--accent); color: var(--btn-text); }

.cwl-divider { display: flex; align-items: center; gap: 14px; margin: 34px 0 22px; color: var(--accent); }
.cwl-divider::before, .cwl-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.cwl-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.cwl-tags a {
	padding: 7px 14px; border-radius: 999px;
	background: var(--surface); border: 1px solid var(--line);
	color: var(--ink); font-size: 0.86rem; font-weight: 700; text-decoration: none;
}
.cwl-tags a::before { content: "#"; color: var(--accent); }

.cwl-share { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 26px; }
.cwl-share-label { margin-right: 4px; color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.cwl-share-btn {
	position: relative;
	display: grid; place-items: center;
	width: 46px; height: 46px; border: 0; border-radius: 50%;
	background: var(--surface); box-shadow: var(--shadow); color: var(--ink);
	transition: transform 0.3s var(--ease), background 0.2s, color 0.2s;
}
.cwl-share-btn[hidden] { display: none; }
.cwl-share-btn:hover { background: var(--accent); color: var(--btn-text); transform: translateY(-3px); }
.cwl-share-btn:active { transform: scale(0.9); }
.cwl-share-btn.is-copied::after {
	content: "Copied!";
	position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
	padding: 4px 10px; border-radius: 8px;
	background: var(--ink); color: var(--bg); font-size: 0.75rem; font-weight: 700; white-space: nowrap;
	animation: cwl-rise 0.3s var(--ease) both;
}

.cwl-author-box {
	display: flex; gap: 16px;
	padding: 20px;
	background: var(--cream); border-radius: var(--radius);
}
.cwl-author-photo { flex: none; width: 76px; height: 76px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 3px var(--surface); }
.cwl-author-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.cwl-author-title { font-size: calc(1.3rem * var(--hs)); margin-bottom: 6px; }
.cwl-author-box p { margin-bottom: 10px; font-size: 0.98rem; line-height: 1.6; opacity: 0.86; }

.cwl-post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.cwl-post-nav a {
	display: flex; flex-direction: column; gap: 6px;
	padding: 16px;
	background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow);
	color: var(--ink); text-decoration: none;
	transition: transform 0.3s var(--ease);
}
.cwl-post-nav a:active { transform: scale(0.97); }
.cwl-nav-next { text-align: right; align-items: flex-end; }
.cwl-nav-label { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.cwl-nav-title {
	font-family: var(--font-display); font-weight: var(--hw); font-size: 1.02rem; line-height: 1.3;
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}

.cwl-related { margin-top: 44px; }
.cwl-related .cwl-section-title { margin-bottom: 18px; }
.cwl-grid-2 { grid-template-columns: 1fr 1fr; gap: 14px; }
.cwl-grid-2 .cwl-card-body { padding: 12px 14px 12px; }
.cwl-grid-2 .cwl-card-title { font-size: calc(1.05rem * var(--hs)); line-height: 1.25; }
.cwl-grid-2 .cwl-card-go { display: none; }
.cwl-grid-2 .cwl-badge-float { left: 10px; top: 10px; font-size: 0.64rem; padding: 4px 9px; }

/* ---------- Pages ---------- */
.cwl-page .cwl-single-header { padding-top: 30px; }
.cwl-about-collage {
	display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px;
	margin: 4px 10px 0;
	max-width: 780px;
	aspect-ratio: 3 / 2;
}
.cwl-about-collage figure { margin: 0; border-radius: calc(var(--radius) * 0.9); overflow: hidden; background: var(--cream); animation: cwl-rise 0.9s var(--ease) both; }
.cwl-about-collage figure:first-child { grid-row: span 2; }
.cwl-about-collage figure:nth-child(2) { animation-delay: 0.12s; }
.cwl-about-collage figure:nth-child(3) { animation-delay: 0.24s; }
.cwl-about-collage img { width: 100%; height: 100%; object-fit: cover; }

.cwl-contact-card {
	display: flex; align-items: center; gap: 14px;
	margin-top: 16px; padding: 14px 16px;
	background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
	color: var(--ink); text-decoration: none;
	transition: transform 0.3s var(--ease);
}
.cwl-contact-card:hover { transform: translateY(-3px); }
.cwl-contact-card > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; margin-right: auto; line-height: 1.35; }
.cwl-contact-card small { color: var(--muted); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.cwl-contact-card strong { font-size: clamp(0.9rem, 4.1vw, 1.1rem); color: var(--accent-dark); overflow-wrap: anywhere; }
.cwl-contact-photo { flex: none; width: 60px; height: 60px; border-radius: 50%; overflow: hidden; }
.cwl-contact-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 45% 30%; }

.cwl-404 { padding-top: 34px; text-align: center; max-width: 560px; }
.cwl-404-photo { width: min(60vw, 280px); aspect-ratio: 1; margin: 0 auto 22px; border-radius: 50%; overflow: hidden; box-shadow: var(--shadow-lg); animation: cwl-rise 0.9s var(--ease) both; }
.cwl-404-photo img { width: 100%; height: 100%; object-fit: cover; }
.cwl-404 .cwl-search-form { margin: 18px 0; text-align: left; }

/* ---------- Footer ---------- */
.cwl-footer {
	margin-top: 64px; padding: 40px 0 26px;
	background: var(--footer-bg); color: var(--footer-text);
	border-radius: calc(var(--radius) * 1.36) calc(var(--radius) * 1.36) 0 0;
	--footer-muted: color-mix(in srgb, var(--footer-text) 62%, var(--footer-bg));
	--footer-accent: color-mix(in srgb, var(--accent) 55%, var(--footer-text));
}
.cwl-footer a { color: inherit; text-decoration: none; }
.cwl-footer a:hover { text-decoration: underline; }
.cwl-footer .cwl-brand { margin-bottom: 12px; }
.cwl-footer .cwl-brand-name { color: var(--footer-text); }
.cwl-footer .cwl-brand-name em { color: var(--footer-accent); }
.cwl-footer-top { display: grid; grid-template-columns: 1fr 1fr; gap: 30px 20px; }
.cwl-footer-brand { grid-column: 1 / -1; }
.cwl-footer-brand p { max-width: 34em; margin-bottom: 14px; font-size: 0.98rem; opacity: 0.85; }
.cwl-footer-mail { color: var(--footer-accent) !important; }
.cwl-footer-heading { margin-bottom: 10px; font-family: var(--font-body); font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--footer-muted); }
.cwl-footer-col li a { display: block; padding: 7px 0; font-size: 0.98rem; }
.cwl-copyright { margin: 30px 0 0; padding-top: 18px; border-top: 1px solid color-mix(in srgb, var(--footer-text) 14%, transparent); font-size: 0.86rem; color: var(--footer-muted); text-align: center; }
.cwl-copyright .cwl-icon { display: inline; vertical-align: -3px; width: 1em; height: 1em; color: var(--footer-accent); fill: currentColor; }

/* ---------- Social links ---------- */
.cwl-social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.cwl-social a {
	display: grid; place-items: center;
	width: 44px; height: 44px; border-radius: 50%;
	background: color-mix(in srgb, currentColor 10%, transparent);
	color: inherit; text-decoration: none;
	transition: transform 0.3s var(--ease), background 0.2s, color 0.2s;
}
.cwl-social a:hover { background: var(--accent); color: var(--btn-text); transform: translateY(-3px); text-decoration: none; }
.cwl-drawer .cwl-social { margin-top: 20px; }

/* ---------- Back to top ---------- */
.cwl-to-top {
	position: fixed; right: 14px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); z-index: 55;
	display: grid; place-items: center;
	width: 46px; height: 46px; border: 0; border-radius: 50%;
	background: var(--ink); color: var(--bg);
	box-shadow: var(--shadow-lg);
	opacity: 0; transform: translateY(14px) scale(0.9); pointer-events: none;
	transition: opacity 0.3s, transform 0.4s var(--ease);
}
.cwl-to-top[hidden] { display: none; }
.cwl-to-top.is-on { opacity: 1; transform: none; pointer-events: auto; }

/* Two recipe columns on phones (Customizer -> Recipe cards). */
@media (max-width: 599px) {
	.cwl-m2 { grid-template-columns: 1fr 1fr; gap: 14px; }
	.cwl-m2 > .cwl-card .cwl-card-body { padding: 12px 14px; }
	.cwl-m2 > .cwl-card .cwl-card-title { font-size: calc(1.05rem * var(--hs)); line-height: 1.25; }
	.cwl-m2 > .cwl-card .cwl-card-excerpt, .cwl-m2 > .cwl-card .cwl-card-go { display: none; }
	.cwl-m2 > .cwl-card .cwl-badge-float { left: 10px; top: 10px; font-size: 0.64rem; padding: 4px 9px; }
	.cwl-m2.cwl-grid-lead > .cwl-card:first-child { grid-column: 1 / -1; }
	.cwl-m2.cwl-grid-lead > .cwl-card:first-child .cwl-card-body { padding: 18px 20px 16px; }
	.cwl-m2.cwl-grid-lead > .cwl-card:first-child .cwl-card-title { font-size: calc(1.38rem * var(--hs)); }
	.cwl-m2.cwl-grid-lead > .cwl-card:first-child .cwl-card-excerpt { display: -webkit-box; }
}

/* ---------- Tablet ---------- */
@media (min-width: 600px) {
	:root { --gutter: 24px; }
	.cwl-grid { grid-template-columns: 1fr 1fr; }
	.cwl-grid-2 { gap: 20px; }
	.cwl-hero, .cwl-single-thumb, .cwl-about-collage { margin-inline: var(--gutter); }
	.cwl-hero-body { padding: 40px; }
	.cwl-chip { width: 96px; }
	.cwl-chip-img { width: 92px; height: 92px; }
	.cwl-about { display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
	.cwl-about-media, .cwl-about-media img { height: 100%; }
	.cwl-about-body { padding: 32px; }
	.cwl-footer-top { grid-template-columns: 2fr 1fr 1fr; }
	.cwl-footer-brand { grid-column: auto; }
	/* First recipe on the home page gets a wide, horizontal card. */
	.cwl-grid-lead > .cwl-card:first-child { grid-column: 1 / -1; flex-direction: row; }
	.cwl-grid-lead > .cwl-card:first-child .cwl-card-media { flex: 1.25; aspect-ratio: auto; min-height: 320px; }
	.cwl-grid-lead > .cwl-card:first-child .cwl-card-body { flex: 1; justify-content: center; padding: 32px; }
	.cwl-grid-lead > .cwl-card:first-child .cwl-card-title { font-size: calc(clamp(1.6rem, 3vw, 2.2rem) * var(--hs)); }
	.cwl-grid-lead > .cwl-card:first-child .cwl-card-excerpt { -webkit-line-clamp: 4; line-clamp: 4; }
	.cwl-grid-lead > .cwl-card:first-child .cwl-card-foot { margin-top: 10px; }
}

@media (min-width: 800px) {
	.cwl-single-thumb, .cwl-about-collage { max-width: 780px; margin: 16px auto 0; }
	.cwl-single-thumb img { aspect-ratio: 16 / 10; }
}

/* ---------- Desktop ---------- */
@media (min-width: 960px) {
	:root { --header-h: 72px; }
	body { padding-bottom: 0; }
	.cwl-tabbar, .cwl-no-tabbar .cwl-menu-btn { display: none; }
	.cwl-to-top { bottom: 24px; right: 24px; }
	.cwl-nav { display: block; margin-right: 8px; }
	.cwl-nav ul { display: flex; gap: 4px; }
	.cwl-nav a {
		position: relative; display: block; padding: 8px 14px;
		color: var(--ink); font-weight: 700; font-size: 0.96rem; text-decoration: none;
		border-radius: 999px;
		transition: background 0.2s, color 0.2s;
	}
	.cwl-nav a:hover, .cwl-nav .current-menu-item > a { background: var(--accent-soft); color: var(--accent-dark); }
	.cwl-brand-name { font-size: calc(var(--logo-size) * 1.15); }
	.cwl-grid { grid-template-columns: repeat(var(--cols), 1fr); gap: 28px; }
	.cwl-grid-2 { grid-template-columns: 1fr 1fr; }
	.cwl-section { margin-top: 72px; }
	.cwl-hero {
		align-items: center;
		max-width: calc(var(--container) - var(--gutter) * 2); margin-inline: auto;
		min-height: 0; aspect-ratio: 16 / 8;
	}
	.cwl-hero-media img { object-position: 50% 30%; }
	.cwl-hero-media::after { background: linear-gradient(90deg, rgba(30, 20, 10, 0.82) 0%, rgba(30, 20, 10, 0.5) 34%, rgba(30, 20, 10, 0) 62%); }
	.cwl-hero-body { padding: 56px; max-width: 520px; }
	.cwl-hero-title { font-size: calc(clamp(2.8rem, 4.4vw, 3.8rem) * var(--hs)); }
	.cwl-chips { gap: 26px; overflow: visible; flex-wrap: wrap; }
	.cwl-page-head + .cwl-chips { justify-content: center; }
	.cwl-drawer .cwl-chips { flex-wrap: nowrap; overflow-x: auto; gap: 14px; }
	.cwl-moments { max-width: var(--container); margin-inline: auto; }
	.cwl-about-body { padding: 56px; }
	.cwl-page-head { padding-top: 44px; text-align: center; }
	.cwl-page-intro, .cwl-page-head .cwl-search-form { margin-inline: auto; }
}

/* Hover effects only where there is a real pointer. */
@media (hover: hover) {
	.cwl-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
	.cwl-card:hover .cwl-card-media img { transform: scale(1.07); }
	.cwl-card:hover .cwl-card-go { background: var(--accent); color: #fff; transform: translateX(4px); }
	.cwl-chip:hover .cwl-chip-img { transform: translateY(-4px) scale(1.04); }
	.cwl-moment:hover img { transform: scale(1.06); }
	.cwl-post-nav a:hover { transform: translateY(-3px); }
}

/* Animations switched off in the Customizer. */
.cwl-no-motion *, .cwl-no-motion *::before, .cwl-no-motion *::after { animation: none !important; transition-duration: 0.01ms !important; }
.js .cwl-no-motion .cwl-reveal { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
	.js .cwl-reveal { opacity: 1; transform: none; }
}

@media print {
	.cwl-header, .cwl-tabbar, .cwl-footer, .cwl-share, .cwl-related, .cwl-post-nav, .cwl-to-top, .cwl-progress, .cwl-jump, .cwl-drawer, .cwl-search-panel, .cwl-overlay { display: none !important; }
	body { background: #fff; padding: 0; }
	.js .cwl-reveal { opacity: 1; transform: none; }
}
