/*
 * Shared blocks for the refreshed inner pages (contact, about, articles, FAQ,
 * help centre, legal, 404). Loaded on every page after refresh.css.
 * Prefix: pg-. Colours and fonts come from the --sb-* tokens in refresh.css.
 */

/* ---------- Layout ---------- */
.pg-wrap { max-width: 1000px; margin: 0 auto; padding-left: 2rem; padding-right: 2rem; }
.pg-wrap--narrow { max-width: 800px; }
.pg-section { padding-top: clamp(2.5rem, 1rem + 4vw, 4.5rem); padding-bottom: clamp(2.5rem, 1rem + 4vw, 4.5rem); }
.pg-section--tight-top { padding-top: 0; }
.pg-band--cream { background: var(--sb-cream); }
@media (max-width: 768px) { .pg-wrap { padding-left: 1.25rem; padding-right: 1.25rem; } }

/* ---------- Page hero ---------- */
.pg-hero {
  background: linear-gradient(180deg, var(--sb-cream) 0%, #f7faf4 100%);
  border-bottom: 1px solid var(--sb-green-pale);
  padding: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) 0 clamp(2.25rem, 1.25rem + 3vw, 3.5rem);
}
.pg-hero--center { text-align: center; }
.pg-hero--center .pg-lead { margin-left: auto; margin-right: auto; }
.pg-eyebrow {
  margin: 0 0 0.6rem;
  color: var(--sb-green-dark);
  font: 700 0.8rem var(--sb-font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pg-hero h1 {
  margin: 0 0 0.9rem;
  color: var(--sb-ink);
  font: 700 clamp(2.1rem, 1.5rem + 2.4vw, 3rem)/1.08 var(--sb-font-display);
  letter-spacing: -0.03em;
}
.pg-hero h1 .pg-hl { color: var(--sb-green-dark); }
main .pg-lead, .pg-lead {
  max-width: 60ch;
  margin: 0;
  color: var(--sb-ink-muted);
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  line-height: 1.6;
}
.pg-meta { margin-top: 1rem; color: var(--sb-grey); font-size: 0.92rem; font-weight: 600; }

/* ---------- Buttons ---------- */
.pg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 50px; padding: 0 1.4rem; border-radius: var(--sb-radius);
  background: var(--sb-green-dark); color: #fff; border: 2px solid var(--sb-green-dark);
  font: 700 1rem var(--sb-font-body); text-decoration: none; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.pg-btn:hover { background: var(--sb-green-deep); border-color: var(--sb-green-deep); }
.pg-btn--ghost { background: transparent; color: var(--sb-green-dark); }
.pg-btn--ghost:hover { background: var(--sb-green-pale); border-color: var(--sb-green-dark); }
.pg-btn--light { background: #fff; border-color: #fff; color: var(--sb-green-dark); }
.pg-btn--light:hover { background: var(--sb-cream); border-color: var(--sb-cream); }
.pg-btn--outline-light { background: transparent; border-color: rgba(255, 255, 255, 0.7); color: #fff; }
.pg-btn--outline-light:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; }
.pg-btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* ---------- Cards ---------- */
.pg-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.pg-cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pg-card {
  position: relative;
  display: flex; flex-direction: column; gap: 0.4rem;
  padding: 1.4rem 1.4rem 1.3rem;
  border-radius: var(--sb-radius);
  background: #fff;
  border: 1px solid var(--sb-green-pale);
  box-shadow: 0 14px 30px rgba(1, 39, 10, 0.06);
  color: var(--sb-ink);
}
a.pg-card { text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
a.pg-card:hover { transform: translateY(-2px); border-color: var(--sb-green-light); box-shadow: 0 18px 36px rgba(1, 39, 10, 0.1); }
.pg-card h2, .pg-card h3 { margin: 0; color: var(--sb-ink); font: 700 1.15rem/1.3 var(--sb-font-display); letter-spacing: -0.015em; }
main .pg-card p, .pg-card p { margin: 0; color: var(--sb-ink-muted); font-size: 0.98rem; line-height: 1.55; }
.pg-card__icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: 0.5rem;
  border-radius: 12px; background: var(--sb-green-pale); color: var(--sb-green-dark);
}
.pg-card__icon svg { width: 22px; height: 22px; }
.pg-card__link { margin-top: auto; padding-top: 0.6rem; color: var(--sb-green-dark); font-weight: 700; }
.pg-card__link::after { content: " →"; }
.pg-card--feature { background: linear-gradient(140deg, var(--sb-green-deep) 0%, var(--sb-green-dark) 55%, var(--sb-green) 140%); border-color: transparent; color: #fff; }
.pg-card--feature h2, .pg-card--feature h3 { color: #fff; }
main .pg-card--feature p, .pg-card--feature p { color: rgba(255, 255, 255, 0.88); }
.pg-card--feature .pg-card__icon { background: rgba(255, 255, 255, 0.16); color: #fff; }
.pg-card--feature .pg-card__link { color: #fff; }
.pg-card--feature a { color: #fff; }
@media (max-width: 860px) { .pg-cards, .pg-cards--2 { grid-template-columns: 1fr; } }

/* ---------- Green CTA card ---------- */
.pg-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem 2rem;
  padding: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  border-radius: calc(var(--sb-radius) + 4px);
  background: linear-gradient(135deg, var(--sb-green-deep) 0%, var(--sb-green-dark) 55%, var(--sb-green) 130%);
  color: #fff;
}
.pg-cta h2 { margin: 0 0 0.4rem; color: #fff; font: 700 clamp(1.4rem, 1.1rem + 1vw, 1.8rem)/1.2 var(--sb-font-display); letter-spacing: -0.02em; }
main .pg-cta p, .pg-cta p { margin: 0; color: rgba(255, 255, 255, 0.88); max-width: 52ch; }
.pg-cta .pg-btn-row { flex-shrink: 0; }
.pg-cta--center { flex-direction: column; text-align: center; }
.pg-cta--center p { margin-left: auto; margin-right: auto; }
@media (max-width: 768px) {
  .pg-cta { flex-direction: column; align-items: flex-start; }
  .pg-cta--center { align-items: center; }
  .pg-cta .pg-btn-row { width: 100%; }
  .pg-cta .pg-btn { flex: 1 1 auto; }
}

/* ---------- Jump links ---------- */
.pg-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.pg-hero--center .pg-chips { justify-content: center; }
.pg-chips a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 0.9rem;
  border-radius: 999px; border: 1px solid var(--sb-green-pale); background: #fff;
  color: var(--sb-ink); font-size: 0.9rem; font-weight: 600; text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.pg-chips a:hover { border-color: var(--sb-green-light); color: var(--sb-green-dark); }

/* ---------- FAQ / help groups (accordion styles live in refresh.css) ---------- */
.pg-faq { max-width: 800px; margin: 0 auto; }
.pg-faq .faq-container { gap: 0.6rem; }
.pg-faq-group {
  scroll-margin-top: 1.5rem;
  margin: 2.25rem 0 0.4rem;
  color: var(--sb-ink);
  font: 700 1.35rem/1.25 var(--sb-font-display);
  letter-spacing: -0.02em;
}
main h2.pg-faq-group { font-size: 1.35rem; }
.pg-faq-group:first-child { margin-top: 0; }
.pg-faq .faq-answer ul, .pg-faq .faq-answer ol { margin: 0.5rem 0 0 1.25rem; color: var(--sb-ink-muted); }
.pg-faq .faq-answer li { margin-bottom: 0.35rem; line-height: 1.55; }
.pg-faq .faq-answer a { color: var(--sb-green-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.pg-faq .faq-question[aria-expanded="true"] + .faq-answer { max-height: 1200px; }

/* ---------- Long-form text (legal pages) ---------- */
.pg-prose { max-width: 760px; color: var(--sb-ink); }
.pg-prose h2 {
  margin: 2.25rem 0 0.75rem; padding-top: 1.5rem; border-top: 1px solid var(--sb-green-pale);
  color: var(--sb-ink); font: 700 1.3rem/1.3 var(--sb-font-display); letter-spacing: -0.015em;
}
main .pg-prose h2 { font-size: 1.3rem; }
.pg-prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.pg-prose h3 { margin: 1.5rem 0 0.5rem; color: var(--sb-ink); font: 700 1.08rem var(--sb-font-display); }
.pg-prose p, main section.pg-prose p { margin: 0 0 1rem; color: var(--sb-ink-muted); font-size: 1.02rem; line-height: 1.7; }
.pg-prose ul, .pg-prose ol { margin: 0 0 1.1rem; padding-left: 1.3rem; color: var(--sb-ink-muted); line-height: 1.65; }
.pg-prose li { margin-bottom: 0.4rem; }
.pg-prose li::marker { color: var(--sb-green); }
.pg-prose strong, .pg-prose b { color: var(--sb-ink); }
.pg-prose a { color: var(--sb-green-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Article template ---------- */
.pg-article .text_section {
  max-width: 760px;
  padding: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  color: var(--sb-ink);
}
.pg-article .text_section > h2,
.pg-article .text_section section > h2 { color: var(--sb-ink); font-size: clamp(1.4rem, 1.15rem + 0.9vw, 1.75rem); margin-top: 2rem; }
/* Body text rules apply only to the article's own content (direct children), so the
   interactive tools keep their own colours, including their dark result panels. */
.pg-article .text_section h2 { color: var(--sb-ink); }
.pg-article .text_section h3 { color: var(--sb-ink); font-family: var(--sb-font-display); letter-spacing: -0.01em; }
.pg-article .text_section > p { color: var(--sb-ink-muted); font-size: 1.06rem; line-height: 1.75; }
.pg-article .text_section > :is(ul, ol) > li { color: var(--sb-ink-muted); line-height: 1.7; }
.pg-article .text_section > :is(p, ul, ol) strong { color: var(--sb-ink); }
.pg-article .text_section p a:not(.article-cta),
.pg-article .text_section :is(.article-numbered-list, .article-tip-list) a,
.pg-article .article-table a { color: var(--sb-green-dark); }
.pg-article img { filter: none; }
.pg-article .article-answer { border-color: var(--sb-green-pale); background: var(--sb-cream); color: var(--sb-ink); border-radius: var(--sb-radius); }
.pg-article .article-answer h2 { color: var(--sb-ink); font-size: 1.3rem; margin-top: 0; }
.pg-article .article-eyebrow { color: var(--sb-green-dark); }
.pg-article .article-callout { border-left-color: var(--sb-green); background: var(--sb-cream); color: var(--sb-ink); border-radius: 0 12px 12px 0; }
.pg-article .article-tip-list li { border-color: var(--sb-green-pale); background: #fbfdf9; }
.pg-article .article-tip-list li::before { color: var(--sb-green-dark); }
.pg-article .article-feature-image { border-color: var(--sb-green-pale); border-radius: var(--sb-radius); }

.pg-related { margin-top: 3rem; }
.pg-related h2 { margin: 0 0 1rem; color: var(--sb-ink); font: 700 1.3rem var(--sb-font-display); }
main .pg-related h2 { font-size: 1.3rem; }
.pg-related ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--sb-green-pale); }
.pg-related li { margin: 0 !important; border-bottom: 1px solid var(--sb-green-pale); }
.pg-related ul a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.95rem 0.2rem; color: var(--sb-ink); font-weight: 700; text-decoration: none !important; }
.pg-related ul a::after { content: "→"; color: var(--sb-green-dark); transition: transform 0.15s ease; }
.pg-related ul a:hover { color: var(--sb-green-dark); }
.pg-related ul a:hover::after { transform: translateX(4px); }
.pg-related__all { margin-top: 1.25rem; }

/* ---------- Article cards (articles hub) ---------- */
.pg-articles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 960px) { .pg-articles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .pg-articles { grid-template-columns: 1fr; } }
.article-card {
  display: flex; flex-direction: column; gap: 0.55rem;
  padding: 1.35rem 1.35rem 1.2rem;
  border-radius: var(--sb-radius); background: #fff; border: 1px solid var(--sb-green-pale);
  box-shadow: 0 14px 30px rgba(1, 39, 10, 0.05);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.article-card:hover { transform: translateY(-2px); border-color: var(--sb-green-light); box-shadow: 0 18px 36px rgba(1, 39, 10, 0.09); }
.article-card .article-category {
  align-self: flex-start; padding: 0.25rem 0.65rem; border-radius: 999px;
  background: var(--sb-green-pale); color: var(--sb-green-dark);
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
}
.article-card h3 { margin: 0.2rem 0 0; color: var(--sb-ink); font: 700 1.15rem/1.3 var(--sb-font-display); letter-spacing: -0.015em; }
.article-card h3 a { color: inherit; text-decoration: none; }
.article-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.article-card { position: relative; }
main .article-card p, .article-card p { margin: 0; flex: 1; color: var(--sb-ink-muted); font-size: 0.97rem; line-height: 1.55; }
.article-card .article-link { margin-top: 0.4rem; color: var(--sb-green-dark); font-weight: 700; }
.article-card .article-link::after { content: " →"; }

/* Featured article on the hub */
.pg-featured {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2rem; align-items: center;
  margin-bottom: 2rem; padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  border-radius: calc(var(--sb-radius) + 4px);
  background: linear-gradient(135deg, var(--sb-green-deep) 0%, var(--sb-green-dark) 60%, var(--sb-green) 140%);
  color: #fff; position: relative;
}
.pg-featured .article-category { display: inline-block; padding: 0.25rem 0.65rem; border-radius: 999px; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.pg-featured h2 { margin: 0.8rem 0 0.6rem; color: #fff; font: 700 clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem)/1.15 var(--sb-font-display); letter-spacing: -0.02em; }
.pg-featured h2 a { color: inherit; text-decoration: none; }
.pg-featured h2 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
main .pg-featured p, .pg-featured p { margin: 0; color: rgba(255, 255, 255, 0.88); }
.pg-featured__link { display: inline-block; margin-top: 1.1rem; color: #fff; font-weight: 700; }
.pg-featured__link::after { content: " →"; }
.pg-featured__art { display: grid; place-items: center; }
.pg-featured__art img { width: 100%; max-width: 340px; height: auto; border-radius: var(--sb-radius); filter: none; }
@media (max-width: 768px) { .pg-featured { grid-template-columns: 1fr; } .pg-featured__art { display: none; } }

/* ---------- 404 ---------- */
.pg-404 { min-height: 52vh; display: grid; place-items: center; text-align: center; }
.pg-404__code { font: 800 clamp(4rem, 3rem + 6vw, 7rem)/1 var(--sb-font-display); color: var(--sb-green-pale); letter-spacing: -0.04em; margin-bottom: 0.5rem; }

.pg-article .pg-hero .pg-eyebrow a { color: inherit; text-decoration: none; }
.pg-article .pg-hero .pg-eyebrow a:hover { text-decoration: underline; }
.pg-article .pg-hero h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem); }
.pg-article-cta { margin-top: 3rem; }
.pg-article .text_section .pg-cta h2 { margin: 0 0 0.4rem; color: #fff; font-size: 1.4rem; }
.pg-article .text_section .pg-cta p { margin: 0; color: rgba(255, 255, 255, 0.88); font-size: 1rem; }

/* Jump links scroll sideways on phones instead of stacking */
@media (max-width: 640px) {
  .pg-chips, .pg-hero--center .pg-chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin-left: -1.25rem; margin-right: -1.25rem; padding: 0 1.25rem 0.25rem; scrollbar-width: none; text-align: left; }
  .pg-chips::-webkit-scrollbar { display: none; }
  .pg-chips a { flex: 0 0 auto; white-space: nowrap; }
}

/* ---------- Green hero variant ---------- */
.pg-hero--green { background: linear-gradient(135deg, var(--sb-green-deep) 0%, var(--sb-green-dark) 50%, var(--sb-green) 120%); border-bottom: 0; color: #fff; }
.pg-hero--green h1 { color: #fff; }
.pg-hero--green h1 .pg-hl { color: var(--sb-green-light); }
.pg-hero--green .pg-eyebrow { color: var(--sb-green-light); }
main .pg-hero--green .pg-lead, .pg-hero--green .pg-lead { color: rgba(255, 255, 255, 0.88); }

/* ---------- Search ---------- */
.pg-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pg-search { position: relative; max-width: 560px; margin: 1.75rem auto 0; }
.pg-search svg { position: absolute; left: 1.1rem; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--sb-grey); pointer-events: none; }
.pg-search input {
  width: 100%; min-height: 56px; padding: 0 1.2rem 0 3.1rem;
  border: 0; border-radius: var(--sb-radius); background: #fff; color: var(--sb-ink);
  font: 500 1.05rem var(--sb-font-body); box-shadow: 0 16px 36px rgba(1, 39, 10, 0.22);
}
.pg-search input:focus { outline: 3px solid var(--sb-green-light); outline-offset: 2px; }
.pg-search-empty { padding: 1.25rem; border-radius: var(--sb-radius); background: #fff; border: 1px dashed var(--sb-green-light); color: var(--sb-ink-muted); text-align: center; }
.pg-search-empty a { color: var(--sb-green-dark); font-weight: 700; }

/* ---------- Help layout: sticky topic list + questions ---------- */
.pg-help { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 2.5rem; align-items: start; max-width: 1100px; }
.pg-help .pg-faq { max-width: none; margin: 0; }
.pg-help .faq-item { background: #fff; }
.pg-help .faq-item:hover { border-color: var(--sb-green-light); }
.pg-help .faq-question:hover, .pg-help .faq-question:focus { background: var(--sb-cream); }
.pg-toc { position: sticky; top: 1.5rem; padding: 1rem; border-radius: var(--sb-radius); background: #fff; border: 1px solid var(--sb-green-pale); box-shadow: 0 14px 30px rgba(1, 39, 10, 0.05); }
.pg-toc__title { margin: 0 0 0.5rem 0.6rem; color: var(--sb-grey); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.pg-toc nav { display: flex; flex-direction: column; gap: 0.15rem; }
.pg-toc a { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0; padding: 0.5rem 0.6rem; border-radius: 10px; color: var(--sb-ink); font-size: 0.93rem; font-weight: 600; line-height: 1.3; text-decoration: none; }
.pg-toc a small { min-width: 1.5rem; padding: 0.05rem 0.4rem; border-radius: 999px; background: var(--sb-cream); color: var(--sb-ink-muted); font-size: 0.75rem; font-weight: 700; text-align: center; }
.pg-toc a:hover { background: var(--sb-cream); color: var(--sb-green-dark); }
.pg-toc a.is-active { background: var(--sb-green-pale); color: var(--sb-green-dark); }
.pg-toc a.is-active small { background: #fff; color: var(--sb-green-dark); }
.pg-chips a { margin-left: 0; }
.pg-chips--mobile { display: none; margin: 0 0 1.25rem; }
@media (max-width: 900px) {
  .pg-help { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pg-help > * { min-width: 0; }
  .pg-toc { display: none; }
  .pg-chips--mobile { display: flex; }
}
@media (max-width: 640px) {
  .pg-chips--mobile { margin-top: -0.5rem; }
}

/* Accordion focus: ring follows the card's rounded corners instead of a square outline clipped by them */
.faq-question:focus { outline: none; }
.faq-item:has(.faq-question:focus-visible) { border-color: var(--sb-green-dark); box-shadow: 0 0 0 2px var(--sb-green-dark); }
.faq-item:has(.faq-question[aria-expanded="true"]) { border-color: var(--sb-green-light); }
.pg-toc { max-height: calc(100vh - 3rem); overflow-y: auto; scrollbar-width: thin; }
.pg-toc__title--gap { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--sb-green-pale); }

/* Article step flow: light panels in the site palette (was a dark band) */
.pg-article .article-step-flow { background: var(--sb-cream); border: 1px solid var(--sb-green-pale); border-radius: var(--sb-radius); color: var(--sb-ink); }
.pg-article .article-step-flow__panel { background: #fff; border-color: var(--sb-green-pale); }
.pg-article .article-step-flow__number { background: var(--sb-green-pale); color: var(--sb-green-dark); }
.pg-article .text_section .article-step-flow h3 { color: var(--sb-ink); }
.pg-article .text_section .article-step-flow p { color: var(--sb-ink-muted); font-size: 0.95rem; line-height: 1.55; }
.pg-article .article-step-flow__arrow { color: var(--sb-green); }
.pg-article .article-step-flow figcaption { color: var(--sb-ink-muted); }
/* Sample record on the articles hub: a little white paper margin above the report */
.pg-featured__art img { background: #fff; padding-top: 0.6rem; }
