/* FDA Risk, one-page fact wall.
   Black and white base. Orange marks data (chart blocks) and action (buttons, link underlines).
   Grey is reserved for the in-progress strip. */

:root {
  --ink: #000000;
  --paper: #ffffff;
  --orange: #ed8600;
  --orange-hover: #d97a00;
  --muted: #5c5c5c;
  --rule: #e6e6e6;
  --progress-bg: #ededed;
  --progress-ink: #5f5f5f;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: 60px;
  --max: 1320px;
  --radius: 6px;
  --radius-lg: 8px;
  --section-gap: 120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  z-index: 10;
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Wordmark. Swap for the FDA Risk logo files when they land in /assets. */
.wordmark {
  color: var(--orange);
  font-family: var(--sans);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark-sm {
  font-size: 24px;
}

/* Buttons and links */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.button-orange {
  background: var(--orange);
  color: var(--ink);
}

.button-orange:hover {
  background: var(--orange-hover);
}

.button-lg {
  min-height: 52px;
  padding: 0 34px;
  font-size: 15px;
}

.button-ghost {
  background: transparent;
  border-color: var(--paper);
  color: var(--paper);
}

.button-ghost:hover {
  background: var(--paper);
  color: var(--ink);
}

.text-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.text-link:hover {
  color: var(--orange-hover);
}

.text-link-plain {
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
}

.text-link-small {
  font-size: 13px;
  font-weight: 500;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 16px;
  min-width: 0;
  text-decoration: none;
}

.brand-tagline {
  font-size: 13px;
  font-weight: 500;
}

/* Section scaffolding: a label on a bold black line */
.section {
  padding-top: var(--section-gap);
}

.section-lead {
  padding-top: 56px;
}

.section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}

.section-label h2 {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-label-aside {
  font-size: 13px;
  font-weight: 500;
}

/* Lead finding */
.lead {
  display: grid;
  grid-template-columns: minmax(0, 510fr) minmax(0, 744fr);
  column-gap: 66px;
  align-items: start;
  padding-top: 56px;
}

.lead-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.lead-headline {
  font-family: var(--serif);
  font-size: 56px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.lead-summary {
  margin-top: 22px;
  font-size: 18px;
}

.lead-copy .text-link {
  margin-top: 48px;
}

.citation {
  align-self: stretch;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.citation a {
  text-decoration: none;
}

.citation a:hover {
  text-decoration: underline;
}

/* Charts: orange block, black marks. Outline = comparison value, solid = the finding. */
.chart {
  background: var(--orange);
  color: var(--ink);
  border-radius: var(--radius);
}

.chart-lead {
  padding: 32px 32px 28px;
}

.chart-mini {
  padding: 20px 20px 16px;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.55);
}

.chart-title {
  max-width: 320px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.25;
}

.chart-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.chart-stat strong {
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 500;
  line-height: 1;
}

.chart-stat span {
  margin-top: 6px;
  font-size: 12px;
}

.bars {
  display: grid;
  gap: 10px;
}

.chart-lead .bars {
  gap: 18px;
  margin-top: 28px;
}

.bar-row {
  display: grid;
  grid-template-columns: var(--label-col, 44px) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.chart-lead .bar-row {
  --label-col: 56px;
  gap: 12px;
}

.chart-wide-labels .bar-row {
  --label-col: 92px;
}

.bar-label {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
}

.chart-lead .bar-label {
  font-size: 14px;
}

/* The value label rides at the end of its bar; --v is the bar's share of the chart's data-max. */
.bar-track {
  --label: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-lead .bar-track {
  --label: 84px;
  gap: 12px;
}

.bar {
  display: block;
  flex: none;
  width: calc((100% - var(--label)) * var(--v));
  height: 20px;
  border-radius: 2px;
}

.chart-lead .bar {
  height: 50px;
}

.bar-outline {
  border: 1.5px solid var(--ink);
}

.bar-solid {
  background: var(--ink);
}

.bar-dashed {
  border: 1.5px dashed var(--ink);
}

.bar-value {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.chart-lead .bar-value {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
}

/* Part-to-whole bar. Segments are separated by a 2px gap. */
.stack {
  display: flex;
  gap: 2px;
  height: 28px;
}

/* flex-grow shares the width left after the gaps, so segments stay proportional. */
.stack-seg {
  display: block;
  flex: var(--v) 1 0;
  min-width: 0;
  border-radius: 2px;
}

.stack-legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.stack-legend span:last-child {
  text-align: right;
}

.sawtooth {
  display: block;
  width: 100%;
  height: 72px;
}

.chart-note {
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.45;
}

.chart-lead .chart-note {
  margin-top: 26px;
  font-size: 12px;
}

/* Research timeline: oldest to newest, arrows between papers */
.timeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.tl-node {
  position: relative;
  padding-right: 20px;
}

.tl-node a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
}

.tl-year {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

/* The dot sits on the line; the arrow runs from it to the next paper. */
.tl-year::before {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

.tl-node-keypedia .tl-year::before {
  border-color: var(--orange);
  background: var(--orange);
}

.tl-node:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 84px;
  right: 18px;
  height: 2px;
  background: var(--ink);
}

/* Arrowhead at the end of each connector */
.tl-node:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 5px;
  right: 10px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid var(--ink);
}

.tl-label {
  padding-top: 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.tl-who {
  color: var(--muted);
  font-size: 12px;
}

.tl-node a:hover .tl-label {
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* Fact wall */
.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 64px 48px;
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--rule);
}

.fact {
  display: flex;
  flex-direction: column;
}

.fact-credit {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.fact-number {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.fact-number-word {
  font-size: 44px;
  line-height: 1.08;
  white-space: normal;
}

.fact-line {
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
}

.fact {
  scroll-margin-top: 24px;
}

.fact:target .fact-number {
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 4px;
  text-underline-offset: 8px;
}

.fact .chart {
  margin-top: 20px;
}

.fact-source {
  margin-top: auto;
  padding-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.fact-source a {
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}

.fact-source a span {
  text-decoration: none;
}

.fact-source a:hover {
  color: var(--ink);
  text-decoration-color: var(--orange);
}

/* In-progress strip */
.progress-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  margin-top: 72px;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  background: var(--progress-bg);
  color: var(--progress-ink);
}

.progress-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.progress-body h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
}

.progress-body p {
  margin-top: 6px;
  font-size: 14px;
}

.progress-strip .text-link {
  color: var(--ink);
  white-space: nowrap;
}

/* Look it up tiles */
.lookup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-top: 48px;
}

.lookup {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 32px 36px 32px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.lookup-kicker {
  color: var(--orange);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lookup-title {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
}

.lookup-arrow {
  margin-top: auto;
  padding-top: 24px;
  color: var(--orange);
  font-size: 26px;
  line-height: 1;
  transition: transform 0.15s ease;
}

.lookup:hover .lookup-arrow {
  transform: translateX(6px);
}

.lookup:hover .lookup-title {
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* Footer: the shared KeyPedia sister-site footer, in FDA Risk colors.
   Black background; orange replaces the purple hover. See README for the source. */
.foot {
  margin-top: var(--section-gap);
  padding-block: clamp(44px, 6vw, 72px) 32px;
  background: var(--ink);
  color: #b9b7b4;
  scroll-margin-top: 24px;
}

.foot-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 36px;
  margin-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.foot-cta-copy h2 {
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 500;
  line-height: 1.15;
}

.foot-cta-copy p {
  margin-top: 8px;
  color: #8f8c88;
  font-size: 17px;
}

.foot-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
}

.foot-brand p {
  max-width: 32ch;
  margin-top: 14px;
  color: #8f8c88;
  font-size: 14px;
}

.foot-social {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.foot-social a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #b9b7b4;
  transition: background 0.15s ease, color 0.15s ease;
}

.foot-social a:hover {
  background: var(--orange);
  color: var(--ink);
}

.foot h4 {
  margin: 0 0 14px;
  color: var(--paper);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.foot ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot a {
  color: #b9b7b4;
  font-size: 14px;
  text-decoration: none;
}

.foot a:hover {
  color: var(--paper);
}

.foot a.wordmark {
  color: var(--orange);
  font-size: 28px;
}

/* `.foot a` outranks `.button-orange`, so pin the CTA's own colors. */
.foot a.button-orange {
  color: var(--ink);
  font-size: 15px;
}

.foot a.button-orange:hover {
  color: var(--ink);
}

.foot-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #8d8a86;
  font-size: 14px;
}

.foot-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.updates-form {
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  gap: 12px;
}

.updates-form[hidden] {
  display: none;
}

.updates-form input {
  width: 320px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--paper);
  border-radius: 999px;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: 15px;
}

.updates-form input::placeholder {
  color: #9a9a9a;
}

.updates-form .button-ghost {
  min-height: 48px;
}

.updates-status {
  flex-basis: 100%;
  min-height: 1.5em;
  color: var(--paper);
  font-size: 14px;
}

/* 404 */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding: 120px 0 160px;
}

.not-found h1 {
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 500;
  line-height: 1.12;
}

.not-found p {
  font-size: 18px;
}

/* Tablet */
@media (max-width: 1100px) {
  :root {
    --gutter: 40px;
    --section-gap: 96px;
  }

  .brand-tagline {
    display: none;
  }

  .lead {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 40px;
  }

  .lead-copy .text-link {
    margin-top: 32px;
  }

  .fact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 56px 40px;
  }

  /* Vertical timeline with arrows pointing down */
  .timeline {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    gap: 0;
  }

  .tl-node {
    padding: 0 0 26px 0;
  }

  .tl-node a {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    column-gap: 16px;
    row-gap: 2px;
  }

  .tl-year {
    grid-row: span 2;
    align-self: start;
    font-size: 19px;
  }

  .tl-label {
    padding-top: 0;
  }

  .tl-node:not(:last-child)::after {
    top: 22px;
    bottom: 10px;
    left: 5px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .tl-node:not(:last-child)::before {
    top: auto;
    right: auto;
    bottom: 2px;
    left: 0;
    border-top: 10px solid var(--ink);
    border-right: 6px solid transparent;
    border-bottom: 0;
    border-left: 6px solid transparent;
  }

  .progress-strip {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .lookup-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .lookup {
    min-height: 0;
  }

}

@media (max-width: 760px) {
  .foot-top {
    grid-template-columns: 1fr 1fr;
  }

  .foot-brand {
    grid-column: 1 / -1;
  }
}

/* Mobile */
@media (max-width: 720px) {
  :root {
    --gutter: 20px;
    --section-gap: 72px;
  }

  .header-inner {
    min-height: 68px;
  }

  .wordmark {
    font-size: 26px;
  }

  .header-inner .button {
    min-height: 40px;
    padding: 0 18px;
    font-size: 13px;
  }

  .section-lead {
    padding-top: 36px;
  }

  .section-label {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .lead {
    padding-top: 36px;
  }

  .lead-headline {
    font-size: 38px;
  }

  .chart-lead {
    padding: 24px 20px 22px;
  }

  .chart-head {
    flex-direction: column;
    gap: 14px;
  }

  .chart-stat {
    align-items: flex-start;
    text-align: left;
  }

  .chart-title {
    font-size: 20px;
  }

  .chart-stat strong {
    font-size: 44px;
  }

  .chart-lead .bar-row {
    --label-col: 44px;
    gap: 10px;
  }

  .chart-lead .bar-track {
    --label: 64px;
  }

  .chart-lead .bar {
    height: 40px;
  }

  .chart-lead .bar-value {
    font-size: 22px;
  }

  .fact-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
    margin-top: 36px;
  }

  .fact-number {
    font-size: 56px;
  }

  .fact-number-word {
    font-size: 38px;
  }

  .progress-strip {
    margin-top: 56px;
    padding: 24px;
  }

  .lookup-grid {
    margin-top: 36px;
  }

  .lookup {
    padding: 28px 24px;
  }

  .lookup-title {
    font-size: 24px;
  }

  .updates-form {
    flex-direction: column;
    align-self: stretch;
    align-items: stretch;
  }

  .updates-form input {
    width: 100%;
  }

  .not-found h1 {
    font-size: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button,
  .lookup-arrow {
    transition: none;
  }
}
