/**
 * Styles for the generated static pages (term pages, glossary, units, legal).
 * Loaded after styles.css, which supplies the design tokens. The app itself
 * does not use this file.
 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-surface-secondary);
  border-bottom: 1px solid var(--stroke-tertiary);
}
.site-header-inner,
.site-footer-inner,
.site-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px;
}
.site-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.site-nav {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.site-main {
  padding-top: 20px;
  padding-bottom: 48px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--texticon-tertiary);
  margin-bottom: 12px;
}
.breadcrumbs a {
  color: var(--texticon-brand);
}

/* Readable prose for definitions and legal text. */
.prose {
  font-size: 16px;
  line-height: 26px;
}
.prose h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
  margin: 28px 0 8px;
}
.prose h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 6px;
}
.prose p,
.prose ul,
.prose ol {
  margin: 0 0 12px;
}
.prose ul,
.prose ol {
  padding-left: 22px;
}
.prose li {
  margin-bottom: 6px;
}
.prose a {
  color: var(--texticon-brand);
}
/* Buttons inside prose keep their own colours (.prose a would win otherwise). */
.prose a.btn-primary {
  color: var(--texticon-secondary);
}
.prose a.btn-secondary,
.prose a.btn-tertiary {
  color: var(--texticon-brand);
}
.prose a.pill {
  text-decoration: none;
  color: var(--texticon-brand);
}
.prose strong {
  font-weight: 600;
}

.lede {
  font-size: 20px;
  line-height: 30px;
  color: var(--texticon-primary);
  margin: 0 0 16px;
}

.term-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}

/* Glossary: search box, A-Z jump bar, and the list itself. */
.glossary-search {
  position: sticky;
  top: 62px;
  z-index: 5;
  padding: 12px 0;
  background: var(--bg-surface-secondary);
}
.alpha-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
}
.alpha-bar a,
.alpha-bar span {
  min-width: 30px;
  padding: 4px 6px;
  text-align: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.alpha-bar a {
  color: var(--texticon-brand);
  background: var(--fill-secondary);
  border: 1px solid var(--stroke-secondary);
}
.alpha-bar span {
  color: var(--texticon-disabled);
}

.glossary-group {
  margin-bottom: 28px;
}
.glossary-letter {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--stroke-secondary);
}
.glossary-item {
  display: block;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke-tertiary);
  background: var(--fill-secondary);
  text-decoration: none;
  color: inherit;
}
.glossary-item:hover {
  border-color: var(--stroke-secondary);
  background: var(--fill-secondary-hover);
}
.glossary-item .term-name {
  font-weight: 600;
  color: var(--texticon-brand);
}
.glossary-item .term-gloss {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  line-height: 20px;
  color: var(--texticon-tertiary);
}
.no-results {
  padding: 24px;
  text-align: center;
  color: var(--texticon-tertiary);
}

/* Question and answer blocks - these carry the FAQ structured data. */
.qa {
  margin: 16px 0;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke-secondary);
  background: var(--fill-secondary);
}
.qa h2,
.qa h3 {
  margin-top: 0;
}
.qa + .qa {
  margin-top: 12px;
}

.sample-question {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke-secondary);
  background: var(--fill-secondary);
}
.sample-options {
  list-style: upper-alpha;
  margin: 10px 0 12px;
  padding-left: 26px;
}
.sample-answer {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--fill-success);
  border: 1px solid var(--stroke-success);
  font-size: 15px;
  line-height: 22px;
}

.term-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* Legal pages and the disclaimer strip in the footer. */
.disclaimer-box {
  margin: 20px 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke-warning);
  background: var(--fill-warning);
  font-size: 14px;
  line-height: 21px;
}

.site-footer {
  border-top: 1px solid var(--stroke-secondary);
  background: var(--fill-secondary);
}
.site-footer-inner {
  padding-top: 24px;
  padding-bottom: 32px;
  font-size: 13px;
  line-height: 20px;
  color: var(--texticon-tertiary);
}
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
}
.site-footer a {
  color: var(--texticon-brand);
}
.footer-disclaimer {
  max-width: 70ch;
}

/* ---------------------------------------------------------- comparisons */

.key-difference {
  border-color: var(--stroke-primary);
  background: var(--fill-secondary-hover);
}

/* Wide tables scroll inside their own box; the page never scrolls sideways. */
.compare-scroll {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--stroke-secondary);
  border-radius: var(--radius-lg);
  background: var(--fill-secondary);
}
.compare-table,
.numbers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 22px;
}
.compare-table th,
.compare-table td,
.numbers-table th,
.numbers-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--stroke-tertiary);
}
.compare-table thead th,
.numbers-table thead th {
  font-size: 13px;
  font-weight: 600;
  color: var(--texticon-tertiary);
  background: var(--bg-surface-secondary);
}
.compare-table thead th:not(:first-child) {
  color: var(--texticon-brand);
  font-size: 15px;
}
.compare-table tbody th {
  width: 120px;
  font-size: 13px;
  font-weight: 600;
  color: var(--texticon-tertiary);
}
.compare-table td {
  min-width: 200px;
}
.compare-table tr:last-child th,
.compare-table tr:last-child td,
.numbers-table tr:last-child td {
  border-bottom: none;
}

/* ------------------------------------------------------------- formulas */

.formula-group {
  margin-bottom: 32px;
}
.formula-card {
  margin-bottom: 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke-secondary);
  background: var(--fill-secondary);
  scroll-margin-top: 80px;
}
.formula-card h3 {
  margin: 0 0 8px;
}
.formula-line {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 21px;
  overflow-x: auto;
}
.calc {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}
.calc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.calc-field input {
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke-secondary);
  background: var(--white);
  font: inherit;
  font-size: 15px;
  color: var(--texticon-primary);
}
.calc-field input:focus {
  outline: 2px solid var(--stroke-primary);
  outline-offset: -1px;
}
.calc-result {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  background: var(--fill-primary);
  color: var(--texticon-secondary);
  font-weight: 700;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.formula-example {
  margin: 12px 0 6px;
  font-size: 15px;
  line-height: 22px;
}

/* ---------------------------------------------------------- numbers sheet */

.numbers-group {
  margin-bottom: 28px;
  break-inside: avoid;
}
.numbers-table .figure {
  width: 170px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--texticon-brand);
  white-space: nowrap;
}
.numbers-table .source {
  width: 160px;
  font-size: 13px;
  color: var(--texticon-tertiary);
}
.numbers-table td a {
  color: var(--texticon-primary);
  text-decoration: underline;
  text-decoration-color: var(--stroke-secondary);
  text-underline-offset: 3px;
}

/* Printing the cheat sheet: content only, compact, black on white. */
@media print {
  .site-header,
  .site-footer,
  .breadcrumbs,
  .no-print,
  .ad-slot,
  .disclaimer-box {
    display: none !important;
  }
  body,
  .compare-scroll,
  .numbers-table thead th {
    background: #fff !important;
  }
  .site-main {
    max-width: none;
    padding: 0;
  }
  .compare-scroll {
    overflow: visible;
    border: none;
  }
  .numbers-table {
    font-size: 11px;
    line-height: 15px;
  }
  .numbers-table th,
  .numbers-table td {
    padding: 4px 6px;
  }
  .numbers-table .figure {
    color: #000;
  }
  .numbers-table td a {
    color: #000;
    text-decoration: none;
  }
  .lede {
    font-size: 13px;
    line-height: 18px;
  }
}

/* ------------------------------------------------------------- landing page */

.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 28px;
  align-items: center;
  padding: 24px 0 8px;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}
.hero-title {
  margin: 0;
  font-size: 40px;
  line-height: 48px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.hero-copy .lede,
.hero-copy .cta-row {
  margin: 0;
}
.hero-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background: linear-gradient(135deg, var(--white) 55%, var(--blue-lighter));
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 28px 0 8px;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke-secondary);
  background: var(--fill-secondary);
}
.stat-n {
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  color: var(--texticon-brand);
  font-variant-numeric: tabular-nums;
}
.stat-l {
  font-size: 13px;
  color: var(--texticon-tertiary);
}

.section-block {
  margin-top: 40px;
}
.section-block > .h2 {
  margin-bottom: 12px;
}
.section-block > p {
  margin: 0 0 14px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.step {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.step h3 {
  margin: 0;
}
.step-n {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--fill-primary);
  color: var(--texticon-secondary);
  font-weight: 700;
}

.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
a.chip {
  text-decoration: none;
}

.final-cta {
  text-align: center;
  padding: 32px 20px;
}
.final-cta .h2 {
  margin: 0 0 8px;
}

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 30px;
    line-height: 38px;
  }
  .stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .steps {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------------- 404 page */

.not-found {
  max-width: 560px;
  margin: 24px auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.not-found-code {
  margin: 0;
  font-size: 72px;
  line-height: 76px;
  font-weight: 700;
  color: var(--stroke-secondary);
}
.not-found .lede {
  margin: 0;
}
.not-found-search {
  display: flex;
  gap: 8px;
}
.not-found-search .search {
  flex: 1;
}

/* Phones: the brand keeps its line; secondary header links (all repeated in
   the footer) give way to the one primary action. */
.site-header .brand .subtitle {
  white-space: nowrap;
}
@media (max-width: 640px) {
  .site-nav .btn-secondary {
    display: none;
  }
}
