/* ============================================================
   foods.css — Enhanced food page styles for MacroLog pSEO
   ============================================================ */

/* --- Hero Macro Cards --- */
.food-macro-cards {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.food-macro-card {
  border-radius: 12px;
  padding: 14px 18px;
  text-align: center;
  min-width: 100px;
  flex: 1;
  max-width: 150px;
}

.food-macro-card .macro-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  display: block;
}

.food-macro-card .macro-unit {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.7;
}

.food-macro-card .macro-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
  display: block;
}

.food-macro-card.cal {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.food-macro-card.protein {
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: #155e75;
}

.food-macro-card.carbs {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.food-macro-card.fat {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* --- Health Score Badge --- */
.health-score-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.health-score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 6px 16px 6px 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #334155;
}

.health-score-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.health-score-circle.score-excellent { background: #16a34a; }
.health-score-circle.score-good { background: #0891b2; }
.health-score-circle.score-moderate { background: #d97706; }
.health-score-circle.score-poor { background: #dc2626; }

/* --- Diet Tags --- */
.diet-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.diet-tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  border: 1px solid;
}

.diet-tag.high-protein { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }
.diet-tag.low-carb { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.diet-tag.low-fat { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.diet-tag.high-fiber { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.diet-tag.keto { background: #fdf2f8; color: #be185d; border-color: #fbcfe8; }
.diet-tag.low-calorie { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.diet-tag.low-sodium { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

/* --- Enhanced Nutrition Table --- */
.nutrition-table {
  width: 100%;
  border-collapse: collapse;
}

.nutrition-table th {
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #94a3b8;
  text-align: left;
  padding: 8px 0;
  border-bottom: 2px solid #e2e8f0;
}

.nutrition-table th:last-child {
  text-align: right;
  width: 90px;
}

.nutrition-table td {
  padding: 9px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.95rem;
  color: #334155;
}

.nutrition-table td:first-child {
  font-weight: 500;
}

.nutrition-table td:nth-child(2) {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  text-align: right;
  padding-right: 16px;
  white-space: nowrap;
}

.nutrition-table td:last-child {
  text-align: right;
  width: 90px;
}

.nutrition-table tr.highlight td {
  font-weight: 600;
  font-size: 1rem;
  border-bottom: 2px solid #e2e8f0;
  padding: 12px 0;
}

.nutrition-table tr.sub td:first-child {
  padding-left: 20px;
  font-weight: 400;
  color: #64748b;
}

.nutrition-table tr.section-divider td {
  padding-top: 16px;
  border-bottom: 2px solid #e2e8f0;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #5A7061;
}

/* DV bar inside table */
.dv-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.dv-bar-track {
  width: 50px;
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
}

.dv-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: #5A7061;
  transition: width 0.3s ease;
  min-width: 0;
}

.dv-bar-fill.high { background: #dc2626; }
.dv-bar-fill.good { background: #16a34a; }
.dv-bar-fill.mid { background: #d97706; }

.dv-pct {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  color: #64748b;
  min-width: 32px;
  text-align: right;
}

/* --- Calorie Source Bar --- */
.calorie-source {
  margin: 24px 0 8px;
}

.calorie-source-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 8px;
}

.calorie-source-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: #f1f5f9;
}

.calorie-source-bar .seg-protein {
  background: #06b6d4;
}

.calorie-source-bar .seg-carbs {
  background: #f59e0b;
}

.calorie-source-bar .seg-fat {
  background: #ef4444;
}

.calorie-source-legend {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.calorie-source-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #475569;
}

.calorie-source-legend-item .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.calorie-source-legend-item .dot.protein { background: #06b6d4; }
.calorie-source-legend-item .dot.carbs { background: #f59e0b; }
.calorie-source-legend-item .dot.fat { background: #ef4444; }

.calorie-source-legend-item .legend-pct {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
}

/* --- Content Sections --- */
.food-content-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px;
}

.food-content-section h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 16px;
}

.food-content-section p {
  font-size: 1rem;
  line-height: 1.7;
  color: #334155;
  margin-bottom: 12px;
}

/* --- Responsive --- */
@media (max-width: 520px) {
  .food-macro-cards {
    gap: 8px;
  }
  .food-macro-card {
    min-width: 70px;
    padding: 10px 8px;
  }
  .food-macro-card .macro-value {
    font-size: 1.25rem;
  }
  .food-macro-card .macro-label {
    font-size: 0.65rem;
    letter-spacing: 0.5px;
  }
  .health-score-row {
    gap: 10px;
  }
  .dv-bar-track {
    width: 36px;
  }
  .nutrition-table td:nth-child(2) {
    padding-right: 8px;
  }
}
