/* ==========================================================================
   EMAZIS — Article extras (tables, diagrams, formulas, sources)
   Loaded only by articles that need these components.
   ========================================================================== */

/* ---------- Responsive data table ---------- */
.article-table-wrap {
  margin: 2rem 0;
  border: 1px solid var(--clr-gray-light);
  border-radius: 8px;
  overflow-x: auto;
}
.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #2d3748;
}
.article-table caption {
  caption-side: top;
  text-align: left;
  padding: 0.9rem 1rem;
  font-size: 0.85rem;
  color: #4a5568;
  border-bottom: 1px solid var(--clr-gray-light);
}
.article-table th,
.article-table td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  vertical-align: top;
}
.article-table thead th {
  background: var(--clr-off-white);
  color: var(--clr-navy);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--clr-blue);
}
.article-table tbody tr + tr td,
.article-table tbody tr + tr th {
  border-top: 1px solid var(--clr-gray-light);
}
.article-table tbody th {
  color: var(--clr-navy);
  font-weight: 700;
}

@media (max-width: 720px) {
  .article-table-wrap { overflow-x: visible; }
  .article-table,
  .article-table tbody,
  .article-table tr,
  .article-table th,
  .article-table td { display: block; width: 100%; }
  .article-table thead {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .article-table caption { display: block; width: 100%; }
  .article-table tbody tr { padding: 0.9rem 1rem; }
  .article-table tbody tr + tr { border-top: 1px solid var(--clr-gray-light); }
  .article-table tbody tr + tr td,
  .article-table tbody tr + tr th { border-top: 0; }
  .article-table th,
  .article-table td { padding: 0.3rem 0; }
  .article-table tbody th { font-size: 1rem; padding-bottom: 0.5rem; }
  .article-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--clr-blue);
  }
}

/* ---------- Diagrams (inline SVG) ---------- */
.article-diagram {
  margin: 2.5rem 0;
  padding: 1.5rem 1rem 1.25rem;
  background: var(--clr-off-white);
  border: 1px solid var(--clr-gray-light);
  border-radius: 10px;
}
.article-diagram svg {
  display: block;
  width: 100%;
  max-width: 500px;
  height: auto;
  margin: 0 auto;
  font-family: var(--font-body);
}
.article-diagram figcaption {
  margin-top: 1rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #4a5568;
  text-align: center;
}
.article-diagram details {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: #2d3748;
}
.article-diagram summary {
  cursor: pointer;
  color: var(--clr-blue);
  font-weight: 600;
  text-align: center;
}
.article-diagram details[open] summary { margin-bottom: 0.6rem; }
.article-diagram details ol,
.article-diagram details ul { margin-bottom: 0; }
.article-diagram details li { font-size: 0.9rem; }

/* ---------- Formula box ---------- */
.article-formula {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--clr-off-white);
  border: 1px solid var(--clr-gray-light);
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--clr-navy);
}
.article-formula strong { color: var(--clr-navy); }

/* ---------- Decision sheet checklist ---------- */
.article-checklist {
  columns: 2;
  column-gap: 2rem;
}
.article-checklist li { break-inside: avoid; }
@media (max-width: 640px) {
  .article-checklist { columns: 1; }
}

/* ---------- Sources ---------- */
.article-sources {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--clr-gray-light);
}
.article-sources h2 {
  font-size: 1.2rem;
  border-bottom: 0;
  margin-top: 0;
  padding-bottom: 0;
}
.article-sources li {
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
