@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,450;9..144,560;9..144,650&family=Inter:wght@400;500;600;700&display=swap');

:root{
  --char: #2B2320;
  --char-soft: #5A4E48;
  --flour: #F6EFE4;
  --flour-deep: #EDE2D0;
  --tomato: #C1432B;
  --tomato-deep: #9B3220;
  --saffron: #E0A429;
  --sage: #566341; /* darkened from earlier palette to pass AA at UI sizes */
  --sage-deep: #3E4A2C;
  --plum: #6B3444;
  --line: rgba(43,35,32,0.14);
  --line-strong: rgba(43,35,32,0.28);
  --error: #9B3220;
  --error-bg: #FBEAE5;
  --radius: 14px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin:0;
  background: var(--flour);
  color: var(--char);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

h1,h2,h3,.serif{
  font-family: 'Fraunces', serif;
  font-weight: 560;
  letter-spacing: -0.01em;
  margin: 0;
}

a{ color: inherit; text-decoration: none; }
img{ max-width:100%; display:block; }
button{ font-family: inherit; cursor: pointer; }

:focus-visible{
  outline: 2px solid var(--tomato);
  outline-offset: 2px;
}

/* ---------- Layout shell ---------- */
.wrap{ max-width: 1180px; margin: 0 auto; padding: 0 48px; }

.topnav{
  position: sticky; top: 0; z-index: 40;
  display:flex; align-items:center; justify-content:space-between;
  padding: 18px 48px;
  background: rgba(246,239,228,0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand{
  display:flex; align-items:center; gap:10px;
  font-family:'Fraunces', serif; font-weight:650; font-size:20px;
}
.brand .mark{
  width:26px; height:26px; border-radius:50%;
  background: conic-gradient(from 210deg, var(--tomato), var(--saffron), var(--sage), var(--plum), var(--tomato));
  flex-shrink:0;
}
.navlinks{ display:flex; align-items:center; gap:24px; font-size:14px; font-weight:500; color: var(--char-soft);
  overflow-x:auto; scrollbar-width:none; -ms-overflow-style:none; }
.navlinks::-webkit-scrollbar{ display:none; }
.navlinks a{ padding-bottom:4px; border-bottom:2px solid transparent; transition: border-color .15s ease, color .15s ease; flex-shrink:0; white-space:nowrap; }
.navlinks a:hover{ color: var(--char); border-color: var(--line-strong); }
.navlinks a.active{ color: var(--tomato-deep); border-color: var(--tomato); }
.navlinks .nav-search{ flex-shrink:0; color: var(--char-soft); }
.navlinks .nav-search:hover{ color: var(--char); }

.lang-switch{
  display:flex; align-items:center; gap:4px;
  padding: 3px; border-radius: 999px; border: 1px solid var(--line-strong);
  margin-left: 8px;
}
.lang-pill{
  border:none; background:transparent; color: var(--char-soft);
  font-size:12px; font-weight:700; letter-spacing:0.02em;
  padding: 5px 11px; border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.lang-pill:hover{ color: var(--char); }
.lang-pill.active{ background: var(--char); color: var(--flour); }

.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding: 11px 22px; border-radius: 999px;
  font-size:14px; font-weight:600; border: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn-primary{ background: var(--tomato); color: var(--flour); }
.btn-primary:hover{ background: var(--tomato-deep); }
.btn-ghost{ background: transparent; color: var(--char); border: 1px solid var(--line-strong); }
.btn-ghost:hover{ background: var(--flour-deep); }

footer{
  padding: 40px 48px; text-align:center; color: var(--char-soft); font-size:13px;
  border-top: 1px solid var(--line); margin-top: 64px;
}

@media (max-width: 860px){
  .wrap{ padding: 0 20px; }
  .topnav{ padding:16px 20px; }
  .navlinks{ gap:16px; font-size:13px; }
}

/* ---------- Homepage ---------- */
.hero{
  padding: 64px 0 40px;
  max-width: 70ch;
}
.hero h1{ font-size: clamp(34px, 5vw, 54px); }
.hero p{ margin-top: 16px; font-size: 17px; color: var(--char-soft); max-width: 56ch; }

.filter-row{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding-bottom: 36px;
}
.filter-pill{
  border:1px solid var(--line-strong); background: transparent; color: var(--char-soft);
  font-size:13px; font-weight:600; padding: 8px 16px; border-radius:999px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.filter-pill:hover{ border-color: var(--char); color: var(--char); }
.filter-pill.active{ background: var(--char); color: var(--flour); border-color: var(--char); }

.recipe-grid{
  display:grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px; padding-bottom: 72px;
}
.recipe-card{
  display:flex; flex-direction:column;
  border-radius: var(--radius); overflow:hidden;
  background: #fff; border: 1px solid var(--line);
  transition: transform .15s ease, box-shadow .15s ease;
}
.recipe-card:hover{ transform: translateY(-3px); box-shadow: 0 12px 28px rgba(43,35,32,0.10); }
.recipe-card .thumb{
  aspect-ratio: 4 / 3; width:100%;
  background: var(--flour-deep);
  display:flex; align-items:center; justify-content:center;
  color: var(--char-soft); font-size: 13px;
  background-size: cover; background-position: center;
}
.recipe-card .body{ padding: 18px 20px 22px; display:flex; flex-direction:column; gap:8px; flex:1; }
.recipe-card .cat{ font-size:12px; font-weight:700; color: var(--tomato-deep); }
.recipe-card h3{ font-size: 19px; }
.recipe-card .desc{ font-size:13.5px; color: var(--char-soft); line-height:1.55; flex:1; }
.recipe-card .meta{
  display:flex; gap:14px; font-size:12.5px; color: var(--char-soft);
  padding-top: 6px; border-top: 1px solid var(--line);
}

.empty-state{
  padding: 60px 0; text-align:center; color: var(--char-soft);
}

@media (max-width: 640px){
  .recipe-grid{ grid-template-columns: 1fr 1fr; gap:16px; }
  .recipe-card h3{ font-size:16px; }
}

/* ---------- Recipe detail page ---------- */
.recipe-header{ padding: 48px 0 8px; max-width: 68ch; }
.recipe-header .cat{ font-size:13px; font-weight:700; color: var(--tomato-deep); }
.recipe-header h1{ font-size: clamp(30px, 4.4vw, 46px); margin-top:8px; }
.recipe-header .desc{ margin-top:14px; font-size:16px; color: var(--char-soft); }

.recipe-photo{
  width:100%; aspect-ratio: 16/7; border-radius: var(--radius);
  background: var(--flour-deep); background-size:cover; background-position:center;
  margin-top: 28px;
}

.recipe-stats{
  display:flex; gap: 28px; flex-wrap:wrap;
  padding: 24px 0; margin-top: 8px; border-bottom: 1px solid var(--line);
}
.recipe-stats .stat .label{ font-size:12px; color: var(--char-soft); font-weight:600; }
.recipe-stats .stat .value{ font-family:'Fraunces', serif; font-size:20px; margin-top:2px; }

.recipe-body{
  display:grid; grid-template-columns: 1fr 1.6fr; gap: 56px;
  padding: 40px 0 80px;
}
.recipe-body h2{ font-size:20px; margin-bottom:16px; }
.ingredient-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:11px; }
.ingredient-list li{ font-size:14.5px; padding-left: 22px; position:relative; }
.ingredient-list li::before{
  content:''; position:absolute; left:0; top:7px; width:8px; height:8px;
  border-radius:2px; background: var(--sage);
}
.steps-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:22px; counter-reset: step; }
.steps-list li{ display:flex; gap:16px; font-size:15px; line-height:1.65; counter-increment: step; }
.steps-list li::before{
  content: counter(step); flex-shrink:0;
  width:30px; height:30px; border-radius:50%;
  background: var(--char); color: var(--flour);
  font-family:'Fraunces', serif; font-size:14px;
  display:flex; align-items:center; justify-content:center;
}
.not-found{ padding: 80px 0; text-align:center; max-width: 50ch; margin: 0 auto; }
.not-found h1{ font-size: 28px; margin-bottom: 12px; }
.not-found p{ color: var(--char-soft); margin-bottom: 24px; }

@media (max-width: 780px){
  .recipe-body{ grid-template-columns: 1fr; gap: 36px; }
}

/* ---------- Section headers (reused across homepage / listing pages) ---------- */
.section{ padding: 8px 0 56px; }
.section-head{
  display:flex; align-items:baseline; justify-content:space-between;
  gap:16px; margin-bottom: 24px; flex-wrap:wrap;
}
.section-head h2{ font-size: clamp(22px, 3vw, 28px); }
.section-head .view-all{ font-size:13.5px; font-weight:600; color: var(--tomato-deep); white-space:nowrap; }
.section-head .view-all:hover{ text-decoration: underline; }
.section-sub{ margin: -14px 0 24px; color: var(--char-soft); font-size:15px; max-width: 60ch; }

.badge-handwritten{
  position:absolute; top:10px; left:10px;
  background: var(--char); color: var(--flour);
  font-size:10.5px; font-weight:700; letter-spacing:0.03em;
  padding: 4px 9px; border-radius: 999px;
}
.recipe-card .thumb{ position: relative; }

/* ---------- Today's Recipe (homepage) ---------- */
.today-card{
  display:grid; grid-template-columns: 1.1fr 1fr; gap: 40px;
  align-items:center;
  background:#fff; border:1px solid var(--line); border-radius: var(--radius);
  overflow:hidden; margin-bottom: 8px;
}
.today-card .thumb{
  aspect-ratio: 4/3; width:100%; height:100%;
  background: var(--flour-deep); background-size:cover; background-position:center;
}
.today-card .body{ padding: 8px 36px 8px 0; }
.today-card .eyebrow{ font-size:12.5px; font-weight:700; letter-spacing:0.04em; color: var(--tomato-deep); text-transform:uppercase; }
.today-card h3{ font-size: clamp(24px, 3.4vw, 34px); margin-top:10px; }
.today-card .desc{ margin-top:12px; color: var(--char-soft); font-size:15.5px; line-height:1.6; }
.today-card .meta{ display:flex; gap:20px; margin-top:18px; font-size:13px; color: var(--char-soft); }
.today-card .actions{ margin-top:26px; }

@media (max-width: 780px){
  .today-card{ grid-template-columns: 1fr; }
  .today-card .body{ padding: 4px 24px 28px; }
}

/* ---------- Collections ---------- */
.collection-grid{
  display:grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.collection-card{
  padding: 26px 26px 24px; border-radius: var(--radius);
  background: var(--flour-deep); border: 1px solid var(--line);
  transition: transform .15s ease, box-shadow .15s ease;
}
.collection-card:hover{ transform: translateY(-3px); box-shadow: 0 12px 28px rgba(43,35,32,0.10); }
.collection-card h3{ font-size:19px; }
.collection-card p{ margin-top:8px; font-size:13.5px; color: var(--char-soft); line-height:1.55; }
.collection-card .count{ margin-top:14px; font-size:12.5px; font-weight:600; color: var(--tomato-deep); }

/* ---------- Category chips (Browse Recipes) ---------- */
.category-grid{
  display:grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.category-chip{
  display:flex; align-items:center; justify-content:center; text-align:center;
  padding: 22px 14px; border-radius: 12px;
  background:#fff; border:1px solid var(--line);
  font-family:'Fraunces', serif; font-weight:560; font-size:16px;
  transition: border-color .15s ease, transform .15s ease;
}
.category-chip:hover{ border-color: var(--tomato); transform: translateY(-2px); }

/* ---------- Newsletter ---------- */
.newsletter{
  margin: 24px 0 64px; padding: 44px 40px;
  background: var(--char); color: var(--flour);
  border-radius: var(--radius);
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:28px;
}
.newsletter .copy{ max-width: 44ch; }
.newsletter h2{ color: var(--flour); font-size: clamp(20px, 2.6vw, 26px); }
.newsletter p{ margin-top:10px; color: rgba(246,239,228,0.72); font-size:14.5px; }
.newsletter-form{ display:flex; gap:10px; flex-wrap:wrap; }
.newsletter-form input[type=email]{
  padding: 12px 16px; border-radius: 999px; border: none; min-width: 240px;
  font-family:inherit; font-size:14.5px;
}
.newsletter-form .btn-primary{ background: var(--tomato); }
.newsletter .fineprint{ margin-top:10px; font-size:12px; color: rgba(246,239,228,0.55); }
.newsletter-thanks{ font-size:14.5px; font-weight:600; }

@media (max-width: 700px){
  .newsletter{ padding: 32px 24px; }
}

/* ---------- Monetization slots (empty & invisible until real content is added) ---------- */
.ad-slot, .affiliate-slot, .cookbook-promo{ display:none; }
.ad-slot:not(:empty), .affiliate-slot:not(:empty), .cookbook-promo:not(:empty){
  display:block; margin: 40px 0; padding: 20px; border-radius: var(--radius);
  border: 1px dashed var(--line-strong); background: rgba(255,255,255,0.5);
}

/* ---------- Recipe detail: story / handwritten / notes / actions ---------- */
.recipe-actions{ display:flex; gap:12px; flex-wrap:wrap; margin-top: 22px; }
.recipe-actions .btn svg{ width:15px; height:15px; }

.handwritten-block{ margin-top: 40px; }
.handwritten-block h2{ font-size:18px; margin-bottom:14px; }
.handwritten-photo{
  width:100%; max-width: 560px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--flour-deep);
  background-size:cover; background-position:center; aspect-ratio: 4/5;
}

.story-block{ margin-top: 40px; max-width: 68ch; }
.story-block h2{ font-size:18px; margin-bottom:12px; }
.story-block p{ font-size:15px; line-height:1.7; color: var(--char-soft); white-space: pre-line; }

.notes-block{
  margin-top: 40px; max-width: 68ch;
  padding: 20px 24px; border-radius: var(--radius);
  background: var(--flour-deep); border: 1px solid var(--line);
}
.notes-block h2{ font-size:16px; margin-bottom:10px; }
.notes-block p{ font-size:14.5px; line-height:1.65; color: var(--char-soft); white-space: pre-line; }

.share-row{ display:flex; align-items:center; gap:10px; margin-top: 40px; flex-wrap:wrap; }
.share-row .label{ font-size:13px; font-weight:600; color: var(--char-soft); }
.share-btn{
  width:36px; height:36px; border-radius:50%; border:1px solid var(--line-strong);
  background:#fff; display:flex; align-items:center; justify-content:center;
  font-size:13px; color: var(--char-soft);
}
.share-btn:hover{ border-color: var(--tomato); color: var(--tomato-deep); }

.related{ padding: 16px 0 72px; }
.related h2{ font-size:20px; margin-bottom:20px; }

@media print{
  .topnav, footer, .recipe-actions, .share-row, .lang-switch, .related, .newsletter, .ad-slot{ display:none !important; }
  body{ background:#fff; }
  .recipe-photo, .handwritten-photo{ break-inside: avoid; }
}

/* ---------- Search page ---------- */
.search-box{ margin: 24px 0 40px; position:relative; max-width: 640px; }
.search-box input{
  width:100%; padding: 15px 20px; border-radius: 999px;
  border: 1px solid var(--line-strong); background:#fff;
  font-family:inherit; font-size:16px; color: var(--char);
}
.search-count{ font-size:13px; color: var(--char-soft); margin-bottom: 20px; }

/* ---------- Nav search link ---------- */
.nav-search{ display:flex; align-items:center; }
.nav-search svg{ width:17px; height:17px; }

/* ---------- Static content pages (The Story / About) ---------- */
.content-page{ max-width: 68ch; padding: 56px 0 80px; }
.content-page h1{ font-size: clamp(30px, 4vw, 44px); }
.content-page p{ margin-top: 20px; font-size:16px; line-height:1.75; color: var(--char-soft); }

/* ---------- Favorite / save button state ---------- */
.btn-save.is-saved{ background: var(--sage); color: var(--flour); border-color: var(--sage); }

