

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {

  --forest: #1F4D3A;
  --forest-dark: #143528;
  --leaf: #3F8F5F;
  --leaf-light: #DCEEE1;
  --sage: #8FBFA3;
  --cream: #FAFAF7;
  --gray-100: #F1F3EF;
  --gray-200: #E3E7E1;
  --gray-400: #A9B3AB;
  --charcoal: #232A25;
  --charcoal-soft: #55605A;
  --white: #FFFFFF;
  --amber: #B5762A;
  --amber-bg: #FBF1E4;
  --red: #B23A34;
  --red-bg: #FBEBEA;


  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;


  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(31, 77, 58, 0.08);
  --shadow-md: 0 8px 24px rgba(31, 77, 58, 0.12);
  --max-width: 1180px;
  --header-height: 72px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--charcoal);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--forest-dark);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 600;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; color: var(--charcoal-soft); }

a { color: var(--leaf); text-decoration: none; }
a:hover { text-decoration: underline; }

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

button {
  font-family: var(--font-body);
  cursor: pointer;
}


a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--leaf);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

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

.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: -9999px;
  top: 0;
  background: var(--forest);
  color: var(--white);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 200;
}
.skip-link:focus {
  left: 0;
}



.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid var(--gray-200);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--forest-dark);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px;
  flex-shrink: 0;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  color: var(--charcoal);
  font-weight: 600;
  font-size: 0.95rem;
}
.main-nav a:hover { background: var(--gray-100); text-decoration: none; }
.main-nav a[aria-current="page"] {
  background: var(--forest);
  color: var(--white);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  border-radius: 8px;
}
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    background: var(--cream);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    padding: 24px;
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav ul {
    flex-direction: column;
    gap: 8px;
  }
  .main-nav a { font-size: 1.1rem; padding: 14px 16px; }
}



.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  border: 2px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--forest);
  color: var(--white);
}
.btn-primary:hover { background: var(--forest-dark); }

.btn-secondary {
  background: var(--white);
  color: var(--forest);
  border-color: var(--gray-200);
}
.btn-secondary:hover { border-color: var(--leaf); }

.btn-ghost {
  background: transparent;
  color: var(--forest);
  padding: 10px 14px;
}
.btn-ghost:hover { background: var(--gray-100); }

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
}

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }



.hero {
  padding: 64px 0 48px;
  background: linear-gradient(180deg, var(--leaf-light) 0%, var(--cream) 100%);
  border-bottom: 1px solid var(--gray-200);
}

.hero-inner {
  max-width: 720px;
}

.hero .eyebrow {
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--leaf);
  background: var(--white);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}

.hero p.lede {
  font-size: 1.15rem;
  max-width: 560px;
}



.chip-field {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  transition: border-color 0.15s ease;
}
.chip-field:focus-within {
  border-color: var(--leaf);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--forest);
  color: var(--white);
  padding: 7px 8px 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}
.chip button {
  background: rgba(255,255,255,0.18);
  border: none;
  color: var(--white);
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  line-height: 1;
}
.chip button:hover { background: rgba(255,255,255,0.32); }

.chip-field input[type="text"] {
  flex: 1 1 160px;
  min-width: 140px;
  border: none;
  outline: none;
  font-size: 1rem;
  padding: 8px 6px;
  font-family: var(--font-body);
  color: var(--charcoal);
  background: transparent;
}

.chip-hint {
  font-size: 0.82rem;
  color: var(--charcoal-soft);
  margin-top: 8px;
}

.search-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.search-tabs {
  display: inline-flex;
  background: var(--gray-100);
  padding: 4px;
  border-radius: var(--radius-pill);
  margin-bottom: 18px;
}
.search-tabs button {
  border: none;
  background: transparent;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--charcoal-soft);
}
.search-tabs button[aria-selected="true"] {
  background: var(--white);
  color: var(--forest);
  box-shadow: var(--shadow-sm);
}



.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 28px;
}

.filters-bar label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--charcoal-soft);
  display: block;
  margin-bottom: 4px;
}

.filters-bar select {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 0.92rem;
  background: var(--white);
  color: var(--charcoal);
  font-family: var(--font-body);
  min-width: 160px;
}

.results-count {
  margin-left: auto;
  font-size: 0.9rem;
  color: var(--charcoal-soft);
}



.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.recipe-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  position: relative;
}
.recipe-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.recipe-card .thumb-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--gray-100);
}
.recipe-card .thumb-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.recipe-card .thumb-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--sage);
}
.recipe-card .thumb-fallback svg { width: 48px; height: 48px; }

.favorite-btn {
  position: absolute;
  top: 10px; right: 10px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.favorite-btn svg { width: 19px; height: 19px; stroke: var(--forest); fill: none; }
.favorite-btn[aria-pressed="true"] svg { fill: var(--red); stroke: var(--red); }

.recipe-card .card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.recipe-card h3 {
  font-size: 1.08rem;
  margin: 0;
}
.recipe-card h3 a { color: var(--forest-dark); }
.recipe-card h3 a:hover { text-decoration: none; color: var(--leaf); }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.82rem;
  color: var(--charcoal-soft);
}
.meta-row span { display: inline-flex; align-items: center; gap: 4px; }
.meta-row svg { width: 14px; height: 14px; }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  background: var(--leaf-light);
  color: var(--forest-dark);
}
.tag.tag-used { background: var(--leaf-light); color: var(--forest-dark); }
.tag.tag-missed { background: var(--amber-bg); color: var(--amber); }

.card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
  padding-top: 8px;
}



.state-panel {
  text-align: center;
  padding: 56px 24px;
  background: var(--white);
  border: 1.5px dashed var(--gray-200);
  border-radius: var(--radius-lg);
  margin: 24px 0 48px;
}
.state-panel svg {
  width: 56px; height: 56px;
  color: var(--sage);
  margin-bottom: 16px;
}
.state-panel h3 { margin-bottom: 6px; }
.state-panel p { max-width: 420px; margin-left: auto; margin-right: auto; }

.skeleton-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.skeleton-card .thumb-wrap { background: var(--gray-100); animation: pulse 1.4s ease-in-out infinite; }
.skeleton-line {
  height: 12px;
  background: var(--gray-100);
  border-radius: 6px;
  margin: 14px 16px;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}



.toast-region {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(90vw, 380px);
}
.toast {
  background: var(--forest-dark);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.2s ease;
}
.toast.toast-error { background: var(--red); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}



.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 53, 40, 0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 250;
}
.modal-panel {
  background: var(--cream);
  border-radius: var(--radius-lg);
  max-width: 780px;
  width: 100%;
  padding: 0;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: none;
  display: flex; align-items: center; justify-content: center;
}
.modal-hero { position: relative; }
.modal-hero img { width: 100%; aspect-ratio: 16/7; object-fit: cover; }
.modal-body { padding: 28px 32px 36px; }

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin: 18px 0 24px;
}
.nutrition-stat {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.nutrition-stat .value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--forest);
  font-weight: 700;
  display: block;
}
.nutrition-stat .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--charcoal-soft);
}

.detail-section { margin-bottom: 28px; }
.ingredient-list, .instructions-list { padding-left: 0; list-style: none; }
.ingredient-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--gray-200);
}
.ingredient-list li .amount { font-weight: 700; color: var(--forest); min-width: 90px; }
.instructions-list { counter-reset: step; }
.instructions-list li {
  counter-increment: step;
  position: relative;
  padding: 10px 0 10px 40px;
  border-bottom: 1px solid var(--gray-200);
}
.instructions-list li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--leaf-light);
  color: var(--forest-dark);
  font-weight: 700;
  font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
}



.planner-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.planner-tabs button {
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--charcoal-soft);
}
.planner-tabs button[aria-selected="true"] {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--white);
}

.day-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.day-column {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
}
.day-column h3 {
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.day-column .calorie-total {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--leaf);
  background: var(--leaf-light);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.meal-slot {
  border: 1.5px dashed var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.meal-slot > .slot-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--charcoal-soft);
  font-weight: 700;
  margin-bottom: 6px;
  display: block;
}
.planned-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 0.85rem;
}
.planned-item img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.planned-item .title { flex: 1; font-weight: 600; }
.planned-item button {
  border: none; background: none; color: var(--charcoal-soft);
  width: 22px; height: 22px; border-radius: 50%;
}
.planned-item button:hover { background: var(--gray-200); color: var(--red); }

.add-meal-btn {
  border: none;
  background: transparent;
  color: var(--leaf);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 4px;
  text-align: left;
}
.add-meal-btn:hover { text-decoration: underline; }



.shopping-list-section { margin-bottom: 28px; }
.shopping-list-section h3 {
  text-transform: capitalize;
  border-bottom: 2px solid var(--leaf-light);
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.shopping-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--gray-200);
}
.shopping-item input[type="checkbox"] {
  width: 20px; height: 20px;
  accent-color: var(--leaf);
  flex-shrink: 0;
}
.shopping-item label { flex: 1; cursor: pointer; }
.shopping-item.checked label { text-decoration: line-through; color: var(--gray-400); }
.shopping-item .qty { color: var(--charcoal-soft); font-size: 0.85rem; }



.site-footer {
  border-top: 1px solid var(--gray-200);
  padding: 32px 0;
  margin-top: 40px;
  font-size: 0.85rem;
  color: var(--charcoal-soft);
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}



.page-header { padding: 40px 0 8px; }
.section { padding: 8px 0 40px; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.hidden { display: none !important; }

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .hero { padding: 40px 0 32px; }
  .filters-bar { flex-direction: column; align-items: stretch; }
  .filters-bar select { width: 100%; }
  .results-count { margin-left: 0; }
}
