/* Our Kitchen — a family recipe book. Cream paper, ink serif, terracotta accents. */

:root {
  --paper: #faf5ea;
  --paper-2: #f3ebd8;
  --card: #fffdf7;
  --ink: #241d11;
  --muted: #77684f;
  --faint: #a49372;
  --accent: #a03e28;
  --accent-dark: #7e2f1f;
  --gold: #b8862f;
  --line: #e4d8bc;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* ---------- Masthead ---------- */
.masthead {
  text-align: center;
  padding: 44px 0 30px;
  border-bottom: 3px double var(--line);
  background:
    radial-gradient(ellipse 60% 45% at 50% 0%, rgba(184, 134, 47, 0.10), transparent),
    var(--paper);
}
.overline {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 4rem);
  margin: 0;
  line-height: 1.05;
}
.tagline {
  color: var(--muted);
  font-style: italic;
  font-family: var(--serif);
  font-size: 1.05rem;
  margin: 10px 0 0;
}
.search-row { margin-top: 22px; }
#search {
  width: 100%;
  max-width: 480px;
  padding: 12px 18px;
  font-size: 1rem;
  font-family: var(--sans);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  outline: none;
  box-shadow: 0 2px 10px rgba(36, 29, 17, 0.05);
}
#search:focus { border-color: var(--gold); box-shadow: 0 2px 14px rgba(184, 134, 47, 0.18); }

/* ---------- Menu sections ---------- */
.menu-section { margin: 40px 0 8px; }
.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.section-head::before,
.section-head::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}
.section-head h2 {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  color: var(--ink);
}
.dish {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.15s ease;
}
.dish:last-child { border-bottom: none; }
.dish:hover, .dish:focus-visible { background: var(--paper-2); outline: none; }
.dish-photo {
  width: 92px;
  height: 92px;
  flex: 0 0 92px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(36, 29, 17, 0.18);
  background: var(--paper-2);
}
.dish-info { min-width: 0; flex: 1; }
.dish-name {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 2px;
  line-height: 1.25;
}
.dish-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.dish-meta .dot { margin: 0 6px; color: var(--faint); }
.dish-go {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 1.3rem;
  padding-right: 4px;
}
.empty { text-align: center; color: var(--muted); padding: 60px 0; font-style: italic; font-family: var(--serif); }

/* ---------- Recipe detail ---------- */
.detail { padding-bottom: 60px; }
.back-btn {
  margin: 22px 0 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
  background: var(--card);
}
.back-btn:hover { border-color: var(--gold); }
.hero {
  position: relative;
  margin: 18px -20px 0;
  height: min(42vh, 380px);
  min-height: 240px;
  overflow: hidden;
}
.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 14, 6, 0.82) 0%, rgba(20, 14, 6, 0.25) 55%, transparent 80%);
}
.hero-text {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 20px;
  max-width: 860px;
  margin: 0 auto;
}
.hero-text h1 {
  font-family: var(--serif);
  color: #fffdf7;
  font-size: clamp(1.9rem, 5.5vw, 2.9rem);
  margin: 0;
  line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.hero-meta {
  color: rgba(255, 253, 247, 0.92);
  margin: 8px 0 0;
  font-size: 0.95rem;
}
.hero-meta .dot { margin: 0 8px; opacity: 0.6; }

.recipe-body { max-width: 700px; margin: 0 auto; }

.cook-cta {
  display: block;
  width: 100%;
  margin: 26px 0 6px;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--sans);
  color: #fffdf7;
  background: var(--accent);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(160, 62, 40, 0.35);
}
.cook-cta:hover { background: var(--accent-dark); }

.section-title {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 700;
  margin: 38px 0 4px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); align-self: center; }
.section-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
  font-style: italic;
  font-family: var(--serif);
}

/* Ingredients / mise en place */
.scale-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 2px 0 12px;
}
.scale-row .scale-label { font-weight: 600; margin-right: 2px; }
.scale-row button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  cursor: pointer;
}
.scale-row button.on {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.scale-row input {
  width: 92px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  background: var(--card);
  color: var(--ink);
}
.scale-row input.bad { border-color: #c0392b; }
.ingredients { list-style: none; margin: 0; padding: 0; }
.ingredients li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--line);
  cursor: pointer;
  font-size: 1.02rem;
}
.ingredients li:last-child { border-bottom: none; }
.ingredients input {
  margin-top: 5px;
  width: 18px; height: 18px;
  accent-color: var(--accent);
  flex: 0 0 auto;
  cursor: pointer;
}
.ingredients li.done span { text-decoration: line-through; color: var(--faint); }

/* Method steps */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 16px 4px 16px 56px;
  border-bottom: 1px solid var(--line);
  font-size: 1.08rem;
  line-height: 1.65;
  cursor: pointer;
}
.steps li:last-child { border-bottom: none; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 14px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--accent);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps li.done { color: var(--faint); }
.steps li.done::before {
  background: var(--accent);
  border-color: var(--accent);
  color: #fffdf7;
  content: "✓";
  font-size: 1rem;
}
.steps li strong { color: var(--accent-dark); font-weight: 600; }
.steps li.done strong { color: var(--faint); }

/* Video + sources */
.video-block { margin: 26px 0 6px; }
.video-placeholder {
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--paper-2);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-placeholder button {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: 999px;
  border: none;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}
.video-frame { position: relative; padding-bottom: 56.25%; height: 0; border-radius: 14px; overflow: hidden; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Instagram reels are vertical: narrow centered player sized for 9:16 video + embed chrome */
.ig-embed { width: min(100%, 400px); margin: 0 auto; }
.ig-embed iframe { width: 100%; height: 740px; border: 0; border-radius: 14px; background: #fff; display: block; }
.video-link { display: inline-block; margin-top: 10px; color: var(--accent); font-weight: 600; font-size: 0.95rem; }

.sources { list-style: none; margin: 0; padding: 0; }
.sources li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.sources li:last-child { border-bottom: none; }
.sources a { color: var(--ink); font-weight: 500; }
.src-host { color: var(--faint); font-size: 0.85rem; margin-left: 8px; }
.recipe-note {
  margin-top: 30px;
  padding: 16px 18px;
  background: var(--paper-2);
  border-left: 3px solid var(--gold);
  border-radius: 0 12px 12px 0;
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
  font-family: var(--serif);
}

.edit-link {
  margin-top: 26px;
  text-align: center;
  font-size: 0.9rem;
}
.edit-link a { color: var(--faint); text-decoration: none; }
.edit-link a:hover { color: var(--ink); text-decoration: underline; }
.link-sep { color: var(--faint); margin: 0 6px; }

/* ---------- Cook mode overlay ---------- */
.cookmode {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
}
.cookmode[hidden] { display: none; }
.cook-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
.cook-exit {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--ink);
  background: var(--card);
}
.cook-progress {
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.cook-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  overflow-y: auto;
}
.cook-kicker {
  font-size: 0.85rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin: 0 0 14px;
}
.cook-step {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 4.5vw, 2rem);
  line-height: 1.5;
  margin: 0;
}
.cook-step strong { color: var(--accent-dark); }
.cook-step.is-done { color: var(--faint); text-decoration: line-through; }
.cook-bottom {
  display: flex;
  gap: 10px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
.cook-nav {
  flex: 1;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.cook-nav:disabled { opacity: 0.35; cursor: default; }
.cook-done {
  flex: 1.4;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: #fffdf7;
  cursor: pointer;
}
.cook-done.undo { background: var(--ink); }

.footer {
  border-top: 3px double var(--line);
  margin-top: 30px;
  padding: 22px 20px 40px;
  text-align: center;
  color: var(--faint);
  font-size: 0.9rem;
  font-style: italic;
  font-family: var(--serif);
}

@media (max-width: 560px) {
  .dish-photo { width: 76px; height: 76px; flex-basis: 76px; }
  .dish-name { font-size: 1.15rem; }
  .hero { margin: 14px -20px 0; }
}
