/* ============================================
   St. Dymphna Autism Foundation
   Multi-page Sensory-Friendly Design System
   ============================================ */

:root {
  --teal-50: #e8f8f7;
  --teal-100: #c5efec;
  --teal-200: #8fddd8;
  --teal-300: #4fc9c0;
  --teal-400: #26b3a8;
  --teal-500: #1a9b91;
  --teal-600: #147d75;
  --teal-700: #116560;
  --teal-800: #0f524e;
  --teal-900: #0c423f;

  --gold-100: #fff8e6;
  --gold-200: #ffefc2;
  --gold-300: #ffe08a;
  --gold-400: #ffc93c;
  --gold-500: #f5b700;

  --coral: #ff7e67;
  --coral-soft: #ffe8e3;

  --cream: #fffdf8;
  --warm-white: #ffffff;
  --soft-gray: #f7f5f0;
  --text-primary: #1a2e2c;
  --text-secondary: #3d5a57;
  --text-muted: #5e7a76;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 30px;

  --shadow-sm: 0 4px 12px rgba(26, 155, 145, 0.08);
  --shadow-md: 0 10px 30px rgba(26, 155, 145, 0.12);
  --shadow-lg: 0 20px 50px rgba(26, 155, 145, 0.14);

  --font-sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Nunito", "Source Sans 3", system-ui, sans-serif;
  --transition: 0.25s ease;
}

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

html { scroll-behavior: smooth; font-size: 18px; }

body {
  font-family: var(--font-sans);
  background-color: var(--cream);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--teal-600); text-decoration: none; transition: color var(--transition); }
a:hover, a:focus { color: var(--teal-800); }
a:focus-visible { outline: 3px solid var(--gold-400); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--teal-900);
}

h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; color: var(--text-secondary); }
.lead { font-size: 1.15rem; line-height: 1.7; color: var(--text-secondary); }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4.5rem 0; }
.section-alt { background: var(--soft-gray); }
.section-teal {
  background: linear-gradient(160deg, #147d75 0%, #0f524e 100%);
  color: white;
}
.section-teal h2, .section-teal h3, .section-teal p { color: white; }
.section-teal p { opacity: 0.92; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(253, 251, 247, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(74, 155, 155, 0.12);
  transition: box-shadow var(--transition);
}
.site-header.scrolled { box-shadow: var(--shadow-sm); }

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 0; gap: 1.5rem;
}

.logo img { height: 58px; width: auto; border-radius: 0; }

.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: 0.5rem; color: var(--teal-700);
}
.nav-toggle svg { width: 28px; height: 28px; }

.main-nav ul {
  display: flex; list-style: none; gap: 0.15rem; align-items: center;
}
.main-nav a {
  display: block; padding: 0.5rem 0.85rem;
  font-weight: 600; font-size: 0.92rem; color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.main-nav a:hover, .main-nav a.active {
  background: var(--teal-50); color: var(--teal-700);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.4rem; font-family: var(--font-display); font-weight: 700;
  font-size: 0.98rem; border-radius: var(--radius-md); border: none;
  cursor: pointer; transition: all var(--transition); text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, #1a9b91, #26b3a8); color: white;
  box-shadow: 0 6px 20px rgba(26, 155, 145, 0.35);
}
.btn-primary:hover { background: var(--teal-600); color: white; transform: translateY(-1px); }
.btn-gold {
  background: linear-gradient(135deg, #ffc93c, #ffb700); color: #1a2e2c;
  box-shadow: 0 6px 20px rgba(255, 183, 0, 0.35);
}
.btn-gold:hover { background: var(--gold-500); color: var(--teal-900); }
.btn-outline {
  background: transparent; color: var(--teal-700); border: 2px solid var(--teal-400);
}
.btn-outline:hover { background: var(--teal-50); color: var(--teal-800); }
.btn-lg { padding: 0.95rem 1.9rem; font-size: 1.05rem; }
.btn-white { background: white; color: var(--teal-700); }
.btn-white:hover { background: var(--teal-50); }

/* Page Hero (for inner pages) */
.page-hero {
  position: relative; padding: 5rem 0 4rem;
  background: linear-gradient(135deg, var(--teal-50) 0%, var(--cream) 60%, var(--gold-100) 100%);
  overflow: hidden;
}
.page-hero .container { position: relative; z-index: 2; }
.page-hero h1 { margin-bottom: 0.75rem; }
.page-hero .lead { max-width: 620px; }

.page-hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0.18; mix-blend-mode: multiply;
}

/* Home Hero */
.hero {
  position: relative; min-height: 82vh;
  display: flex; align-items: center;
  background: linear-gradient(135deg, #e0f7f5 0%, #fff9eb 45%, #ffe8d6 100%);
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background-image: url('../images/hero.jpg');
  background-size: cover; background-position: center;
  opacity: 0.22; mix-blend-mode: multiply;
}
.hero-content { position: relative; z-index: 2; max-width: 680px; padding: 3.5rem 0; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: white; color: var(--teal-600); font-size: 0.85rem; font-weight: 600;
  padding: 0.4rem 0.9rem; border-radius: 999px; margin-bottom: 1.4rem;
  box-shadow: var(--shadow-sm);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 2.2rem; }
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 2rem;
  padding-top: 1.4rem; border-top: 1px solid rgba(74, 155, 155, 0.2);
}
.stat-number {
  font-family: var(--font-display); font-size: 1.7rem; font-weight: 800;
  color: var(--teal-600); line-height: 1;
}
.stat-label { font-size: 0.88rem; color: var(--text-muted); margin-top: 0.2rem; }

/* Mission strip */
.mission-strip {
  background: var(--teal-700); color: white; padding: 2.2rem 0; text-align: center;
}
.mission-strip p {
  color: rgba(255,255,255,0.95); font-size: 1.15rem; max-width: 820px;
  margin: 0 auto; font-weight: 500;
}

/* Split layouts */
.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center;
}
.split img {
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  width: 100%; height: 380px; object-fit: cover;
}
.split-reverse { direction: rtl; }
.split-reverse > * { direction: ltr; }

/* Programs */
.programs-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.75rem; margin-top: 2.5rem;
}
.program-card {
  background: white; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(74, 155, 155, 0.08);
  transition: transform var(--transition), box-shadow var(--transition);
  height: 100%; display: flex; flex-direction: column;
}
.program-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.program-card img { width: 100%; height: 210px; object-fit: cover; }
.program-body { padding: 1.75rem; flex-grow: 1; display: flex; flex-direction: column; }
.program-body h3 { margin-bottom: 0.7rem; color: var(--teal-800); }
.program-body p { flex-grow: 1; margin-bottom: 1.2rem; }
.program-body .learn-more {
  font-weight: 600; font-size: 0.95rem; color: var(--teal-600);
}

/* Moments gallery */
.moments-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 2.5rem;
}
.moments-grid img {
  width: 100%; height: 250px; object-fit: cover;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}
.moments-grid img:hover { transform: scale(1.02); }
.moments-grid .tall { grid-row: span 2; min-height: 520px; height: 100%; }

/* Stories */
.stories-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem; margin-top: 2.5rem;
}
.story-card {
  background: white; border-radius: var(--radius-lg); padding: 1.75rem;
  box-shadow: var(--shadow-sm); border-left: 4px solid var(--gold-400); height: 100%;
}
.story-card blockquote {
  font-style: italic; color: var(--text-secondary); margin-bottom: 1rem;
  font-size: 1.05rem; line-height: 1.6;
}
.story-card cite { font-style: normal; font-weight: 700; color: var(--teal-700); font-size: 0.95rem; }
.story-meta { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Impact / Donate */
.impact-section { text-align: center; }
.impact-numbers {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2.5rem;
  margin: 2.2rem 0 2.5rem;
}
.impact-item .number {
  font-family: var(--font-display); font-size: 2.6rem; font-weight: 800;
  color: var(--gold-400); line-height: 1;
}
.impact-item .label { color: rgba(255,255,255,0.85); margin-top: 0.35rem; font-size: 0.95rem; }

/* Apply form */
.apply-section { background: linear-gradient(180deg, var(--cream), var(--teal-50)); }
.apply-intro { max-width: 700px; margin: 0 auto 2.5rem; text-align: center; }
.apply-card {
  background: white; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  padding: 2.5rem; max-width: 780px; margin: 0 auto;
  border: 1px solid rgba(74, 155, 155, 0.1);
}
.apply-card h3 { margin-bottom: 0.5rem; text-align: center; }
.apply-card .form-note {
  text-align: center; color: var(--text-muted); font-size: 0.95rem; margin-bottom: 2rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  display: block; font-weight: 600; margin-bottom: 0.4rem;
  color: var(--teal-800); font-size: 0.95rem;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 0.8rem 1rem; border: 1.5px solid var(--teal-200);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 1rem; background: white;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--teal-400);
  box-shadow: 0 0 0 3px rgba(74, 155, 155, 0.15);
}
.form-group textarea { min-height: 130px; resize: vertical; }
.checkbox-group {
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin-top: 0.5rem;
}
.checkbox-group label {
  display: flex; align-items: center; gap: 0.5rem; font-weight: 500;
  cursor: pointer; color: var(--text-secondary);
}
.checkbox-group input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--teal-500);
}
.form-actions { margin-top: 1.75rem; text-align: center; }
.form-privacy {
  font-size: 0.85rem; color: var(--text-muted); margin-top: 1.25rem;
  text-align: center; line-height: 1.5;
}
.hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.35rem; }

.alert {
  padding: 1rem 1.25rem; border-radius: var(--radius-md);
  margin-bottom: 1.5rem; font-weight: 500;
}
.alert-success { background: #e8f5f0; color: #1a5c45; border: 1px solid #b8e0d0; }
.alert-error { background: #fef2f2; color: #9b1c1c; border: 1px solid #f5c2c2; }

/* Contact */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin-top: 2rem;
}
.contact-card {
  background: white; border-radius: var(--radius-lg); padding: 2rem;
  box-shadow: var(--shadow-sm);
}
.contact-item {
  display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.4rem;
}
.contact-item:last-child { margin-bottom: 0; }
.contact-icon {
  width: 44px; height: 44px; background: var(--teal-50); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--teal-600); flex-shrink: 0;
}
.contact-item strong { display: block; color: var(--teal-800); margin-bottom: 0.15rem; }

/* Dymphna / About content */
.dymphna-content {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; margin-top: 2rem;
}
.dymphna-content img {
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  width: 100%; height: 360px; object-fit: cover;
}

/* Values grid */
.values-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem; margin-top: 2.5rem;
}
.value-card {
  background: white; padding: 1.75rem; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); text-align: center;
}
.value-card .icon {
  width: 56px; height: 56px; margin: 0 auto 1rem;
  background: var(--teal-50); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--teal-600); font-size: 1.5rem;
}

/* Footer */
.site-footer {
  background: var(--teal-900); color: rgba(255,255,255,0.85);
  padding: 4rem 0 2rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem; margin-bottom: 3rem;
}
.footer-brand p { color: rgba(255,255,255,0.7); margin-top: 1rem; font-size: 0.95rem; }
.footer-brand .logo-text strong { color: white; font-size: 1.15rem; }
.footer-brand .logo-text span { color: var(--teal-300); font-size: 0.85rem; }
.footer-col h4 {
  color: white; font-size: 0.95rem; margin-bottom: 1.2rem; letter-spacing: 0.03em;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.55rem; }
.footer-col a { color: rgba(255,255,255,0.7); font-size: 0.95rem; }
.footer-col a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.6rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  font-size: 0.88rem; color: rgba(255,255,255,0.55);
}

/* Utilities */
.section-header { max-width: 640px; margin: 0 auto 1rem; text-align: center; }
.section-header p { font-size: 1.1rem; }
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .split, .dymphna-content, .contact-grid, .footer-grid, .moments-grid {
    grid-template-columns: 1fr;
  }
  .moments-grid .tall { grid-row: auto; min-height: 280px; height: 280px; }
  .split img, .dymphna-content img { height: 280px; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { gap: 2rem; }
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; top: 0; right: 0; width: min(320px, 85vw); height: 100vh;
    background: var(--warm-white); box-shadow: var(--shadow-lg);
    padding: 5rem 1.5rem 2rem; transform: translateX(100%);
    transition: transform 0.3s ease; z-index: 999;
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; align-items: stretch; }
  .main-nav a { padding: 0.85rem 1rem; font-size: 1.05rem; }
  .nav-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.35); z-index: 998;
  }
  .nav-overlay.open { display: block; }
  .hero { min-height: auto; padding: 3rem 0; }
  .apply-card { padding: 1.5rem; }
}

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


/* ===== Supercharged Animations (gentle & sensory-friendly) ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes softPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.animate-fade-up {
  opacity: 0;
  animation: fadeUp 0.7s ease forwards;
}
.animate-fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}
.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }

/* Card hover lift */
.program-card, .story-card, .value-card, .contact-card {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.program-card:hover, .story-card:hover, .value-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* Button micro-interaction */
.btn {
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0);
}

/* Logo soft pulse on load */
.logo img {
  transition: transform 0.4s ease;
}
.logo:hover img {
  transform: scale(1.05);
}

/* Moments images gentle zoom */
.moments-grid img {
  transition: transform 0.5s ease, box-shadow 0.4s ease;
}
.moments-grid img:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
}

/* Social icons */
.social-links {
  display: flex;
  gap: 0.85rem;
  margin-top: 1.25rem;
}
.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: white;
  transition: background 0.25s ease, transform 0.25s ease;
}
.social-links a:hover {
  background: #E1306C;
  transform: translateY(-3px);
  color: white;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .animate-fade-up,
  .animate-fade-in,
  .program-card,
  .story-card,
  .value-card,
  .btn,
  .moments-grid img,
  .logo img {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}


/* ===== Floating Apply Button ===== */
.floating-apply {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  background: linear-gradient(135deg, #1a9b91, #26b3a8);
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.95rem 1.5rem;
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(26, 155, 145, 0.4);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeUp 0.8s ease 1s both;
}
.floating-apply:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 12px 32px rgba(26, 155, 145, 0.5);
  color: white;
}
@media (max-width: 600px) {
  .floating-apply {
    bottom: 18px;
    right: 18px;
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
  }
}

/* ===== Simple Testimonial Carousel ===== */
.carousel-wrap {
  position: relative;
  max-width: 720px;
  margin: 2.5rem auto 0;
  overflow: hidden;
}
.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}
.carousel-slide {
  min-width: 100%;
  padding: 0 0.5rem;
  box-sizing: border-box;
}
.carousel-slide .story-card {
  margin: 0;
  height: auto;
}
.carousel-nav {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal-200);
  border: none;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}
.carousel-dot.active {
  background: var(--teal-500);
  transform: scale(1.25);
}
.carousel-arrows {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}
.carousel-btn {
  background: white;
  border: 1.5px solid var(--teal-200);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--teal-600);
  transition: background 0.25s ease, border-color 0.25s ease;
}
.carousel-btn:hover {
  background: var(--teal-50);
  border-color: var(--teal-400);
}
