/*
Theme Name: YarnPurls
Theme URI: https://yarnpurls.com
Author: YarnPurls
Description: A cozy, fast, ad-ready blog theme for free crochet patterns. Includes category images, pattern details, printable posts, lots of AdSense placements (plus Auto ads), contact & newsletter forms and a one-click demo importer (Appearance → YarnPurls Setup).
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
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: yarnpurls
Tags: blog, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ───────── Tokens ───────── */
:root {
  --bg: #fbf7f2;
  --surface: #ffffff;
  --surface-2: #f4ece3;
  --ink: #2a211d;
  --ink-2: #5b4f48;
  --muted: #887a70;
  --line: #e9ddd1;
  --accent: #b14d29;
  --accent-hover: #963d1d;
  --accent-ink: #ffffff;
  --accent-soft: #f7e3d8;
  --sage: #63745a;
  --sage-soft: #e4eadc;
  --shadow: 0 1px 2px rgb(60 35 20 / 0.05), 0 8px 24px -12px rgb(60 35 20 / 0.18);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 14px;
  --radius-lg: 22px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #18120f; --surface: #221a16; --surface-2: #2b221d; --ink: #f4ece5; --ink-2: #d2c4b9; --muted: #a09288;
    --line: #3a2f29; --accent: #e27a4f; --accent-hover: #f08f66; --accent-ink: #1b120e; --accent-soft: #3b261d;
    --sage: #a8b898; --sage-soft: #283024; --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 28px -14px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #18120f; --surface: #221a16; --surface-2: #2b221d; --ink: #f4ece5; --ink-2: #d2c4b9; --muted: #a09288;
  --line: #3a2f29; --accent: #e27a4f; --accent-hover: #f08f66; --accent-ink: #1b120e; --accent-soft: #3b261d;
  --sage: #a8b898; --sage-soft: #283024; --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 28px -14px rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body);
  font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--font-display); font-weight: 500; line-height: 1.15; letter-spacing: -0.01em;
  margin: 0 0 0.5em; font-variation-settings: 'SOFT' 50, 'opsz' 96; text-wrap: balance;
}
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.screen-reader-text, .sr-only {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { body.admin-bar .site-header { top: 0; } }

/* ───────── Helpers ───────── */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 780px; }
.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0; }
.eyebrow { font-family: var(--font-body); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.link-arrow { font-weight: 600; font-size: 0.95rem; color: var(--accent); text-decoration: none; white-space: nowrap; }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 4px; }
.lead { font-size: 1.12rem; color: var(--ink-2); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 999px;
  font: 600 0.95rem/1 var(--font-body); text-decoration: none; border: 1.5px solid transparent; cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink) !important; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { padding: 10px 18px; }

/* ───────── Header ───────── */
.topbar { background: var(--ink); color: var(--bg); font-size: 0.8rem; text-align: center; padding: 8px 0; }
.site-header {
  position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line);
}
.header-bar { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { text-decoration: none; flex-shrink: 1; min-width: 0; display: inline-flex; align-items: center; }
.brand .custom-logo { max-height: 48px; width: auto; max-width: 100%; }
.logo { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.logo svg { flex-shrink: 0; }
.logo-word { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-word em { font-style: italic; font-weight: 400; color: var(--accent); }

.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav > ul { display: flex; align-items: center; gap: 4px; }
.main-nav li { position: relative; }
.main-nav > ul > li > a {
  font: 500 0.95rem var(--font-body); color: var(--ink-2); text-decoration: none; padding: 8px 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
}
.main-nav > ul > li > a:hover, .main-nav .current-menu-item > a, .main-nav .current-menu-ancestor > a { color: var(--ink); background: var(--surface-2); }
.main-nav .menu-item-has-children > a::after {
  content: ''; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translateY(-3px); margin-left: 2px;
}
.main-nav .sub-menu {
  position: absolute; top: calc(100% + 8px); left: 50%; translate: -50% 0; width: 250px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; display: grid;
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: 0.18s; z-index: 5;
}
.main-nav .sub-menu::before { content: ''; position: absolute; inset: -10px 0 auto; height: 10px; }
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.main-nav .sub-menu a { display: block; padding: 9px 12px; border-radius: 9px; text-decoration: none; font-size: 0.93rem; color: var(--ink-2); }
.main-nav .sub-menu a:hover, .main-nav .sub-menu .current-menu-item > a { background: var(--surface-2); color: var(--ink); }

.header-tools { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; color: var(--ink);
  background: none; border: 0; cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-moon { display: none; }
[data-theme='dark'] .icon-sun { display: none; }
[data-theme='dark'] .icon-moon { display: block; }
.menu-toggle { display: none; }

/* Mobile menu: closed unless opened with the menu button, and never shown on desktop. */
.drawer { display: none; border-top: 1px solid var(--line); background: var(--bg); padding: 12px 0 20px; max-height: calc(100dvh - 72px); overflow-y: auto; }
.drawer.is-open { display: block; }
@media (min-width: 861px) { .site-header .drawer, .site-header .drawer.is-open { display: none !important; } }
.drawer ul { list-style: none; margin: 0; padding: 0; }
.drawer a { display: block; padding: 12px 0; text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--line); }
.drawer .sub-menu { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; padding-left: 0; }
.drawer .sub-menu a { font-size: 0.95rem; color: var(--ink-2); font-weight: 400; }

@media (max-width: 860px) {
  .main-nav { display: none; }
  .header-tools { margin-left: auto; }
  .menu-toggle { display: grid; }
  .header-bar { height: 64px; }
}
@media (max-width: 480px) { .topbar { font-size: 0.72rem; } }

/* ───────── Cards grid ───────── */
.grid { display: grid; gap: clamp(18px, 2.5vw, 28px); grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.card { display: flex; flex-direction: column; min-width: 0; }
.card-media { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.card:hover .card-media img { transform: scale(1.04); }
.badge {
  position: absolute; left: 12px; top: 12px; background: rgb(255 255 255 / 0.92); color: #2a211d; font-size: 0.72rem;
  font-weight: 700; letter-spacing: 0.04em; padding: 5px 10px; border-radius: 999px;
}
.card-body { padding: 14px 4px 0; }
.card-cat { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); text-decoration: none; }
.card-title { font-size: 1.12rem; line-height: 1.3; margin: 6px 0 0; }
.card-title a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.3s; }
.card:hover .card-title a { background-size: 100% 1px; }
@media (max-width: 480px) { .card-title { font-size: 0.98rem; } }

/* ───────── Category circles ───────── */
.cats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 16px; }
.cats a { display: flex; flex-direction: column; align-items: center; gap: 12px; text-decoration: none; text-align: center; }
.cat-ring {
  display: block; width: 100%; max-width: 120px; aspect-ratio: 1; border-radius: 50%; padding: 4px; background: var(--surface);
  border: 1.5px solid var(--line); transition: border-color 0.2s, transform 0.25s; overflow: hidden;
}
.cat-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.cat-ring .cat-ph { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 500 1.6rem var(--font-display); }
.cats a:hover .cat-ring { border-color: var(--accent); transform: translateY(-3px); }
.cat-name { font-weight: 600; font-size: 0.92rem; color: var(--ink); }
.cats a:hover .cat-name { color: var(--accent); }
@media (max-width: 860px) { .cats { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 24px; } }
@media (max-width: 420px) { .cats { gap: 10px; row-gap: 20px; } .cat-name { font-size: 0.8rem; } }

/* ───────── Home ───────── */
.hero { padding: clamp(40px, 6vw, 80px) 0 0; background: radial-gradient(1100px 420px at 15% 0%, var(--accent-soft), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 0.9fr 1.3fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 4rem); line-height: 1.04; margin-bottom: 18px; }
.hero h1 em { color: var(--accent); font-style: italic; font-weight: 400; }
.search-pill {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 6px 6px 18px; box-shadow: var(--shadow); margin-top: 26px; color: var(--muted);
}
.search-pill input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); outline: none; padding: 8px 4px; }
.favs-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.favs-head h2 { font-size: 1.25rem; margin: 0; }
.arrows { display: flex; gap: 6px; }
.arrow { width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.arrow:hover { border-color: var(--ink); }
.favs-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 32px) / 3); gap: 16px; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px;
}
.favs-track::-webkit-scrollbar { display: none; }
.fav { position: relative; aspect-ratio: 3 / 4.6; border-radius: var(--radius-lg); overflow: hidden; scroll-snap-align: start; text-decoration: none; color: #fff; background: var(--surface-2); }
.fav img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.fav:hover img { transform: scale(1.05); }
.fav::after { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgb(25 15 10 / 0.82)); }
.fav-text { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 1; display: grid; gap: 6px; }
.fav-cat { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; opacity: 0.85; }
.fav-title { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.2; }
.cats-section { padding-top: clamp(48px, 6vw, 72px); padding-bottom: 8px; }

.start { background: var(--sage-soft); }
.split { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.start-media { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 5; max-height: 520px; }
.start-media img { width: 100%; height: 100%; object-fit: cover; }
.split h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.checks { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: baseline; }
.checks li::before { content: '✓'; color: var(--sage); font-weight: 700; }
.hello { grid-template-columns: 0.75fr 1.25fr; }
.hello-img { border-radius: 200px 200px var(--radius-lg) var(--radius-lg); overflow: hidden; max-width: 420px; aspect-ratio: 5 / 6; }
.hello-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.hello p { color: var(--ink-2); }

.faq-wrap { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
.faq-wrap h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.faq-wrap a { color: var(--accent); }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 20px; }
.faq summary { cursor: pointer; list-style: none; font-weight: 600; padding: 18px 28px 18px 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; position: absolute; right: 0; top: 50%; translate: 0 -50%; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 1.1rem;
}
.faq details[open] summary::after { content: '−'; }
.faq details p { color: var(--ink-2); margin: 0 0 18px; }

@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .favs-track { grid-auto-columns: 72%; }
  .split, .hello, .faq-wrap { grid-template-columns: 1fr; }
  .start-media { aspect-ratio: 16 / 11; }
  .hello-img { max-width: 300px; }
}

/* ───────── Newsletter ───────── */
.newsletter { background: var(--accent-soft); border-radius: var(--radius-lg); padding: clamp(28px, 5vw, 56px); position: relative; overflow: hidden; }
.newsletter::after {
  content: ''; position: absolute; right: -110px; top: -140px; width: 220px; height: 220px; border-radius: 50%;
  border: 18px dotted color-mix(in srgb, var(--accent) 22%, transparent); pointer-events: none;
}
.newsletter-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; position: relative; z-index: 1; }
.newsletter h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.newsletter .lead { margin: 0; }
.nl-form { display: flex; gap: 10px; background: var(--surface); padding: 6px; border-radius: 999px; border: 1px solid var(--line); }
.nl-form input[type='email'] { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 16px; font: inherit; color: var(--ink); outline: none; }
.form-msg { margin: 12px 0 0; font-weight: 600; color: var(--sage); }
.form-msg.error { color: var(--accent); }
@media (max-width: 760px) { .newsletter-inner { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .nl-form { flex-direction: column; border-radius: var(--radius); } .nl-form input[type='email'] { padding: 12px 14px; } }

/* ───────── Ads ───────── */
.ad-slot { margin: 32px auto; text-align: center; }
.ad-slot.is-placeholder {
  min-height: 120px; display: grid; place-items: center; border: 1.5px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  background: repeating-linear-gradient(45deg, transparent 0 12px, var(--surface-2) 12px 13px);
}
.grid > .ad-slot { grid-column: 1 / -1; margin: 4px 0; }
.ad-label { display: block; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* ───────── Single post ───────── */
.post-head { max-width: 860px; padding-top: clamp(28px, 5vw, 56px); text-align: center; }
.crumbs { font-size: 0.85rem; color: var(--muted); display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; color: var(--accent); font-weight: 600; }
.post-head h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); line-height: 1.08; }
.dek { font-size: 1.15rem; color: var(--ink-2); max-width: 62ch; margin: 0 auto 16px; }
.meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; font-size: 0.9rem; color: var(--muted); }
.meta a { color: var(--ink); font-weight: 600; text-decoration: none; }
.post-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 22px 0 8px; }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; margin-top: 32px; max-width: 1120px; }
.hero-img { margin: 0 0 24px; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); }
.hero-img img { width: 100%; max-height: 900px; object-fit: cover; }
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0 0 20px;
}
.facts div { background: var(--surface); padding: 14px 16px; }
.facts dt { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.facts dd { margin: 2px 0 0; font-weight: 600; font-size: 0.95rem; }
.disclosure { font-size: 0.85rem; color: var(--muted); font-style: italic; border-left: 2px solid var(--line); padding-left: 12px; }
.disclosure a { color: inherit; }
.share-box {
  display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 24px; margin: 40px 0;
}
.share-box p { margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0; }
.tags a { font-size: 0.85rem; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); text-decoration: none; }
.toc { position: sticky; top: 96px; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; background: var(--surface); margin-bottom: 24px; }
.toc-title { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.toc ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 0.92rem; }
.toc a { text-decoration: none; color: var(--ink-2); }
.toc a:hover { color: var(--accent); }
.toc li::marker { color: var(--accent); font-weight: 600; }
.side-ad { position: sticky; top: 440px; }
.side-ad.is-placeholder { min-height: 600px; }
@media (max-width: 980px) { .post-layout { grid-template-columns: 1fr; max-width: 760px; } .post-side { display: none; } }

/* ───────── Prose (post & page content) ───────── */
.prose { font-size: 1.075rem; color: var(--ink); }
.prose > *:first-child { margin-top: 0; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); margin: 2em 0 0.6em; }
.prose h3 { font-size: 1.3rem; margin: 1.6em 0 0.5em; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 700; }
.prose blockquote, .prose .wp-block-quote {
  margin: 1.6em 0; padding: 18px 22px; border-left: 3px solid var(--sage); background: var(--sage-soft); border-radius: 0 var(--radius) var(--radius) 0;
}
.prose blockquote p:last-child { margin: 0; }
.prose .wp-block-table { margin: 1.4em 0; overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th, .prose thead td { font-weight: 700; background: var(--surface-2); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose code { font-size: 0.9em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.prose figure { margin: 1.6em 0; }
.prose figure img { border-radius: var(--radius); }
.prose figcaption { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 8px; }
.prose .pattern {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(18px, 3vw, 30px); margin: 1.6em 0;
}
.prose .pattern > h3:first-child { margin-top: 0; }
.prose .pattern ul { list-style: none; padding: 0; }
.prose .pattern li { padding: 8px 0; border-bottom: 1px dashed var(--line); margin: 0; }
.prose .pattern li:last-child { border-bottom: 0; }
.prose .wp-block-details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.prose .wp-block-details summary { cursor: pointer; font-weight: 600; }
.prose .wp-block-details p { color: var(--ink-2); margin: 10px 0 0; }
.prose .alignwide { margin-left: calc(-1 * min(80px, 6vw)); margin-right: calc(-1 * min(80px, 6vw)); }
.prose .aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.prose .alignleft { float: left; margin: 0 1.2em 1em 0; }
.prose .alignright { float: right; margin: 0 0 1em 1.2em; }
.prose .wp-block-button__link { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 12px 22px; text-decoration: none; font-weight: 600; }
.prose .inline-link, .linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ───────── Pages / archives ───────── */
.page-title { font-size: clamp(2.1rem, 5vw, 3.2rem); }
.updated { color: var(--muted); font-size: 0.9rem; margin-bottom: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.page-thumb { margin: 8px 0 32px; border-radius: var(--radius-lg); overflow: hidden; }
.cat-hero { background: radial-gradient(900px 360px at 10% 0%, var(--accent-soft), transparent 70%); padding: clamp(36px, 6vw, 72px) 0 12px; }
.cat-hero-inner { display: flex; gap: clamp(20px, 4vw, 44px); align-items: center; }
.cat-hero .cat-ring { width: clamp(110px, 18vw, 180px); max-width: none; flex-shrink: 0; border-color: var(--accent); padding: 5px; }
.cat-hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin-bottom: 10px; }
.cat-hero p { color: var(--ink-2); max-width: 60ch; font-size: 1.08rem; }
.count { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips a { padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 0.92rem; background: var(--surface); }
.chips a:hover { border-color: var(--accent); color: var(--accent); }
.pagination { display: flex; justify-content: center; gap: 6px; margin: 48px 0 0; flex-wrap: wrap; }
.pagination .page-numbers { min-width: 42px; height: 42px; padding: 0 12px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.pagination .current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.empty { text-align: center; padding: 60px 0; color: var(--ink-2); }
@media (max-width: 560px) { .cat-hero-inner { flex-direction: column; align-items: flex-start; } }

/* Search page */
.search-box input {
  width: 100%; font: inherit; font-size: 1.1rem; padding: 16px 22px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); outline: none;
}
.search-box input:focus { border-color: var(--accent); }
.results { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.results a { display: flex; gap: 16px; align-items: center; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.results a:hover { border-color: var(--accent); }
.results img { width: 80px; height: 110px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.results span { display: grid; gap: 2px; min-width: 0; }
.results small { color: var(--accent); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }
.results strong { font-family: var(--font-display); font-weight: 500; font-size: 1.15rem; line-height: 1.25; }
.results em { font-style: normal; color: var(--ink-2); font-size: 0.92rem; }

/* Forms (contact) */
.yp-form { display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(20px, 4vw, 32px); margin: 28px 0 40px; }
.yp-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.yp-form label { display: grid; gap: 6px; font-weight: 600; font-size: 0.92rem; }
.yp-form input:not([type='checkbox']), .yp-form select, .yp-form textarea {
  font: inherit; font-weight: 400; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); width: 100%;
}
.yp-form input:focus, .yp-form select:focus, .yp-form textarea:focus { outline: none; border-color: var(--accent); }
.yp-form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--ink-2); }
.yp-form .check input { accent-color: var(--accent); margin-top: 5px; }
.yp-form .btn { justify-self: start; }
.notice { padding: 14px 18px; border-radius: var(--radius); background: var(--sage-soft); font-weight: 600; }
.notice.error { background: var(--accent-soft); }
@media (max-width: 560px) { .yp-form .row { grid-template-columns: 1fr; } }

/* Comments */
.comments { margin: 48px 0; }
.comments h2 { font-size: 1.6rem; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { border-bottom: 1px solid var(--line); padding: 16px 0; }
.comment-meta { font-size: 0.85rem; color: var(--muted); }
.comment-author .avatar { border-radius: 50%; float: left; margin-right: 10px; }
.comment-form { display: grid; gap: 12px; }
.comment-form input:not([type='submit']):not([type='checkbox']), .comment-form textarea {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
}
.comment-form .submit { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: 12px 22px; font: 600 0.95rem var(--font-body); cursor: pointer; }

/* ───────── Footer ───────── */
.site-footer { background: var(--surface-2); border-top: 1px solid var(--line); padding: 64px 0 24px; margin-top: 40px; }
.footer-cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-about p { color: var(--ink-2); font-size: 0.95rem; max-width: 34ch; margin: 16px 0 18px; }
.social { display: flex; gap: 8px; }
.social a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.social a:hover { color: var(--accent); border-color: var(--accent); }
.footer-col h2 { font: 700 0.72rem var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col a { display: block; color: var(--ink-2); text-decoration: none; font-size: 0.93rem; padding: 4px 0; }
.footer-col a:hover { color: var(--accent); }
.legal-line { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 48px; padding-top: 20px; font-size: 0.82rem; color: var(--muted); }
.legal-line p { margin: 0; }
@media (max-width: 860px) { .footer-cols { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }

/* ───────── Print ───────── */
@media print {
  .topbar, .site-header, .site-footer, .ad-slot, .no-print, .hero-img, .post-side, .comments { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .post-layout { display: block; margin: 0; }
  .post-head { text-align: left; padding-top: 0; }
  .prose .pattern { border: 1px solid #ccc; break-inside: avoid; }
}
