/* ===== LENT MEAL PLANS — SHARED DESIGN SYSTEM ===== */
/* Dark default, light via [data-theme="light"] */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@400;500;600;700&display=swap');

/* ===== THEME VARIABLES ===== */
:root {
  --bg: #0a0a10;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-solid: #13131a;
  --bg-elevated: rgba(255,255,255,0.06);
  --text: #e8e0d4;
  --text-dim: #a89880;
  --text-mid: #b0a594;
  --text-muted: #6a5e50;
  --gold: #d4b978;
  --gold-dim: #a88452;
  --gold-glow: rgba(212,185,120,0.12);
  --divider: rgba(168,132,82,0.15);
  --sage: #7fa882;
  --sage-dim: rgba(107,140,112,0.25);
  --sage-bg: rgba(107,140,112,0.08);
  --terra: #c48070;
  --terra-bg: rgba(192,108,93,0.08);
  --purple: #9b8ec4;
  --purple-deep: #8b7bb4;
  --purple-bg: rgba(155,142,196,0.08);
  --warn-bg: rgba(226,172,80,0.08);
  --warn-border: rgba(226,172,80,0.2);
  --warn-text: #e2ac50;
  --danger-bg: rgba(226,92,79,0.08);
  --danger-border: rgba(226,92,79,0.2);
  --danger-text: #e08070;
  --tip-bg: rgba(107,140,112,0.08);
  --tip-border: rgba(107,140,112,0.2);
  --tip-text: #7fa882;
  --ctrl-bg: rgba(255,255,255,0.06);
  --ctrl-hover: rgba(255,255,255,0.10);
  --ctrl-active: rgba(212,185,120,0.2);
  --check-bg: var(--sage);
  --check-done: rgba(255,255,255,0.25);
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.2);
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: 'Cinzel', serif;
  --font-serif: 'Cormorant Garamond', serif;
  --font-body: 'DM Sans', sans-serif;
}

[data-theme="light"] {
  --bg: #faf7f0;
  --bg-card: rgba(0,0,0,0.02);
  --bg-card-solid: #ffffff;
  --bg-elevated: rgba(0,0,0,0.03);
  --text: #1a1610;
  --text-dim: #5a4e3e;
  --text-mid: #6a5a4a;
  --text-muted: #999080;
  --gold: #8a6914;
  --gold-dim: #a88452;
  --gold-glow: rgba(138,105,20,0.06);
  --divider: rgba(138,105,20,0.12);
  --sage: #4a6b4f;
  --sage-dim: rgba(74,107,79,0.15);
  --sage-bg: rgba(74,107,79,0.05);
  --terra: #b05545;
  --terra-bg: rgba(176,85,69,0.05);
  --purple: #5a3d7a;
  --purple-deep: #4a2d6a;
  --purple-bg: rgba(90,61,122,0.05);
  --warn-bg: #fff8ee;
  --warn-border: rgba(200,150,50,0.25);
  --warn-text: #8a6d3b;
  --danger-bg: #fef2f0;
  --danger-border: rgba(200,60,50,0.2);
  --danger-text: #8b3a33;
  --tip-bg: #eef4ef;
  --tip-border: rgba(74,107,79,0.25);
  --tip-text: #3d5a40;
  --ctrl-bg: rgba(0,0,0,0.04);
  --ctrl-hover: rgba(0,0,0,0.08);
  --ctrl-active: rgba(138,105,20,0.15);
  --check-bg: #6b8c70;
  --check-done: rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.04);
}

/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1.5;
}

/* ===== CONTROLS BAR (top of every page) ===== */
.site-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--divider);
}

.site-controls .left { display: flex; align-items: center; gap: 8px; }
.site-controls .right { display: flex; align-items: center; gap: 6px; }

.home-btn {
  color: var(--gold);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 4px;
}
.home-btn::before { content: '✝'; font-size: 1rem; }

.lang-switcher { display: flex; }
.lang-btn {
  padding: 5px 10px;
  border: 1px solid var(--divider);
  background: var(--ctrl-bg);
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}
.lang-btn:first-child { border-radius: 5px 0 0 5px; }
.lang-btn:last-child { border-radius: 0 5px 5px 0; }
.lang-btn + .lang-btn { border-left: none; }
.lang-btn.active { background: var(--ctrl-active); color: var(--gold); }

.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--divider);
  background: var(--ctrl-bg);
  color: var(--gold);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.theme-toggle:hover { background: var(--ctrl-hover); }

/* ===== HEADER (day pages & shopping) ===== */
header {
  background: linear-gradient(135deg, rgba(74,107,79,0.15) 0%, rgba(107,140,112,0.08) 100%);
  border-bottom: 1px solid var(--divider);
  padding: 1rem 1rem 0.8rem;
  position: sticky;
  top: 0; /* JS adjusts based on site-controls height */
  z-index: 10;
}

header .hdr-back {
  color: var(--gold-dim);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  display: block;
  margin-bottom: 0.3rem;
  letter-spacing: 0.02em;
}

header h1 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
}

header .sub {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
  font-style: italic;
}

header .saint {
  font-family: var(--font-serif);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
  font-style: italic;
}

/* Shopping header variant */
header.shopping-header {
  background: linear-gradient(135deg, rgba(90,61,122,0.12) 0%, rgba(155,142,196,0.06) 100%);
}

/* ===== RESET BAR (day pages) ===== */
.reset-bar {
  padding: 0.45rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  z-index: 9;
  background: var(--bg);
  border-bottom: 1px solid var(--divider);
}

.reset-btn {
  background: var(--ctrl-bg);
  border: 1px solid var(--divider);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-family: var(--font-body);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
}
.reset-btn:hover { background: var(--ctrl-hover); }

.show-toggle {
  font-size: 0.72rem;
  color: var(--sage);
  cursor: pointer;
  background: var(--ctrl-bg);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--divider);
  font-family: var(--font-body);
  transition: all 0.2s;
}

/* ===== SUPPLEMENTS & WARN BOXES ===== */
.supplements {
  background: var(--sage-bg);
  border-left: 3px solid var(--sage);
  padding: 0.65rem 0.85rem;
  margin: 0.75rem 0.75rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.8rem;
  color: var(--text);
}
.supplements strong { color: var(--sage); }

.warn-box {
  background: var(--warn-bg);
  border-left: 3px solid var(--warn-border);
  padding: 0.6rem 0.85rem;
  margin: 0.5rem 0.75rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.78rem;
  color: var(--warn-text);
}

/* ===== TIMELINE ===== */
.timeline {
  background: var(--bg-card-solid);
  margin: 0.75rem;
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--divider);
}

.timeline h2 {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tl-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--divider);
  font-size: 0.8rem;
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.tl-row:last-child { border-bottom: none; }

.tl-time {
  font-weight: 700;
  color: var(--sage);
  min-width: 65px;
  flex-shrink: 0;
  font-size: 0.76rem;
}

.tl-what { flex: 1; color: var(--text); }
.tl-what strong { color: var(--gold); font-weight: 700; }

.tl-notes {
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-top: 0.1rem;
}

.tl-row.checked { opacity: 0.3; }
.tl-row.checked.hide-done {
  max-height: 0;
  padding: 0;
  overflow: hidden;
  border: none;
  transition: all 0.3s ease;
}

/* ===== MEAL CARDS ===== */
.meal {
  background: var(--bg-card-solid);
  margin: 0.75rem;
  border-radius: var(--radius);
  padding: 0.85rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--divider);
  transition: all 0.4s ease;
}

.meal-header {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.meal-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.meal-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.meal-subtitle {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--sage);
  font-weight: 600;
  margin-bottom: 0.3rem;
  font-style: italic;
}

.meal-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.55rem;
  line-height: 1.45;
}

.section-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-dim);
  margin-bottom: 0.3rem;
  margin-top: 0.5rem;
}

/* ===== COMPONENTS (ingredients — not checkable) ===== */
.component {
  font-size: 0.8rem;
  padding: 0.2rem 0;
  display: flex;
  gap: 0.3rem;
  color: var(--text);
}

.comp-name { font-weight: 600; }
.comp-qty { color: var(--text-muted); }

/* ===== STEPS (checkable) ===== */
.step {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: all 0.3s ease;
}
.step:last-child { border-bottom: none; }

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--check-bg);
  color: #fff;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  margin-right: 0.4rem;
  flex-shrink: 0;
  vertical-align: top;
  transition: background 0.2s;
}

.step-task {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
}

.step-details {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
  line-height: 1.45;
  padding-left: 32px;
}

/* Step checked states */
.step.checked {
  opacity: 0.3;
  max-height: 0;
  padding: 0;
  overflow: hidden;
  border: none;
}
.step.show-done.checked {
  max-height: 500px;
  padding: 0.4rem 0;
  opacity: 0.3;
  border-bottom: 1px solid var(--divider);
}
.step.checked .step-task { text-decoration: line-through; }

/* ===== NOTES (warn/tip) ===== */
.note {
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-top: 0.55rem;
  line-height: 1.4;
}
.note.warn {
  background: var(--danger-bg);
  border-left: 3px solid var(--danger-border);
  color: var(--danger-text);
}
.note.tip {
  background: var(--tip-bg);
  border-left: 3px solid var(--tip-border);
  color: var(--tip-text);
}

/* ===== MEAL COMPLETION STATES ===== */
.meal.meal-done {
  max-height: 0;
  padding: 0;
  margin: 0 0.75rem;
  overflow: hidden;
  border: none;
  box-shadow: none;
}
.meal.show-done.meal-done {
  max-height: 5000px;
  padding: 0.85rem;
  margin: 0.75rem;
  opacity: 0.3;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--divider);
}

.divider {
  height: 1px;
  background: var(--divider);
  margin: 0 0.75rem;
}
.divider.div-done { max-height: 0; overflow: hidden; }
.divider.show-done.div-done { max-height: 1px; }

/* ===== ALL DONE MESSAGE ===== */
.all-done {
  display: none;
  text-align: center;
  padding: 3rem 1.5rem;
}
.all-done.visible { display: block; }
.all-done .done-cross {
  font-size: 2.5rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
  text-shadow: 0 0 30px var(--gold-glow);
}
.all-done .done-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.3rem;
  letter-spacing: 0.05em;
}
.all-done .done-sub {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
}
.all-done .done-verse {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.75rem;
}

/* ===== BACK LINK (bottom of page) ===== */
.back {
  display: inline-block;
  padding: 0.8rem 0.75rem;
  font-size: 0.82rem;
  color: var(--gold-dim);
  text-decoration: none;
}

/* ===== SHOPPING PAGE SPECIFICS ===== */
.counter-bar {
  background: var(--bg);
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--divider);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  z-index: 9;
  gap: 0.5rem;
}

.counter {
  font-size: 0.82rem;
  color: var(--text-dim);
}
.counter strong { color: var(--gold); }

.category {
  padding: 0.55rem 1rem 0.25rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  background: var(--bg);
}
.category.cat-done { max-height: 0; padding: 0; overflow: hidden; }
.category.show-done.cat-done { max-height: 60px; padding: 0.55rem 1rem 0.25rem; opacity: 0.35; }

.item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--bg-card-solid);
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: all 0.3s;
}
.item.checked {
  opacity: 0.35;
  max-height: 0;
  padding: 0 1rem;
  margin: 0;
  overflow: hidden;
  border: none;
}
.item.show-done.checked {
  max-height: 200px;
  padding: 0.65rem 1rem;
  opacity: 0.35;
  border-bottom: 1px solid var(--divider);
}
.item.checked .item-name { text-decoration: line-through; }

.cb {
  width: 24px;
  height: 24px;
  border: 2px solid var(--divider);
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: all 0.15s;
}
.item.checked .cb { background: var(--check-bg); border-color: var(--check-bg); }
.cb::after { content: ''; display: none; }
.item.checked .cb::after { display: block; content: '\2713'; color: #fff; font-size: 14px; font-weight: 700; }

.item-content { flex: 1; min-width: 0; }
.item-name { font-size: 0.92rem; font-weight: 600; color: var(--text); }
.item-qty { font-size: 0.82rem; color: var(--text-dim); margin-top: 0.1rem; }
.item-brand { font-size: 0.76rem; color: var(--text-muted); margin-top: 0.12rem; font-style: italic; }

/* ===== HUB / INDEX PAGES ===== */
.hub-body { padding: 1.5rem 1rem; padding-top: 0; }

.hub-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  text-align: center;
  color: var(--gold);
  letter-spacing: 0.06em;
  margin-bottom: 0.2rem;
  margin-top: 1rem;
}

.hub-subtitle {
  text-align: center;
  font-family: var(--font-serif);
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 420px;
  margin: 0 auto;
}

a.card, .card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--bg-card-solid);
  border-radius: var(--radius);
  padding: 1rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--divider);
  border-left: 4px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s;
}
a.card:active { transform: scale(0.98); }

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.card-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-icon.emoji { font-size: 1.8rem; text-align: center; line-height: 48px; }

.card-text { flex: 1; }
.card-title { font-weight: 700; font-size: 1rem; margin-bottom: 0.12rem; color: var(--text); }
.card-desc { font-size: 0.78rem; color: var(--text-dim); }
.card-arrow { color: var(--text-muted); font-size: 1.2rem; }

.card.cycle { border-left-color: var(--sage); }
.card.holy { border-left-color: var(--gold); }
.card.easter { border-left-color: var(--purple); opacity: 0.5; cursor: default; }
.card.easter .card-arrow { visibility: hidden; }
.card.shopping { border-left-color: var(--gold); }
.card.day1 { border-left-color: var(--sage); }
.card.day2 { border-left-color: var(--terra); }
.card.day3 { border-left-color: var(--sage); }

.badge {
  display: inline-block;
  background: var(--gold-glow);
  color: var(--gold);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--divider);
}

.cross-footer {
  text-align: center;
  margin-top: 2rem;
  padding-bottom: 1rem;
  color: var(--gold-dim);
  font-size: 1.1rem;
}

/* ===== BACK HUB LINK (index pages) ===== */
.back-hub {
  padding: 0.5rem 0.75rem 0;
  font-size: 0.82rem;
}
.back-hub a {
  color: var(--gold-dim);
  text-decoration: none;
  font-weight: 500;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 380px) {
  header h1 { font-size: 1rem; }
  .meal-title { font-size: 0.95rem; }
}
