/* ===== CSS Custom Properties ===== */
:root {
  --color-mauve: #b08699;
  --color-tan: #d99e73;
  --color-mint: #b5ffc2;
  --color-mauve-light: #d4b5c5;
  --color-tan-light: #f0d4b0;
  --color-mint-light: #e0ffe7;
  --color-text: #2a2a2a;
  --color-text-muted: #666;
  --color-bg: #cce8d2;
  --font-main: 'Geom', system-ui, sans-serif;
  color-scheme: light;
}

/* ===== Global Overrides ===== */
body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-main);
}

/* ===== Header & Navigation ===== */
header {
  background: var(--color-mauve);
  color: white;
  padding: 1rem 1.5rem;
  margin: 0 -1.5rem;
  margin-bottom: 2rem;
  border-bottom: 3px solid var(--color-tan);
}

header h1 {
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
}

header h1 a {
  color: white;
  text-decoration: none;
}

header h1 a:hover {
  text-decoration: none;
  opacity: 0.9;
}

header .site-desc {
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.main-nav a:hover,
.main-nav a.active {
  color: white;
  border-bottom-color: var(--color-mint);
}

/* ===== Home Page ===== */
.home-hero {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}

.home-hero h2 {
  font-size: 2.2rem;
  color: var(--color-mauve);
  margin-bottom: 0.5rem;
}

.home-subtitle {
  color: var(--color-text-muted);
  font-size: 1.1rem;
}

.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.home-card {
  background: var(--color-mint-light);
  border: 2px solid var(--color-mint);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.home-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--color-tan);
  text-decoration: none;
}

.home-card h3 {
  margin: 0;
  color: var(--color-mauve);
  font-size: 1.2rem;
}

.home-card p {
  margin: 0.5rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ===== Page Headers ===== */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header h2 {
  color: var(--color-mauve);
  border-bottom: 3px solid var(--color-tan);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--color-text-muted);
  margin-top: 0;
}

/* ===== Shopping List ===== */
.shopping-controls {
  margin-bottom: 1.5rem;
}

.btn-reset {
  background: var(--color-tan);
  color: white;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-main);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s;
}

.btn-reset:hover {
  background: #c48a5f;
}

.shopping-category {
  margin-bottom: 2rem;
}

.category-heading {
  background: var(--color-mauve);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px 4px 0 0;
  margin: 0;
  font-size: 1.05rem;
}

.shopping-table {
  width: 100%;
  border-collapse: collapse;
}

.shopping-table th {
  background: var(--color-tan-light);
  text-align: left;
  padding: 0.5rem 0.6rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--color-tan);
}

.shopping-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: top;
}

.shopping-table tr:nth-child(even) {
  background: var(--color-mint-light);
}

.shopping-table tr.checked td {
  text-decoration: line-through;
  opacity: 0.5;
}

.shopping-checkbox {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--color-mauve);
  cursor: pointer;
}

.col-check {
  width: 2.5rem;
  text-align: center;
}

.options-list {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.options-note {
  font-size: 0.8rem;
  color: var(--color-tan);
}

/* ===== Daily Meals / Tracker ===== */
.daily-meals-intro {
  margin-bottom: 1.5rem;
  color: var(--color-text-muted);
}

.tracker-controls {
  margin-bottom: 1.5rem;
}

.daily-meals-table {
  width: 100%;
  border-collapse: collapse;
}

.daily-meals-table th {
  background: var(--color-tan);
  color: white;
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.daily-meals-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #e0e0e0;
}

.daily-meals-table tr:nth-child(even) {
  background: var(--color-mint-light);
}

.prep-note {
  font-style: italic;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.consumed-input {
  width: 5rem;
  padding: 0.3rem 0.4rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  text-align: right;
}

.consumed-input:focus {
  outline: none;
  border-color: var(--color-tan);
  box-shadow: 0 0 0 2px rgba(217, 158, 115, 0.3);
}

.remaining-positive {
  color: #2e7d32;
  font-weight: 500;
}

.remaining-zero {
  color: var(--color-text-muted);
  font-weight: 500;
}

.remaining-negative {
  color: #c62828;
  font-weight: 600;
}

/* ===== Reference Tables ===== */
.ref-section {
  margin-bottom: 2.5rem;
}

.ref-section h3 {
  color: var(--color-mauve);
  border-left: 4px solid var(--color-tan);
  padding-left: 0.75rem;
  margin-bottom: 1rem;
}

.table-scroll {
  overflow-x: auto;
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ref-table th {
  background: var(--color-mauve);
  color: white;
  padding: 0.5rem 0.6rem;
  text-align: left;
  white-space: nowrap;
  font-size: 0.85rem;
}

.ref-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #e0e0e0;
}

.ref-table tr:nth-child(even) {
  background: var(--color-mint-light);
}

/* ===== Footer ===== */
footer {
  border-top: 2px solid var(--color-mauve-light);
  padding-top: 1rem;
  margin-top: 3rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  body {
    padding: 0 1rem;
  }

  header {
    margin: 0 -1rem;
    padding: 1rem;
  }

  .home-hero h2 {
    font-size: 1.6rem;
  }

  .home-cards {
    grid-template-columns: 1fr;
  }

  .main-nav {
    gap: 0.75rem;
  }

  .shopping-table,
  .daily-meals-table,
  .ref-table {
    font-size: 0.85rem;
  }

  .shopping-table th,
  .shopping-table td {
    padding: 0.4rem;
  }
}
