/* Mundo Alergia — artículos (listado + detalle) */

/* Evitar scroll horizontal en toda la página */
html,
body {
  overflow-x: clip;
  max-width: 100%;
}

/* Grid: min-width:0 permite que columnas se encojan */
.article-layout {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.article-body,
.sidebar,
.article-hero,
.hero-content {
  min-width: 0;
  max-width: 100%;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body p,
.article-hero h1,
.callout p,
.toc a {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Tablas: scroll solo dentro del bloque, no en la página */
.table-scroll,
.cal-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin: 1.5rem 0;
}

.level-table,
.comp-table,
.freq-table {
  width: 100%;
  min-width: 520px;
}

/* Calendario de pólenes */
.cal-chart {
  display: grid;
  grid-template-columns: 5.5rem repeat(12, minmax(0, 1fr));
  gap: 3px;
  align-items: center;
  font-size: 0.68rem;
  min-width: 520px;
}

.cal-chart .cal-month {
  text-align: center;
}

.cal-chart .cal-plant-label {
  font-weight: 600;
  color: var(--carbon);
  font-size: 0.68rem;
  padding-right: 0.25rem;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-top: 0.65rem;
  font-size: 0.65rem;
  color: var(--carbon-suave);
}

.cal-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 8px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 4px;
}

.cal-legend-swatch--active { background: var(--mostaza); }
.cal-legend-swatch--peak { background: #A84B2A; }

.table-scroll .level-table,
.table-scroll .comp-table,
.table-scroll .freq-table {
  margin: 0;
}

.cal-bar {
  height: 8px;
  border-radius: 2px;
}

.b-active { background: var(--mostaza); }
.b-peak { background: #A84B2A; }
.b-none { background: var(--borde); }

@media (max-width: 768px) {
  .logo {
    max-width: calc(100vw - 4.75rem);
  }
  .article-hero {
    height: auto;
    min-height: 240px;
    max-height: 320px;
  }

  .hero-content {
    padding: 1.25rem 1.25rem 1.5rem;
  }

  .article-hero h1 {
    font-size: clamp(1.35rem, 6.5vw, 1.85rem);
    line-height: 1.2;
  }

  .article-cat {
    font-size: 0.55rem;
    padding: 3px 10px;
    margin-bottom: 10px;
  }

  .article-meta {
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin-top: 12px;
  }

  .article-meta span {
    font-size: 0.62rem;
  }

  .breadcrumb {
    flex-wrap: wrap;
    row-gap: 4px;
    font-size: 0.58rem;
  }

  .article-layout {
    padding: 2rem 1.25rem 3rem;
    gap: 2rem;
  }

  .article-body h2 {
    font-size: 1.35rem;
    margin: 1.75rem 0 0.65rem;
  }

  .article-body h3 {
    font-size: 1.05rem;
    margin: 1.25rem 0 0.5rem;
  }

  .article-body p {
    font-size: 0.88rem;
    line-height: 1.75;
  }

  .toc {
    padding: 1rem 1.1rem;
    margin-bottom: 1.5rem;
  }

  .callout {
    padding: 1rem 1rem 0.85rem;
    margin: 1.25rem 0;
  }

  .level-table,
  .comp-table,
  .freq-table {
    font-size: 0.72rem;
    min-width: 480px;
  }

  .level-table th,
  .level-table td,
  .comp-table th,
  .comp-table td,
  .freq-table th,
  .freq-table td {
    padding: 0.65rem 0.75rem;
  }

  .cal-chart {
    min-width: 480px;
    grid-template-columns: 4.5rem repeat(12, minmax(0, 1fr));
    font-size: 0.62rem;
  }

  .cal-month {
    font-size: 0.45rem;
    padding: 2px 0;
  }

  .error-card {
    padding: 1.25rem 1rem 1rem;
    margin: 1.25rem 0;
  }

  .error-num {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    top: -12px;
    left: 16px;
  }

  .formula-box {
    padding: 1rem 1.1rem;
  }

  .formula-box .formula {
    font-size: 1.25rem;
  }

  .stat-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-num {
    font-size: 1.75rem;
  }

  .step {
    gap: 12px;
    margin-bottom: 1.25rem;
  }

  .step-num {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .step-title {
    font-size: 1.05rem;
  }

  .tipos-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tipo-card {
    padding: 1rem;
  }

  .step-item {
    gap: 12px;
  }

  .sidebar-card {
    padding: 1.25rem;
  }

  /* Listado */
  .page-header {
    padding: 2.25rem 1.25rem 2rem;
  }

  .page-header p {
    font-size: 0.85rem;
  }

  .filtros {
    padding: 0 1rem;
    gap: 4px;
  }

  .filtro-btn {
    font-size: 0.6rem;
    padding: 14px 2px;
  }

  .articulos-section {
    padding: 2rem 1.25rem 3.5rem;
  }

  .featured-row {
    margin-bottom: 1rem;
  }

  .grid {
    gap: 1rem;
  }

  .card.featured .card-img {
    height: 200px;
  }

  .card:not(.featured) .card-img {
    height: 170px;
  }

  .card.featured .card-title {
    font-size: 1.2rem;
  }

  .card:not(.featured) .card-title {
    font-size: 1rem;
  }

  .card-body {
    padding: 1.1rem 1rem 0.9rem;
  }

  .card-excerpt {
    font-size: 0.76rem;
    -webkit-line-clamp: 4;
  }

  .card-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem 1.25rem;
    gap: 1rem;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .article-hero {
    min-height: 220px;
    max-height: 280px;
  }

  .article-layout {
    padding-inline: 1rem;
  }

  .articulos-section {
    padding-inline: 1rem;
  }
}
