/* ============================================================
   Blog — Estilos compartidos
   Importar en cada artículo: <link rel="stylesheet" href="/blog/blog.css">
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --cream: #F5F2EE;
  --white: #FFFFFF;
  --dark: #111111;
  --mid: #888888;
  --light: #E8E4DE;
  --green: #22c55e;
  --green-d: #16a34a;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'DM Sans', sans-serif;
}
html { scroll-behavior: smooth; }
body { font-family: var(--sans); background: var(--cream); color: var(--dark); }

/* ── Nav ─────────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 16px 40px;
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(245,242,238,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--light);
}
.nav-logo { font-family: var(--serif); font-size: 20px; color: var(--green); text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 24px; list-style: none; }
.nav-links a { font-size: 13px; color: var(--mid); text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: var(--dark); }
.nav-cta { background: var(--dark) !important; color: white !important; padding: 8px 18px; border-radius: 100px; font-weight: 500 !important; }
@media (max-width: 640px) { nav { padding: 14px 20px; } .nav-links { display: none; } }

/* ── Article layout ──────────────────────────────────────── */
.article-wrap { max-width: 680px; margin: 0 auto; padding: 120px 24px 80px; }

.article-meta {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap;
}
.meta-tag { background: var(--white); border: 1px solid var(--light); border-radius: 100px; padding: 4px 12px; font-size: 11px; color: var(--mid); }
.meta-date { font-size: 12px; color: var(--mid); }
.meta-read { font-size: 12px; color: var(--mid); }

.article-title { font-family: var(--serif); font-size: clamp(32px, 5vw, 52px); line-height: 1.1; margin-bottom: 20px; }
.article-title em { font-style: italic; color: var(--green); }

.article-lead {
  font-size: 18px; color: var(--mid); line-height: 1.7; font-weight: 300;
  margin-bottom: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--light);
}

/* ── Article body ────────────────────────────────────────── */
.article-body { font-size: 16px; line-height: 1.8; color: #333; }
.article-body h2 { font-family: var(--serif); font-size: 28px; color: var(--dark); margin: 48px 0 16px; line-height: 1.2; }
.article-body h3 { font-family: var(--serif); font-size: 22px; color: var(--dark); margin: 36px 0 12px; }
.article-body p { margin-bottom: 20px; }
.article-body strong { color: var(--dark); font-weight: 600; }
.article-body ul { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.article-body ul li { padding-left: 20px; position: relative; }
.article-body ul li::before { content: '\2192'; position: absolute; left: 0; color: var(--green); font-size: 14px; }

/* ── Components ──────────────────────────────────────────── */
.callout {
  background: var(--white); border-left: 3px solid var(--green);
  border-radius: 0 12px 12px 0; padding: 20px 24px; margin: 32px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.callout p { margin: 0; font-size: 15px; color: var(--dark); font-style: italic; }

.method-box {
  background: var(--dark); border-radius: 16px; padding: 28px; margin: 32px 0; color: white;
}
.method-box h4 { font-family: var(--serif); font-size: 18px; margin-bottom: 16px; }
.method-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid #222; }
.method-row:last-child { border: none; padding-bottom: 0; }
.method-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.method-text strong { display: block; font-size: 14px; font-weight: 500; color: white; margin-bottom: 3px; }
.method-text span { font-size: 12px; color: #666; line-height: 1.5; }
.method-badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 100px; margin-left: 6px; vertical-align: middle; }
.badge-green { background: var(--green); color: white; }
.badge-mid { background: #333; color: #888; }

.tip-box {
  background: var(--white); border-radius: 14px; padding: 20px 24px; margin: 32px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-top: 2px solid var(--green);
}
.tip-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--green); font-weight: 600; margin-bottom: 10px; }
.tip-box p { margin: 0; font-size: 14px; color: var(--mid); line-height: 1.65; }

/* ── Nutrition table (for dish articles) ─────────────────── */
.nutrition-table {
  width: 100%; border-collapse: collapse; margin: 24px 0;
  font-size: 14px; background: var(--white); border-radius: 12px;
  overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.nutrition-table th {
  text-align: left; padding: 12px 16px; font-size: 11px;
  text-transform: uppercase; letter-spacing: .08em; color: var(--mid);
  border-bottom: 1px solid var(--light); background: var(--cream);
}
.nutrition-table td {
  padding: 10px 16px; border-bottom: 1px solid var(--light);
}
.nutrition-table tr:last-child td { border-bottom: none; }
.nutrition-table .nt-highlight { font-weight: 600; color: var(--dark); }

/* Wrapper para tablas que deben hacer scroll horizontal en mobile.
   Uso: <div class="table-scroll"><table class="nutrition-table">...</table></div> */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.table-scroll .nutrition-table {
  margin: 0;
  min-width: 560px;
  box-shadow: none;
}
.table-scroll::-webkit-scrollbar { height: 6px; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--light); border-radius: 3px; }

/* ── Quick stat callout (for dish articles) ──────────────── */
.quick-stat {
  background: var(--dark); border-radius: 16px; padding: 28px; margin: 32px 0;
  text-align: center; color: white;
}
.quick-stat .qs-number {
  font-family: var(--serif); font-size: 48px; line-height: 1;
  margin-bottom: 4px;
}
.quick-stat .qs-unit { font-size: 14px; color: var(--green); margin-bottom: 12px; }
.quick-stat .qs-range { font-size: 13px; color: #888; }
.quick-stat .qs-source { font-size: 11px; color: #555; margin-top: 8px; }

/* ── CTA ─────────────────────────────────────────────────── */
.article-cta {
  background: var(--dark); border-radius: 20px; padding: 36px 32px; text-align: center; margin: 48px 0;
}
.article-cta h3 { font-family: var(--serif); font-size: 24px; color: white; margin-bottom: 10px; }
.article-cta p { font-size: 14px; color: #888; margin-bottom: 24px; line-height: 1.6; }
.article-cta a { display: inline-block; background: var(--green); color: white; padding: 13px 28px; border-radius: 100px; font-family: var(--sans); font-size: 14px; font-weight: 500; text-decoration: none; transition: background 0.2s; }
.article-cta a:hover { background: var(--green-d); }

/* ── Author ──────────────────────────────────────────────── */
.article-author { display: flex; align-items: center; gap: 16px; padding: 32px 0; border-top: 1px solid var(--light); margin-top: 48px; }
.author-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--dark); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 20px; color: var(--green); flex-shrink: 0; }
.author-name { font-size: 14px; font-weight: 500; margin-bottom: 3px; }
.author-bio { font-size: 13px; color: var(--mid); }

/* ── Related articles ────────────────────────────────────── */
.related { padding: 48px 0 0; border-top: 1px solid var(--light); }
.related-label { font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--mid); margin-bottom: 20px; }
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.related-card { background: var(--white); border-radius: 14px; padding: 20px; text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: transform 0.2s; }
.related-card:hover { transform: translateY(-2px); }
.related-tag { font-size: 10px; color: var(--mid); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.related-title { font-family: var(--serif); font-size: 17px; color: var(--dark); line-height: 1.3; }
@media (max-width: 480px) { .related-grid { grid-template-columns: 1fr; } }

/* ── Footer ──────────────────────────────────────────────── */
footer { background: var(--dark); border-top: 1px solid #1e1e1e; padding: 28px 40px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 80px; }
.f-logo { font-family: var(--serif); font-size: 18px; color: var(--green); text-decoration: none; }
.f-links { display: flex; gap: 24px; list-style: none; }
.f-links a { font-size: 12px; color: #555; text-decoration: none; }
.f-copy { font-size: 12px; color: #444; }

/* ── Comparison table (for review articles) ──────────────── */
.compare-table {
  width: 100%; border-collapse: collapse; margin: 24px 0;
  font-size: 13px; background: var(--white); border-radius: 12px;
  overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.compare-table th {
  text-align: left; padding: 12px 14px; font-size: 11px;
  text-transform: uppercase; letter-spacing: .06em; color: var(--mid);
  border-bottom: 1px solid var(--light); background: var(--cream);
}
.compare-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--light); vertical-align: top;
}
.compare-table tr:last-child td { border-bottom: none; }

/* ── Situation cards (for dish articles) ─────────────────── */
.situation-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 32px 0 18px;
}
.sit-card {
  background: var(--white);
  border: 1px solid var(--light);
  border-radius: 14px;
  padding: 20px 16px 18px;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.sit-card:hover {
  transform: translateY(-2px);
  border-color: var(--green);
  box-shadow: 0 6px 20px -8px rgba(31,26,18,0.12);
}
.sit-card-icon {
  font-size: 28px; line-height: 1; margin-bottom: 10px;
}
.sit-card-label {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 600; color: var(--mid); margin-bottom: 8px;
}
.sit-card-value {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 42px; line-height: 1; color: var(--dark);
  margin-bottom: 2px; letter-spacing: -0.01em;
}
.sit-card-value-unit {
  display: inline-block; font-family: var(--sans); font-style: normal;
  font-size: 14px; color: var(--mid); margin-left: 3px; font-weight: 400;
  letter-spacing: 0;
}
.sit-card-portion {
  font-size: 12px; color: var(--mid); margin-bottom: 12px;
}
.sit-card-meta {
  font-size: 11px; color: var(--mid);
  border-top: 1px solid var(--light); padding-top: 10px; margin-top: 4px;
  line-height: 1.4;
}
@media (max-width: 700px) {
  .situation-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sit-card { padding: 16px 12px 14px; }
  .sit-card-icon { font-size: 24px; margin-bottom: 8px; }
  .sit-card-value { font-size: 36px; }
  .sit-card-value-unit { font-size: 12px; }
  .sit-card-meta { font-size: 10px; padding-top: 8px; }
}
@media (max-width: 380px) {
  .situation-grid { grid-template-columns: 1fr; }
}

/* ── Range visualization (for dish articles) ─────────────── */
.range-viz {
  background: var(--white); border: 1px solid var(--light);
  border-radius: 14px; padding: 22px 24px; margin: 8px 0 32px;
}
.range-viz-title {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.range-viz-title-text { font-size: 13px; font-weight: 500; color: var(--dark); }
.range-viz-title-spread {
  font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--green-d);
}
.range-bar { position: relative; height: 38px; margin: 18px 0 8px; }
.range-bar-track {
  position: absolute; top: 16px; left: 0; right: 0; height: 6px;
  background: linear-gradient(to right, #bbf7d0 0%, #22c55e 50%, #facc15 75%, #f97316 100%);
  border-radius: 999px;
}
.range-bar-marker {
  position: absolute; top: 6px; width: 26px; height: 26px;
  border-radius: 50%; background: var(--dark); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-style: italic; font-size: 13px;
  transform: translateX(-50%); border: 2px solid var(--white);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.range-bar-marker.active {
  background: var(--green); width: 32px; height: 32px; top: 3px; font-size: 14px;
}
.range-bar-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--mid); margin-top: 6px;
}
.range-bar-labels span { text-align: center; flex: 1; }
.range-viz-note {
  font-size: 13px; color: var(--mid); font-style: italic;
  margin-top: 12px; line-height: 1.5;
}

/* ── Warning box ─────────────────────────────────────────── */
.warn-box {
  background: #fef3c7; border: 1px solid #fcd34d;
  border-radius: 10px; padding: 14px 18px; margin: 22px 0;
  color: #854d0e;
}
.warn-box p { color: #854d0e; margin: 0; font-size: 14px; }

/* ── Nutrition table modifiers (extend existing .nutrition-table) ── */
.nutrition-table .nt-muted { color: var(--mid); font-size: 12px; font-weight: 400; }
.nutrition-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.nutrition-table .nt-row-total { background: var(--cream); }
.nutrition-table .nt-row-total td { font-weight: 500; color: var(--dark); }
.nutrition-table .nt-bar { background: rgba(220,252,231,0.4); }

/* ── MFP comparison row colors (used inside .nutrition-table) ───── */
.mfp-bad { color: #b91c1c; font-weight: 600; }
.mfp-warn { color: #854d0e; }
.mfp-ok { color: var(--green-d); font-weight: 500; }
.nutrition-table .mfp-final { background: #dcfce7; }
.nutrition-table .mfp-final td { color: #166534; font-weight: 500; }

/* ── Disclaimer block (legal/sources) ────────────────────── */
.disclaimer {
  font-size: 12px; color: var(--mid); font-style: italic;
  margin: 24px 0; padding: 14px 0;
  border-top: 1px solid var(--light); border-bottom: 1px solid var(--light);
  line-height: 1.6;
}
