/* =========================================================
   Foodie Fixes — main.css
   Aesthetic: editorial cookbook × artisanal food zine
   Fonts: Playfair Display (headings) + Lora (body)
   Palette: warm parchment, espresso, terracotta accent
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Lora:ital,wght@0,400;0,500;1,400&display=swap');

:root {
  --parchment:        #faf6f0;
  --surface:          #ffffff;
  --surface-warm:     #fdf9f5;
  --espresso:         #1c0f07;
  --ink:              #2d1a10;
  --ink-light:        #6b4c3b;
  --terracotta:       #c05c28;
  --terracotta-light: #f0e4da;
  --sage:             #5a7a5a;
  --border:           #e8ddd4;
  --border-light:     #f2ece6;
  --shadow-sm:  0 1px 3px rgba(28,15,7,.07), 0 1px 2px rgba(28,15,7,.04);
  --shadow-md:  0 4px 12px rgba(28,15,7,.10), 0 1px 3px rgba(28,15,7,.06);
  --radius-sm:  8px;
  --radius-md:  14px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Lora', Georgia, serif;
  --font-ui:      -apple-system, 'Segoe UI', sans-serif;
  --max-content:  1160px;
  --max-article:  720px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* Base */
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--parchment);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--espresso);
  font-weight: 700;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); font-weight: 600; margin-top: 2rem; margin-bottom: .75rem; }
p  { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* Header */
.site-header {
  background: var(--espresso);
  color: #f5ede5;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  gap: 1.5rem;
}

.site-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: #f5ede5;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  padding-bottom: 2px;
}
.site-name::after {
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  width: 100%;
  height: 2px;
  background: var(--terracotta);
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.site-name:hover { color: #fff; }
.site-name:hover::after { transform: scaleX(1); }

.site-nav { display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; }
.site-nav a {
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #c4b5aa;
  padding: .4rem .7rem;
  border-radius: var(--radius-sm);
  transition: color .18s, background .18s;
}
.site-nav a:hover { color: #fff; background: rgba(255,255,255,.1); }

/* Hero */
.hero {
  background: var(--espresso);
  color: #f5ede5;
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  pointer-events: none;
}
.hero__eyebrow {
  font-family: var(--font-ui);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: .6rem;
  display: block;
  position: relative;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: #fff;
  font-style: italic;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin-bottom: .9rem;
  position: relative;
}
.hero p {
  font-size: 1.05rem;
  color: #c4b5aa;
  max-width: 520px;
  margin: 0 auto 0;
  font-style: italic;
  position: relative;
}

/* Page wrappers */
.page-wrap {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}
.listing-wrap {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 2rem 1.5rem 3.5rem;
}
.article-wrap {
  max-width: var(--max-article);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.methodology-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* Section heading with rule */
.section-heading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Card grid */
.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.post-list__item {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  transition: box-shadow .22s, transform .22s;
  overflow: hidden;
  position: relative;
}
.post-list__item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--terracotta);
  transition: width .22s;
}
.post-list__item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.post-list__item:hover::before { width: 6px; }

.post-list__link {
  display: block;
  padding: 1.2rem 1.25rem .7rem 1.45rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--espresso);
  transition: color .18s;
  flex: 1;
}
.post-list__item:hover .post-list__link { color: var(--terracotta); }

.post-list__meta {
  padding: .5rem 1.25rem 1rem 1.45rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

/* Consensus pills */
.consensus {
  font-family: var(--font-ui);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .2em .65em;
  border-radius: 99px;
  white-space: nowrap;
}
.consensus--high   { background: #e8f5e9; color: #2e7d32; }
.consensus--medium { background: #fff8e1; color: #e65100; }
.consensus--low    { background: #fce4ec; color: #c62828; }

time {
  font-family: var(--font-ui);
  font-size: .75rem;
  color: var(--ink-light);
}

/* Category grid on homepage */
.category-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .75rem;
}
.category-list a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  font-family: var(--font-ui);
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
  transition: background .18s, border-color .18s, color .18s, transform .18s;
}
.category-list a:hover {
  background: var(--terracotta-light);
  border-color: var(--terracotta);
  color: var(--terracotta);
  transform: translateY(-1px);
}

/* Original question body */
.question-body {
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.3rem;
  margin-bottom: 1.75rem;
  font-size: .95rem;
  color: var(--ink-light);
  font-style: italic;
}
.question-body h2 {
  font-family: var(--font-ui) !important;
  font-size: .7rem !important;
  font-weight: 600 !important;
  letter-spacing: .09em !important;
  text-transform: uppercase !important;
  color: var(--ink-light) !important;
  border-bottom: none !important;
  margin-bottom: .6rem !important;
  margin-top: 0 !important;
}
.question-body p { color: var(--ink-light); margin-bottom: .6rem; font-style: italic; }
.question-body p:last-child { margin-bottom: 0; }

/* Show more / show less toggle */
.question-body__overflow {
  position: relative;
}
.question-body__overflow.is-collapsed {
  max-height: 7.5em; /* ~4 lines at 1.75 line-height */
  overflow: hidden;
}
.question-body__overflow.is-collapsed::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3em;
  background: linear-gradient(to bottom, transparent, var(--surface-warm));
  pointer-events: none;
}
.question-body__toggle {
  background: none;
  border: none;
  padding: .35rem 0 0;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 600;
  color: var(--terracotta);
  display: block;
  margin-top: .4rem;
  font-style: normal;
  transition: color .15s;
}
.question-body__toggle:hover { color: var(--espresso); }

/* Breadcrumb */
.breadcrumb {
  font-family: var(--font-ui);
  font-size: .8rem;
  color: var(--ink-light);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--terracotta); }
.breadcrumb a:hover { text-decoration: underline; }

/* Article — max-width and padding applied to the element itself so
   existing R2 articles (without .article-wrap) are styled correctly */
article {
  max-width: var(--max-article);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

article h1 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.18;
  letter-spacing: -.025em;
  margin-bottom: 1.5rem;
  font-style: italic;
}
article section { margin-bottom: 1.75rem; }
article section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--espresso);
  padding-bottom: .45rem;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: .9rem;
  margin-top: 0;
}
article p  { color: var(--ink); line-height: 1.78; }
article ul { padding-left: 1.4rem; }
article ul li { margin-bottom: .35rem; list-style: disc; }
article ul li::marker { color: var(--terracotta); }
article ol { padding-left: 1.4rem; }
article ol li { margin-bottom: .35rem; list-style: decimal; }
article ol li::marker { color: var(--terracotta); font-weight: 600; }

/* Direct answer callout */
.direct-answer {
  background: linear-gradient(135deg, #fff8f4 0%, #fef2ea 100%);
  border-left: 4px solid var(--terracotta);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.25rem 1.4rem;
  margin-bottom: 2rem;
  font-size: 1.05rem;
  line-height: 1.68;
  color: var(--espresso);
}
.direct-answer p:last-child { margin-bottom: 0; }

/* Debate section */
.debate {
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
}
.debate h2 {
  border-bottom: none !important;
  color: var(--terracotta) !important;
  font-style: italic;
  margin-bottom: .75rem !important;
}

/* Quick reference */
.quick-reference {
  background: var(--espresso);
  color: #f5ede5;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  margin: 2rem 0;
}
.quick-reference h2 {
  color: #fff !important;
  border-bottom: 1px solid rgba(255,255,255,.15) !important;
  margin-bottom: .9rem !important;
  font-size: .95rem !important;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-top: 0 !important;
}
.quick-reference ul { padding-left: 0; }
.quick-reference li {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .35rem 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
  color: #e0d4cc;
  font-family: var(--font-ui);
  font-size: .88rem;
  list-style: none;
}
.quick-reference li:last-child { border-bottom: none; }

/* Article meta */
.meta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .9rem;
  font-family: var(--font-ui);
  font-size: .82rem;
  color: var(--ink-light);
}
.meta a { color: var(--terracotta); font-weight: 500; }
.meta a:hover { text-decoration: underline; }

/* Related articles */
.related { margin-top: 2.5rem; }
.related h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--espresso);
  margin-bottom: 1rem;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: .45rem;
  margin-top: 0;
}
.related ul { padding: 0; }
.related li { margin-bottom: .55rem; }
.related a {
  color: var(--terracotta);
  font-weight: 500;
  font-family: var(--font-ui);
  font-size: .92rem;
}
.related a:hover { text-decoration: underline; color: var(--espresso); }
.related a::before { content: '→ '; opacity: .45; }

/* Category / listing description */
.category-description {
  color: var(--ink-light);
  font-size: .95rem;
  margin-bottom: 1.5rem;
  font-style: italic;
}

/* Empty + 404 states */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--ink-light);
  font-style: italic;
  font-size: 1.05rem;
}
.not-found { text-align: center; padding: 5rem 1.5rem; }
.not-found h1 { font-size: 5rem; color: var(--border); margin-bottom: .5rem; }
.not-found p  { color: var(--ink-light); margin-bottom: 1.5rem; }
.not-found a  {
  display: inline-block;
  background: var(--terracotta);
  color: #fff;
  padding: .65rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: .9rem;
  transition: background .18s;
}
.not-found a:hover { background: var(--espresso); }

/* Footer */
.site-footer {
  background: var(--espresso);
  color: #7a6258;
  padding: 1.5rem;
  text-align: center;
  font-family: var(--font-ui);
  font-size: .8rem;
  line-height: 1.6;
}
.site-footer a { color: #c4b5aa; text-decoration: underline; text-underline-offset: 3px; }
.site-footer a:hover { color: #fff; }

/* Methodology */
.methodology-wrap h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin-bottom: .4rem; font-style: italic; }
.methodology-wrap h2 { margin-top: 2.2rem; }
.methodology-wrap ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.methodology-wrap ol li { margin-bottom: .75rem; list-style: decimal; }

/* Category sections on homepage */
.cat-section {
  margin-bottom: 3rem;
}

.cat-section__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 1.5px solid var(--border);
}

.cat-section__title-wrap { flex: 1; min-width: 0; }

.cat-section__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--espresso);
  margin: 0;
  line-height: 1.2;
}

.cat-section__desc {
  font-family: var(--font-ui);
  font-size: .8rem;
  color: var(--ink-light);
  margin: .2rem 0 0;
  font-style: italic;
}

.cat-section__see-all {
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 600;
  color: var(--terracotta);
  white-space: nowrap;
  flex-shrink: 0;
  padding: .3rem .6rem;
  border: 1.5px solid var(--terracotta);
  border-radius: var(--radius-sm);
  transition: background .18s, color .18s;
}
.cat-section__see-all:hover {
  background: var(--terracotta);
  color: #fff;
}

/* 4-column grid for category rows on homepage */
.post-list--category {
  grid-template-columns: repeat(4, 1fr);
}

/* Responsive */
@media (max-width: 480px) {
  .post-list--category { grid-template-columns: 1fr; }
  .cat-section__header { flex-direction: column; align-items: flex-start; gap: .4rem; }
}

@media (min-width: 481px) and (max-width: 900px) {
  .post-list--category { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .site-header { padding: 0 1rem; min-height: 54px; }
  .site-name { font-size: 1.1rem; }
  .site-nav a { padding: .3rem .5rem; font-size: .72rem; }
  .hero { padding: 2.5rem 1rem 2rem; }
  .page-wrap, .listing-wrap, .methodology-wrap { padding: 1.5rem 1rem 3rem; }
  .article-wrap { padding: 1.5rem 1rem 3rem; }
  .post-list { grid-template-columns: 1fr; gap: .9rem; }
  .category-list { grid-template-columns: repeat(2, 1fr); }
  .quick-reference { margin: 1.5rem 0; }
  .meta { gap: .4rem; }
}
@media (min-width: 681px) and (max-width: 900px) {
  .post-list { grid-template-columns: repeat(2, 1fr); }
}

/* Focus */
a:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Print */
@media print {
  .site-header, .site-footer, .related, .breadcrumb { display: none; }
  body { font-size: 12pt; background: white; color: black; }
  .direct-answer { border-left: 2pt solid #000; background: #f5f5f5; }
}
