/* ═══════════════════════════════════════════════════════════════════════════
   Silver Clarity — shared blog styles
   Linked from every post + the blog index. Keeps CSS out of the HTML and
   lets one change ripple to every article.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --primary: #0d7377;
  --primary-dark: #084d51;
  --accent: #f0a500;
  --accent-dark: #c88a00;
  --bg: #f4f7f6;
  --card: #fff;
  --text: #1e2d2f;
  --text-light: #5a6f72;       /* WCAG AA on white & on #fafcfb */
  --border: #d8e4e2;
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
  font-size: 17px;            /* bumped from 16 for retiree readability */
}

img, svg { max-width: 100%; height: auto; }

/* ── Skip link (accessibility) ── */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--primary-dark); color: #fff;
  padding: 8px 14px; z-index: 1000;
  font-size: 14px; text-decoration: none;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ── Reading progress bar ── */
.reading-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; z-index: 50;
  background: transparent;
  pointer-events: none;
}
.reading-progress > span {
  display: block; height: 100%; width: 0;
  background: var(--accent);
  transition: width 0.05s linear;
}

/* ── Header ── */
header.site {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff; padding: 28px 24px 22px; text-align: center;
}
header.site .brand {
  display: inline-block; font-size: 14px; opacity: 0.85;
  margin-bottom: 6px; color: #fff; text-decoration: none;
}
header.site .crumbs { font-size: 13px; opacity: 0.85; }
header.site .crumbs a { color: #fff; text-decoration: none; }
header.site .crumbs a:hover { text-decoration: underline; }

/* ── Layout ── */
main { max-width: 760px; margin: 0 auto; padding: 32px 20px 80px; }
.back-link {
  display: inline-block; margin-bottom: 18px;
  color: var(--primary); text-decoration: none;
  font-size: 14px; font-weight: 600;
}
.back-link:hover { text-decoration: underline; }

/* ── Article shell ── */
article {
  background: var(--card); border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 36px 32px;
}
article h1 {
  font-size: 32px; color: var(--primary-dark);
  margin-bottom: 10px; line-height: 1.25;
}
article .byline { font-size: 14px; color: var(--text-light); margin-bottom: 4px; }
article .byline strong { color: var(--text); }
article .updated {
  font-size: 14px; color: var(--text-light);
  margin-bottom: 20px; padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
article h2 {
  font-size: 24px; color: var(--primary-dark);
  margin-top: 40px; margin-bottom: 12px; line-height: 1.3;
  scroll-margin-top: 16px;     /* anchor jumps land below the fixed bar */
}
article h3 {
  font-size: 19px; color: var(--text);
  margin-top: 26px; margin-bottom: 8px;
}
article p, article li { font-size: 17px; color: var(--text); margin-bottom: 14px; }
article ul, article ol { padding-left: 24px; margin-bottom: 16px; }
article a { color: var(--primary); }
article a:hover { color: var(--primary-dark); }
article strong { color: var(--text); }

/* ── Disclaimer ── */
.disclaimer {
  font-size: 14px; color: var(--text-light);
  background: #f7faf9; border-left: 3px solid var(--primary);
  padding: 12px 14px; border-radius: 4px; margin-bottom: 20px; line-height: 1.55;
}

/* ── Hero formula diagram (SVG) ── */
.formula-diagram { margin: 24px auto 8px; max-width: 100%; display: block; }

/* ── Formula text blocks ── */
.formula {
  background: #eef4f3; border-left: 4px solid var(--primary);
  padding: 14px 18px; margin: 16px 0; border-radius: 6px;
  font-size: 15.5px; font-family: 'Consolas', 'Courier New', monospace;
  color: var(--text); overflow-x: auto;
}
.formula strong { color: var(--primary-dark); }

/* ── Tables (with horizontal scroll on mobile) ── */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 18px 0; border: 1px solid var(--border); border-radius: 6px;
}
article table {
  width: 100%; border-collapse: collapse;
  font-size: 15px; min-width: 460px;
}
article th, article td {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  text-align: left; vertical-align: top;
}
article th { background: #eef4f3; font-weight: 600; color: var(--primary-dark); }
article tbody tr:nth-child(even) { background: #fafcfb; }
article tbody tr:last-child td { border-bottom: none; }

/* visually hidden but available to screen readers */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── Table of contents (collapsible) ── */
.toc {
  background: #fafcfb; border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 18px; margin: 22px 0 28px;
}
.toc summary {
  cursor: pointer; font-weight: 700; color: var(--primary-dark);
  font-size: 15px; padding: 4px 0;
}
.toc summary::marker { color: var(--primary); }
.toc ul { list-style: none; padding-left: 0; margin-top: 12px; columns: 2; column-gap: 24px; }
.toc li { font-size: 14.5px; margin-bottom: 6px; break-inside: avoid; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--primary); text-decoration: underline; }
@media (max-width: 600px) {
  .toc ul { columns: 1; }
}

/* ── Key-takeaway callouts ── */
.key-takeaway {
  background: linear-gradient(135deg, #eef4f3, #fafcfb);
  border-left: 4px solid var(--primary);
  padding: 14px 18px; border-radius: 6px;
  margin: 22px 0; font-size: 16px; color: var(--text);
}
.key-takeaway strong { color: var(--primary-dark); }

/* ── CTA boxes ── */
.cta-box {
  background: linear-gradient(135deg, #fdf6e3, #fff);
  border: 2px solid var(--accent);
  border-radius: 12px; padding: 22px 24px;
  margin: 28px 0; text-align: center;
}
.cta-box h3 {
  font-size: 19px; color: var(--primary-dark);
  margin-bottom: 8px; margin-top: 0;
}
.cta-box p { font-size: 15.5px; color: var(--text); margin-bottom: 14px; }
.cta-btn {
  display: inline-block; background: var(--accent);
  color: #fff; padding: 12px 24px; border-radius: 8px;
  font-weight: 700; text-decoration: none; font-size: 15.5px;
  min-height: 44px; line-height: 20px;     /* mobile touch target */
}
.cta-btn:hover { background: var(--accent-dark); color: #fff; }
.cta-btn.secondary { background: var(--primary); }
.cta-btn.secondary:hover { background: var(--primary-dark); }

/* ── Inline lead-capture form ── */
.lead-capture {
  background: #f7faf9; border: 2px dashed var(--primary);
  border-radius: 12px; padding: 22px 24px; margin: 28px 0;
}
.lead-capture h3 {
  font-size: 19px; color: var(--primary-dark); margin: 0 0 6px;
}
.lead-capture p { font-size: 15px; color: var(--text); margin-bottom: 14px; }
.lead-row { display: flex; gap: 8px; flex-wrap: wrap; }
.lead-row input[type="email"] {
  flex: 1 1 240px; min-width: 0;
  padding: 12px 14px; font-size: 16px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-family: inherit; min-height: 44px;
}
.lead-row input[type="email"]:focus {
  outline: none; border-color: var(--primary);
}
.lead-row button {
  background: var(--primary); color: #fff; border: none;
  padding: 12px 22px; border-radius: 8px; font-weight: 700;
  font-size: 15.5px; cursor: pointer; font-family: inherit;
  min-height: 44px;
}
.lead-row button:hover:not(:disabled) { background: var(--primary-dark); }
.lead-row button:disabled { opacity: 0.6; cursor: wait; }
.lead-status {
  font-size: 14px; color: var(--text-light); margin-top: 10px; min-height: 20px;
}
.lead-status.success { color: var(--primary-dark); font-weight: 600; }
.lead-status.error { color: #c0392b; }

/* ── FAQ accordion ── */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.faq-item:last-of-type { border-bottom: none; }
.faq-item summary {
  cursor: pointer; font-weight: 600; color: var(--primary-dark);
  font-size: 17px; padding: 6px 0; list-style: none;
  display: flex; justify-content: space-between; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; color: var(--primary); font-size: 22px; line-height: 1;
  transition: transform 0.2s;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item[open] summary { margin-bottom: 8px; }
.faq-item p { font-size: 16px; color: var(--text); margin-bottom: 0; }

/* ── Author bio box ── */
.author-bio {
  display: flex; gap: 16px; align-items: flex-start;
  background: #fafcfb; border: 1px solid var(--border);
  border-radius: 12px; padding: 20px 22px; margin-top: 36px;
}
.author-bio .avatar {
  flex: 0 0 56px; width: 56px; height: 56px;
  border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; font-weight: 700;
}
.author-bio h3 { font-size: 16px; color: var(--text); margin: 0 0 4px; }
.author-bio p { font-size: 14.5px; color: var(--text-light); margin: 0; line-height: 1.55; }

/* ── Related posts ── */
.related-posts { margin-top: 36px; }
.related-posts h2 { font-size: 22px; color: var(--primary-dark); margin-bottom: 14px; }
.related-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .related-grid { grid-template-columns: 1fr; } }
.related-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
  text-decoration: none; color: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.related-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.related-card h3 { font-size: 15.5px; color: var(--primary-dark); margin-bottom: 4px; }
.related-card p { font-size: 13.5px; color: var(--text-light); margin: 0; }
.related-card.coming-soon { opacity: 0.7; cursor: default; }
.related-card.coming-soon:hover { transform: none; box-shadow: none; }

/* ── Sticky mobile CTA ── */
.sticky-cta {
  position: fixed; left: 12px; right: 12px; bottom: 12px;
  background: var(--accent); color: #fff;
  padding: 14px 18px; border-radius: 10px;
  text-align: center; font-weight: 700; font-size: 15.5px;
  text-decoration: none; box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  z-index: 40; opacity: 0; pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
}
.sticky-cta.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
@media (min-width: 720px) {
  .sticky-cta { display: none; }     /* desktop has inline CTAs */
}

/* ── Blog index post cards ── */
.post-list { display: grid; gap: 18px; }
.post-card {
  background: var(--card); border-radius: 12px;
  box-shadow: var(--shadow-sm); padding: 24px 26px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.post-card a { text-decoration: none; color: inherit; display: block; }
.post-card h2 { font-size: 22px; color: var(--primary-dark); margin-bottom: 8px; }
.post-card .meta { font-size: 13px; color: var(--text-light); margin-bottom: 10px; }
.post-card .excerpt { font-size: 15.5px; color: var(--text); }
.post-card .read-more {
  display: inline-block; margin-top: 12px;
  color: var(--primary); font-weight: 600; font-size: 14px;
}

/* ── Footer ── */
footer.site {
  text-align: center; font-size: 13px; color: var(--text-light);
  padding: 24px 16px; max-width: 760px; margin: 0 auto; line-height: 1.6;
}
footer.site a { color: inherit; }

/* ── Responsive ── */
@media (max-width: 600px) {
  article { padding: 26px 20px; }
  article h1 { font-size: 26px; }
  article h2 { font-size: 21px; margin-top: 32px; }
  article h3 { font-size: 17px; }
  main { padding: 22px 12px 100px; }     /* extra bottom for sticky CTA */
}

/* ── Print stylesheet ── */
@media print {
  body { background: #fff; font-size: 12pt; line-height: 1.5; }
  header.site, footer.site, .reading-progress, .sticky-cta,
  .cta-box, .lead-capture, .related-posts, .back-link, .toc {
    display: none !important;
  }
  article {
    box-shadow: none; padding: 0;
    background: #fff; max-width: 100%;
  }
  article h1 { font-size: 20pt; color: #000; }
  article h2 { font-size: 14pt; color: #000; page-break-after: avoid; }
  article h3 { font-size: 12pt; color: #000; }
  article a { color: #000; text-decoration: underline; }
  article a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
  .formula, .key-takeaway { background: #f3f3f3; border-color: #888; }
  table, .table-wrap { page-break-inside: avoid; }
  .disclaimer { border: 1px solid #888; }
}
