/* aqi-widget.css - Calidad del aire en Houston | Clínica Hispana América
   Usa las variables del sitio (--elite-navy, --elite-gold, --font-heading, --font-body);
   si no existen, usa los mismos valores como respaldo.
   Colores AQI: estándar EPA (Technical Assistance Document, Tabla 2). No modificar. */

.aqi-widget {
  --aqi-navy: var(--elite-navy, #0a192f);
  --aqi-gold: var(--elite-gold, #725a2f);
  --aqi-text: var(--elite-text, #1e293b);
  --aqi-muted: #475569;
  --aqi-line: rgba(139, 110, 59, 0.2);
  --aqi-heading: var(--font-heading, 'Playfair Display', serif);
  --aqi-body: var(--font-body, 'Montserrat', sans-serif);
  display: block;
  max-width: 920px;
  margin: 0 auto;
  font-family: var(--aqi-body);
  color: var(--aqi-text);
  line-height: 1.55;
  text-align: left;
}
.aqi-widget *, .aqi-widget *::before, .aqi-widget *::after { box-sizing: border-box; }

/* Colores de categoría (RGB EPA): good 0,228,0 | moderate 255,255,0 | usg 255,126,0 |
   unhealthy 255,0,0 | very unhealthy 143,63,151 | hazardous 126,0,35 */
.aqi-widget { --aqi-c: #d8dee6; --aqi-on: var(--aqi-navy); }
.aqi-widget[data-cat="good"]           { --aqi-c: #00e400; --aqi-on: #0a192f; }
.aqi-widget[data-cat="moderate"]       { --aqi-c: #ffff00; --aqi-on: #0a192f; }
.aqi-widget[data-cat="usg"]            { --aqi-c: #ff7e00; --aqi-on: #0a192f; }
.aqi-widget[data-cat="unhealthy"]      { --aqi-c: #ff0000; --aqi-on: #ffffff; }
.aqi-widget[data-cat="very_unhealthy"] { --aqi-c: #8f3f97; --aqi-on: #ffffff; }
.aqi-widget[data-cat="hazardous"]      { --aqi-c: #7e0023; --aqi-on: #ffffff; }

.aqi-card {
  background: #fff;
  border: 1px solid var(--aqi-line);
  border-top: 8px solid var(--aqi-c);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
  padding: 32px;
}

.aqi-example {
  background: #fff7e0;
  border: 2px dashed var(--aqi-gold);
  color: #5b4520;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 700;
}

.aqi-eyebrow {
  display: block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--aqi-gold);
  margin-bottom: 6px;
}
.aqi-title {
  font-family: var(--aqi-heading);
  color: var(--aqi-navy);
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 22px;
}

.aqi-main { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.aqi-gauge {
  flex: 0 0 auto;
  width: 148px; height: 148px;
  border-radius: 50%;
  background: var(--aqi-c);
  color: var(--aqi-on);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.35), 0 8px 20px rgba(0, 0, 0, 0.12);
}
.aqi-gauge-num { font-size: 52px; font-weight: 800; line-height: 1; }
.aqi-gauge-lbl { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; margin-top: 4px; }
.aqi-gauge.is-empty .aqi-gauge-num { font-size: 40px; }

.aqi-summary { flex: 1 1 260px; min-width: 0; }
.aqi-level {
  font-family: var(--aqi-heading);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700; font-style: italic;
  color: var(--aqi-navy);
  line-height: 1.15;
  margin: 0 0 8px;
}
.aqi-line { margin: 0 0 4px; font-size: 16px; color: var(--aqi-text); }
.aqi-line strong { color: var(--aqi-navy); }
.aqi-time { margin: 0; font-size: 14px; color: var(--aqi-muted); }

/* Barra de escala (decorativa) */
.aqi-scale { position: relative; margin: 26px 0 8px; padding-top: 14px; }
.aqi-scale-bar {
  display: flex; height: 12px; border-radius: 8px; overflow: hidden;
}
.aqi-scale-bar span { flex: 1 1 0; }
.aqi-scale-bar span:nth-child(1) { background: #00e400; }
.aqi-scale-bar span:nth-child(2) { background: #ffff00; }
.aqi-scale-bar span:nth-child(3) { background: #ff7e00; }
.aqi-scale-bar span:nth-child(4) { background: #ff0000; }
.aqi-scale-bar span:nth-child(5) { background: #8f3f97; }
.aqi-scale-bar span:nth-child(6) { background: #7e0023; }
.aqi-marker {
  position: absolute; top: 0; left: 0;
  width: 0; height: 0;
  border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-top: 12px solid var(--aqi-navy);
  transform: translateX(-8px);
}
.aqi-scale-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--aqi-muted); margin-top: 6px; }

/* Aviso de datos desactualizados */
.aqi-alert {
  margin: 18px 0 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: #fff4e5; border: 1px solid #f5c27a; color: #6b3d00;
  font-size: 14px; font-weight: 600;
}

.aqi-tip {
  margin: 24px 0 0;
  padding: 18px 20px;
  background: #f8fafc;
  border-left: 6px solid var(--aqi-c);
  border-radius: 0 14px 14px 0;
}
.aqi-tip-title { font-weight: 700; color: var(--aqi-navy); margin: 0 0 4px; font-size: 15px; }
.aqi-tip-text { margin: 0; font-size: 16px; }
.aqi-tip-src { margin: 8px 0 0; font-size: 12px; color: var(--aqi-muted); }
.aqi-tip-src a { color: var(--aqi-navy); font-weight: 600; text-underline-offset: 2px; }

.aqi-forecast { margin: 26px 0 0; }
.aqi-sub { font-family: var(--aqi-heading); color: var(--aqi-navy); font-size: 20px; margin: 0 0 12px; font-weight: 700; }
.aqi-fc-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.aqi-fc-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--aqi-line); border-radius: 14px; background: #fff;
}
.aqi-dot {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; margin-top: 3px;
  border: 2px solid rgba(10, 25, 47, 0.35);
}
.aqi-fc-day { font-weight: 700; color: var(--aqi-navy); display: block; text-transform: capitalize; }
.aqi-fc-cat { display: block; font-size: 15px; }
.aqi-fc-extra { display: block; font-size: 13px; color: var(--aqi-muted); }
.aqi-fc-note { font-size: 13px; color: #6b3d00; margin: 10px 0 0; }

.aqi-actions { margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.aqi-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 13px 28px; border-radius: 30px;
  font-family: var(--aqi-heading); font-weight: 700; font-size: 16px;
  text-decoration: none; cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
}
.aqi-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12); }
.aqi-btn-wa { background: linear-gradient(135deg, #25d366 0%, #128c7e 100%); color: #fff; border: 2px solid rgba(255, 255, 255, 0.2); }
.aqi-btn-wa:hover { color: #fff; }
.aqi-btn-call { background: #e8e3d9; color: #2f4f4f; border: 2px solid transparent; }
.aqi-btn-call:hover { background: #fff; border-color: #e8e3d9; }
.aqi-btn:focus-visible, .aqi-widget a:focus-visible {
  outline: 3px solid #0ea5e9; outline-offset: 3px;
}
.aqi-urgent { flex: 1 1 100%; margin: 4px 0 0; font-size: 14px; color: var(--aqi-muted); }

.aqi-foot {
  margin: 26px 0 0; padding-top: 16px;
  border-top: 1px solid var(--aqi-line);
  font-size: 13px; color: var(--aqi-muted);
}
.aqi-foot p { margin: 0 0 6px; }
.aqi-foot a { color: var(--aqi-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.aqi-foot a:hover { color: var(--aqi-gold); }

.aqi-status { text-align: center; padding: 24px 12px; font-size: 16px; color: var(--aqi-muted); }
.aqi-status a { color: var(--aqi-navy); font-weight: 700; }

/* Versión compacta (para la página de inicio u otras): data-variant="compact" */
.aqi-widget[data-variant="compact"] .aqi-card { padding: 20px 22px; border-radius: 18px; }
.aqi-widget[data-variant="compact"] .aqi-title { font-size: 20px; margin-bottom: 14px; }
.aqi-widget[data-variant="compact"] .aqi-gauge { width: 96px; height: 96px; }
.aqi-widget[data-variant="compact"] .aqi-gauge-num { font-size: 34px; }
.aqi-widget[data-variant="compact"] .aqi-gauge-lbl { font-size: 11px; }
.aqi-widget[data-variant="compact"] .aqi-level { font-size: 24px; }
.aqi-widget[data-variant="compact"] .aqi-main { gap: 18px; }
.aqi-widget[data-variant="compact"] .aqi-tip { margin-top: 16px; padding: 12px 16px; }
.aqi-widget[data-variant="compact"] .aqi-tip-text { font-size: 15px; }
.aqi-more { margin: 14px 0 0; font-size: 15px; font-weight: 700; }
.aqi-more a { color: var(--aqi-navy); text-underline-offset: 3px; }

@media (max-width: 600px) {
  .aqi-card { padding: 22px 18px; border-radius: 18px; }
  .aqi-main { gap: 18px; justify-content: center; text-align: center; }
  .aqi-gauge { width: 128px; height: 128px; }
  .aqi-gauge-num { font-size: 44px; }
  .aqi-btn { width: 100%; }
  .aqi-tip { border-radius: 0 12px 12px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .aqi-btn, .aqi-btn:hover { transition: none; transform: none; }
}
@media print { .aqi-actions { display: none; } }

/* ---------- Tabla de niveles (página completa) ---------- */
.aqi-levels { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; background: #fff; border: 1px solid var(--aqi-line, rgba(139,110,59,.2)); border-radius: 16px; overflow: hidden; }
.aqi-levels caption { text-align: left; padding: 0 0 12px; font-size: 14px; color: #475569; caption-side: bottom; padding-top: 12px; }
.aqi-levels th, .aqi-levels td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(139,110,59,.15); }
.aqi-levels thead th { background: #0a192f; color: #fff; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.aqi-levels tbody tr:last-child th, .aqi-levels tbody tr:last-child td { border-bottom: 0; }
.aqi-levels tbody th { font-weight: 700; color: #0a192f; white-space: nowrap; }
.aqi-chip { display: inline-block; width: 16px; height: 16px; border-radius: 50%; margin-right: 10px; vertical-align: -2px; border: 2px solid rgba(10,25,47,.35); }
.aqi-levels-note { font-size: 14px; color: #475569; margin: 14px 0 0; }
@media (max-width: 760px) {
  .aqi-levels thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .aqi-levels, .aqi-levels tbody, .aqi-levels tr, .aqi-levels th, .aqi-levels td { display: block; width: 100%; }
  .aqi-levels tbody tr { border-bottom: 1px solid rgba(139,110,59,.25); padding: 6px 0; }
  .aqi-levels tbody tr:last-child { border-bottom: 0; }
  .aqi-levels th, .aqi-levels td { border: 0; padding: 6px 16px; }
  .aqi-levels td[data-label]::before { content: attr(data-label) ": "; font-weight: 700; color: #0a192f; }
}

/* ---------- Página calidad-del-aire-houston.html ---------- */
.aqi-page-hero { min-height: 0 !important; padding: 150px 0 70px !important; text-align: center; }
.aqi-page-hero h1 { font-family: var(--font-heading, 'Playfair Display', serif); color: #fff; font-size: clamp(32px, 5vw, 52px); line-height: 1.2; font-weight: 400; margin: 0 auto 18px; max-width: 820px; }
.aqi-page-hero p { font-size: 18px; line-height: 1.6; opacity: .92; max-width: 680px; margin: 0 auto 28px; }
.aqi-page-sec { padding: 64px 0; }
.aqi-page-sec.alt { background: var(--elite-white, #F0EEE9); }
.aqi-page-sec .container { max-width: 1000px; }
.aqi-page-head { text-align: center; margin-bottom: 32px; }
.aqi-page-head .bar { margin-bottom: 20px; }
.aqi-prose { max-width: 800px; margin: 0 auto; color: #334155; font-size: 17px; line-height: 1.7; }
.aqi-prose p { margin: 0 0 14px; }
.aqi-faq details { background: #fff; border: 1px solid rgba(139,110,59,.2); border-radius: 14px; padding: 4px 20px; margin: 0 0 12px; }
.aqi-faq summary { cursor: pointer; font-weight: 700; color: #0a192f; padding: 14px 0; font-size: 17px; }
.aqi-faq details[open] summary { border-bottom: 1px solid rgba(139,110,59,.15); margin-bottom: 12px; }
.aqi-faq p { margin: 0 0 14px; color: #334155; line-height: 1.65; }
.aqi-faq summary:focus-visible { outline: 3px solid #0ea5e9; outline-offset: 3px; border-radius: 6px; }
.aqi-sources { padding-left: 20px; color: #334155; line-height: 1.8; }
.aqi-sources a { color: #0a192f; font-weight: 600; text-underline-offset: 3px; }
.aqi-cta { text-align: center; }
.aqi-cta .btn-sage-light, .aqi-cta .btn-sage-border { margin: 6px; }
.aqi-cta-box { background: #2F4F4F; color: #fff; border-radius: 24px; padding: 44px 28px; }
.aqi-cta-box h2 { font-family: var(--font-heading, 'Playfair Display', serif); color: #fff; font-size: clamp(26px, 4vw, 36px); font-weight: 400; margin: 0 0 12px; }
.aqi-cta-box p { max-width: 640px; margin: 0 auto 24px; opacity: .92; line-height: 1.6; }
@media (min-width: 761px) {
  .aqi-levels { table-layout: fixed; }
  .aqi-levels th:nth-child(1) { width: 21%; white-space: normal; }
  .aqi-levels th:nth-child(2) { width: 11%; }
  .aqi-levels th:nth-child(3) { width: 27%; }
  .aqi-levels th:nth-child(4) { width: 41%; }
  .aqi-levels td:nth-child(2) { white-space: nowrap; }
}
