/* Renergy content-article stylesheet.
   Built from PageMakingInstruction/templates/tw-content.css, retoned to the
   live site palette (renergy-shared.css) and the MatterSQ face so article
   pages sit inside the real site shell without fighting the nav or footer.

   Load order in <head>:  renergy-shared.css  then  tw-content.css
   Article body typography is scoped to .tw-article so the Webflow nav and
   footer keep their own rules. Component classes (.answer, .tbl, .faq and so
   on) are global because renergy-shared.css defines none of those names.

   Every rule traces to a course lecture. Citations inline. */

:root {
  --tw-ink: #101512;
  --tw-ink-soft: #59645e;
  --tw-ink-faint: #758079;
  --tw-line: #d8e2dd;
  --tw-bg: #fff;
  --tw-bg-soft: #f8f8f3;
  --tw-accent: #14663d;          /* --green-dark on the live site */
  --tw-accent-bright: #00b259;   /* --renergy-green */
  --tw-dark: #001a0d;            /* --green-darkest */
  --tw-warn: #8a4b0b;
  --tw-warn-bg: #fff6ec;
  --tw-page: 80rem;              /* page container, same as .cs-container on the case studies */
  --tw-measure: 52rem;           /* reading measure for prose inside that container */
  --tw-radius: .6rem;
}

/* --- Article body [L195: sans-serif, 12pt minimum, 1.5x line height] --- */
.tw-article {
  color: var(--tw-ink);
  font-family: MatterSQ, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

/* Page container. Same geometry as `.cs-container` + `.cs-section` on the case
   study pages: 80rem cap, 5% side padding. Prose inside it is capped at a
   readable measure and centred; tables, figures and callouts break out wider so
   the data has room. */
.wrap, .wrap-wide { width: 100%; max-width: var(--tw-page); margin: 0 auto; padding: 0 5%; }

/* Doubled class keeps these ahead of the element rules below (.tw-article p and
   friends) which would otherwise reset margin-left to 0 and kill the centring. */
.tw-article.tw-article > * { max-width: var(--tw-measure); margin-right: auto; margin-left: auto; }
.tw-article.tw-article > h1 { max-width: 46rem; }
.tw-article.tw-article > .tbl,
.tw-article.tw-article > figure,
.tw-article.tw-article > .evidence,
.tw-article.tw-article > .fact,
.tw-article.tw-article > .cta { max-width: 64rem; }

@media screen and (max-width: 1100px) {
  .tw-article.tw-article > * { max-width: 100%; }
}

/* --- Breadcrumbs: visible navigation UI [L128] --- */
.crumbs { padding: 2rem 0 0; color: var(--tw-ink-faint); font-size: .875rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.crumbs li::after { content: "/"; margin-left: .35rem; color: var(--tw-line); }
.crumbs li:last-child::after { content: ""; }
.crumbs a { color: var(--tw-accent); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* --- Headings. Real tags only, never faked with CSS [L83] --- */
.tw-article h1 {
  margin: .6em 0 .35em;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.06;
}
.tw-article h2 {
  margin: 2.2em 0 .5em;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.tw-article h3 { margin: 1.8em 0 .4em; font-size: 1.2rem; font-weight: 600; line-height: 1.3; }
.tw-article h4 { margin: 1.5em 0 .3em; font-size: 1.0625rem; font-weight: 600; }

.tw-article p { margin: 0 0 1.05em; }   /* 1-3 sentences, six maximum [L90, L195] */
.tw-article ul, .tw-article ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.tw-article li { margin: .35em 0; }
.tw-article strong { font-weight: 700; }   /* signals key terms to AI [L104] */
.tw-article a { color: var(--tw-accent); text-decoration: underline; text-underline-offset: 2px; }
.tw-article a.btn, .tw-article a.btn:hover { text-decoration: none; }
.tw-article a:hover { text-decoration-thickness: 2px; }

.tw-article blockquote {
  margin: 0 0 1.6em;
  padding: .2rem 0 .2rem 1.25rem;
  border-left: 3px solid var(--tw-accent-bright);
  color: var(--tw-ink);
  font-size: 1.1rem;
  line-height: 1.55;
}
.tw-article blockquote p { margin-bottom: .5em; }
.tw-article blockquote cite {
  color: var(--tw-ink-faint);
  font-size: .8rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* --- THE ANSWER BLOCK, inverted pyramid [L103].
   Sits immediately under the H1, before any introduction. The single most
   important structural element on the page. --- */
.answer {
  margin: 0 0 2.5em;
  padding: 1.5rem 1.6rem;
  border-left: 4px solid var(--tw-accent-bright);
  border-radius: 0 var(--tw-radius) var(--tw-radius) 0;
  background: var(--tw-bg-soft);
}
.answer > :first-child { margin-top: 0; }
.answer > :last-child { margin-bottom: 0; }
.answer .lede { font-size: 1.2rem; font-weight: 600; line-height: 1.45; }
.answer--urgent { border-left-color: var(--tw-warn); background: var(--tw-warn-bg); }

/* --- Tables. Comparison data is "a goldmine for any AI model" [L104].
   The wrapper is what stops the page body scrolling sideways on a phone. --- */
.tbl {
  margin: 0 0 1.8em;
  overflow-x: auto;
  border: 1px solid var(--tw-line);
  border-radius: var(--tw-radius);
  background: #fff;
}
.tbl table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl caption {
  padding: .75rem .9rem;
  border-bottom: 1px solid var(--tw-line);
  color: var(--tw-ink-soft);
  font-size: .85rem;
  text-align: left;
}
.tbl th, .tbl td {
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--tw-line);
  text-align: left;
  vertical-align: top;
}
.tbl thead th {
  background: var(--tw-bg-soft);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr.is-marked td { background: #f2fbf6; font-weight: 600; }
.tbl .num { font-variant-numeric: tabular-nums; }

/* --- Images. width and height attributes are mandatory in the HTML [L147].
   These rules keep them responsive without reintroducing shift. --- */
.tw-article img { max-width: 100%; height: auto; display: block; }
.tw-article figure { margin: 0 0 1.6em; }
.tw-article figcaption { margin-top: .6em; color: var(--tw-ink-soft); font-size: .85rem; }

/* --- Key-fact callout: real numbers, with their source --- */
.fact {
  margin: 0 0 1.8em;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--tw-line);
  border-radius: var(--tw-radius);
  background: #fff;
}
.fact .label {
  margin: 0 0 .35em;
  color: var(--tw-ink-faint);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.fact .big { margin: 0 0 .2em; color: var(--tw-accent); font-size: 1.9rem; font-weight: 600; line-height: 1.1; }
.fact cite { display: block; margin-top: .5em; color: var(--tw-ink-faint); font-size: .8rem; font-style: normal; }

/* --- Data-evidence block. The real temperature curve. This is the moat [L25, L107] --- */
.evidence {
  margin: 0 0 2em;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--tw-line);
  border-left: 4px solid var(--tw-accent);
  border-radius: 0 var(--tw-radius) var(--tw-radius) 0;
  background: #fff;
}
.evidence h3 { margin-top: 0; }
.evidence > :last-child { margin-bottom: 0; }

/* --- FAQ. Marked up with FAQPage schema in <head> [L105].
   Text must be visible in the HTML, not hidden behind JS [L131]. --- */
.faq { margin: 0 0 2em; }
.faq details { padding: .9rem 0; border-bottom: 1px solid var(--tw-line); }
.faq summary { cursor: pointer; font-size: 1.0625rem; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  display: inline-block;
  width: 1.2em;
  color: var(--tw-accent-bright);
  content: "+";
  font-weight: 700;
}
.faq details[open] summary::before { content: "\2212"; }
.faq details > div { padding: .6em 0 0 1.2em; }
.faq details > div p:last-child { margin-bottom: 0; }

/* --- Homework series: hub kicker, prev/next, tutorial TOC --- */
.series-kicker {
  margin: -0.6em 0 1.6em;
  padding: .85rem 1rem;
  border-left: 4px solid var(--tw-accent);
  background: var(--tw-bg-soft);
  color: var(--tw-ink-soft);
  font-size: .98rem;
}
.series-kicker a { font-weight: 600; }

.series-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .8rem;
  align-items: stretch;
  margin: 2.4em 0 0;
}
.series-pager a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem 1.1rem;
  border: 1px solid var(--tw-line);
  border-radius: var(--tw-radius);
  background: #fff;
  text-decoration: none;
  color: inherit;
}
.series-pager a:hover { border-color: var(--tw-accent); }
.series-pager-dir {
  color: var(--tw-ink-faint);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.series-pager-name { margin-top: .25rem; font-weight: 600; }
.series-pager-prev { text-align: left; }
.series-pager-next { text-align: right; grid-column: 3; }
.series-pager-hub {
  align-items: center;
  justify-content: center;
  color: var(--tw-accent);
  font-weight: 700;
  font-size: .9rem;
}
.series-pager:not(:has(.series-pager-prev)):not(:has(.series-pager-hub)) {
  grid-template-columns: 1fr;
}
.series-pager:not(:has(.series-pager-prev)):not(:has(.series-pager-hub)) .series-pager-next {
  grid-column: 1;
  text-align: left;
}

.series-toc { margin: 0 0 2em; padding: 0; list-style: none; counter-reset: none; }
.series-toc li {
  margin: 0 0 1.1rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--tw-line);
  border-radius: var(--tw-radius);
  background: #fff;
}
.series-toc h3 { margin: 0 0 .4rem; font-size: 1.15rem; }
.series-toc p { margin: 0 0 .5rem; }
.series-toc p:last-child { margin-bottom: 0; }

@media screen and (max-width: 767px) {
  .series-pager { grid-template-columns: 1fr; }
  .series-pager-next, .series-pager-prev, .series-pager-hub { grid-column: 1; text-align: left; }
}

/* --- Internal link cluster: pillar and spoke linking [L100, L128] --- */
.related {
  margin: 2.6em 0;
  padding: 1.5rem 1.6rem;
  border-radius: var(--tw-radius);
  background: var(--tw-bg-soft);
}
.related h2 { margin-top: 0; font-size: 1.2rem; }
.related ul { margin: 0; padding-left: 1.2em; }

/* --- E-E-A-T footer block [L98, L99] --- */
.eeat {
  margin-top: 3.5em;
  padding: 1.8rem 0 3rem;
  border-top: 1px solid var(--tw-line);
  color: var(--tw-ink-soft);
  font-size: .95rem;
}
.eeat .author { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 1.2em; }
.eeat .author img { flex: 0 0 auto; border-radius: 50%; }
.eeat .sources { margin-top: 1.2em; }
.eeat .sources li { font-size: .875rem; }
.updated { margin: 0 0 1.6em; color: var(--tw-ink-faint); font-size: .875rem; }

/* --- CTA. Below the fold, never above interactive content [L147, L200] --- */
.cta {
  margin: 2.6em 0;
  padding: 1.75rem;
  border-radius: var(--tw-radius);
  background: var(--tw-dark);
  color: #fff;
}
.cta h2 { margin-top: 0; color: #fff; }
.cta p { color: #c6d3cd; }
.btn {
  display: inline-block;
  text-decoration: none;
  padding: .8rem 1.4rem;
  border-radius: var(--tw-radius);
  background: var(--tw-accent-bright);
  color: #001a0d;
  font-weight: 700;
  text-decoration: none;
}
.btn:hover { background: #00c964; }

/* --- Article hero strip, shared with the gallery pages --- */
.tw-hero {
  padding: 6.5rem 5% 2.75rem;
  background:
    radial-gradient(circle at 85% 20%, rgba(0, 178, 89, .16), transparent 30%),
    var(--tw-dark);
  color: #fff;
}
.tw-hero-inner { width: 100%; max-width: 80rem; margin: 0 auto; }
.tw-hero .crumbs { padding: 0; margin-bottom: 2.5rem; color: #aebeb6; }
.tw-hero .crumbs a { color: var(--tw-accent-bright); }
.tw-hero .crumbs li::after { color: #45564d; }
.tw-eyebrow {
  margin-bottom: 1rem;
  color: var(--tw-accent-bright);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

@media screen and (max-width: 767px) {
  .tw-hero { padding: 5rem 5% 2.25rem; }
}
