/* ============================================================
   AI FOR EVERYDAY LIFE — Curriculum Website
   Audience: Older adults & caregivers | Workshop use
   Design: Warm, high-contrast, generous spacing, large text
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400&family=Source+Sans+3:wght@400;500;600;700&display=swap');

/* ---- DESIGN TOKENS ---- */
:root {
  /* Type */
  --font-display: 'Lora', Georgia, serif;
  --font-body: 'Source Sans 3', 'Helvetica Neue', sans-serif;

  --text-xs:   clamp(0.875rem, 0.8rem + 0.25vw, 1rem);
  --text-sm:   clamp(1rem, 0.9rem + 0.35vw, 1.125rem);
  --text-base: clamp(1.125rem, 1rem + 0.5vw, 1.3rem);
  --text-lg:   clamp(1.3rem, 1.1rem + 0.75vw, 1.6rem);
  --text-xl:   clamp(1.6rem, 1.2rem + 1.5vw, 2.25rem);
  --text-2xl:  clamp(2rem, 1.4rem + 2.5vw, 3.2rem);
  --text-hero: clamp(2.4rem, 1.5rem + 4vw, 4.5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Light mode — warm amber-cream palette, deep navy accent */
  --color-bg: #fdf8f0;
  --color-surface: #fefcf7;
  --color-surface-2: #f8f0e0;
  --color-border: #d9c8a8;
  --color-divider: #e5d7be;
  --color-text: #1e1a12;
  --color-text-muted: #6b5f45;
  --color-text-faint: #b0a28a;
  --color-text-inverse: #fef9f0;

  /* Navy blue — trustworthy, readable */
  --color-primary: #1a4a7a;
  --color-primary-hover: #12375d;
  --color-primary-active: #0c2640;
  --color-primary-light: #dce9f5;

  /* Amber — warm accent for callouts */
  --color-accent: #c87800;
  --color-accent-hover: #a56200;
  --color-accent-light: #fff0cc;

  /* Warning red for scam alerts */
  --color-danger: #c0392b;
  --color-danger-hover: #96281b;
  --color-danger-light: #fdecea;

  /* Success green */
  --color-success: #276221;
  --color-success-light: #dff0da;

  /* Radii & shadows */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --shadow-sm: 0 1px 3px rgba(30,26,18,0.08);
  --shadow-md: 0 4px 14px rgba(30,26,18,0.1);
  --shadow-lg: 0 8px 32px rgba(30,26,18,0.13);
  --transition: 180ms cubic-bezier(0.16,1,0.3,1);

  /* Layout */
  --content-narrow: 680px;
  --content-default: 960px;
  --content-wide: 1160px;
}

/* Dark mode */
[data-theme="dark"] {
  --color-bg: #141210;
  --color-surface: #1c1914;
  --color-surface-2: #231f18;
  --color-border: #3a3328;
  --color-divider: #2d2820;
  --color-text: #e8dfc8;
  --color-text-muted: #9e9077;
  --color-text-faint: #5e5642;
  --color-text-inverse: #1c1914;
  --color-primary: #7ab3e0;
  --color-primary-hover: #9cc5ea;
  --color-primary-active: #bdd7f2;
  --color-primary-light: #1a2d3f;
  --color-accent: #f5a623;
  --color-accent-hover: #f8b942;
  --color-accent-light: #3a2d0a;
  --color-danger: #e74c3c;
  --color-danger-hover: #ec6656;
  --color-danger-light: #3a1510;
  --color-success: #52b84a;
  --color-success-light: #122e10;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #141210;
    --color-surface: #1c1914;
    --color-surface-2: #231f18;
    --color-border: #3a3328;
    --color-divider: #2d2820;
    --color-text: #e8dfc8;
    --color-text-muted: #9e9077;
    --color-text-faint: #5e5642;
    --color-text-inverse: #1c1914;
    --color-primary: #7ab3e0;
    --color-primary-hover: #9cc5ea;
    --color-primary-active: #bdd7f2;
    --color-primary-light: #1a2d3f;
    --color-accent: #f5a623;
    --color-accent-hover: #f8b942;
    --color-accent-light: #3a2d0a;
    --color-danger: #e74c3c;
    --color-danger-hover: #ec6656;
    --color-danger-light: #3a1510;
    --color-success: #52b84a;
    --color-success-light: #122e10;
  }
}

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

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-16);
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
}

img, svg { display: block; max-width: 100%; height: auto; }
ul[role="list"], ol[role="list"] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  text-wrap: balance;
  line-height: 1.2;
}
p, li { text-wrap: pretty; max-width: 72ch; }

::selection { background: color-mix(in oklab, var(--color-primary) 25%, transparent); }
:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-sm); }

a { color: var(--color-primary); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--color-primary) 40%, transparent); text-underline-offset: 3px; transition: color var(--transition), text-decoration-color var(--transition); }
a:hover { color: var(--color-primary-hover); text-decoration-color: var(--color-primary-hover); }

button { cursor: pointer; background: none; border: none; }

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

/* ---- LAYOUT ---- */
.container { width: 100%; max-width: var(--content-default); margin-inline: auto; padding-inline: clamp(var(--space-4), 5vw, var(--space-12)); }
.container--narrow { max-width: var(--content-narrow); }
.container--wide { max-width: var(--content-wide); }

/* ---- HEADER / NAV ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in oklab, var(--color-bg) 93%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1.5px solid var(--color-divider);
  padding-block: var(--space-4);
  transition: box-shadow var(--transition);
}
.site-header.scrolled { box-shadow: var(--shadow-md); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}
.site-logo svg { flex-shrink: 0; }
.logo-text { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; color: var(--color-primary); line-height: 1; }
.logo-sub { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 500; }

.main-nav { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.nav-link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--color-primary); background: var(--color-primary-light); }

.theme-toggle {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--color-surface-2); color: var(--color-text); }

/* Mobile nav */
.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text);
  transition: background var(--transition);
}
.menu-toggle:hover { background: var(--color-surface-2); }

@media (max-width: 680px) {
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--color-surface); border-bottom: 1.5px solid var(--color-divider); flex-direction: column; padding: var(--space-4); gap: var(--space-2); }
  .main-nav.open { display: flex; }
  .menu-toggle { display: flex; }
}

/* ---- HERO ---- */
.hero {
  padding-block: clamp(var(--space-16), 10vw, var(--space-24));
  background: linear-gradient(160deg, var(--color-primary-light) 0%, var(--color-bg) 60%);
  border-bottom: 1.5px solid var(--color-divider);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-12);
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full, 9999px);
  margin-bottom: var(--space-5);
}
.hero h1 { font-size: var(--text-hero); color: var(--color-text); margin-bottom: var(--space-6); }
.hero h1 span { color: var(--color-primary); }
.hero-lead { font-size: var(--text-lg); color: var(--color-text-muted); max-width: 54ch; margin-bottom: var(--space-8); line-height: 1.6; }
.hero-actions { display: flex; gap: var(--space-4); flex-wrap: wrap; }

.hero-visual { display: flex; align-items: center; justify-content: center; }

@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-body); font-weight: 700; font-size: var(--text-sm);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
  cursor: pointer; border: 2px solid transparent;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); color: #fff; box-shadow: var(--shadow-md); }

.btn-outline { border-color: var(--color-border); color: var(--color-text); background: transparent; }
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-light); }

.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: var(--color-danger-hover); color: #fff; }

.btn-lg { font-size: var(--text-base); padding: var(--space-4) var(--space-8); }

/* ---- SECTION ---- */
section { padding-block: clamp(var(--space-12), 8vw, var(--space-20)); }
section + section { border-top: 1.5px solid var(--color-divider); }

.section-label {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-primary); margin-bottom: var(--space-3);
}
.section-title { font-size: var(--text-2xl); margin-bottom: var(--space-5); }
.section-desc { font-size: var(--text-lg); color: var(--color-text-muted); max-width: 60ch; margin-bottom: var(--space-10); line-height: 1.6; }

/* ---- LESSON CARDS ---- */
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
}

.lesson-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-decoration: none;
  color: var(--color-text);
  display: flex; flex-direction: column; gap: var(--space-4);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.lesson-card:hover { box-shadow: var(--shadow-lg); border-color: var(--color-primary); transform: translateY(-3px); color: var(--color-text); }

.lesson-number {
  width: 48px; height: 48px;
  background: var(--color-primary); color: #fff;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700;
  flex-shrink: 0;
}
.lesson-card h3 { font-size: var(--text-lg); font-weight: 700; }
.lesson-card p { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.6; }
.lesson-meta { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: auto; }
.lesson-tag {
  font-size: var(--text-xs); font-weight: 600;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2); color: var(--color-text-muted);
}

/* ---- CALLOUT BOXES ---- */
.callout {
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-8);
  margin-block: var(--space-8);
  display: flex; gap: var(--space-5);
}
.callout-icon { font-size: 1.8rem; flex-shrink: 0; line-height: 1; }
.callout-body { flex: 1; }
.callout-body h4 { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; margin-bottom: var(--space-2); }
.callout-body p, .callout-body li { font-size: var(--text-sm); max-width: 100%; }
.callout-body ul { padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); }

.callout-safety { background: var(--color-success-light); border-left: 4px solid var(--color-success); }
.callout-safety h4 { color: var(--color-success); }

.callout-warning { background: var(--color-accent-light); border-left: 4px solid var(--color-accent); }
.callout-warning h4 { color: var(--color-accent); }

.callout-danger { background: var(--color-danger-light); border-left: 4px solid var(--color-danger); }
.callout-danger h4 { color: var(--color-danger); }

.callout-info { background: var(--color-primary-light); border-left: 4px solid var(--color-primary); }
.callout-info h4 { color: var(--color-primary); }

/* ---- LESSON PAGE ---- */
.lesson-header {
  padding-block: clamp(var(--space-10), 7vw, var(--space-16));
  background: linear-gradient(160deg, var(--color-primary-light) 0%, var(--color-bg) 60%);
  border-bottom: 1.5px solid var(--color-divider);
}
.breadcrumb { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-5); }
.breadcrumb a { color: var(--color-primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--color-text-faint); }

.lesson-header .lesson-number-lg {
  display: inline-flex; align-items: center; gap: var(--space-3);
  font-size: var(--text-sm); font-weight: 700; letter-spacing: 0.06em;
  color: var(--color-primary); margin-bottom: var(--space-4);
}
.lesson-header h1 { font-size: var(--text-2xl); margin-bottom: var(--space-5); }
.lesson-header .lead { font-size: var(--text-lg); color: var(--color-text-muted); max-width: 56ch; line-height: 1.6; }

.lesson-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-12);
  padding-block: var(--space-12);
}
@media (max-width: 860px) { .lesson-body { grid-template-columns: 1fr; } }

.lesson-content h2 { font-size: var(--text-xl); margin-top: var(--space-10); margin-bottom: var(--space-5); color: var(--color-primary); }
.lesson-content h3 { font-size: var(--text-lg); margin-top: var(--space-8); margin-bottom: var(--space-4); }
.lesson-content p { margin-bottom: var(--space-5); }
.lesson-content ul, .lesson-content ol { padding-left: var(--space-6); margin-bottom: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.lesson-content li { line-height: 1.7; }

/* Sidebar */
.lesson-sidebar { display: flex; flex-direction: column; gap: var(--space-6); }

.sidebar-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.sidebar-card h4 { font-size: var(--text-sm); font-weight: 700; margin-bottom: var(--space-4); color: var(--color-primary); letter-spacing: 0.04em; text-transform: uppercase; }
.sidebar-card ul { list-style: none; display: flex; flex-direction: column; gap: var(--space-3); }
.sidebar-card li { font-size: var(--text-sm); display: flex; gap: var(--space-2); align-items: flex-start; }
.sidebar-card .check { color: var(--color-success); font-size: 1rem; flex-shrink: 0; }
.sidebar-card .x { color: var(--color-danger); font-size: 1rem; flex-shrink: 0; }

/* Lesson nav */
.lesson-nav-footer {
  border-top: 1.5px solid var(--color-divider);
  padding-block: var(--space-8);
}
.lesson-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ---- STEP BOXES ---- */
.steps { display: flex; flex-direction: column; gap: var(--space-5); margin-block: var(--space-6); }
.step {
  display: flex; gap: var(--space-5); align-items: flex-start;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
}
.step-num {
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--color-primary); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--text-sm);
}
.step-body h4 { font-size: var(--text-base); font-weight: 700; margin-bottom: var(--space-1); }
.step-body p { font-size: var(--text-sm); color: var(--color-text-muted); max-width: 100%; }

/* ---- TOOL GRID ---- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-5); margin-block: var(--space-6); }
.tool-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.tool-card .tool-icon { font-size: 2rem; margin-bottom: var(--space-3); }
.tool-card h4 { font-size: var(--text-base); font-weight: 700; margin-bottom: var(--space-2); }
.tool-card p { font-size: var(--text-xs); color: var(--color-text-muted); max-width: 100%; }

/* ---- HANDOUT PAGE ---- */
.handout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-6); margin-top: var(--space-8); }
.handout-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  display: flex; flex-direction: column; gap: var(--space-4);
}
.handout-icon { font-size: 2.5rem; }
.handout-card h3 { font-size: var(--text-lg); }
.handout-card p { font-size: var(--text-sm); color: var(--color-text-muted); }
.handout-card .btn { align-self: flex-start; margin-top: auto; }

/* ---- FOOTER ---- */
.site-footer {
  background: var(--color-surface);
  border-top: 1.5px solid var(--color-divider);
  padding-block: var(--space-10);
  margin-top: var(--space-8);
}
.footer-inner {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-8);
}
@media (max-width: 640px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-col h5 { font-family: var(--font-display); font-size: var(--text-base); font-weight: 700; margin-bottom: var(--space-4); color: var(--color-text); }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: var(--space-2); }
.footer-col li { font-size: var(--text-sm); }
.footer-col a { color: var(--color-text-muted); text-decoration: none; }
.footer-col a:hover { color: var(--color-primary); }
.footer-bottom { text-align: center; font-size: var(--text-xs); color: var(--color-text-faint); margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--color-divider); }

/* ---- UTILITIES ---- */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.font-display { font-family: var(--font-display); }
.mt-auto { margin-top: auto; }
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: var(--text-xs); font-weight: 700;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full, 9999px);
}
.badge-blue { background: var(--color-primary-light); color: var(--color-primary); }
.badge-orange { background: var(--color-accent-light); color: var(--color-accent); }
.badge-red { background: var(--color-danger-light); color: var(--color-danger); }
.badge-green { background: var(--color-success-light); color: var(--color-success); }

/* ---- PRINT STYLES ---- */
@media print {
  .site-header, .site-footer, .lesson-sidebar, .lesson-nav-footer, .btn, .hero-actions, .theme-toggle, .menu-toggle { display: none !important; }
  body { background: white !important; color: black !important; font-size: 12pt; }
  .lesson-body { grid-template-columns: 1fr !important; }
  h1 { font-size: 22pt; } h2 { font-size: 16pt; } h3 { font-size: 14pt; }
  .callout { border: 2px solid #333; background: #f5f5f5 !important; }
  a { color: black !important; text-decoration: none; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 10pt; color: #666; }
}

/* Handout print page */
.handout-print-page {
  display: none;
  padding: 0.75in;
  font-family: var(--font-body);
  color: #111;
  background: white;
}
@media print {
  .handout-print-page { display: block; }
  .handout-screen { display: none; }
}

/* Workshop activities and print-ready PDF library. */
.toolkit-sheet, .family-safety, .lesson-activity {
  margin-block: var(--space-8); padding: clamp(1.25rem, 4vw, 2rem);
  border: 2px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface); scroll-margin-top: 7rem;
}
.toolkit-sheet h3, .family-safety h3 { margin-top: 1.5rem; }
.toolkit-sheet p, .family-safety p, .lesson-activity p { margin-block: 1rem; }
.family-safety ol, .toolkit-sheet ul { padding-left: 1.5rem; }
.family-safety li, .toolkit-sheet li { margin-block: .75rem; }
.toolkit-index { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem; }
.toolkit-index a { text-decoration: underline; }
.worksheet-field { margin-block: 1.5rem; }
.worksheet-lines { display: block; }
.worksheet-lines span { display: block; height: 2rem; border-bottom: 1px solid var(--color-border); }
.source-note { font-size: var(--text-xs); color: var(--color-text-muted); overflow-wrap: anywhere; }
.family-safety .btn, .toolkit-sheet .btn, .lesson-activity .btn, .lesson-header .btn { white-space: normal; text-align: center; max-width: 100%; }
