/* ---------- Article pages, version 3 (28 Oct 2026) ----------
   Markup: renderArticle() in src/lib/article.mjs. Behaviour: article-page.js. Classes start ar-.
   The rules, from the research (clients/solarsave/pages/guide-solar-panel-grants/10-article-design-research.md):
   - Reading first: one column of about 70 characters, 19px near-black text at 1.65 (17px on phones). Nothing grey
     that people need to read; secondary text is --ink-soft, which is still 10:1 on white.
   - Structure comes from headings and white space, not boxes. One box on the page: the quote block.
   - Colour has jobs: ink for reading and links, orange for SolarSave's buttons only, and three status colours used
     only as words in the comparison table (green open, dark gold ending, grey closed; each over 6:1 on white). */

.page-article { --ar-measure: 680px; --st-open-ink: #1b6239; --st-end-ink: #6a4f00; --st-shut-ink: #555c62; }
.ar-page { background: var(--paper); }

/* Layout: the article column, with "On this page" to its left on wide screens */
.ar-grid { display: grid; grid-template-columns: minmax(0, var(--ar-measure)); justify-content: center; padding-top: 16px; padding-bottom: 8px; }
.ar-side { display: none; }
@media (min-width: 1200px) {
  .ar-grid { grid-template-columns: 210px minmax(0, var(--ar-measure)); column-gap: 72px; }
  .ar-hero .ar-hero-grid { grid-template-columns: 210px var(--ar-measure); column-gap: 72px; }
  .ar-hero-in { grid-column: 2; }
  .ar-side { padding-top: 32px; }
  .ar-side { display: block; }
  .ar-toc--side { position: sticky; top: 104px; }
  .ar-toc--inline { display: none; }
}

/* The header: headline, the answer, who wrote it and when, and what we are */
.ar-crumbs ol { margin-bottom: 20px; font-size: .9375rem; }
.ar-title { font: 500 clamp(2.25rem, 1.55rem + 2.3vw, 3rem)/1.1 var(--display); letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
.ar-standfirst { margin-top: 18px; font-size: clamp(1.1875rem, 1.1rem + .35vw, 1.3125rem); line-height: 1.55; color: var(--ink); }
.ar-by { margin-top: 26px; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: .9375rem; line-height: 1.6; color: var(--ink-soft); }
.ar-by span[aria-hidden] { margin: 0 4px; color: var(--line-strong); }
.ar-by-u { white-space: nowrap; }
.ar-by a { color: var(--ink-soft); }
.ar-disclose { margin-top: 14px; font-size: .9375rem; line-height: 1.55; color: var(--ink-soft); }


/* The page title band (1 Nov 2026): pale sky with the sun arc, so the article clearly starts below the site header */
.ar-hero { position: relative; overflow: hidden; background: var(--sky); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ar-hero::after { content: ""; position: absolute; right: -60px; bottom: -120px; width: 340px; height: 340px; background: url(/assets/sun-arc.svg) no-repeat center / contain; opacity: .55; pointer-events: none; }
.ar-hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: min(100%, var(--ar-measure)); justify-content: center; padding-top: 32px; padding-bottom: 40px; }
.ar-hero .ar-crumbs ol { margin-bottom: 16px; }
@media (max-width: 759px) {
  .ar-hero-grid { padding-top: 22px; padding-bottom: 28px; }
  .ar-hero::after { width: 220px; height: 220px; right: -70px; bottom: -90px; }
}

/* Reading text */
.ar-body { padding-bottom: 24px; }
.ar-body p, .ar-body li { font-size: 1.1875rem; line-height: 1.65; color: var(--ink); }
.ar-body p + p, .ar-body ul + p, .ar-body ol + p, .ar-body p + ul, .ar-body p + ol { margin-top: 16px; }
.ar-body ul, .ar-body ol { margin: 16px 0 0; padding-left: 1.4em; }
.ar-body li + li { margin-top: 8px; }
.ar-body li::marker { color: var(--ink-soft); }
.ar-body strong { font-weight: 600; }
.ar-body a, .ar-related a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--sun-coral); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.ar-body a:hover { text-decoration-thickness: 2.5px; }
.ar-sec { margin-top: 64px; }
.ar-sec > h2 { font: 500 clamp(1.625rem, 1.4rem + .7vw, 2rem)/1.2 var(--display); letter-spacing: -0.01em; color: var(--ink); scroll-margin-top: 104px; text-wrap: balance; }
.ar-sec > h2 + * { margin-top: 18px; }
.ar-body h3 { margin-top: 32px; font: 600 1.25rem/1.35 var(--text); color: var(--ink); }
.ar-body h3 + p, .ar-body h3 + ul, .ar-body h3 + ol { margin-top: 8px; }
.ar-body .ar-source { margin-top: 18px; font-size: .9375rem; line-height: 1.5; color: var(--ink-soft); }
.ar-body .ar-source a { color: var(--ink-soft); }
.ar-cols { columns: 2; column-gap: 40px; }
.ar-cols li { break-inside: avoid; }

/* In short: plain bullets under a small heading, straight after the byline */
.ar-short { margin-top: 32px; }
.ar-short h2 { font: 600 1.25rem/1.3 var(--text); color: var(--ink); }
.ar-short ul { margin-top: 10px; }

/* The comparison table: plain, labelled rows, status as a coloured word */
.ar-table { margin-top: 32px; overflow-x: auto; }
.ar-body .ar-table + p { margin-top: 18px; }
.ar-table:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.ar-table table { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.5; }
.ar-table caption { caption-side: top; padding-bottom: 10px; text-align: left; font: 600 1.25rem/1.3 var(--text); color: var(--ink); }
.ar-table th, .ar-table td { padding: 12px 16px 12px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); color: var(--ink); }
.ar-table thead th { padding-top: 6px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); font-size: .9375rem; font-weight: 600; }
.ar-table tbody th { font-weight: 600; }
.ar-table tbody th a { color: var(--ink); text-decoration-color: var(--sun-coral); text-underline-offset: 3px; }
.ar-table tr > :last-child { padding-right: 0; }
.st { font-weight: 600; white-space: nowrap; }
.st--open { color: var(--st-open-ink); }
.st--end { color: var(--st-end-ink); }
.st--shut { color: var(--st-shut-ink); }

/* On this page */
.ar-toc-title { font-size: .9375rem; font-weight: 600; color: var(--ink); }
.ar-toc ol { list-style: none; margin: 10px 0 0; padding: 0; }
.ar-toc a { display: block; padding: 6px 0 6px 14px; border-left: 2px solid var(--line); font-size: .9375rem; line-height: 1.4; color: var(--ink-soft); text-decoration: none; }
.ar-toc a:hover { color: var(--ink); border-left-color: var(--line-strong); }
.ar-toc a[aria-current="true"] { color: var(--ink); font-weight: 600; border-left-color: var(--ink); }
.ar-toc--inline { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); }
.ar-toc--inline ol { columns: 2; column-gap: 32px; }
.ar-toc--inline li { break-inside: avoid; }
.ar-toc--side .ar-toc-title { margin-top: 4px; }

/* The one box: a quote, with a photo of our own work */
.ar-quote { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 64px; padding: 28px; border-radius: 12px; background: var(--sky); }
.ar-quote-photo { margin: 0; }
.ar-quote-photo img { display: block; width: 100%; height: auto; border-radius: 8px; }
.ar-quote-photo figcaption { margin-top: 8px; font-size: .875rem; line-height: 1.45; color: var(--ink-soft); }
.ar-quote-title { font: 500 1.625rem/1.2 var(--display); letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
.ar-body .ar-quote-text { margin-top: 8px; font-size: 1.0625rem; line-height: 1.55; }
.ar-quote .quote-form { margin-top: 16px; max-width: 420px; }
.ar-body .ar-quote-small { margin-top: 12px; font-size: .875rem; line-height: 1.5; color: var(--ink-soft); }
.ar-body .ar-quote-small a { color: var(--ink-soft); }

/* Questions people ask: one column, a heading per question */
.ar-faq h3:first-of-type { margin-top: 20px; }

/* About this guide */
.ar-about { padding-top: 28px; border-top: 1px solid var(--line); }
.ar-related { margin-top: 12px; }
.ar-sources { margin-top: 18px; }
.ar-sources summary { display: inline-flex; min-height: 44px; align-items: center; cursor: pointer; font-size: 1rem; font-weight: 600; color: var(--ink); }
.ar-sources ol { margin-top: 8px; }
.ar-body .ar-sources li { font-size: .9375rem; line-height: 1.5; color: var(--ink-soft); }
.ar-sources a { overflow-wrap: anywhere; }

/* The closing quote section's team */
.ar-close { margin-top: clamp(56px, 7vw, 88px); }
.book-intro .ar-team-title { margin-top: 32px; font-size: 1rem; font-weight: 600; color: var(--ink); }
.ar-team { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; max-width: 34rem; margin: 12px 0 0; padding: 0; list-style: none; }
.ar-team li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: center; }
.ar-team img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.ar-team span { display: flex; flex-direction: column; font-size: .9375rem; line-height: 1.35; color: var(--ink-soft); }
.ar-team strong { font-size: 1.0625rem; font-weight: 600; color: var(--ink); }

/* Phones and small tablets */
@media (max-width: 760px) {
  .ar-quote { grid-template-columns: 1fr; gap: 18px; padding: 22px 18px; }
  .ar-quote-photo { max-width: 360px; }
}
@media (max-width: 640px) {
  .ar-grid { padding-top: 18px; }
  .ar-crumbs ol { margin-bottom: 14px; }
  .ar-body p, .ar-body li { font-size: 1.0625rem; line-height: 1.6; }
  .ar-sec { margin-top: 48px; }
  .ar-toc--inline ol, .ar-cols { columns: 1; }
  .ar-table thead { display: none; }
  .ar-table caption { padding-bottom: 4px; }
  .ar-table tr { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .ar-table th, .ar-table td { padding: 0; border: 0; }
  .st { white-space: normal; }
  .ar-table td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; }
}

/* Author block at the foot of the title band (1 Nov 2026) */
.ar-author { display: flex; align-items: center; gap: 14px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line-strong); }
.ar-author-faces { display: flex; flex: none; }
.ar-author-faces img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 3px solid var(--sky); background: #fff; }
.ar-author-faces img + img { margin-left: -14px; }
.ar-author-text p { margin: 0; }
.ar-author-name { font-size: 1.0625rem; font-weight: 600; line-height: 1.35; color: var(--ink); }
.ar-author-name a { color: var(--ink); text-decoration-color: var(--sun-coral); text-underline-offset: 3px; }
.ar-author-meta { margin-top: 2px !important; font-size: .9375rem; line-height: 1.45; color: var(--ink-soft); }
.ar-author-meta a { color: var(--ink-soft); }
.ar-author-meta span { margin: 0 4px; }
.ar-hero .ar-disclose { margin-top: 12px; font-size: .875rem; color: var(--ink-soft); }

/* Figures in articles (1 Nov 2026): illustrations and photos inside the reading column */
.ar-fig { margin: 24px 0 8px; }
.ar-fig img { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--sky); }
.ar-fig figcaption { margin-top: 8px; font-size: .875rem; line-height: 1.45; color: var(--ink-soft); }
.ar-sec > h2 + .ar-fig { margin-top: 18px; }

/* Answer cards (1 Nov 2026; answerCards() in article.mjs) */
.ar-body .ar-cards-title { margin-top: 40px; font: 500 clamp(1.625rem, 1.4rem + .7vw, 2rem)/1.2 var(--display); letter-spacing: -0.01em; color: var(--ink); text-wrap: balance; }
.ar-body .ar-cards-intro { margin-top: 14px; }
.ar-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-top: 16px; }
.ar-card { padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.ar-card--top { border: 2px solid var(--sun-solid); }
.ar-body .ar-card p { margin: 0; }
.ar-body .ar-card .ar-card-q { font-size: 1rem; line-height: 1.35; font-weight: 600; color: var(--ink-soft); }
.ar-body .ar-card .ar-card-n { margin-top: 6px; font: 500 2.75rem/1 var(--display); color: var(--ink); letter-spacing: -.01em; }
.ar-body .ar-card .ar-card-u { margin-top: 4px; font-size: .9375rem; line-height: 1.35; color: var(--ink-soft); }
.ar-body .ar-card .ar-card-a { margin-top: 10px; font-size: 1rem; line-height: 1.45; color: var(--ink); }
.ar-body .ar-cards-note { margin-top: 12px; font-size: .9375rem; line-height: 1.5; color: var(--ink-soft); }
@media (max-width: 759px) { .ar-cards { grid-template-columns: 1fr; gap: 10px; } .ar-card { padding: 14px 16px; } .ar-body .ar-card .ar-card-n { font-size: 2.25rem; } }

/* Rating tables (ratingTable() in article.mjs): row tints green to red, plus stars */
.ar-body .ar-rate-key { margin-top: 14px; font-size: .9375rem; color: var(--ink-soft); }
.ar-rate tbody tr.ar-r5 { background: #e2f1e5; }
.ar-rate tbody tr.ar-r4 { background: #edf5e0; }
.ar-rate tbody tr.ar-r3 { background: #fbf2d6; }
.ar-rate tbody tr.ar-r2 { background: #fce7d8; }
.ar-rate tbody tr.ar-r1 { background: #f9dedb; }
.ar-rate tbody tr { border-bottom: 2px solid #fff; }
.ar-rate tbody th, .ar-rate tbody td { border-bottom: 0; }
.ar-rate tbody th:first-child, .ar-rate thead th:first-child { padding-left: 14px; }
.ar-stars { white-space: nowrap; font-size: 1.125rem; letter-spacing: 1px; color: rgba(38, 40, 42, .22); }
.ar-stars .on { color: #b84c1c; }
@media (max-width: 759px) { .ar-rate tbody tr { padding: 12px 14px; } .ar-rate tbody th:first-child, .ar-rate thead th:first-child { padding-left: 0; } }
