/* Earl & Jen's Cookbook — PWA styles.
   Warm cream background, navy text, gold/burgundy accents, EB Garamond. */

@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/EBGaramond-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/EBGaramond-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/EBGaramond-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/fonts/EBGaramond-BoldItalic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --cream: #fdf8ee;
  --cream-dark: #f3e8ce;
  --navy: #1e2a44;
  --gold: #b08d3c;
  --burgundy: #7a2e3a;
  --body: #232323;
  --muted: #5a5a5a;
  --card: #fffdf7;
  --line: #e5dcc4;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--body);
  font-family: "EB Garamond", Georgia, serif;
  font-size: 18px;
  line-height: 1.35;
}

a { color: var(--navy); }

button, input {
  font-family: inherit;
}

/* --- Header --- */

.app-header {
  background: var(--navy);
  color: var(--cream);
  padding: 0.7rem 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--cream);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
}

.brand .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--burgundy);
  border: 2px solid var(--gold);
  color: var(--cream);
  font-size: 0.85rem;
  flex: none;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
}

/* --- Home --- */

.search {
  width: 100%;
  font-size: 1.1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: var(--card);
  color: var(--body);
  margin: 0.25rem 0 1.25rem;
}

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

.category-title {
  color: var(--navy);
  font-size: 1.45rem;
  margin: 1.4rem 0 0.6rem;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 0.25rem;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.recipe-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(30, 42, 68, 0.08);
}

.recipe-card a {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.recipe-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}

.recipe-card .card-body { padding: 0.7rem 0.85rem 0.9rem; }

.recipe-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  line-height: 1.25;
  color: var(--navy);
}

.recipe-card .meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.empty {
  color: var(--muted);
  font-style: italic;
  padding: 1rem 0;
}

/* --- Detail --- */

.back-link {
  display: inline-block;
  margin-bottom: 0.6rem;
  color: var(--burgundy);
  text-decoration: none;
  font-weight: 700;
}

.recipe-hero {
  width: 100%;
  border-radius: 10px;
  display: block;
  margin: 0.5rem 0 0.75rem;
}

.recipe-title {
  color: var(--navy);
  text-align: center;
  font-size: 1.9rem;
  line-height: 1.15;
  margin: 0.25rem 0 0.35rem;
}

.recipe-desc {
  color: var(--burgundy);
  font-style: italic;
  text-align: center;
  font-size: 1.15rem;
  margin: 0 0 0.6rem;
}

.info-bar {
  text-align: center;
  color: var(--navy);
  font-size: 1.05rem;
  margin: 0 0 1rem;
}

.info-bar .dot { color: var(--gold); padding: 0 0.4em; }

.section-title {
  color: var(--navy);
  font-size: 1.45rem;
  margin: 1.3rem 0 0.5rem;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 0.2rem;
}

.group-title {
  color: var(--burgundy);
  font-size: 1.15rem;
  margin: 0.9rem 0 0.3rem;
}

.ingredient-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ingredient-list li {
  margin: 0.15rem 0;
}

.ingredient-list label {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  cursor: pointer;
  padding: 0.15rem 0;
}

.ingredient-list input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--burgundy);
  flex: none;
  transform: translateY(0.15rem);
}

.ingredient-list li.checked span { text-decoration: line-through; color: var(--muted); }

.step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.step-list li { margin: 0.9rem 0; }

.step-list h3 {
  margin: 0 0 0.15rem;
  font-size: 1.2rem;
  color: var(--body);
}

.step-list .cue {
  color: var(--muted);
  font-style: italic;
  margin: 0 0 0.25rem;
}

.step-list p { margin: 0; }

.tip-box {
  background: var(--cream-dark);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-top: 1.2rem;
}

.tip-box h3 {
  color: var(--burgundy);
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
}

.tip-box p { margin: 0; }

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.4rem 0 0.5rem;
}

.btn {
  display: inline-block;
  background: var(--burgundy);
  color: var(--cream);
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn.secondary {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--navy);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.45rem 0.8rem;
  font-size: 0.95rem;
}

.revision {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 1.2rem;
}

/* --- Cook mode --- */

.cook-mode { text-align: center; }

.cook-mode .progress {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0.4rem 0 0.2rem;
}

.cook-mode .step-title {
  color: var(--navy);
  font-size: 2rem;
  line-height: 1.15;
  margin: 0.5rem 0;
}

.cook-mode .step-cue {
  color: var(--burgundy);
  font-style: italic;
  font-size: 1.3rem;
  margin: 0 0 0.8rem;
}

.cook-mode .step-text {
  font-size: 1.6rem;
  line-height: 1.45;
  text-align: left;
  margin: 0 auto 1.4rem;
  max-width: 640px;
}

.cook-nav {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin: 1rem 0 1.6rem;
}

.cook-nav .btn { flex: 1; max-width: 220px; }

.timer {
  border: 1px solid var(--gold);
  border-radius: 10px;
  background: var(--card);
  padding: 0.9rem 1rem;
  max-width: 420px;
  margin: 0 auto 1.4rem;
}

.timer h3 {
  margin: 0 0 0.5rem;
  color: var(--navy);
  font-size: 1.2rem;
}

.timer-display {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0.2rem 0 0.6rem;
  font-variant-numeric: tabular-nums;
}

.timer.done .timer-display { color: var(--burgundy); }

.timer-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.timer input {
  width: 4.5rem;
  font-size: 1.2rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: var(--cream);
  text-align: center;
}

.timer .btn { padding: 0.5rem 0.9rem; font-size: 1rem; }

.cook-exit { margin-top: 0.5rem; }

.noscript { padding: 2rem 1rem; font-style: italic; }

@media (min-width: 700px) {
  body { font-size: 19px; }
  .recipe-title { font-size: 2.2rem; }
}
