/* WHOLE FOOD FAMILY MEALS v1.0 — warm kitchen UI, offline, no external assets */
:root {
  --cream: #fbf6ee;
  --cream-deep: #f3ead8;
  --ink: #2a2218;
  --muted: #5c5348;
  --green: #2f6b3a;
  --green-deep: #1f4d28;
  --tomato: #c44536;
  --gold: #d4a017;
  --wood: #8b5e34;
  --card: #fffdf8;
  --line: #e4d8c4;
  --focus: #1a5f8a;
  --radius: 18px;
  --shadow: 0 10px 28px rgba(42, 34, 24, 0.08);
  --safe-bg: #eef6ef;
  --allergen-bg: #fff4e8;
  --honey-bg: #fff8d9;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --step: 1.125rem;
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 112.5%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #fff8e8 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #e8f3ea 0%, transparent 50%),
    var(--cream);
  min-height: 100vh;
  line-height: 1.5;
}
img, svg { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--green); color: #fff;
  padding: .75rem 1rem; z-index: 100; border-radius: 0 0 8px 0; font-weight: 600;
}
.skip-link:focus { left: 0; outline: 3px solid var(--gold); }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.app-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 246, 238, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: .75rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand {
  display: flex; align-items: center; gap: .75rem; background: none; border: 0;
  cursor: pointer; text-align: left; min-height: 44px; padding: .25rem;
  border-radius: 12px;
}
.brand-icon { border-radius: 10px; box-shadow: var(--shadow); }
.brand-name { display: block; font-weight: 800; font-size: 1.05rem; color: var(--green-deep); }
.brand-sub { display: block; font-size: .85rem; color: var(--muted); }
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  flex-wrap: wrap;
}
.btn-holder {
  min-height: 44px;
  min-width: 44px;
  padding: .4rem .95rem;
  border-radius: 999px;
  border: 2px solid var(--wood);
  background: #fff;
  color: var(--wood);
  font-weight: 800;
  cursor: pointer;
}
.btn-holder:hover { background: var(--cream-deep); }
.lang-toggle {
  display: inline-flex; border: 2px solid var(--green); border-radius: 999px; overflow: hidden;
  background: #fff;
}
.lang-btn {
  min-width: 48px; min-height: 44px; border: 0; background: transparent;
  font-weight: 700; cursor: pointer; padding: 0 .9rem;
}
.lang-btn.is-active { background: var(--green); color: #fff; }
.page-bottom-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  justify-content: space-between;
  align-items: center;
  margin: 2rem 0 0.5rem;
  padding: 1rem 0 0;
  border-top: 1px solid var(--line);
}
.bottom-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  color: var(--green-deep);
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
  padding: .25rem 0;
  font: inherit;
}
.bottom-btn { text-align: left; }

.app-main { max-width: 1100px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.view[hidden], .view:not(.is-active) { display: none !important; }
.view.is-active { display: block; }

.hero {
  display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: center;
  background: linear-gradient(135deg, #fff 0%, var(--cream-deep) 100%);
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px);
  padding: 1.25rem 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.25rem;
}
.hero-art {
  width: 110px; height: 110px; border-radius: 28px;
  background: #fff; display: grid; place-items: center;
  border: 2px solid var(--line);
}
.hero h1 {
  margin: 0 0 .5rem; font-size: clamp(1.6rem, 3vw, 2.15rem); line-height: 1.15;
  color: var(--green-deep); letter-spacing: -0.02em;
}
.lede { margin: 0 0 .4rem; font-size: 1.05rem; color: var(--ink); max-width: 42rem; }
.lede-es-hint { margin: 0; color: var(--muted); }

.toolbar {
  display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; align-items: stretch;
}
.search-wrap { flex: 1 1 220px; }
.search-input {
  width: 100%; min-height: 48px; border-radius: 14px; border: 2px solid var(--line);
  padding: .65rem 1rem; background: #fff;
}
.search-input:focus { border-color: var(--green); }
.filters {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .75rem; margin-bottom: 1.5rem; padding: 1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.filters label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 600; color: var(--muted); }
.select {
  min-height: 44px; border-radius: 12px; border: 2px solid var(--line);
  padding: .4rem .65rem; background: #fff;
}

.btn {
  min-height: 48px; border-radius: 999px; border: 2px solid transparent;
  padding: .55rem 1.15rem; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
.btn-primary { background: var(--green); color: #fff; border-color: var(--green-deep); }
.btn-primary:hover { background: var(--green-deep); }
.btn-secondary { background: #fff; border-color: var(--wood); color: var(--wood); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--green-deep); text-decoration: underline; min-height: 44px; }
.back-btn { margin-bottom: .75rem; padding-left: 0; }

.section-title {
  margin: 1.5rem 0 .85rem; font-size: 1.35rem; color: var(--green-deep);
}

.category-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .85rem;
  align-items: stretch; /* equal-height tiles in each row */
}
.cat-tile {
  appearance: none; border: 0; cursor: pointer; text-align: left;
  background: var(--card); border-radius: var(--radius); padding: 1rem .9rem;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  min-height: 168px; height: 100%;
  display: flex; flex-direction: column; align-items: flex-start; gap: .55rem;
  transition: transform .15s ease;
}
.cat-tile:hover { transform: translateY(-2px); border-color: var(--green); }
.cat-tile .icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: var(--cream-deep); flex-shrink: 0;
}
/* Title block sits at top; equal-ish space for multi-line category names */
.cat-tile .label {
  font-weight: 800; font-size: 1rem; line-height: 1.25; color: var(--ink);
  margin: 0; align-self: stretch;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  overflow: hidden;
  min-height: calc(1.25em * 2);
}
/* Footer line (count) aligns across the row */
.cat-tile .count {
  color: var(--muted); font-size: .9rem; margin-top: auto; padding-top: .35rem;
  align-self: stretch;
}

.recipe-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  align-items: stretch; /* equal-height recipe cards in each row */
}
.recipe-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.05rem;
  min-height: 220px; height: 100%;
  display: flex; flex-direction: column; align-items: stretch; gap: .55rem;
}
/* Text block: title + intro + badges stay at the top */
.recipe-card h3 {
  margin: 0; font-size: 1.12rem; line-height: 1.25; color: var(--green-deep);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; min-height: calc(1.25em * 2);
}
.recipe-card p {
  margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.4;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  overflow: hidden; min-height: calc(1.4em * 2);
  flex: 0 1 auto;
}
.badge-row {
  display: flex; flex-wrap: wrap; gap: .35rem;
  align-content: flex-start;
  min-height: 2rem;
}
/* Green "View recipe" buttons sit on one baseline at the bottom of every card */
.recipe-card > .btn,
.recipe-card > .btn-primary,
.recipe-card > .open-recipe {
  margin-top: auto;
  width: 100%;
  flex-shrink: 0;
  align-self: stretch;
}
.badge {
  display: inline-flex; align-items: center; min-height: 28px; padding: .15rem .55rem;
  border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--cream-deep);
  color: var(--ink); border: 1px solid var(--line);
}
.badge-veg { background: #e5f4e8; color: var(--green-deep); border-color: #b7d9be; }
.badge-allergen { background: #fff0e8; color: #8a3b1d; border-color: #f0c9b4; }
.badge-method { background: #fff6d9; color: #6b4e00; border-color: #edd89a; }

.view-header {
  display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem;
}
.view-header h1 { margin: 0; font-size: clamp(1.4rem, 2.5vw, 1.9rem); color: var(--green-deep); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.cat-hero-icon {
  width: 64px; height: 64px; border-radius: 18px; background: var(--cream-deep);
  display: grid; place-items: center; border: 1px solid var(--line); flex-shrink: 0;
}

.recipe-sheet {
  background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow); padding: 1.25rem 1.25rem 2rem;
}
.recipe-header h1 { margin: .2rem 0 .5rem; font-size: clamp(1.5rem, 3vw, 2rem); color: var(--green-deep); }
.recipe-kicker { margin: 0; font-weight: 700; color: var(--tomato); letter-spacing: .04em; text-transform: uppercase; font-size: .8rem; }
.recipe-intro { font-size: 1.05rem; margin: 0 0 .75rem; }
.recipe-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.recipe-controls {
  display: flex; flex-wrap: wrap; gap: .65rem; align-items: end; margin: 1rem 0 1.25rem;
  padding: .85rem; background: var(--cream-deep); border-radius: 14px;
}
.servings-label { display: grid; gap: .3rem; font-weight: 700; color: var(--muted); font-size: .9rem; }

.callout {
  border-radius: 14px; padding: .9rem 1rem; margin: 0 0 1rem; border: 1px solid var(--line);
  font-size: 1rem;
}
.callout-safety { background: var(--safe-bg); border-color: #b7d9be; }
.callout-allergen { background: var(--allergen-bg); border-color: #f0c9b4; }
.callout-honey { background: var(--honey-bg); border-color: #e6d27a; }
.callout strong { display: block; margin-bottom: .25rem; color: var(--green-deep); }
.callout.is-hidden { display: none; }

.recipe-sheet h2 {
  margin: 1.4rem 0 .55rem; font-size: 1.2rem; color: var(--wood);
  border-bottom: 2px solid var(--cream-deep); padding-bottom: .25rem;
}
.recipe-sheet h3 { margin: 1rem 0 .4rem; font-size: 1.05rem; color: var(--muted); }
.plain-list, .check-list, .steps-list { margin: 0 0 1rem; padding-left: 1.2rem; }
.check-list { list-style: none; padding-left: 0; }
.check-list li {
  display: flex; gap: .65rem; align-items: flex-start; padding: .45rem .2rem;
  border-bottom: 1px dashed var(--line);
}
.check-list input[type="checkbox"] {
  width: 22px; height: 22px; min-width: 22px; margin-top: .15rem; accent-color: var(--green);
}
.steps-list li { margin: 0 0 .75rem; padding-left: .25rem; }
.body-text { margin: 0 0 1rem; }

/* Cooking mode */
.cook-view { max-width: 720px; }
.cook-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.cook-recipe-title { font-size: 1.15rem; color: var(--muted); margin: 0 0 1rem; font-weight: 600; }
.cook-card {
  background: #fff; border: 2px solid var(--green); border-radius: 22px;
  padding: 1.5rem; min-height: 220px; box-shadow: var(--shadow); margin-bottom: 1rem;
}
.cook-step-num { margin: 0 0 .5rem; font-weight: 800; color: var(--tomato); letter-spacing: .04em; text-transform: uppercase; }
.cook-step-text { margin: 0; font-size: 1.25rem; line-height: 1.45; }
.cook-nav { display: flex; gap: .75rem; justify-content: space-between; }
.cook-timer { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed var(--line); text-align: center; }
.timer-display { font-size: 2.2rem; font-weight: 800; color: var(--green-deep); margin: .25rem 0 .75rem; font-variant-numeric: tabular-nums; }
.timer-actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.cook-timer.is-hidden { display: none; }

.app-footer {
  border-top: 1px solid var(--line); background: #fffdf8; padding: 1.25rem 1rem 2rem;
  text-align: center;
  max-width: 48rem;
  margin: 0 auto;
}
.footer-line { margin: 0 auto 10px; max-width: 48rem; color: var(--muted); font-size: 16px; line-height: 1.55; }
.wffm-author-note {
  margin: 10px auto;
  max-width: 48rem;
  color: #1a2438;
  font-size: 16px;
  line-height: 1.55;
  font-weight: 600;
}
.wffm-author-namaste { margin: 10px 0 0; font-size: 16px; }
a.wffm-namaste-link {
  color: var(--green-deep);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}
a.wffm-namaste-link:hover,
a.wffm-namaste-link:focus { opacity: 0.9; }

.search-results { margin-top: 1.5rem; }
.search-results.is-hidden { display: none; }

/* Print */
@media print {
  .app-header, .app-footer, .recipe-controls, .back-btn, .skip-link, .filters, .toolbar { display: none !important; }
  body { background: #fff; }
  .recipe-sheet { box-shadow: none; border: 0; }
  .view { display: none !important; }
  #view-recipe.is-active, #view-recipe:not([hidden]) { display: block !important; }
}

/* Mobile */
@media (max-width: 640px) {
  html { font-size: 106%; }
  .hero { grid-template-columns: 1fr; text-align: left; }
  .hero-art { width: 88px; height: 88px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recipe-sheet { padding: 1rem; }
  .cook-step-text { font-size: 1.15rem; }
}
