/* mhrecovery.ai — shared styles (forked from mentalhealthtreatment.ai) */
:root {
  --ink: #17212b;
  --ink-soft: #43505e;
  --ink-faint: #6b7684;
  --accent: #4a3d75;        /* dusk plum-indigo: calm, not clinical, unlike every sibling site */
  --accent-dark: #352a58;
  --accent-light: #f1eef7;
  --accent-mid: #cfc6e4;
  --bg: #fdfcfa;
  --bg-soft: #f5f2ee;
  --bg-warm: #faf6ef;
  --border: #e6e1da;
  --crisis: #8a3324;
  --crisis-bg: #fdf3f0;
  --radius: 12px;
  --maxw: 1080px;
  --maxw-text: 760px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 17px;
}

h1, h2, h3, h4, .sans {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

h1 { font-size: 2.3rem; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }
h2 { font-size: 1.6rem; line-height: 1.3; letter-spacing: -0.01em; font-weight: 700; }
h3 { font-size: 1.15rem; line-height: 1.35; font-weight: 650; }

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

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

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-weight: 800; font-size: 1.06rem; color: var(--ink); text-decoration: none;
  letter-spacing: -0.01em; line-height: 1.2;
}
.logo .logo-ai { color: var(--accent); }
.logo small { display: block; font-weight: 500; font-size: 0.68rem; color: var(--ink-faint); letter-spacing: 0.06em; text-transform: uppercase; }
.main-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.92rem; font-weight: 550; color: var(--ink-soft); text-decoration: none;
  padding: 7px 12px; border-radius: 8px;
}
.main-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.main-nav a.nav-cta {
  background: var(--accent); color: #fff; font-weight: 650;
}
.main-nav a.nav-cta:hover { background: var(--accent-dark); color: #fff; }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, var(--accent-light) 0%, var(--bg) 100%); padding: 72px 0 56px; }
.hero .eyebrow {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.hero h1 { max-width: 720px; margin-bottom: 18px; }
.hero p.lede { font-size: 1.18rem; color: var(--ink-soft); max-width: 640px; margin-bottom: 28px; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  display: inline-block; padding: 13px 24px; border-radius: 10px; text-decoration: none;
  font-weight: 650; font-size: 0.98rem; border: 1.5px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--accent); border-color: var(--accent-mid); }
.btn-secondary:hover { border-color: var(--accent); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { max-width: 640px; margin-bottom: 32px; }
.section-head .kicker {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
}
.section-head p { color: var(--ink-soft); margin-top: 10px; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; display: flex; flex-direction: column; gap: 10px;
}
.card h3 { color: var(--ink); }
.card p { font-size: 0.97rem; color: var(--ink-soft); flex: 1; }
.card a.card-link {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-weight: 650; font-size: 0.92rem; text-decoration: none;
}
.card .card-tag {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-light); align-self: flex-start;
  padding: 3px 10px; border-radius: 999px;
}

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat { background: var(--accent); color: #fff; border-radius: var(--radius); padding: 26px 24px; }
.stat .num { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 2rem; font-weight: 800; line-height: 1.1; }
.stat .lbl { font-size: 0.92rem; opacity: 0.9; margin-top: 6px; }

/* ---------- Crisis strip ---------- */
.crisis-strip { background: var(--crisis-bg); border: 1px solid #f0ddd6; border-radius: var(--radius); padding: 24px 26px; }
.crisis-strip h3 { color: var(--crisis); margin-bottom: 10px; }
.crisis-strip p { font-size: 0.96rem; color: var(--ink-soft); }
.crisis-lines { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 14px; }
.crisis-lines div { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; }
.crisis-lines .line-name { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); }
.crisis-lines .line-num { font-size: 1.15rem; font-weight: 750; color: var(--ink); }
.crisis-lines .line-num a { color: var(--ink); text-decoration: none; }
.crisis-lines .line-note { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 0.78rem; color: var(--ink-faint); margin-top: 2px; }

/* ---------- Article pages ---------- */
.article-hero { background: var(--bg-warm); border-bottom: 1px solid var(--border); padding: 56px 0 40px; }
.article-hero .crumb { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 0.85rem; margin-bottom: 16px; }
.article-hero .crumb a { text-decoration: none; font-weight: 600; }
.article-hero h1 { font-size: 2.05rem; max-width: 760px; }
.article-hero .meta-line { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; color: var(--ink-faint); font-size: 0.88rem; margin-top: 14px; }
.article-body { padding: 48px 0 24px; }
.article-body h2 { margin: 40px 0 14px; }
.article-body h3 { margin: 28px 0 10px; }
.article-body p { margin-bottom: 18px; color: #222d37; }
.article-body ul, .article-body ol { margin: 0 0 18px 26px; }
.article-body li { margin-bottom: 8px; }
.article-body .callout {
  background: var(--accent-light); border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0; padding: 18px 22px; margin: 26px 0;
}
.article-body .callout p { margin-bottom: 0; font-size: 0.98rem; }
.article-body .warning {
  background: var(--crisis-bg); border-left: 4px solid var(--crisis);
  border-radius: 0 10px 10px 0; padding: 18px 22px; margin: 26px 0;
}
.article-body .warning p { margin-bottom: 0; font-size: 0.98rem; }
.at-a-glance {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 28px; margin: 40px 0 8px;
}
.at-a-glance h2 { margin: 0 0 14px; font-size: 1.25rem; }
.at-a-glance ul { margin-left: 22px; }
.sources { border-top: 1px solid var(--border); margin-top: 40px; padding-top: 22px; }
.sources h3 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); margin-bottom: 12px; }
.sources ol { margin-left: 22px; font-size: 0.9rem; color: var(--ink-soft); }
.sources li { margin-bottom: 7px; }
.disclaimer-box { font-size: 0.85rem; color: var(--ink-faint); border-top: 1px solid var(--border); margin-top: 28px; padding-top: 18px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; }

/* ---------- Guide tool ---------- */
.tool-shell {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 8px 30px rgba(74, 61, 117, 0.10); padding: 34px 34px 30px;
  max-width: 720px; margin: 0 auto;
}
.tool-progress { display: flex; gap: 6px; margin-bottom: 26px; }
.tool-progress span { height: 5px; flex: 1; border-radius: 999px; background: var(--border); }
.tool-progress span.done { background: var(--accent); }
.tool-q { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.tool-sub { color: var(--ink-soft); font-size: 0.97rem; margin-bottom: 20px; }
.tool-opts { display: grid; gap: 10px; }
.tool-opt {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  text-align: left; background: var(--bg-soft); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 14px 18px; font-size: 0.98rem; font-weight: 550;
  color: var(--ink); cursor: pointer; transition: border-color 0.12s, background 0.12s;
}
.tool-opt:hover { border-color: var(--accent); background: var(--accent-light); }
.tool-opt small { display: block; font-weight: 450; color: var(--ink-faint); margin-top: 2px; }
.tool-back {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: none; border: none; color: var(--ink-faint); font-size: 0.88rem;
  cursor: pointer; margin-top: 20px; padding: 4px 0; font-weight: 600;
}
.tool-back:hover { color: var(--accent); }
.tool-result h3 { font-size: 1.35rem; margin-bottom: 4px; }
.tool-result .rec-level {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  display: inline-block; background: var(--accent); color: #fff; border-radius: 999px;
  padding: 6px 16px; font-weight: 700; font-size: 0.95rem; margin: 10px 0 16px;
}
.tool-result p { color: var(--ink-soft); margin-bottom: 14px; font-size: 0.99rem; }
.tool-result .also { background: var(--bg-soft); border-radius: 10px; padding: 16px 20px; margin: 16px 0; font-size: 0.94rem; }
.tool-note { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 0.82rem; color: var(--ink-faint); margin-top: 22px; border-top: 1px solid var(--border); padding-top: 16px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px; max-width: 560px; }
.form-grid label { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-weight: 650; font-size: 0.9rem; display: block; margin-bottom: 6px; }
.form-grid input, .form-grid textarea, .form-grid select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.97rem; color: var(--ink); background: #fff;
}
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus { outline: 2px solid var(--accent-mid); border-color: var(--accent); }
.form-status { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 0.95rem; font-weight: 600; margin-top: 4px; min-height: 1.2em; }
.form-status.ok { color: #1f7a4d; }
.form-status.err { color: var(--crisis); }
.form-status.pending { color: var(--ink-faint); }

/* ---------- Floating contact pill ---------- */
.contact-pill {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--accent); color: #fff; text-decoration: none;
  padding: 14px 22px; border-radius: 999px; font-weight: 700; font-size: 0.95rem;
  box-shadow: 0 6px 20px rgba(44, 69, 118, 0.35); display: flex; align-items: center; gap: 8px;
}
.contact-pill:hover { background: var(--accent-dark); color: #fff; transform: translateY(-1px); }

/* ---------- Footer ---------- */
.site-footer { background: #1d1830; color: #c3bdd4; margin-top: 56px; padding: 48px 0 32px; font-size: 0.92rem; }
.site-footer a { color: #e0dbec; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 32px; margin-bottom: 32px; }
.footer-grid h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.09em; color: #948bb0; margin-bottom: 14px; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 8px; }
.footer-brand { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-weight: 800; color: #fff; font-size: 1.05rem; margin-bottom: 10px; }
.footer-brand .logo-ai { color: #c9b8f0; }
.footer-note { border-top: 1px solid #332b4d; padding-top: 22px; font-size: 0.82rem; color: #948bb0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .card-grid, .stats, .footer-grid { grid-template-columns: 1fr 1fr; }
  .header-inner { flex-wrap: wrap; }
}
@media (max-width: 620px) {
  h1 { font-size: 1.75rem; }
  .hero { padding: 48px 0 40px; }
  .card-grid, .card-grid-2, .stats, .footer-grid { grid-template-columns: 1fr; }
  .main-nav { gap: 0; }
  .main-nav a { padding: 6px 8px; font-size: 0.85rem; }
  .tool-shell { padding: 24px 20px; }
  .contact-pill { right: 14px; bottom: 14px; padding: 12px 18px; }
}

/* ---------- Related articles (auto-generated) ---------- */
.related { margin-top: 48px; border-top: 1px solid var(--border); padding-top: 26px; }
.related h2 { font-size: 1.25rem; margin: 0 0 16px; }
.related-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.related-list a {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-weight: 650; font-size: 1.02rem; text-decoration: none; display: block;
}
.related-list p { margin: 3px 0 0; color: var(--ink-soft); font-size: 0.92rem; }

/* ---- Utility + variant classes (replace former inline style="" attributes so the
        Content-Security-Policy can ship without style-src 'unsafe-inline') ---- */
.hero-compact { padding: 52px 0 40px; }
.hero-center .container { text-align: center; }
.hero-center .eyebrow { justify-content: center; }
.hero-center h1 { margin: 0 auto 14px; }
.hero-center p.lede { margin: 0 auto; }
.section-tight { padding-top: 20px; }
.grid-center { align-items: center; }
.section-head-tight { margin-bottom: 18px; }
.fine-print {
  font-size: 0.84rem; color: var(--ink-faint); margin-top: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}
.card-accent { background: var(--accent-light); border-color: var(--accent-mid); }
.card-accent h3 { color: var(--accent-dark); }
.card-accent p { color: var(--ink-soft); }
.honeypot { display: none; }
.tool-warning { margin: 0 0 18px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-18 { margin-top: 18px; }
.mt-22 { margin-top: 22px; }
.mb-4 { margin-bottom: 4px; }

/* comparison tables in guides (wrapper scrolls on narrow screens) */
.table-wrap { overflow-x: auto; margin: 0 0 24px; border: 1px solid var(--border); border-radius: var(--radius); }
.article-body table { width: 100%; border-collapse: collapse; font-size: 0.95rem; line-height: 1.5; }
.article-body caption { text-align: left; padding: 12px 14px 0; font-size: 0.9rem; color: var(--ink-faint); }
.article-body th, .article-body td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.article-body thead th { background: var(--bg-soft); color: var(--ink); font-weight: 600; }
.article-body tbody th { font-weight: 600; color: var(--ink); }
.article-body tbody tr:last-child th, .article-body tbody tr:last-child td { border-bottom: 0; }
.table-wrap-wide table { min-width: 680px; }
@media (max-width: 559px) { .article-body th, .article-body td { padding: 9px 10px; } }

/* ---------- Safety plan worksheet (screen + print) ---------- */
.ws { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 22px 14px; margin: 28px 0; background: var(--bg); }
.ws-head { border-bottom: 2px solid var(--accent); padding-bottom: 10px; margin-bottom: 16px; }
.ws-title { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-weight: 800; font-size: 1.35rem; color: var(--accent-dark); }
.ws-meta { font-size: 0.85rem; color: var(--ink-soft); margin-top: 6px; }
.ws-box { position: relative; padding: 12px 0 12px 44px; border-bottom: 1px solid var(--border); break-inside: avoid; }
.ws-box:last-of-type { border-bottom: 0; }
.ws-step { position: absolute; left: 0; top: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; }
.ws-box h3 { margin-bottom: 4px; }
.article-body .ws-hint { font-size: 0.86rem; color: var(--ink-faint); margin-bottom: 8px; line-height: 1.5; }
.ws-lines span { display: block; border-bottom: 1px solid #c3bdb4; height: 30px; font-size: 0.72rem; color: var(--ink-faint); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; padding-top: 14px; }
.article-body .ws-fixed { font-size: 0.86rem; margin: 10px 0 0; color: var(--ink); }
.article-body .ws-foot { font-size: 0.82rem; color: var(--ink-soft); margin: 14px 0 0; text-align: center; }

@media print {
  .site-header, .site-footer, .contact-pill, .no-print { display: none !important; }
  body { font-size: 10pt; line-height: 1.3; }
  .article-body { padding: 0 !important; }
  .container-text { max-width: none; padding: 0; }
  .ws { border: 0; padding: 0; margin: 0; }
  .ws-head { margin-bottom: 8px; }
  .ws-box { padding: 4px 0 4px 36px; }
  .article-body .ws-box h3 { font-size: 0.95rem; margin: 0 0 2px; }
  .ws-step { -webkit-print-color-adjust: exact; print-color-adjust: exact; top: 6px; }
  .article-body .ws-hint { font-size: 8.5pt; margin-bottom: 2px; line-height: 1.35; }
  .ws-lines span { height: 18px; padding-top: 6px; }
  a { color: inherit; text-decoration: none; }
  @page { margin: 10mm; }
}
