/* type-scale: ntu.org-anchored (19px body) */
/*
 * Self-host the same Latin subsets previously requested from Google Fonts.
 * The normal file is variable across the weights used by the site, so one
 * preloaded request covers 300–700. Keeping the font on tariffs.org removes a
 * render-blocking cross-origin stylesheet and lets it begin loading with the
 * page's other critical assets.
 */
@font-face {
  font-family: "Crimson Pro";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/crimson-pro-latin-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Crimson Pro";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/crimson-pro-latin-italic.woff2") format("woff2");
}

/* NTUF State Tariffs demo — palette recreated from the Jul-2026 mockup */
:root {
  --navy: #1b3a6b;
  --navy-deep: #12294e;
  --red: #8b1a1a;
  --red-bright: #a32020;
  --ink: #1d2430;
  --muted: #5b6672;
  --paper: #ffffff;
  --wash: #f4f6f9;
  --line: #d9dfe7;
  --chart-blue: #2c5c9e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  /* NTUF brand type: ntu.org/foundation sets Crimson Pro across the whole site */
  font-family: "Crimson Pro", Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.67; /* ntu.org's measured body leading (19px/31.7px) */
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
.site-header {
  border-bottom: 3px solid var(--navy);
  background: var(--paper);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px; padding-bottom: 14px; gap: 16px;
}
.lockup { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.lockup-mark {
  font-weight: 900; font-size: 34px; letter-spacing: 1px; color: var(--navy);
  display: flex; align-items: center; line-height: 1;
}
.lockup-mark .star { color: var(--red); font-size: 30px; margin: 0 1px; transform: translateY(-1px); }
.lockup-sub {
  font-size: 13px; font-weight: 700; letter-spacing: 1.6px; color: var(--navy);
  text-transform: uppercase; border-top: 2px solid var(--red); padding-top: 3px; margin-top: 2px;
}
.header-tag { text-align: right; font-size: 15.5px; color: var(--muted); max-width: 300px; }
.header-tag strong { color: var(--navy); }

/* ---------- hero / landing ---------- */
.hero { text-align: center; padding: 44px 0 8px; }
.hero h1 {
  font-size: clamp(32px, 4.8vw, 48px); font-weight: 700; color: var(--navy);
  letter-spacing: 0; line-height: 1.12;
}
.hero h1 em { font-style: normal; color: var(--red); }
.hero p.lede {
  margin: 14px auto 0; max-width: 620px; font-size: 21px; color: var(--muted);
}

/* The answer paragraph — the page's claim, stated in prose before any chart.
   Readers skim it; answer engines quote it. Styled as a lead-in rather than a
   callout box so it reads as the article's opening sentence, which is what it
   is, and so nothing about it looks like an ad unit to a summarizer. */
.answer {
  font-size: 19px; line-height: 1.6; color: var(--ink); max-width: 760px;
  margin: 16px 0 0; padding-left: 14px; border-left: 3px solid var(--red);
}
.hero .answer { margin: 18px auto 0; text-align: left; }
.answer strong { color: var(--navy); }
.answer a { color: var(--navy); font-weight: 600; white-space: nowrap; }
.updated-stamp { font-size: 15px; color: var(--muted); margin: 10px 0 0; }
.rankings-head .answer { margin-bottom: 16px; }
@media (max-width: 640px) {
  .answer { font-size: 17.5px; line-height: 1.5; padding-left: 12px; }
}

.map-section { padding: 12px 0 8px; }
.map-holder { position: relative; margin: 0 auto; max-width: 960px; }
.map-holder svg { width: 100%; height: auto; display: block; }
.map-holder svg .state, .map-holder svg path, .map-holder svg circle { transition: filter .12s ease, opacity .12s ease; }
.map-holder svg [data-state] { cursor: pointer; }
.map-holder svg [data-state]:hover { filter: brightness(0.82); }

.map-tooltip {
  position: absolute; pointer-events: none; z-index: 5; display: none;
  background: var(--navy-deep); color: #fff; padding: 8px 12px; border-radius: 6px;
  font-size: 15.5px; line-height: 1.3; box-shadow: 0 6px 18px rgba(18, 41, 78, .35);
  white-space: nowrap; transform: translate(-50%, calc(-100% - 10px));
}
.map-tooltip .tt-name { font-weight: 700; font-size: 16.5px; }
.map-tooltip .tt-val { color: #ffd9d9; }

.legend {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  flex-wrap: wrap; margin: 10px 0 4px; font-size: 15px; color: var(--muted);
}
.legend .legend-label { margin-right: 6px; font-weight: 600; color: var(--ink); }
.legend .bucket { display: flex; align-items: center; gap: 5px; }
.legend .swatch { width: 22px; height: 13px; border-radius: 2px; display: inline-block; border: 1px solid rgba(0,0,0,.08); }

.source-strip {
  text-align: center; font-size: 16px; color: var(--muted);
  padding: 14px 0 40px;
}
.source-strip .dot { margin: 0 8px; color: var(--line); }
.source-strip strong { color: var(--navy); }

/* ---------- state view ---------- */
.state-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; font-size: 16.5px;
}
.state-nav a { color: var(--navy); text-decoration: none; font-weight: 600; }
.state-nav a:hover { text-decoration: underline; }
.state-nav .nn { display: flex; gap: 18px; }

.state-masthead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; padding: 8px 0 16px; border-bottom: 3px solid var(--navy);
  flex-wrap: wrap;
}
.state-masthead .kicker { font-size: 17.5px; color: var(--muted); font-weight: 600; }
.state-masthead h1 {
  font-size: clamp(36px, 5.2vw, 54px); font-weight: 700; color: var(--navy); line-height: 1.04;
}
.report-cta {
  background: var(--red); color: #fff; border: none; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 17px;
  padding: 11px 18px; border-radius: 6px;
}
.report-cta:hover { background: var(--red-bright); }

.section-title {
  text-align: center; font-size: clamp(20px, 2.7vw, 26px); font-weight: 700;
  color: var(--navy); margin: 34px 0 18px;
}

.chart-grid {
  display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(220px, 1fr);
  gap: 28px; align-items: center;
}
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 18px; justify-content: center; margin-top: 6px; font-size: 15px; color: var(--muted); }
.chart-legend .key { display: flex; align-items: center; gap: 6px; }
.chart-legend .key i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }

.callouts { display: flex; flex-direction: column; gap: 26px; }
.callout .big {
  font-size: clamp(36px, 4.2vw, 46px); font-weight: 700; color: var(--red); line-height: 1;
}
.callout p { font-size: 16.5px; color: var(--ink); margin-top: 6px; max-width: 260px; }
.callout p strong { color: var(--red); }

/* category cards */
.cards {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px; margin: 30px 0 8px;
}
.card {
  border: 1.5px solid var(--red); border-radius: 12px; text-align: center;
  padding: 54px 12px 18px; position: relative; margin-top: 46px; background: #fff;
}
.card:nth-child(even) { border-color: var(--navy); }
.card .badge {
  /* Centred ON the top border (translate -50% Y) rather than pinned above it,
     so a two-line label grows evenly up and down instead of overlapping the
     figures below. max-width keeps a long category name inside its own card —
     without it, `white-space: nowrap` sent names like "Miscellaneous
     Manufactured Commodities" straight across the neighbouring card. */
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 8px;
  background: var(--red); color: #fff; border-radius: 24px;
  padding: 10px 20px 10px 8px; font-size: 13px; font-weight: 700; line-height: 1.25;
  text-align: left; max-width: calc(100% - 4px); text-wrap: balance;
  overflow-wrap: break-word;
}
.card:nth-child(even) .badge { background: var(--navy); }
.card .badge .icn {
  width: 34px; height: 34px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.card .badge .icn svg { width: 20px; height: 20px; stroke: var(--red); }
.card:nth-child(even) .badge .icn svg { stroke: var(--navy); }
.card .money { font-size: 32px; font-weight: 700; color: var(--red); }
.card:nth-child(even) .money { color: var(--navy); }
.card .cap { font-size: 14.5px; color: var(--muted); margin-top: 2px; }
.card .div { border-top: 2px dotted var(--line); margin: 12px 18px; }
.card .pct { font-size: 28.5px; font-weight: 700; color: var(--ink); }
.card .mult { font-size: 14.5px; color: var(--muted); }
.card .mult b { display: block; font-size: 26.5px; font-weight: 700; color: var(--ink); }

.demo-note {
  text-align: center; font-size: 15px; color: var(--muted);
  margin: 26px auto 34px; max-width: 640px; font-style: italic;
}

/* ---------- footer ---------- */
.site-footer { background: var(--navy-deep); color: #cdd8ea; margin-top: 26px; }
.site-footer .wrap {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; padding-top: 18px; padding-bottom: 18px; font-size: 15.5px;
}
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(18, 41, 78, .55);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-back.open { display: flex; }
.modal {
  background: #fff; border-radius: 12px; max-width: 460px; padding: 30px 32px;
  text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.modal h3 { color: var(--navy); font-size: 23px; margin-bottom: 10px; }
.modal p { font-size: 17px; color: var(--muted); }
.modal button {
  margin-top: 18px; background: var(--navy); color: #fff; border: none;
  font: inherit; font-weight: 700; padding: 10px 22px; border-radius: 6px; cursor: pointer;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .chart-grid { grid-template-columns: 1fr; }
  .callouts { flex-direction: row; gap: 20px; }
  .callout p { max-width: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 52px; }
  .header-tag { display: none; }
}
@media (max-width: 520px) {
  .cards { grid-template-columns: 1fr; row-gap: 40px; }
  .callouts { flex-direction: column; }
  .state-masthead { align-items: flex-start; flex-direction: column; }
}

/* ── production additions (tracker) ── */
.band { display: block; }
.prose { max-width: 760px; padding: 44px 0 60px; }
.prose h1 { font-size: clamp(32px, 4.2vw, 42px); font-weight: 700; color: var(--navy); margin-bottom: 18px; }
.prose h2 { font-size: 26.5px; font-weight: 700; color: var(--navy); margin: 26px 0 8px; }
.prose p { font-size: 19.5px; line-height: 1.65; color: var(--ink); margin-bottom: 10px; }
.faq { max-width: 860px; margin: 30px auto 10px; }
.faq .faq-item { border-top: 1px solid var(--line); padding: 16px 0; }
.faq .faq-item h3 { font-size: 20px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.faq .faq-item p { font-size: 17.5px; line-height: 1.6; color: var(--muted); }
.faq .small { font-size: 15px; color: var(--muted); margin-top: 14px; }
.state-index { display: block; margin: 26px 0 50px; }
.state-index .section-title { font-size: clamp(26px, 3.6vw, 34px); margin-bottom: 10px; }
.state-index-sub { text-align: center; color: var(--muted); font-size: 17.5px; max-width: 44rem; margin: 0 auto 26px; }
.state-index ul { columns: 3; column-gap: 56px; list-style: none; padding: 0; max-width: 960px; margin: 0 auto; }
.state-index li { break-inside: avoid; padding: 5px 0; border-bottom: 1px dotted var(--line); display: flex; justify-content: space-between; }
.state-index li a { color: var(--navy); text-decoration: none; font-weight: 600; }
.state-index li a:hover { text-decoration: underline; }
.state-index li span { color: var(--muted); font-size: 16px; }
@media (max-width: 800px) { .state-index ul { columns: 2; column-gap: 40px; } }
@media (max-width: 520px) { .state-index ul { columns: 1; } }
.site-footer .wrap a { color: #fff; text-decoration: none; }

/* ── footer legal rows ── */
.site-footer .footer-rows { display: block; }
.site-footer .footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; justify-content: center; }
.site-footer .footer-links a { color: #fff; text-decoration: none; }
.site-footer .footer-links a:hover { text-decoration: underline; }
.site-footer .footer-legal { text-align: center; margin-top: 10px; font-size: 14.5px; color: #8fa0b5; }
/* Build credit — reads as a colophon, not a second disclosure competing with the
   501(c)(3) notice. Its quietness comes from SIZE, not a dimmer grey: the dimmer
   grey I reached for first measured 3.92:1 on this navy, under the 4.5:1 AA
   minimum, and this site publishes an accessibility statement. Same colour as
   the legal line above (5.41:1), one step smaller. */
.site-footer .footer-credit { text-align: center; margin-top: 12px; font-size: 13px; color: #8fa0b5; }
.site-footer .footer-credit a { color: #9fb2c9; text-decoration: none; border-bottom: 1px solid rgba(159,178,201,.35); }
.site-footer .footer-credit a:hover { color: #fff; border-bottom-color: #fff; text-decoration: none; }

/* ── rank chip (state masthead) ── */
.rank-chip {
  display: inline-block; margin-top: 8px; font-size: 17px; font-weight: 600;
  color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--line);
}
.rank-chip:hover { color: var(--navy); border-bottom-color: var(--navy); }

/* ── compare module (state pages) ── */
.compare { margin-top: 8px; }
.compare-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
  max-width: 860px; margin: 0 auto;
}
.compare-card {
  display: flex; flex-direction: column; gap: 3px; text-decoration: none;
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  background: #fff; transition: border-color .12s ease;
}
.compare-card:hover { border-color: var(--navy); }
.compare-card .cc-rank { font-size: 15px; font-weight: 600; color: var(--muted); }
.compare-card .cc-name { font-size: 19px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.compare-card .cc-val { font-size: 23px; font-weight: 700; color: var(--red); }
.compare-card.compare-all { justify-content: center; background: var(--wash); }
.compare-card.compare-all .cc-val { color: var(--navy); }
@media (max-width: 700px) { .compare-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── rankings page ── */
.rankings-head { padding-bottom: 8px; }
.rank-table {
  width: 100%; max-width: 860px; margin: 6px auto 14px; border-collapse: collapse;
  font-size: 19.5px;
}
.rank-table th {
  text-align: left; font-size: 15.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); border-bottom: 2px solid var(--navy); padding: 8px 10px;
}
.rank-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.rank-table .rk { color: var(--muted); font-weight: 600; width: 64px; }
.rank-table .st a { color: var(--navy); font-weight: 700; text-decoration: none; }
.rank-table .st a:hover { text-decoration: underline; }
.rank-table .amt { font-weight: 700; color: var(--red); white-space: nowrap; }
.rank-table .cat { color: var(--muted); font-size: 17.5px; }
.rankings-note { text-align: center; color: var(--muted); font-size: 16px; margin: 10px 0 44px; }
@media (max-width: 560px) { .rank-table .cat { display: none; } .rank-table th:last-child { display: none; } }

/* ── About-NTUF block (above legal footer, every page) ── */
.about-ntuf { background: var(--wash); border-top: 1px solid var(--line); margin-top: 34px; }
.about-ntuf .wrap { max-width: 760px; padding-top: 30px; padding-bottom: 30px; }
.about-ntuf h2 { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.about-ntuf p { font-size: 18px; line-height: 1.6; color: var(--ink); }
.about-ntuf .about-links { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.about-ntuf .about-links a { color: var(--navy); font-weight: 600; text-decoration: none; border-bottom: 1px dotted var(--line); }
.about-ntuf .about-links a:hover { border-bottom-color: var(--navy); }
.about-ntuf + .site-footer { margin-top: 0; }

/* ── honor reduced-motion preference (claimed in /accessibility/) ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ── official NTUF logo ── */
.lockup-picture { display: block; }
.lockup-img { height: 54px; width: auto; display: block; }
.lockup-chip { display: inline-block; background: #fff; border-radius: 10px; padding: 12px 18px; }
.lockup-chip .lockup-img { height: 46px; }
@media (max-width: 560px) { .lockup-img { height: 42px; } }
