/* ===========================================================
   Recipes — polished theme
   Per-section palettes are driven by CSS custom properties set
   on each #section, then inherited by its cards and headings.
   =========================================================== */

:root {
  --page-bg: #faf7f2;
  --ink: #2b2622;
  --ink-soft: #6b635b;
  --card: #ffffff;
  --radius: 18px;
  --shadow-sm: 0 1px 2px rgba(40, 30, 20, 0.06);
  --shadow-md: 0 6px 18px rgba(40, 30, 20, 0.10);
  --shadow-lg: 0 16px 40px rgba(40, 30, 20, 0.16);
  --maxw: min(95vw, 1680px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background-color: var(--page-bg);
  background-image:
    radial-gradient(circle at 12% -8%, rgba(232, 89, 12, 0.06), transparent 40%),
    radial-gradient(circle at 88% -4%, rgba(230, 73, 128, 0.06), transparent 42%);
  margin: 0;
  padding: 0 1rem 4rem;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header / hero ---------- */
.site-header {
  text-align: center;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1rem 1.25rem;
}
h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
.tagline {
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* ---------- Tabs (sticky) ---------- */
.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.75rem;
  background: rgba(250, 247, 242, 0.82);
  backdrop-filter: saturate(160%) blur(10px);
  border-radius: 0 0 var(--radius) var(--radius);
}
.tabs.back-to-top {
  position: static;
  background: none;
  backdrop-filter: none;
  margin-top: 2rem;
}

.tab-button {
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  border: 1px solid rgba(40, 30, 20, 0.08);
  border-radius: 999px;
  color: var(--ink);
  background-color: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.tab-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.tab-button:active { transform: translateY(0); }

/* Active tab takes on its section colour */
.tab-button.active { color: #fff; border-color: transparent; }
.tab-button.active.mains    { background-color: #e8590c; }
.tab-button.active.starters { background-color: #2f9e44; }
.tab-button.active.desserts { background-color: #e64980; }
.tab-button.active.sauces   { background-color: #1098ad; }

/* ---------- Section containers + per-type palettes ---------- */
main { max-width: var(--maxw); margin: 0 auto; }

.tab-content {
  display: none;
  padding: 1.75rem clamp(1rem, 3vw, 2rem) 2rem;
  margin-top: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--edge, rgba(40, 30, 20, 0.06));
  background: var(--section-bg, #fff);
}
.tab-content.active {
  display: block;
  animation: fade-in 0.35s ease;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mains — warm amber / roast */
#mains {
  --accent: #e8590c;
  --accent-soft: #ffe8cc;
  --edge: #ffd8a8;
  --section-bg: linear-gradient(160deg, #fff7ed 0%, #ffe8d6 100%);
}
/* Starters — fresh garden green */
#starters {
  --accent: #2f9e44;
  --accent-soft: #d3f9d8;
  --edge: #b2f2bb;
  --section-bg: linear-gradient(160deg, #f3fbf4 0%, #ddf6e1 100%);
}
/* Desserts — sweet berry pink */
#desserts {
  --accent: #e64980;
  --accent-soft: #ffdeeb;
  --edge: #fcc2d7;
  --section-bg: linear-gradient(160deg, #fff5f8 0%, #ffe3ee 100%);
}
/* Sauces / Sides — cool teal */
#sauces {
  --accent: #1098ad;
  --accent-soft: #c5f6fa;
  --edge: #99e9f2;
  --section-bg: linear-gradient(160deg, #f1fcfd 0%, #d6f6fa 100%);
}

/* ---------- Section heading ---------- */
h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  margin: 0 0 1.25rem;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
h2 .section-title { position: relative; }
h2 .section-title::after {
  content: "";
  display: block;
  height: 4px;
  width: 56px;
  margin-top: 0.35rem;
  border-radius: 4px;
  background: var(--accent);
}
.count {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

/* ---------- Recipe grid + cards ---------- */
.recipe-grid {
  display: grid;
  grid-template-columns: 1fr; /* mobile: single column */
  gap: 1.25rem;
}
/* small tablets: 2 across */
@media (min-width: 600px) {
  .recipe-grid { grid-template-columns: repeat(2, 1fr); }
}
/* desktop: 4 across before stacking */
@media (min-width: 900px) {
  .recipe-grid { grid-template-columns: repeat(4, 1fr); }
}
.recipe {
  background-color: var(--card);
  border-radius: var(--radius);
  border: 1px solid rgba(40, 30, 20, 0.06);
  border-top: 4px solid var(--accent);
  box-shadow: var(--shadow-sm);
  padding: 1.4rem 1.5rem 1.6rem;
  transition: transform 0.18s ease, box-shadow 0.22s ease;
}
.recipe:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.2;
  margin: 0 0 0.9rem;
  color: var(--ink);
}

h4 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 1.2rem 0 0.6rem;
}

/* ---------- Ingredients ---------- */
ul.ingredients {
  list-style: none;
  margin: 0;
  padding: 0;
}
ul.ingredients li {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.4rem;
  border-bottom: 1px dashed rgba(40, 30, 20, 0.08);
  font-size: 0.97rem;
}
ul.ingredients li:last-child { border-bottom: none; }
ul.ingredients li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Method ---------- */
ol.method {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}
ol.method li {
  position: relative;
  counter-increment: step;
  padding: 0.2rem 0 0.85rem 2.4rem;
  font-size: 0.97rem;
}
ol.method li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  .tab-button { font-size: 0.9rem; padding: 0.55rem 0.9rem; }
  .site-header { padding-top: 1.75rem; }
}
