/* ==========================================================================
   récolte Auto Cooking Pot — 36 Recipes
   ========================================================================== */

:root {
  --bg: #faf6f0;
  --bg-alt: #f1ebe1;
  --card-bg: #ffffff;
  --ink: #2b2521;
  --ink-soft: #6b6058;
  --border: #e6ddcf;
  --accent: #b3654f;
  --max-width: 1160px;

  --c-potage: #b3654f;
  --c-potage-bg: #f4e3dd;
  --c-soup: #9c8a3e;
  --c-soup-bg: #efe9d3;
  --c-hearty: #b6473f;
  --c-hearty-bg: #f5ddda;
  --c-porridge: #46406b;
  --c-porridge-bg: #e2e0ee;
  --c-soymilk: #5f7d7a;
  --c-soymilk-bg: #dfe9e7;
  --c-smoothie: #5f7a44;
  --c-smoothie-bg: #e3ecd9;

  --radius: 14px;
  --shadow: 0 2px 6px rgba(43, 37, 33, 0.06), 0 10px 24px -12px rgba(43, 37, 33, 0.12);
  --shadow-hover: 0 6px 16px rgba(43, 37, 33, 0.10), 0 18px 34px -14px rgba(43, 37, 33, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1815;
    --bg-alt: #241f1b;
    --card-bg: #262019;
    --ink: #f1e9dd;
    --ink-soft: #b8ab9c;
    --border: #3a322a;
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 10px 24px -12px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.35), 0 18px 34px -14px rgba(0, 0, 0, 0.55);

    --c-potage-bg: #3a2a24;
    --c-soup-bg: #35311d;
    --c-hearty-bg: #3a2523;
    --c-porridge-bg: #26243a;
    --c-soymilk-bg: #223330;
    --c-smoothie-bg: #263524;
  }
}

:root[data-theme="dark"] {
  --bg: #1c1815;
  --bg-alt: #241f1b;
  --card-bg: #262019;
  --ink: #f1e9dd;
  --ink-soft: #b8ab9c;
  --border: #3a322a;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 10px 24px -12px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.35), 0 18px 34px -14px rgba(0, 0, 0, 0.55);

  --c-potage-bg: #3a2a24;
  --c-soup-bg: #35311d;
  --c-hearty-bg: #3a2523;
  --c-porridge-bg: #26243a;
  --c-soymilk-bg: #223330;
  --c-smoothie-bg: #263524;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: "Fraunces", Georgia, "Hiragino Mincho ProN", serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

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

img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.15rem;
  white-space: nowrap;
}

.brand small {
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.search-box {
  flex: 1;
  position: relative;
  max-width: 360px;
  margin-left: auto;
}

.search-box input {
  width: 100%;
  padding: 9px 14px 9px 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--ink);
  font-size: 0.9rem;
  font-family: inherit;
}

.search-box input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--ink-soft);
  pointer-events: none;
}

.category-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 20px 14px;
  scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink-soft);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
}

.hero-banner {
  position: relative;
  height: min(50vh, 420px);
  min-height: 260px;
  overflow: hidden;
}

.hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.hero-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 16, 12, 0.05) 0%, rgba(20, 16, 12, 0.55) 100%);
}

.hero-text {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 20px 26px;
  color: #fff;
  text-align: center;
}

.hero-text .eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 6px;
}

.hero-text h1 {
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  max-width: 720px;
  margin: 0 auto;
  text-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.hero-sub {
  max-width: 640px;
  margin: 20px auto 0;
  padding: 0 20px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.98rem;
}
.hero-sub p { margin: 0 0 10px; }
.hero-sub p:last-child { margin-bottom: 0; }

/* ---------- Sections ---------- */

.category-section {
  padding: 40px 0 8px;
}

.category-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.category-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.category-head h2 {
  font-size: 1.5rem;
}

.category-tagline {
  color: var(--ink-soft);
  font-size: 0.9rem;
  flex-basis: 100%;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  padding-bottom: 20px;
}

/* ---------- Recipe Card ---------- */

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}

.card:hover, .card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-alt);
  position: relative;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }

.card-body {
  padding: 14px 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.card-title-ja {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.card-meta {
  margin-top: auto;
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  padding-top: 6px;
}
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.card-meta svg { width: 13px; height: 13px; }

/* ---------- Recipe Detail ---------- */

.detail {
  padding-top: 24px;
  padding-bottom: 60px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-bottom: 18px;
  cursor: pointer;
}
.back-link svg { width: 15px; height: 15px; }
.back-link:hover { color: var(--ink); }

.detail-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

@media (min-width: 720px) {
  .detail-hero { grid-template-columns: 1.1fr 1fr; align-items: center; }
}

.detail-img {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4/3;
}
.detail-img img { width: 100%; height: 100%; object-fit: cover; }

.detail-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.detail-info h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 6px; }
.detail-title-ja { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 10px; }
.detail-subtitle { font-size: 1rem; color: var(--ink-soft); margin-bottom: 16px; line-height: 1.6; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.82rem;
}
.meta-pill svg { width: 15px; height: 15px; color: var(--ink-soft); flex: none; }
.meta-pill b { font-weight: 600; }

.page-ref { color: var(--ink-soft); font-size: 0.8rem; margin-top: 10px; display: flex; align-items: center; gap: 5px; }
.page-ref svg { width: 14px; height: 14px; flex: none; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 720px) {
  .detail-grid { grid-template-columns: 280px 1fr; }
}

.ingredients h3, .steps h3 {
  font-size: 1.1rem;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.ingredients ul {
  list-style: none;
  margin: 0; padding: 0;
}
.ingredients li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.92rem;
}
.ingredients li .amt { color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }

.steps ol {
  list-style: none;
  margin: 0; padding: 0;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.96rem;
}
.steps li:last-of-type { border-bottom: none; }
.steps li::before {
  content: counter(step);
  flex: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
}

.tip-box {
  margin-top: 22px;
  background: var(--bg-alt);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.9rem;
  border-left: 3px solid var(--accent);
}
.tip-box b { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 4px; }

/* ---------- About ---------- */

.about-section {
  padding-top: 40px;
  padding-bottom: 60px;
}
.about-section .lede {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.3rem;
  max-width: 620px;
  margin-bottom: 22px;
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 22px;
}
@media (min-width: 720px) {
  .about-grid { grid-template-columns: repeat(3, 1fr); }
}
.about-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.about-card h3 { font-size: 1rem; margin-bottom: 8px; }
.about-card p { font-size: 0.88rem; color: var(--ink-soft); margin: 0; line-height: 1.6; }

.credit {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 0 36px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.8rem;
}
.site-footer a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Empty state ---------- */

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

/* ---------- Utility ---------- */

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; }
  .search-box { max-width: none; order: 3; flex-basis: 100%; margin-left: 0; }
}
