/* ============================================================
   Palette: warm kitchen-slate + saffron + sage.
   Deliberately avoiding the generic cream/terracotta AI look —
   this leans into a deeper, spice-rack feel instead.
   ============================================================ */
:root, [data-theme="light"] {
  --bg: #faf7ef;
  --bg-raised: #ffffff;
  --ink: #2b2620;
  --muted: #776e5e;
  --border: #e6ddc9;
  --saffron: #d99a1f;
  --saffron-ink: #2b2620;
  --sage: #6f8f6a;
  --line: #ece4d1;
  --shadow: 0 10px 30px rgba(43,38,32,0.08);
}
[data-theme="dark"] {
  --bg: #17181a;
  --bg-raised: #1f2123;
  --ink: #ece7db;
  --muted: #9a9587;
  --border: #303234;
  --saffron: #e3ab3d;
  --saffron-ink: #17181a;
  --sage: #86a781;
  --line: #2a2c2e;
  --shadow: 0 10px 30px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  transition: background .25s ease, color .25s ease;
}
h1, h2, h3, .brand { font-family: 'Fraunces', serif; }
.mono { font-family: 'IBM Plex Mono', monospace; }

a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; gap: 20px;
  padding: 18px 32px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.brand { font-size: 22px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.brand-mark { font-size: 24px; }
.search-wrap { flex: 1; max-width: 420px; }
.search-wrap input {
  width: 100%; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-raised); color: var(--ink); font-size: 14px;
}
.header-controls { display: flex; align-items: center; gap: 10px; margin-left: auto; }
#lang-select {
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-raised); color: var(--ink); font-size: 13px;
}
#theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg-raised); color: var(--ink); cursor: pointer; font-size: 16px;
}

/* ---------- Category rail ---------- */
.tag-rail {
  display: flex; gap: 10px; padding: 14px 32px; overflow-x: auto;
  border-bottom: 1px solid var(--border);
}
.tag-rail button {
  border: 1px solid var(--border); background: var(--bg-raised); color: var(--muted);
  padding: 6px 14px; border-radius: 999px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.tag-rail button.active { background: var(--saffron); color: var(--saffron-ink); border-color: var(--saffron); }

.container { max-width: 1100px; margin: 0 auto; padding: 32px; }

/* ---------- Recipe grid ---------- */
.recipe-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px;
}
.recipe-card {
  background: var(--bg-raised); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid var(--border); display: flex; flex-direction: column;
}
/* Signature element: a spice-dot strip along the top of every card, standing
   in for the recipe's primary category — a small nod to a spice rack. */
.recipe-card .spice-strip { height: 6px; background: var(--saffron); }
.recipe-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.recipe-card .body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.recipe-card h3 { margin: 0; font-size: 17px; }
.recipe-card .meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; }
.recipe-card .desc { font-size: 13px; color: var(--muted); flex: 1; }

.pager { display: flex; justify-content: center; gap: 10px; margin-top: 30px; }
.pager button {
  border: 1px solid var(--border); background: var(--bg-raised); color: var(--ink);
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
}
.pager button.active { background: var(--saffron); color: var(--saffron-ink); }

/* ---------- Recipe detail page ---------- */
.recipe-page .hero-image { width: 100%; max-height: 420px; object-fit: cover; border-radius: 16px; margin-bottom: 20px; }
.recipe-page h1 { font-size: 32px; margin: 0 0 8px; }
.recipe-page .stats { display: flex; gap: 20px; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.recipe-page .stats span { font-family: 'IBM Plex Mono', monospace; }
.recipe-layout { display: grid; grid-template-columns: 280px 1fr; gap: 40px; }
@media (max-width: 720px) { .recipe-layout { grid-template-columns: 1fr; } }

.ingredients-panel {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px; padding: 20px; height: fit-content;
}
.ingredients-panel ul { list-style: none; padding: 0; margin: 0; }
.ingredients-panel li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ingredients-panel li:last-child { border-bottom: none; }

.steps ol { padding-left: 22px; }
.steps li { margin-bottom: 16px; font-size: 15px; line-height: 1.6; }

.section-title { font-size: 20px; margin: 36px 0 14px; }

/* Reviews */
.review { border-bottom: 1px solid var(--line); padding: 14px 0; }
.review .stars { color: var(--saffron); }
.review-form { display: flex; flex-direction: column; gap: 10px; max-width: 480px; }
.review-form input, .review-form textarea, .review-form select {
  padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-raised); color: var(--ink);
}

/* Visitor photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.photo-grid figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.upload-photo-form { display: flex; flex-direction: column; gap: 10px; max-width: 420px; }

.btn {
  background: var(--saffron); color: var(--saffron-ink); border: none; padding: 10px 18px;
  border-radius: 999px; font-weight: 600; cursor: pointer; font-size: 14px; width: fit-content;
}

.site-footer { text-align: center; padding: 30px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); }
