/* Mobile-first digital recipe book */
:root {
  --paper: #fdf8f0;
  --card: #ffffff;
  --ink: #3a2e28;
  --ink-soft: #7a6a5f;
  --accent: #8c3b2e;
  --accent-soft: #f3e2dc;
  --gold: #c8963e;
  --border: #e8ddd0;
  --shadow: 0 2px 8px rgba(58, 46, 40, 0.10);
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.site-header {
  text-align: center;
  padding: 20px 16px 8px;
}
.site-header h1 {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: 0.02em;
}
.site-header h1 a { color: var(--accent); text-decoration: none; }
.tagline { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.9rem; font-style: italic; }

.new-recipe-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 7px 16px;
  font-size: 0.9rem;
  color: #fff;
  background: var(--gold);
  border-radius: 999px;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.new-recipe-btn:active { transform: scale(0.97); }

/* ---------- Filters ---------- */
.filters {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
}

#search-box {
  width: 100%;
  padding: 11px 14px;
  font-size: 1rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  outline: none;
}
#search-box:focus { border-color: var(--accent); }

.filter-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0 2px;
  scrollbar-width: none;
  align-items: center;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-row::before {
  content: attr(data-label);
  flex: none;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  width: 62px;
}

.chip {
  flex: none;
  padding: 6px 13px;
  font-size: 0.85rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.slider-row { padding-right: 4px; }
#time-slider {
  flex: 1;
  min-width: 0;
  accent-color: var(--accent);
  height: 22px;
  cursor: pointer;
}
.slider-value {
  flex: none;
  min-width: 84px;
  text-align: right;
  font-size: 0.85rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.clear-btn {
  display: block;
  margin: 6px auto 2px;
  padding: 4px 14px;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- Browse book ---------- */
.book {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px 14px 30px;
  max-width: 900px;
  margin: 0 auto;
}
@media (min-width: 560px) { .book { grid-template-columns: 1fr 1fr; } }
@media (min-width: 860px) { .book { grid-template-columns: 1fr 1fr 1fr; } }

.recipe-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  font-family: inherit;
  color: inherit;
  transition: transform 0.12s ease;
}
.recipe-card:active { transform: scale(0.98); }

.card-photo {
  height: 130px;
  background-size: cover;
  background-position: center;
  background-color: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
}

.card-body { padding: 12px 14px 14px; }
.card-body h2 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  line-height: 1.25;
  color: var(--accent);
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.meta-pill {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
}
.meta-pill.effort-easy { border-color: #9dbb8f; }
.meta-pill.effort-medium { border-color: var(--gold); }
.meta-pill.effort-involved { border-color: var(--accent); }

.estimate-mark { color: var(--gold); cursor: help; }

/* ---------- Detail view ---------- */
.detail {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}
.back-btn {
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--accent);
  background: none;
  border: none;
  padding: 6px 0;
  cursor: pointer;
}
.detail h2 {
  margin: 6px 0 4px;
  font-size: 1.6rem;
  color: var(--accent);
}
.detail .card-meta { font-size: 0.85rem; margin-bottom: 14px; }

.detail-section h3 {
  font-size: 1.05rem;
  border-bottom: 2px solid var(--accent-soft);
  padding-bottom: 4px;
  margin: 20px 0 10px;
}

.ingredient-list { list-style: none; padding: 0; margin: 0; }
.ingredient-list li {
  display: flex;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px dotted var(--border);
  font-size: 0.98rem;
  cursor: pointer;
}
.ingredient-list li.checked { opacity: 0.45; text-decoration: line-through; }
.ingredient-list .qty { color: var(--ink-soft); flex: none; min-width: 70px; }

.step-list { padding-left: 22px; margin: 0; }
.step-list li { padding: 6px 0; line-height: 1.55; font-size: 0.98rem; }

.card-photos { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.card-photos img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.photo-caption { font-size: 0.8rem; color: var(--ink-soft); font-style: italic; text-align: center; margin: 2px 0 0; }

.recipe-notes {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-style: italic;
  font-size: 0.92rem;
}

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

.site-footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.8rem;
  padding: 10px 0 26px;
  font-style: italic;
}
