/* CareSoul.ai / NumaHaven — shared stylesheet
 *
 * Default theme = CareSoul (teal/cyan, inspired by the brand logo).
 * body.theme-numahaven overrides to NumaHaven's lavender palette (matches
 * the app's splash color #667eea and the brain-in-hands logo).
 */

:root {
  /* CareSoul — teal/cyan brand */
  --primary: #1fa89e;
  --primary-dark: #157b74;
  --accent: #7fe4d9;
  --bg: #f5fafa;
  --surface: #ffffff;
  --surface-alt: #ecf5f4;
  --text: #0a2b2a;
  --text-muted: #4a5d62;
  --text-soft: #7e9194;
  --border: #dce8e7;
  --border-soft: #e9f1f0;
  --callout-bg: linear-gradient(135deg, rgba(31, 168, 158, 0.08), rgba(127, 228, 217, 0.04));
  --callout-border: rgba(31, 168, 158, 0.2);
  --callout-warn-bg: linear-gradient(135deg, rgba(234, 102, 102, 0.08), rgba(244, 124, 124, 0.04));
  --callout-warn-border: rgba(234, 102, 102, 0.22);
  --logo-mark-bg: linear-gradient(135deg, #1fa89e 0%, #7fe4d9 100%);
  --shadow-sm: 0 1px 2px rgba(10, 43, 42, 0.04), 0 0 0 1px rgba(10, 43, 42, 0.03);
  --shadow-md: 0 4px 12px rgba(10, 43, 42, 0.08), 0 1px 3px rgba(10, 43, 42, 0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --max-width: 720px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* NumaHaven theme — lavender/iris */
body.theme-numahaven {
  --primary: #667eea;
  --primary-dark: #4c5fc8;
  --accent: #9aaaf5;
  --bg: #f7f7fd;
  --surface: #ffffff;
  --surface-alt: #eef0fb;
  --text: #1a1d2e;
  --text-muted: #555a6f;
  --text-soft: #7a8099;
  --border: #e2e5f4;
  --border-soft: #eff1f8;
  --callout-bg: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(154, 170, 245, 0.04));
  --callout-border: rgba(102, 126, 234, 0.2);
  --callout-warn-bg: linear-gradient(135deg, rgba(234, 102, 102, 0.08), rgba(244, 124, 124, 0.04));
  --callout-warn-border: rgba(234, 102, 102, 0.22);
  --logo-mark-bg: linear-gradient(135deg, #667eea 0%, #9aaaf5 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #071515;
    --surface: #0f2424;
    --surface-alt: #132d2d;
    --text: #eafbf9;
    --text-muted: #a0bfbc;
    --text-soft: #77908d;
    --border: #1f3b3a;
    --border-soft: #152a29;
    --callout-bg: linear-gradient(135deg, rgba(31, 168, 158, 0.14), rgba(127, 228, 217, 0.05));
    --callout-border: rgba(127, 228, 217, 0.22);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.03);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
  }

  body.theme-numahaven {
    --bg: #0f1119;
    --surface: #181b26;
    --surface-alt: #1d2030;
    --text: #eaecf3;
    --text-muted: #a2a8bd;
    --text-soft: #7a8099;
    --border: #2a2e3d;
    --border-soft: #1f2331;
    --callout-bg: linear-gradient(135deg, rgba(102, 126, 234, 0.14), rgba(154, 170, 245, 0.05));
    --callout-border: rgba(154, 170, 245, 0.22);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

header.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  padding: 16px 20px;
}

header.site-header .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

/* Text-style logo mark (used for CareSoul placeholder until logo file is uploaded) */
.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--logo-mark-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Image-style logo mark (used for NumaHaven with its actual logo file) */
img.logo-mark {
  background: transparent;
  object-fit: contain;
  padding: 0;
  box-shadow: none;
  border-radius: 9px;
}

body.theme-numahaven img.logo-mark {
  background: var(--surface-alt);
  padding: 2px;
}

header.site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  margin-left: 16px;
  transition: color 0.15s ease;
}

header.site-header nav a:hover,
header.site-header nav a:focus {
  color: var(--primary);
}

h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  color: var(--text);
}

h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 32px 0 12px;
  color: var(--text);
}

h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text);
}

p, ul, ol {
  margin: 0 0 14px;
  color: var(--text-muted);
}

ul, ol {
  padding-left: 22px;
}

li {
  margin-bottom: 6px;
}

li::marker {
  color: var(--text-soft);
}

strong {
  color: var(--text);
  font-weight: 600;
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

a:hover,
a:focus {
  color: var(--primary-dark);
}

.meta {
  font-size: 13px;
  color: var(--text-soft);
  font-style: italic;
  margin: 0 0 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.card h2:first-child,
.card h3:first-child {
  margin-top: 0;
}

.intro {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
  font-weight: 500;
  margin: 0 0 24px;
}

.callout {
  background: var(--callout-bg);
  border: 1px solid var(--callout-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 20px 0;
  font-size: 15px;
}

.callout.warn {
  background: var(--callout-warn-bg);
  border-color: var(--callout-warn-border);
}

.callout strong {
  display: block;
  margin-bottom: 4px;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 24px 0;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.product-card h2 {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-card .tagline {
  color: var(--text-muted);
  font-style: italic;
  margin: 0 0 12px;
  font-size: 15px;
}

.product-card .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 14px;
  font-size: 14px;
}

.hero {
  text-align: center;
  padding: 56px 20px 32px;
  background: linear-gradient(180deg, var(--surface-alt) 0%, var(--bg) 100%);
}

/* Hero logo — works for both <img> (real logo file) and div-with-text (placeholder) */
.hero .hero-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 22px;
  margin: 0 auto 20px;
  background: var(--logo-mark-bg);
  box-shadow: 0 8px 24px rgba(31, 168, 158, 0.22);
  color: #fff;
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -0.02em;
}

.hero img.hero-logo {
  background: transparent;
  object-fit: contain;
  padding: 0;
}

/* NumaHaven logo file has a soft white-ish background; give it a subtle frame */
body.theme-numahaven .hero img.hero-logo {
  background: var(--surface);
  padding: 6px;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.22);
}

.hero h1 {
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero .tagline {
  font-size: 18px;
  color: var(--text-muted);
  margin: 0;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

footer.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 32px 20px;
  margin-top: 32px;
  color: var(--text-soft);
  font-size: 13px;
  text-align: center;
}

footer.site-footer .inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

footer.site-footer a {
  color: var(--text-muted);
  margin: 0 8px;
  white-space: nowrap;
}

footer.site-footer .copyright {
  margin-top: 12px;
  color: var(--text-soft);
}

.crisis-list li {
  margin-bottom: 8px;
}

.crisis-list strong {
  display: inline-block;
  min-width: 180px;
}

@media (min-width: 640px) {
  .container {
    padding: 40px 24px 96px;
  }

  h1 {
    font-size: 34px;
  }

  .hero {
    padding: 72px 24px 40px;
  }

  .hero h1 {
    font-size: 48px;
  }

  .hero .hero-logo {
    width: 120px;
    height: 120px;
    font-size: 44px;
    border-radius: 28px;
  }

  .hero .tagline {
    font-size: 20px;
  }

  header.site-header {
    padding: 20px 24px;
  }

  .card {
    padding: 24px 28px;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }
  header.site-header, footer.site-footer, nav {
    display: none;
  }
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
  .hero {
    background: none;
  }
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
