/* ==========================================================================
   My Parents Are Aging — site stylesheet
   Plain CSS, no build step. Version 1.0.0 (2026-08-07)
   Design: editorial, warm, high-contrast, accessible for readers of all ages.
   ========================================================================== */

:root {
  /* Color tokens */
  --bg: #FBF7EF;            /* warm cream */
  --surface: #FFFFFF;
  --surface-alt: #F3EDE1;   /* slightly deeper cream for cards */
  --ink: #1E2A26;           /* near-black green-tinted text */
  --ink-soft: #46534D;      /* secondary text — still high contrast */
  --line: #E2D8C6;          /* hairline borders */
  --brand: #0E5E57;         /* deep teal */
  --brand-dark: #0A4641;
  --brand-ink: #0A4641;
  --link: #0B5D54;          /* teal links on cream */
  --accent: #B45309;        /* warm amber */
  --accent-soft: #FBE7C8;   /* amber wash for highlights */
  --ok: #1E6B34;
  --ok-soft: #E3F2E6;
  --warn: #7A4E00;
  --warn-soft: #FCEFD3;
  --danger: #A61B1B;
  --danger-soft: #F9E3E1;
  --neutral-soft: #ECE7DB;

  /* Typography */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size: 19px;
  --line-height: 1.65;
  --radius: 10px;
  --maxw: 1080px;
  --maxw-narrow: 760px;
}

/* ---- Reset & base ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--font-size);
  line-height: var(--line-height);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

/* Accessible focus states */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--accent-soft); }

/* ---- Layout ------------------------------------------------------------ */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow {
  max-width: var(--maxw-narrow);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Skip link --------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--brand-dark);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  font-weight: 700;
}
.skip-link:focus {
  left: 0;
  color: #fff;
}

/* ---- Header & navigation ---------------------------------------------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: -0.01em;
}

.wordmark-mark { flex: 0 0 auto; color: var(--accent); }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.site-nav a {
  display: inline-block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
}

.site-nav a:hover { background: var(--surface-alt); color: var(--brand-dark); }

.site-nav a[aria-current="page"] {
  background: var(--brand);
  color: #fff;
}

.site-nav .nav-cta {
  background: var(--accent);
  color: #fff;
}
.site-nav .nav-cta:hover { background: #96400a; color: #fff; }

/* Mobile: collapse nav behind a details/summary toggle (no JS needed) */
.nav-toggle { position: relative; }

.nav-toggle summary {
  list-style: none;
  cursor: pointer;
  display: none;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
  background: var(--surface);
}
.nav-toggle summary::-webkit-details-marker { display: none; }

@media (max-width: 920px) {
  .nav-toggle summary { display: inline-block; }
  .nav-toggle[open] summary { background: var(--surface-alt); }
  .site-nav {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 30px rgba(30, 42, 38, 0.14);
    padding: 10px;
    min-width: 250px;
    z-index: 50;
  }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-nav a { display: block; }
  .nav-toggle:not([open]) .site-nav { display: none; }
}

/* ---- Typography helpers ------------------------------------------------ */
h1, h2, h3, h4 {
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
}

h1 { font-size: clamp(2rem, 5vw, 2.9rem); margin: 0 0 0.4em; }
h2 { font-size: clamp(1.45rem, 3vw, 1.8rem); margin: 1.6em 0 0.5em; }
h3 { font-size: 1.22rem; margin: 1.4em 0 0.4em; }

p { margin: 0 0 1em; }

a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }

.lead {
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 64ch;
}

.muted { color: var(--ink-soft); }
.small { font-size: 0.92rem; }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 1.02rem;
  text-decoration: none;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  transition: background 120ms ease;
}
.btn:hover { background: var(--brand-dark); color: #fff; }

.btn-secondary {
  background: var(--surface);
  color: var(--brand-ink);
  border-color: var(--brand);
}
.btn-secondary:hover { background: var(--surface-alt); color: var(--brand-dark); }

.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: #96400a; color: #fff; }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---- Hero -------------------------------------------------------------- */
.hero {
  padding: 56px 0 40px;
  background:
    radial-gradient(1200px 420px at 85% -10%, rgba(180, 83, 9, 0.10), transparent 60%),
    radial-gradient(900px 380px at -10% 20%, rgba(14, 94, 87, 0.10), transparent 55%),
    var(--bg);
}

.hero h1 { max-width: 18ch; }
.hero .lead { margin-bottom: 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-note {
  margin-top: 18px;
  font-size: 0.95rem;
  color: var(--ink-soft);
  max-width: 56ch;
}

/* ---- Cards ------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
  margin: 22px 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 42, 38, 0.10);
  color: var(--ink);
}

.card h2, .card h3 { margin: 0; font-size: 1.15rem; color: var(--brand-dark); }
.card p { margin: 0; font-size: 0.98rem; color: var(--ink-soft); }
.card .card-cta { margin-top: auto; font-weight: 700; color: var(--link); }

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}

/* Section headings on hub pages */
.section-head { margin: 40px 0 6px; }
.section-head h2 { margin: 0 0 6px; }
.section-head p { margin: 0; color: var(--ink-soft); max-width: 70ch; }

/* ---- Content blocks ---------------------------------------------------- */
.prose { max-width: 72ch; }

.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin-bottom: 0.5em; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }

/* Step lists */
.steps { counter-reset: step; list-style: none; padding-left: 0; margin: 1em 0 1.4em; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 14px 16px 14px 58px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}

/* Callout boxes */
.callout {
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 1.2em 0;
  border: 1px solid transparent;
}
.callout strong:first-child { display: block; margin-bottom: 4px; }
.callout p:last-child { margin-bottom: 0; }

.callout-tip { background: var(--neutral-soft); border-color: #D8D0BE; }
.callout-warn { background: var(--warn-soft); border-color: #EACF9C; }
.callout-critical { background: var(--danger-soft); border-color: #E4B3AE; }
.callout-ok { background: var(--ok-soft); border-color: #BBD9C2; }
.callout-info { background: #E4EEF2; border-color: #B9D2DC; }

/* Content class badges */
.class-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 10px;
  vertical-align: middle;
}
.class-a { background: var(--neutral-soft); color: var(--ink-soft); }
.class-b { background: var(--accent-soft); color: #7A4E00; }
.class-c { background: var(--danger-soft); color: var(--danger); }

/* Meta rows (last reviewed, freshness) */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0 0 1.4em;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* Tables */
.table-wrap { overflow-x: auto; margin: 1.2em 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.98rem; background: var(--surface); }
th, td { text-align: left; padding: 10px 12px; border: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-alt); font-weight: 700; }

/* FAQ (details-based, keyboard accessible) */
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--brand-dark);
}
.faq details p { margin: 10px 0 0; }

/* ---- Tools: Scam Risk Check ------------------------------------------- */
.tool-shell { padding: 36px 0 56px; }

.form-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0;
}

.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field .hint { display: block; font-size: 0.9rem; color: var(--ink-soft); margin-top: 5px; }

input[type="text"], input[type="url"], input[type="email"],
select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
}

textarea { min-height: 150px; resize: vertical; }

.char-count { text-align: right; font-size: 0.85rem; color: var(--ink-soft); margin-top: 4px; }

.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { margin-bottom: 10px; }
.check-list label { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check-list input[type="checkbox"] { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--brand); }

/* Risk bands */
.band {
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 18px 0;
  border: 1px solid transparent;
}
.band h2 { margin: 0 0 8px; font-size: 1.35rem; }
.band p:last-child { margin-bottom: 0; }

.band-lower { background: var(--ok-soft); border-color: #BBD9C2; }
.band-lower h2 { color: var(--ok); }
.band-suspicious { background: var(--warn-soft); border-color: #EACF9C; }
.band-suspicious h2 { color: var(--warn); }
.band-high { background: var(--danger-soft); border-color: #E4B3AE; }
.band-high h2 { color: var(--danger); }
.band-unknown { background: var(--neutral-soft); border-color: #D8D0BE; }
.band-unknown h2 { color: var(--ink-soft); }

.flag-list { list-style: none; padding: 0; margin: 0; }
.flag-list li {
  padding: 10px 12px 10px 14px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
  margin-bottom: 8px;
}
.flag-list .flag-id { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.82rem; color: var(--ink-soft); }

.tool-result { display: none; }
.tool-result.visible { display: block; }

.copy-box {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  white-space: pre-wrap;
  font-size: 1rem;
}

/* ---- Tools: Explain It ------------------------------------------------- */
.format-controls { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.format-controls [aria-pressed="true"] { background: var(--brand); color: #fff; }

.explain-result { margin-top: 18px; }

.large-print { font-size: 1.5rem; line-height: 1.6; }
.large-print .steps li { padding-top: 18px; padding-bottom: 18px; }
.large-print .steps li::before { width: 40px; height: 40px; font-size: 1.2rem; top: 16px; left: 14px; }
.large-print .steps li { padding-left: 72px; }

/* ---- Privacy event viewer --------------------------------------------- */
.event-viewer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 14px 0;
}
.event-viewer table { font-size: 0.92rem; }

/* ---- Footer ------------------------------------------------------------ */
.site-footer {
  background: var(--brand-dark);
  color: #E9EFEA;
  margin-top: 64px;
  padding: 44px 0 20px;
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 28px;
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

.footer-brand .footer-wordmark { font-weight: 800; font-size: 1.1rem; margin-bottom: 8px; }
.site-footer h2 { color: #fff; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 7px; }
.site-footer a { color: #CFE3DC; }
.site-footer a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 16px;
  font-size: 0.88rem;
  color: #BCCEC7;
}
.footer-bottom p { margin: 0; }
.footer-bottom a { color: #E4F0EB; }

/* ---- Misc -------------------------------------------------------------- */
.breadcrumbs { font-size: 0.9rem; color: var(--ink-soft); margin: 20px 0 0; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; color: var(--line); }
.breadcrumbs a { color: var(--ink-soft); }

.page-head { padding: 34px 0 6px; }
.page-head h1 { margin-bottom: 0.3em; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; margin: 22px 0; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }

.freshness-table td:first-child { white-space: nowrap; font-weight: 700; }

.newsletter-note {
  background: var(--accent-soft);
  border: 1px solid #EACF9C;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 18px 0;
  font-size: 0.95rem;
}

/* ---- Print ------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .skip-link, .no-print, .tool-actions { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .container, .container-narrow { max-width: 100%; padding: 0; }
  .tool-result { display: block !important; }
  .band, .callout { break-inside: avoid; border: 1px solid #999; }
  .steps li { break-inside: avoid; }
  a { color: var(--ink); }
}

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

/* ---- Launch-page additions ------------------------------------------- */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 34px; align-items: center; }
.hero-panel { background: var(--brand-dark); color: #fff; border-radius: 18px; padding: 26px; box-shadow: 0 16px 36px rgba(10, 70, 65, .18); }
.hero-panel h2 { color: #fff; margin: 0 0 10px; font-size: 1.25rem; }
.hero-panel p { color: #E9EFEA; }
.hero-panel ul { margin: 16px 0 0; padding-left: 1.2em; color: #E9EFEA; }
.hero-panel li { margin-bottom: 8px; }
.section { padding: 42px 0; }
.section-alt { background: var(--surface-alt); }
.eyebrow { color: var(--brand); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .82rem; margin-bottom: 10px; }
.card-grid.four { grid-template-columns: repeat(4, 1fr); }
.card-grid.three { grid-template-columns: repeat(3, 1fr); }
.card .kicker { color: var(--accent); font-weight: 800; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.article-list { list-style: none; margin: 0; padding: 0; }
.article-list li { border-top: 1px solid var(--line); padding: 14px 0; }
.article-list li:last-child { border-bottom: 1px solid var(--line); }
.article-list a { font-weight: 700; }
.share-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 22px; }
.source-list { font-size: .92rem; }
.source-list li { margin-bottom: 8px; }
.notice { border-left: 5px solid var(--brand); padding: 14px 18px; background: var(--surface-alt); }
.disclosure { font-size: .9rem; background: var(--accent-soft); border: 1px solid #EACF9C; border-radius: var(--radius); padding: 12px 16px; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.error { color: var(--danger); font-weight: 700; margin-top: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.check-list.compact { columns: 2; column-gap: 24px; }
.check-list.compact li { break-inside: avoid; }
.result-heading { display: flex; justify-content: space-between; gap: 12px; align-items: start; flex-wrap: wrap; }
.result-heading h2 { margin-top: 0; }
.tool-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.site-header .container { position: relative; }
@media (max-width: 900px) { .hero-grid, .card-grid.four, .card-grid.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) {
  .hero { padding-top: 38px; }
  .hero-grid, .card-grid.four, .card-grid.three { grid-template-columns: 1fr; }
  .form-panel { padding: 18px; }
  .check-list.compact { columns: 1; }
  .container, .container-narrow { padding-left: 16px; padding-right: 16px; }
}
