/* ══════════════════════════════════════════════════════════════════
   /state-of-web-security — State of Web Security report (EN-25)
   Builds on api-docs.css (loaded first): .api-docs-page, .api-section,
   tables, pre.code-block. Only what that file lacks lives here, tokens
   only (DESIGN.md).
   ══════════════════════════════════════════════════════════════════ */

.sows-page .api-section {
  scroll-margin-top: 5rem;
}

.sows-kicker {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cyan);
}

.sows-hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.sows-hero-cta .btn-cta-accent {
  min-height: 44px;
  margin-top: 0;
}

.sows-note {
  margin: 0 0 var(--space-6);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--muted2);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

/* ── Key findings: one tile per headline share ────────────────────── */
.sows-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.sows-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 0;
}
.sows-tile__value {
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.sows-tile__label {
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--muted2);
}
.sows-base {
  margin-top: var(--space-3);
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* ── Table ────────────────────────────────────────────────────────── */
/* Four short columns fit a phone: no 720px floor from components.css
   (.table-responsive table) and no sideways scroll to reach the figures. */
.table-responsive .sows-table {
  min-width: 0;
}
/* Row headers are the metric names: not the uppercase column-header look
   api-docs.css gives every th. */
.api-section .sows-table th[scope="row"] {
  font-size: inherit;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
  text-align: left;
  background: none;
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.75rem;
  overflow-wrap: anywhere;
}
.sows-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.api-section table th.sows-num {
  text-align: right;
}
.sows-muted {
  color: var(--muted);
}
/* The base moves under the metric name on phones, where its column is hidden. */
.sows-base-inline {
  display: none;
  margin-top: var(--space-0-5);
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--muted);
}

/* ── Bars: label · bar · figure ───────────────────────────────────── */
.sows-bars {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}
.sows-bars__row {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 4.5rem;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--muted2);
}
.sows-bars__label {
  display: flex;
  flex-direction: column;
  gap: var(--space-0-5);
  min-width: 0;
}
.sows-bars__label .sows-muted {
  font-size: var(--fs-xs);
}
.sows-bars__value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.sows-bar {
  display: block;
  width: 100%;
  height: 0.5rem;
}
.sows-bar__track {
  fill: var(--surface3);
}
.sows-bar__fill {
  fill: var(--accent);
}

.sows-defs {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-5);
  color: var(--muted2);
  font-size: var(--fs-sm);
  line-height: 1.65;
}
.sows-defs li + li {
  margin-top: var(--space-1-5);
}
.sows-defs strong {
  color: var(--text);
}
.sows-defs code {
  background: var(--accent-glow-08);
  color: var(--cyan);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-xs);
  font-family: var(--mono);
  font-size: 0.85em;
}

.sows-page pre.code-block {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sows-columns {
  line-height: 2;
}

@media (max-width: 768px) {
  .api-section .sows-table th[scope="row"] {
    padding: 0.4rem 0.5rem;
  }
  .api-section .sows-table th {
    letter-spacing: normal;
  }
  .sows-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sows-bars__row {
    grid-template-columns: minmax(0, 1fr) 4rem;
    row-gap: var(--space-1);
  }
  .sows-bars__label {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .sows-base-col {
    display: none;
  }
  .sows-base-inline {
    display: block;
  }
  .sows-tiles {
    grid-template-columns: minmax(0, 1fr);
  }
  .sows-tile__value {
    font-size: var(--fs-xl);
  }
}

/* ── Links in running text ─────────────────────────────────────────────
   api-docs.css draws section links in the accent colour with no underline;
   inside a paragraph that is colour alone telling link from text (WCAG
   1.4.1, axe link-in-text-block). Here they are underlined. The note above
   the methodology gets the same link style (it sits outside .api-section). */
.sows-page .api-section p a,
.sows-note a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sows-note a {
  display: inline-block;
  margin-top: var(--space-1);
}
