/* SunSetup — Static content pages (how it works, FAQ, legal, 404)
   Shares the design tokens from styles.css. */

body.page {
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* === HEADER === */
.page-header {
  position: relative;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-bot) 100%);
  padding: 22px 24px 92px;
  overflow: hidden;
}
.page-header::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 60px;
  background: var(--bg);
  clip-path: polygon(0 100%, 0 55%, 18% 38%, 42% 62%, 68% 30%, 88% 52%, 100% 40%, 100% 100%);
}
.page-header__inner { max-width: 780px; margin: 0 auto; position: relative; z-index: 1; }

.page-brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; margin-bottom: 34px;
}
.page-brand__mark {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold-light) 48%, var(--orange));
  box-shadow: 0 3px 14px rgba(251,191,36,0.55);
}
.page-brand__name {
  font-family: var(--font-d); font-weight: 800; font-size: 1.05rem;
  color: #fff; letter-spacing: 1.6px; text-transform: uppercase;
}

.breadcrumb { font-size: 0.8rem; color: rgba(255,255,255,0.82); margin-bottom: 12px; }
.breadcrumb a { color: rgba(255,255,255,0.92); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.4); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb span { margin: 0 6px; opacity: 0.6; }

.page-title {
  font-family: var(--font-d); font-weight: 800; color: #fff;
  font-size: clamp(1.9rem, 4.4vw, 2.9rem); line-height: 1.15; margin-bottom: 10px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.18);
}
.page-lede {
  font-size: clamp(1rem, 2vw, 1.12rem); color: rgba(255,255,255,0.95);
  max-width: 620px; line-height: 1.6;
}

/* === CONTENT === */
.page-main {
  max-width: 780px; margin: 0 auto; padding: 0 24px 72px;
  position: relative; z-index: 2;
}
.prose {
  background: #fff; border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: 0 12px 48px rgba(15,40,80,0.08);
  padding: 44px 48px;
  margin-top: -46px;
}
.prose > * + * { margin-top: 18px; }
.prose h2 {
  font-family: var(--font-d); font-weight: 800; font-size: 1.45rem;
  line-height: 1.3; margin-top: 40px; scroll-margin-top: 20px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-family: var(--font-d); font-weight: 700; font-size: 1.1rem; margin-top: 28px;
}
.prose p, .prose li { color: var(--text-m); line-height: 1.75; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 8px; }
.prose a { color: var(--gold-dark); font-weight: 600; }
.prose a:hover { color: var(--orange); }
.prose strong { color: var(--text); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 34px 0; }
.prose small { font-size: 0.82rem; color: var(--text-d); }
/* Caveats that belong with a table but shouldn't compete with it for attention. */
.prose p.fineprint { font-size: 0.84rem; line-height: 1.6; color: var(--text-d); margin-top: 10px; }

/* Table of contents */
.toc {
  background: linear-gradient(135deg, #fffdf5, #fef9e7);
  border: 1px solid rgba(245,158,11,0.28);
  border-radius: var(--r-lg); padding: 20px 24px;
}
.toc p { font-weight: 700; color: var(--text); margin-bottom: 8px; font-size: 0.9rem; }
.toc ul { list-style: none; padding: 0; display: grid; gap: 4px; }
.toc li + li { margin-top: 0; }
.toc a { font-weight: 500; font-size: 0.94rem; }

/* Numbered steps */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 14px; }
.steps li {
  counter-increment: step;
  position: relative; padding: 18px 20px 18px 62px;
  background: #f8fafc; border: 1px solid var(--border); border-radius: var(--r-md);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 18px; top: 17px;
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light), var(--orange));
  color: #fff; font-family: var(--font-d); font-weight: 800; font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center;
}
.steps b { display: block; color: var(--text); margin-bottom: 3px; }

/* Fact table */
.fact-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.fact-table th, .fact-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.fact-table th { font-family: var(--font-d); font-weight: 700; color: var(--text); background: #f8fafc; }
.fact-table td { color: var(--text-m); }
/* Figures read as one token — "1,450 – 1,750" broken across two lines is worse
   than a horizontal scroll, which .table-scroll already provides. */
.fact-table .num { white-space: nowrap; }
/* A table wider than the phone scrolls sideways — but a table that gives no sign
   it can scroll just looks like a table missing its last two columns. The paired
   gradients are the standard CSS-only scroll shadow: the covers are painted in
   the scroller's own coordinate space (`local`) and slide away from each edge as
   you scroll, uncovering the fixed shadows behind them. No JS, and nothing shows
   at all when the table already fits. */
.table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--card) 40%, rgba(255,255,255,0)) left center / 44px 100% no-repeat local,
    linear-gradient(to left,  var(--card) 40%, rgba(255,255,255,0)) right center / 44px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%,   rgba(15,23,42,0.14), rgba(15,23,42,0)) left center / 16px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(15,23,42,0.14), rgba(15,23,42,0)) right center / 16px 100% no-repeat scroll;
}

/* FAQ list */
.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item:last-child { border-bottom: 0; padding-bottom: 0; }
.faq-item h2 { font-size: 1.12rem; margin-top: 0; margin-bottom: 8px; }
/* .prose > * + * only reaches direct children, so space the answer paragraphs here */
.faq-item > * + * { margin-top: 12px; }

/* === ARTICLE META === */
.article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  font-size: 0.84rem; color: rgba(255,255,255,0.86); margin-top: 16px;
}
.article-meta__dot { opacity: 0.5; }

/* Key-takeaways box at the top of an article */
.takeaways {
  margin-top: 0;
  background: #f8fafc; border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--r-md); padding: 20px 24px;
}
.takeaways p { font-weight: 700; color: var(--text); margin-bottom: 8px; font-size: 0.92rem; }
.takeaways ul { padding-left: 20px; }
.takeaways li { font-size: 0.94rem; }

/* Pull-out caveat / disclaimer */
.callout {
  background: linear-gradient(135deg, #fffdf5, #fef9e7);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--r-md); padding: 18px 22px;
  font-size: 0.92rem;
}
.callout strong { display: block; margin-bottom: 4px; }

/* === ARTICLE INDEX (blog hub) === */
.post-grid { display: grid; gap: 18px; }
@media (min-width: 720px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }

/* Two classes so this beats `.prose a`, which would otherwise make every span
   inside the card gold and semi-bold. */
.prose .post-card, .post-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 24px 26px; text-decoration: none;
  color: var(--text-m); font-weight: 400;
  box-shadow: 0 4px 18px rgba(15,40,80,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.post-card:hover {
  transform: translateY(-3px); border-color: rgba(245,158,11,0.45);
  box-shadow: 0 12px 32px rgba(15,40,80,0.1);
}
.post-card__tag {
  align-self: flex-start;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--gold-dark); background: #fef3c7;
  padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
}
.post-card__title {
  font-family: var(--font-d); font-weight: 800; font-size: 1.12rem;
  line-height: 1.35; color: var(--text); margin-bottom: 8px;
}
.post-card__excerpt { font-size: 0.92rem; color: var(--text-m); line-height: 1.6; flex: 1; }
.post-card__foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; font-size: 0.8rem; color: var(--text-d);
}
/* min-width:0 lets the label shrink; nowrap keeps "Read →" from breaking in two */
.post-card__foot > :first-child { min-width: 0; }
.post-card__more { margin-left: auto; color: var(--gold-dark); font-weight: 700; white-space: nowrap; flex: none; }

/* Featured (first) card spans both columns */
@media (min-width: 720px) {
  .post-card--featured { grid-column: 1 / -1; }
  .post-card--featured .post-card__title { font-size: 1.4rem; }
  .post-card--featured .post-card__excerpt { font-size: 0.98rem; }
}

/* === RELATED ARTICLES === */
.related { margin-top: 34px; }
.related h2 { font-family: var(--font-d); font-weight: 800; font-size: 1.15rem; margin-bottom: 14px; }
.related ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.related li { margin: 0; }
.related a {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px 18px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 0.94rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.related a:hover { border-color: rgba(245,158,11,0.5); transform: translateX(3px); color: var(--text); }
.related a::after { content: '→'; margin-left: auto; color: var(--gold-dark); }

/* === READING PROGRESS === */
.read-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: 40; pointer-events: none; background: transparent;
}
.read-progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold-light), var(--gold), var(--orange));
  box-shadow: 0 0 10px rgba(251,191,36,0.55);
  transition: width 0.08s linear;
}

/* === BACK TO TOP === */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 30;
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: var(--gold-dark);
  border: 1px solid var(--border); cursor: pointer;
  box-shadow: 0 8px 26px rgba(15,40,80,0.18);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { color: var(--orange); border-color: rgba(245,158,11,0.5); }
.to-top:focus-visible { outline: 3px solid rgba(245,158,11,0.55); outline-offset: 2px; }

/* === TOC current-section highlight === */
.toc a.is-current {
  color: var(--orange); font-weight: 700;
}
.toc a.is-current::before {
  content: '▸ '; margin-left: -12px;
}

/* === TAG FILTER (guides hub) === */
.tag-filter {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 22px;
}
.tag-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; min-height: 38px;
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  font-family: var(--font); font-size: 0.86rem; font-weight: 600; color: var(--text-m);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.tag-chip:hover { border-color: rgba(245,158,11,0.5); color: var(--text); }
.tag-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tag-chip.is-active {
  background: linear-gradient(135deg, var(--gold), var(--orange));
  border-color: transparent; color: #1a1a2e;
}
.tag-chip__n {
  font-size: 0.74rem; font-weight: 700; opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.tag-chip.is-active .tag-chip__n { opacity: 0.85; }
.post-card[hidden] { display: none; }

/* Call to action */
.page-cta {
  margin-top: 34px; padding: 30px 32px; text-align: center;
  background: linear-gradient(135deg, rgba(255,253,245,0.98), rgba(254,243,199,0.98));
  border: 1px solid rgba(245,158,11,0.35); border-radius: var(--r-xl);
  box-shadow: 0 8px 32px rgba(251,191,36,0.16);
}
.page-cta h2 { font-family: var(--font-d); font-weight: 800; font-size: 1.3rem; margin-bottom: 6px; }
.page-cta p { color: var(--text-m); margin-bottom: 18px; }
.page-cta .btn { text-decoration: none; }

.btn-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 15px 34px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #1a1a2e; font-weight: 700; font-size: 1rem; text-decoration: none;
  box-shadow: 0 4px 20px rgba(251,191,36,0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-link:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(251,191,36,0.5); color: #1a1a2e; }
.btn-link:focus-visible { outline: 3px solid rgba(245,158,11,0.55); outline-offset: 2px; }

/* === FOOTER === */
.page-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 30px 24px 36px;
}
.page-footer__inner {
  max-width: 780px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
}
.page-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.page-footer a { color: var(--text-m); text-decoration: none; font-size: 0.88rem; font-weight: 500; }
.page-footer a:hover { color: var(--gold-dark); }
.page-footer small { color: var(--text-d); font-size: 0.8rem; }

/* === RESPONSIVE === */
@media (max-width: 680px) {
  .page-header { padding: 18px 20px 76px; }
  .page-main { padding: 0 16px 48px; }
  .prose { padding: 28px 22px; border-radius: var(--r-lg); }
  .prose h2 { font-size: 1.25rem; }
  .page-cta { padding: 24px 20px; }
  .steps li { padding: 16px 16px 16px 56px; }
  .page-footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* === PRINT ===
   Guides get saved and printed — mostly the cost and comparison tables. */
@media print {
  .read-progress, .to-top, .tag-filter, .page-cta, .related,
  .page-footer nav, .breadcrumb { display: none !important; }

  body.page { background: #fff; color: #000; }
  .page-header {
    background: #fff !important; padding: 0 0 12px;
    border-bottom: 2px solid #000; color: #000;
  }
  .page-header::after, .page-brand__mark { display: none; }
  .page-title, .page-lede, .page-brand__name, .article-meta { color: #000; text-shadow: none; }
  .page-brand__name { letter-spacing: 1px; }

  .page-main { max-width: none; padding: 0; }
  .prose {
    box-shadow: none; border: 0; border-radius: 0;
    margin-top: 18px; padding: 0;
    font-size: 11pt;
  }
  .prose h2 { page-break-after: avoid; break-after: avoid; }
  .prose a { color: #000; text-decoration: underline; }
  /* Spell out link targets — a printed page has no hover */
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }

  .takeaways, .callout, .toc {
    border: 1px solid #999; background: #fff !important;
    page-break-inside: avoid; break-inside: avoid;
  }
  .fact-table { page-break-inside: avoid; break-inside: avoid; }
  .fact-table th { background: #eee !important; }
  .table-scroll { overflow: visible; }
  .steps li { page-break-inside: avoid; break-inside: avoid; background: #fff; border-color: #999; }
  .steps li::before { background: #000 !important; color: #fff; }
}
