/* Home Recipes 1.0.0 — warm homely index.
   Friendly Nunito sans + Fraunces serif accent for section titles only.
   Mobile-first; header is 320px-safe (nowrap row, ellipsis brand,
   search-icon opens a full-width panel BELOW the header). One CSS file,
   no external URLs in it; fonts are enqueued in functions.php.
   NOTE: the brand variables live HERE (not only in style.css), because
   WordPress does not auto-enqueue style.css — main.css is the only
   stylesheet loaded, so var(--color-primary) etc. must be defined here. */
:root {
  --color-primary: #8c4a2f;
  --color-primary-dark: #6f3822;
  --color-accent: #d97706;
  --color-accent-soft: #fdeecd;
  --color-ink: #2d2118;
  --color-muted: #6b5d52;
  --color-bg: #fdf8f3;
  --color-cream: #f7ead9;
  --color-surface: #ffffff;
  --color-border: #ead9c8;
  --color-footer: #3a241a;
  --radius: 20px;
  --radius-sm: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; color: var(--color-ink); }
h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.5rem; font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em 1.25em; padding: 0; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.screen-reader-text {
  position: absolute; 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: 12px; top: -60px; z-index: 100;
  background: var(--color-primary); color: #fff; padding: 10px 16px; border-radius: 0 0 12px 12px;
}
.skip-link:focus { top: 0; color: #fff; text-decoration: none; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.site-main { padding: 0 0 48px; }

/* Buttons */
.button {
  display: inline-block; background: var(--color-primary); color: #fff;
  border: 2px solid var(--color-primary); border-radius: 999px;
  padding: 10px 22px; font-weight: 800; cursor: pointer; text-align: center;
}
.button:hover, .button:focus { background: var(--color-primary-dark); text-decoration: none; color: #fff; }
.button-primary { background: var(--color-primary); }
.button:not(.button-primary) { background: #fff; color: var(--color-primary); }

/* ---------- Header: cream bar ---------- */
/* v1.0.1: the brand is never truncated — the header may wrap to two
   lines when crowded instead of squeezing the site title (the old
   nowrap + ellipsis cut the tagline to "Easy Home Recipes for Di…"
   and could cut the brand itself at 320px). */
.site-header {
  background: #fffdf9; border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 50;
}
.site-header-inner {
  max-width: 1180px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  min-width: 0;
}
/* v1.0.1: brand never shrinks, so the full site title is always
   visible — the old flex:1 1 auto + min-width:0 let the menu crowd
   it out. */
.site-brand { margin: 0; flex: 0 0 auto; display: flex; align-items: baseline; gap: 8px; }
.site-brand a {
  color: var(--color-primary); font-weight: 800; font-size: 1.25rem;
  /* v1.0.1: NO overflow:hidden / text-overflow:ellipsis here — the
     site title is never truncated. It stays on one line; the brand
     cannot shrink, so it cannot be cut off. */
  white-space: nowrap;
}
.site-brand a:hover { text-decoration: none; }
.brand-mark { font-size: 1.1rem; margin-right: 2px; }
.brand-tagline {
  display: none; color: var(--color-muted); font-size: .8rem;
  /* v1.0.1: tagline wraps to two lines instead of truncating with an
     ellipsis. */
  line-height: 1.35; max-width: 13rem; flex: 0 1 auto;
}
.custom-logo { max-height: 48px; width: auto; }
.primary-nav { display: none; }
.nav-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.nav-menu a { display: block; padding: 8px 12px; border-radius: 999px; color: var(--color-ink); font-weight: 700; }
.nav-menu a:hover { background: var(--color-cream); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.header-search { display: none; }
.header-search form, .header-search-panel form, .hero-search form, .search-page-form form, .no-results form {
  display: flex; gap: 8px; width: 100%;
}
/* The label wraps the input: it must shrink, or the submit button is
   pushed past the viewport at 320px (the v1 defect). */
.header-search form label, .header-search-panel form label, .hero-search form label,
.search-page-form form label, .no-results form label, .newsletter-box form label {
  flex: 1 1 auto; min-width: 0; display: flex;
}
.header-search form label input, .header-search-panel form label input,
.hero-search form label input, .search-page-form form label input,
.no-results form label input, .newsletter-box form label input { width: 100%; }
.header-search input[type="search"], .header-search-panel input[type="search"],
.hero-search input[type="search"], .search-page-form input[type="search"], .no-results input[type="search"] {
  flex: 1 1 auto; min-width: 0; border: 2px solid var(--color-border);
  border-radius: 999px; padding: 10px 16px; background: #fff; color: var(--color-ink);
}
.header-search button, .header-search-panel button, .hero-search button,
.search-page-form button, .no-results button {
  flex: 0 0 auto; border: 0; border-radius: 999px; padding: 10px 20px;
  background: var(--color-primary); color: #fff; font-weight: 800; cursor: pointer;
}
.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--color-border);
  background: #fff; color: var(--color-primary); cursor: pointer; flex: 0 0 auto;
}
.icon-button svg { width: 20px; height: 20px; }
.menu-toggle { padding: 8px 14px; }
.menu-toggle .menu-label { margin-left: 6px; }
.header-search-panel {
  display: none; padding: 12px 16px 16px; border-top: 1px solid var(--color-border);
  background: #fffdf9;
}
.header-search-panel.open { display: block; }
.header-search-panel form { max-width: 560px; margin: 0 auto; }

/* ---------- Search hero: warm cream panel, centred search ---------- */
.search-hero {
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: 28px;
  text-align: center;
  padding: 40px 20px 36px;
  margin: 28px 0 40px;
}
.hero-eyebrow {
  color: var(--color-primary); font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; font-size: .8rem; margin-bottom: 10px;
}
.hero-title { font-size: 1.9rem; max-width: 640px; margin: 0 auto .5em; }
.hero-sub { color: var(--color-muted); max-width: 560px; margin: 0 auto 22px; }
.hero-search { max-width: 560px; margin: 0 auto 18px; }
.hero-search input[type="search"] { padding: 14px 20px; font-size: 1.05rem; }
.hero-search button { padding: 14px 26px; }
.hero-chips { font-size: .95rem; color: var(--color-muted); margin: 0; }
.hero-chips a {
  display: inline-block; background: #fff; border: 1px solid var(--color-border);
  border-radius: 999px; padding: 4px 14px; margin: 2px; color: var(--color-primary); font-weight: 700;
}
.hero-chips a:hover { background: var(--color-primary); color: #fff; text-decoration: none; }

/* ---------- Sections ---------- */
.section-head { text-align: center; margin: 0 0 24px; }
.section-title {
  font-family: "Fraunces", Georgia, serif; font-weight: 600;
  font-size: 1.7rem; margin-bottom: .25em;
}
.section-sub { color: var(--color-muted); margin: 0; }
.index-section, .categories-section, .latest-section { margin: 0 0 48px; }
.home-author-intro {
  max-width: 640px; margin: 28px auto 0; text-align: center;
  color: var(--color-muted); font-style: italic;
}

/* ---------- Recipe index cards: warm, rounded, soft shadow ---------- */
.recipe-grid {
  display: grid; grid-template-columns: 1fr; gap: 24px;
}
.recipe-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 4px 18px rgba(140, 74, 47, .08);
  display: flex; flex-direction: column; min-width: 0;
}
.recipe-card-media { position: relative; overflow: hidden; }
.recipe-card-media img {
  width: 100%; aspect-ratio: 640 / 420; object-fit: cover;
  transition: transform .35s ease;
}
.recipe-card:hover .recipe-card-media img { transform: scale(1.04); }
.card-cat-pill {
  position: absolute; left: 14px; top: 14px; background: #fff;
  color: var(--color-primary); font-weight: 800; font-size: .8rem;
  border-radius: 999px; padding: 5px 13px; box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.card-cat-pill:hover { text-decoration: none; }
.recipe-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.recipe-card-body h2, .recipe-card-body h3 { font-size: 1.2rem; margin-bottom: .3em; }
.recipe-card-body h2 a, .recipe-card-body h3 a { color: var(--color-ink); }
.card-stars { color: var(--color-accent); margin: 0 0 .4em; font-size: 1rem; letter-spacing: .05em; }
.card-stars .stars-empty { color: #d8c8b8; }
.card-stars .rating-note { color: var(--color-muted); font-size: .85rem; letter-spacing: 0; }
.card-excerpt {
  color: var(--color-muted); font-size: .95rem; margin: 0 0 .8em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { margin: auto 0 0; color: var(--color-muted); font-size: .88rem; }
.card-meta time { font-weight: 700; color: var(--color-ink); }

/* In-feed reserved ad slot (empty placeholder, no ad code). */
.in-feed-slot { grid-column: 1 / -1; }
.ad-slot-reserved {
  border: 2px dashed #c9a98f; border-radius: var(--radius-sm);
  background: #fbf3ea; min-height: 250px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: #a08064; font-size: .9rem; padding: 16px;
}
.in-feed-slot .ad-slot-reserved { min-height: 90px; }

/* ---------- Category tiles with images ---------- */
.category-tiles {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.category-tile {
  position: relative; display: block; border-radius: var(--radius);
  background-size: cover; background-position: center; background-color: var(--color-primary);
  min-height: 150px; overflow: hidden;
}
.category-tile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(43, 24, 14, .72));
}
.category-tile-plain { background: var(--color-primary); }
.category-tile-label {
  position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 1;
  color: #fff; font-weight: 800; font-size: 1.15rem;
}
.category-tile-count { font-weight: 400; font-size: .9rem; opacity: .9; }
.category-tile a:hover, .category-tile a:focus { text-decoration: none; }

/* ---------- Newsletter panel (warm brown, prominent) ---------- */
.newsletter-panel { margin: 0 0 48px; }
.newsletter-panel .newsletter-box {
  background: var(--color-primary); color: #fff;
  border-radius: 28px; padding: 36px 24px; text-align: center;
  border: 0; box-shadow: 0 8px 28px rgba(140, 74, 47, .25);
}
.newsletter-panel .newsletter-box h3 {
  color: #fff; font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.6rem;
}
.newsletter-panel .newsletter-box p { color: #f7e3d3; }
.newsletter-box form {
  display: flex; flex-direction: column; gap: 10px;
  max-width: 480px; margin: 0 auto;
}
.newsletter-box input[type="email"] {
  flex: 1 1 auto; min-width: 0; border: 0; border-radius: 999px;
  padding: 12px 18px; background: #fff; color: var(--color-ink);
}
.newsletter-box .button {
  background: var(--color-accent); border-color: var(--color-accent); color: #2d1a10;
}
.newsletter-box .button:hover { background: #b45309; border-color: #b45309; color: #fff; }
.newsletter-note { font-size: .85rem; opacity: .9; margin: 12px 0 0; }

/* ---------- Archive hero / page titles ---------- */
.page-title { margin: 28px 0 8px; }
.archive-hero {
  background: var(--color-cream); border: 1px solid var(--color-border);
  border-radius: 28px; padding: 32px 24px; text-align: center; margin: 20px 0 32px;
}
.archive-hero .page-title { margin-top: 0; }
.archive-description { color: var(--color-muted); max-width: 640px; margin: 0 auto .5em; }
.archive-count { color: var(--color-primary); font-weight: 800; margin: 0; }

/* ---------- Single post + sticky right sidebar ---------- */
.breadcrumbs { font-size: .9rem; color: var(--color-muted); margin: 20px 0 4px; }
.breadcrumbs ol { list-style: none; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li { display: inline; }
.breadcrumbs .sep { color: #c9b8a8; }
.single-layout { display: block; }
.single-post { min-width: 0; }
.entry-title { font-size: 1.85rem; margin: 12px 0 .4em; }
.entry-meta { color: var(--color-muted); font-size: .92rem; margin: 0 0 14px; }
.entry-meta a { color: var(--color-primary); font-weight: 700; }
.byline { display: flex; align-items: center; gap: 10px; color: var(--color-muted); font-size: .95rem; }
.byline-avatar { border-radius: 50%; width: 48px; height: 48px; }
.single-featured { margin: 18px 0 22px; }
.single-featured img { border-radius: var(--radius); width: 100%; }
.recipe-jump { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; }
.toc {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 20px 24px; margin: 0 0 28px;
}
.toc h2 { font-size: 1.1rem; margin-bottom: .5em; }
.toc ol { margin: 0 0 0 1.25em; }
.toc li { margin-bottom: .3em; }
.entry-content { font-size: 1.05rem; }
.entry-content h2 { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.55rem; margin-top: 1.4em; scroll-margin-top: 90px; }
.entry-content h3 { font-size: 1.25rem; margin-top: 1.3em; }
.entry-content > p:first-of-type::first-letter {
  font-family: "Fraunces", Georgia, serif; font-size: 2.6em; font-weight: 700;
  float: left; line-height: .9; padding-right: 8px; color: var(--color-primary);
}
.entry-content img { border-radius: var(--radius-sm); }
.entry-content .wprm-recipe-container { scroll-margin-top: 90px; }
.entry-tags { color: var(--color-muted); font-size: .92rem; margin-top: 28px; }
.author-box {
  display: flex; gap: 16px; background: #fff; border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 22px; margin: 28px 0;
}
.author-box-avatar { border-radius: 50%; width: 96px; height: 96px; flex: 0 0 auto; }
.author-box-title { font-size: 1rem; color: var(--color-muted); margin-bottom: .2em; }
.author-box-name { font-weight: 800; font-size: 1.15rem; margin-bottom: .3em; }
.author-box-bio { color: var(--color-muted); margin-bottom: .5em; }
.post-nav { display: flex; flex-direction: column; gap: 8px; margin: 28px 0; }
.post-nav p { margin: 0; }
.related-recipes { margin: 40px 0; }
.related-recipes > h2 {
  font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.6rem; margin-bottom: 20px;
}
.single-sidebar { margin-top: 36px; }
.sidebar-box {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 24px;
}
.sidebar-box h3 { font-size: 1.1rem; margin-bottom: 14px; }
.sidebar-box ul { list-style: none; margin: 0; }
.sidebar-box li { margin-bottom: 12px; }
.sidebar-box li:last-child { margin-bottom: 0; }
.sidebar-box li a { display: flex; gap: 12px; align-items: center; color: var(--color-ink); font-weight: 700; font-size: .95rem; }
.sidebar-box li img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; flex: 0 0 auto; }
.single-sidebar .newsletter-box { background: var(--color-cream); border-color: var(--color-border); }
.single-sidebar .newsletter-box h3 { color: var(--color-ink); }
.single-sidebar .newsletter-box p { color: var(--color-muted); }
.single-sidebar .newsletter-box .button { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.single-sidebar .ad-slot-reserved { margin-bottom: 24px; }

/* ---------- Comments ---------- */
.comments-area { margin: 40px 0; }
.comments-title { font-family: "Fraunces", Georgia, serif; font-weight: 600; }
.comment-list { list-style: none; margin: 0; }
.comment-list .comment { border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: #fff; padding: 16px; margin-bottom: 14px; }
.comment-list .children { list-style: none; margin: 14px 0 0 1em; }
.comment-form input, .comment-form textarea {
  width: 100%; border: 2px solid var(--color-border); border-radius: 12px;
  padding: 10px 14px; background: #fff; color: var(--color-ink);
}
.comment-form .submit {
  background: var(--color-primary); color: #fff; border: 0; border-radius: 999px;
  padding: 10px 24px; font-weight: 800; cursor: pointer; width: auto;
}

/* ---------- Search / 404 / no-results ---------- */
.search-page-form, .no-results form, .not-found form { max-width: 560px; margin: 0 0 28px; }
.not-found { text-align: center; padding: 32px 0 8px; }
.not-found form { margin-left: auto; margin-right: auto; }
.no-results { text-align: center; padding: 24px 0; }
.no-results form { margin-left: auto; margin-right: auto; }

/* ---------- Pagination ---------- */
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 32px 0 0; }
.page-numbers {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--color-border); color: var(--color-ink); font-weight: 700;
}
.page-numbers.current { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* ---------- Footer: warm brown ---------- */
.site-footer { background: var(--color-footer); color: #e9d8c8; margin-top: 16px; }
.site-footer-inner { max-width: 1180px; margin: 0 auto; padding: 44px 20px 28px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
.footer-brand-name { font-size: 1.3rem; font-weight: 800; margin: 0 0 .4em; }
.footer-brand-name a { color: #fff; }
.footer-brand p { margin-bottom: .7em; font-size: .95rem; }
.site-footer h2 { color: #fff; font-size: 1.05rem; margin-bottom: .8em; }
.site-footer ul { list-style: none; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #e9d8c8; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.18); margin-top: 32px; padding-top: 20px; font-size: .88rem; text-align: center; }
.footer-bottom p { margin: 0; }

/* ---------- Cookie banner (small bottom bar, not a popup) ---------- */
.cookie-banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 90;
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.cookie-banner p { margin: 0; font-size: .92rem; }
.cookie-banner-actions { display: flex; gap: 8px; }

/* ---------- FAQ / details ---------- */
.rank-math-faq-item, .entry-content details {
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: #fff; padding: 14px 18px; margin-bottom: 12px;
}
.entry-content details summary { font-weight: 800; cursor: pointer; }

/* ---------- Wider screens ---------- */
@media (min-width: 640px) {
  .recipe-grid { grid-template-columns: repeat(2, 1fr); }
  .category-tiles { grid-template-columns: repeat(2, 1fr); }
  .newsletter-box form { flex-direction: row; }
  .hero-title { font-size: 2.3rem; }
  .post-nav { flex-direction: row; justify-content: space-between; }
  .cookie-banner { flex-direction: row; align-items: center; justify-content: space-between; }
}
@media (min-width: 720px) {
  .brand-tagline { display: inline; }
  .header-search { display: block; width: 200px; }
  .search-toggle { display: none; }
  .header-search-panel { display: none !important; }
  /* v1.0.1: the nav is the flexible part — it shrinks and its items
     wrap before the brand is ever squeezed. */
  .primary-nav { display: block; flex: 1 1 auto; min-width: 0; }
  .primary-nav .nav-menu { display: flex; }
  .menu-toggle { display: none; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
@media (min-width: 900px) {
  .header-search { width: 240px; }
  .recipe-grid { grid-template-columns: repeat(3, 1fr); }
  .category-tiles { grid-template-columns: repeat(4, 1fr); }
  .category-tile { min-height: 190px; }
  .single-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
  .single-sidebar { margin-top: 0; position: sticky; top: 84px; }
  .search-hero { padding: 56px 32px 48px; }
  h1 { font-size: 2.3rem; }
}
@media (max-width: 719px) {
  /* Mobile menu: dropdown panel under the header bar. */
  .primary-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fffdf9; border-bottom: 1px solid var(--color-border); }
  .site-header { position: relative; }
  .primary-nav.open { display: block; }
  .primary-nav .nav-menu { display: block; padding: 8px 16px 14px; }
  .primary-nav .nav-menu a { padding: 10px 12px; }
  .site-header-inner { padding: 10px 12px; }
  .menu-toggle .menu-label { display: none; }
  .author-box { flex-direction: column; }
  .author-box-avatar { width: 72px; height: 72px; }
}
@media print {
  .site-header, .site-footer, .single-sidebar, .recipe-jump, .toc, .comments-area, .cookie-banner { display: none !important; }
  body { background: #fff; }
}
