/* ==========================================================================
   ARTICLE — long-form content beneath the calculator.
   ========================================================================== */

/* Poster-scale display type lives here, now that the hero H1 is compact. */
.section-head h2 {
  font-size: clamp(2rem, 6.5vw, 4.25rem);
}

/* Interior pages: a compact banded masthead instead of the homepage hero. */
.page-head {
  background: var(--yellow);
  padding-block: 40px;
}

.page-head h1 {
  font-size: clamp(2.25rem, 6.5vw, 4rem);
}

.prose {
  max-width: 70ch;
}

/* Sub-headings inside long-form prose. */
.prose h2 {
  font-size: clamp(1.5rem, 3.4vw, 2.25rem);
  margin: 40px 0 var(--s4);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p,
.prose li {
  font-size: 1.0625rem;
  line-height: 1.75;
}

.prose h3 {
  margin: 32px 0 var(--s3);
}

.prose ul,
.prose ol {
  margin: 0 0 var(--s4);
  padding-left: var(--s6);
}

.prose li {
  margin-bottom: var(--s2);
}

.prose li::marker {
  color: var(--red);
  font-weight: 900;
}

.prose strong {
  font-weight: 700;
}

.prose a {
  font-weight: 700;
  text-decoration-color: var(--red);
}

/* --- Tables --------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: var(--bw-strong) solid var(--border);
  box-shadow: var(--shadow-lg);
  background: var(--white);
  margin-bottom: var(--s6);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.table-wrap caption {
  text-align: left;
  padding: var(--s4) var(--s6);
  background: var(--fg);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.table-wrap th,
.table-wrap td {
  padding: var(--s3) var(--s6);
  text-align: left;
  border-bottom: var(--bw) solid var(--border);
  font-size: 1rem;
}

.table-wrap thead th {
  background: var(--yellow);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.table-wrap tbody tr:last-child th,
.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.table-wrap tbody th {
  font-weight: 700;
}

/* Highlight the row a reader is most likely to want. */
.table-wrap tbody tr.is-key {
  background: var(--wash);
}

/* --- Callouts ------------------------------------------------------------- */

.callout {
  position: relative;
  padding: var(--s6);
  margin-bottom: var(--s6);
  background: var(--white);
  border: var(--bw-strong) solid var(--border);
  box-shadow: var(--shadow-md);
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout__label {
  display: inline-block;
  margin-bottom: var(--s3);
  padding: var(--s1) var(--s3);
  background: var(--fg);
  color: var(--white);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.callout--key {
  background: var(--yellow);
}

.callout--warn {
  background: var(--red);
  color: var(--white);
}

.callout--warn .callout__label {
  background: var(--white);
  color: var(--fg);
}

.callout--note {
  background: var(--wash);
}

/* An email address is one long unbreakable token — it must be allowed to
   wrap or it pushes narrow phones sideways. */
.contact-email {
  font-size: clamp(1rem, 4.2vw, 1.25rem);
  font-weight: 900;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* --- Formula block -------------------------------------------------------- */

.formula {
  padding: var(--s6);
  margin-bottom: var(--s6);
  background: var(--fg);
  color: var(--white);
  border: var(--bw-strong) solid var(--border);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
}

.formula p {
  margin: 0 0 var(--s3);
  font-size: 1.0625rem;
  font-weight: 700;
  white-space: nowrap;
}

.formula p:last-child {
  margin-bottom: 0;
}

.formula em {
  font-style: normal;
  color: var(--yellow);
}

.formula .formula__note {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--muted);
  white-space: normal;
}

/* --- Worked example ------------------------------------------------------- */

.example {
  padding: var(--s6);
  margin-bottom: var(--s6);
  background: var(--white);
  border: var(--bw-strong) solid var(--border);
  box-shadow: var(--shadow-md);
}

.example h4 {
  margin: 0 0 var(--s4);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.example ol {
  margin: 0;
  padding-left: var(--s6);
}

.example li {
  margin-bottom: var(--s2);
  font-size: 1rem;
  line-height: 1.6;
}

.example li::marker {
  font-weight: 900;
  color: var(--blue);
}

.example__answer {
  display: inline-block;
  margin-top: var(--s4);
  padding: var(--s2) var(--s4);
  background: var(--yellow);
  border: 2px solid var(--border);
  font-weight: 900;
}

/* --- Two-column content grid --------------------------------------------- */

.grid-2 {
  display: grid;
  gap: var(--s6);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-3 {
  display: grid;
  gap: var(--s6);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Material swatches ---------------------------------------------------- */

.material__swatch {
  margin-bottom: var(--s4);
  border: var(--bw) solid var(--border);
  line-height: 0;
}

/* Width/height attributes on the img reserve the 5:3 box, so lazy loading
   cannot shift the layout. Not greyscaled by default like other imagery —
   colour is the whole point of these. */
.material__swatch img {
  display: block;
  width: 100%;
  height: auto;
}

.material h3 {
  margin: 0 0 var(--s3);
  padding-right: var(--s6);
}

.material__spec {
  margin: 0 0 var(--s4);
  padding: 0;
  display: grid;
  gap: var(--s2);
}

.material__spec div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: var(--s3);
  padding-bottom: var(--s2);
  border-bottom: 2px solid var(--muted);
}

.material__spec dt {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding-top: 2px;
}

.material__spec dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
}

.material > p {
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
}

/* --- Sources -------------------------------------------------------------- */

.sources {
  max-width: 70ch;
}

.sources ol {
  padding-left: var(--s6);
}

.sources li {
  margin-bottom: var(--s3);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.sources__updated {
  display: inline-block;
  margin-top: var(--s4);
  padding: var(--s2) var(--s4);
  background: var(--muted);
  border: 2px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --- Cited source ---------------------------------------------------------
   Attribution block for external authority. Kept visually distinct so both
   readers and answer engines can see the claim is sourced.
   ------------------------------------------------------------------------ */

.quote {
  margin: 0 0 var(--s6);
  padding: var(--s6);
  background: var(--white);
  border: var(--bw-strong) solid var(--border);
  border-left-width: 12px;
  box-shadow: var(--shadow-md);
}

.quote p {
  margin: 0 0 var(--s4);
  font-size: 1.0625rem;
  line-height: 1.65;
}

.quote footer {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.quote cite {
  font-style: normal;
}

/* Author attribution. Named accountability for the figures, not decoration. */
.byline {
  margin-top: var(--s6);
  padding-top: var(--s4);
  border-top: var(--bw) solid var(--border);
  font-size: 0.9375rem;
  font-weight: 700;
}

.byline span {
  display: block;
  margin-top: var(--s1);
  font-weight: 500;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
