/* ============================================
   Happy Brainiacs — style.css
   WCAG 2.1 AA Accessible
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-text: #1F2937;
  --color-heading: #0C4A6E;
  --color-primary: #0369A1;
  --color-primary-light: #E0F2FE;
  --color-cta: #C2410C;
  --color-cta-hover: #9A3412;
  --color-green: #047857;
  --color-green-light: #D1FAE5;
  --color-orange-light: #FFF7ED;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F0F9FF;
  --color-bg-warm: #FFFBF5;
  --color-border: #CBD5E1;
  --color-footer: #0C4A6E;
  --font-display: 'Nunito', sans-serif;
  --font-body: 'Inter', sans-serif;
  --max-width: 1200px;
  --header-height: 120px;
}

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

html { scroll-behavior: smooth; font-size: 100%; }
body { font-family: var(--font-body); color: var(--color-text); background: var(--color-bg); line-height: 1.7; -webkit-font-smoothing: antialiased; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: underline; }
a:hover { color: var(--color-cta); }

/* Focus styles for keyboard navigation */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- Skip Link --- */
.skip-link {
  position: absolute; top: -100%; left: 16px;
  background: var(--color-heading); color: #fff;
  padding: 12px 24px; z-index: 10000;
  font-weight: 700; text-decoration: none;
  border-radius: 0 0 8px 8px;
}
.skip-link:focus { top: 0; }

/* --- Header --- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  height: var(--header-height);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.header-brand {
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.25rem;
  color: var(--color-heading);
  text-decoration: none;
  flex-shrink: 0;
}
.header-brand:hover { color: var(--color-cta); }

.header-nav { display: flex; align-items: center; gap: 32px; }
.header-nav a {
  font-family: var(--font-display);
  font-weight: 600; font-size: 0.95rem;
  color: var(--color-text); text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}
.header-nav a:hover, .header-nav a[aria-current="page"] {
  border-bottom-color: var(--color-cta);
  color: var(--color-heading);
}

.header-logos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 4px 8px;
  justify-items: center;
  align-items: center;
  flex-shrink: 0;
}
.header-logos img { height: 26px; width: auto; }
.header-logos .amea-icon { height: 32px; }
.header-logos .logo-top {
  grid-column: 1 / -1;
}

/* Mobile menu */
.header-right {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.header-right .amea-icon { height: 36px; width: auto; }

.menu-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: 8px; color: var(--color-text);
}
.menu-toggle svg { width: 28px; height: 28px; }

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .header-nav {
    display: none; position: absolute;
    top: var(--header-height); left: 0; right: 0;
    background: #fff; flex-direction: column;
    padding: 24px; gap: 16px;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  .header-nav.open { display: flex; }
  .header-right .amea-icon { height: 28px; }
  .header-logos img { height: 20px; }
  .header-logos .logo-top { height: 18px; }
  .header-logos { gap: 2px 6px; }
}

/* --- Main content offset --- */
main { padding-top: var(--header-height); }

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 520px;
  display: flex; align-items: center;
  overflow: hidden;
  background: var(--color-bg-alt);
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(12,74,110,0.82) 0%, rgba(3,105,161,0.65) 100%);
}
.hero-content {
  position: relative; z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto; padding: 80px 24px;
  color: #fff;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800; line-height: 1.2;
  margin-bottom: 20px;
  max-width: 700px;
}
.hero p {
  font-size: 1.1rem; line-height: 1.8;
  max-width: 620px; margin-bottom: 28px;
  opacity: 0.95;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700; font-size: 1rem;
  padding: 14px 32px;
  border-radius: 8px;
  text-decoration: none;
  border: none; cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }

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

.btn-outline {
  background: transparent; color: #fff;
  border: 2px solid #fff;
}
.btn-outline:hover { background: rgba(255,255,255,0.15); color: #fff; }

.btn-outline-dark {
  background: transparent; color: var(--color-cta);
  border: 2px solid var(--color-cta);
}
.btn-outline-dark:hover { background: var(--color-cta); color: #fff; }

/* --- Sections --- */
.section {
  padding: 80px 24px;
}
.section-alt { background: var(--color-bg-alt); }
.section-warm { background: var(--color-bg-warm); }
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800; color: var(--color-heading);
  margin-bottom: 16px; line-height: 1.3;
}
.section-subtitle {
  font-size: 1.05rem; color: #475569;
  margin-bottom: 40px; max-width: 650px;
}

/* --- Values (Play/Love/Grow) --- */
.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px; margin-top: 32px;
}
.value-card {
  padding: 32px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: #fff;
  transition: box-shadow 0.2s;
}
.value-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.value-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 10px;
}
.value-card p { font-size: 0.95rem; color: #475569; }

/* Card accent colors */
.value-card--love { border-top: 4px solid #E11D48; }
.value-card--play { border-top: 4px solid var(--color-primary); }
.value-card--create { border-top: 4px solid #F59E0B; }
.value-card--learn { border-top: 4px solid var(--color-green); }

/* --- Split Section (text + image) --- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px; align-items: center;
}
.split-img img {
  border-radius: 16px;
  width: 100%;
  object-fit: cover;
  max-height: 460px;
}
.split-text h2 {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 800;
  color: var(--color-heading);
  margin-bottom: 16px;
}
.split-text p { margin-bottom: 16px; }
.split-text .signature {
  font-family: var(--font-display);
  font-weight: 700; font-style: italic;
  color: var(--color-heading);
}

@media (max-width: 768px) {
  .split { grid-template-columns: 1fr; gap: 32px; }
  .split--reverse .split-img { order: -1; }
}

/* --- Program Cards --- */
.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}
.program-card {
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--color-border);
  background: #fff;
  transition: box-shadow 0.2s;
}
.program-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.1); }
.program-card img {
  width: 100%; height: 240px; object-fit: cover;
}
.program-card-body {
  padding: 28px;
}
.program-card-body h3 {
  font-family: var(--font-display);
  font-size: 1.3rem; font-weight: 800;
  color: var(--color-heading);
  margin-bottom: 12px;
}
.program-card-body p {
  font-size: 0.95rem; color: #475569;
  margin-bottom: 16px;
}
.program-card-body ul {
  list-style: none; padding: 0; margin-bottom: 20px;
}
.program-card-body li {
  padding: 4px 0 4px 24px;
  position: relative;
  font-size: 0.92rem; color: var(--color-text);
}
.program-card-body li::before {
  content: '✓'; position: absolute; left: 0;
  color: var(--color-green); font-weight: 700;
}

/* --- Why Us section --- */
.why-us-list {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin: 20px 0 32px;
}
.why-us-list li {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; color: var(--color-heading);
  list-style: none;
}
.why-us-list li::before {
  content: ''; display: block;
  width: 10px; height: 10px;
  background: var(--color-green);
  border-radius: 50%; flex-shrink: 0;
}

/* --- Photo Gallery --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.gallery img {
  width: 100%; height: 220px;
  object-fit: cover; border-radius: 10px;
}
@media (max-width: 768px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery img { height: 160px; }
}

/* --- About page --- */
.about-bio {
  font-size: 1rem; line-height: 1.9;
  color: #374151;
}
.about-bio p { margin-bottom: 16px; }

/* --- Contact page --- */
.contact-box {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding: 48px 32px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--color-border);
}
.contact-box h2 {
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 800;
  color: var(--color-heading);
  margin-bottom: 16px;
}
.contact-box p { margin-bottom: 24px; color: #475569; }
.contact-details {
  font-size: 0.95rem; color: #475569;
  margin-top: 12px;
}
.contact-or {
  display: block; margin: 28px 0;
  font-weight: 700; color: var(--color-heading);
  font-family: var(--font-display);
}
.contact-email {
  font-size: 1.1rem;
  font-weight: 600;
}

/* --- Footer --- */
.site-footer {
  background: var(--color-footer);
  color: rgba(255,255,255,0.85);
  padding: 48px 24px 24px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px; align-items: start;
}
.footer-brand {
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.2rem; color: #fff;
}
.footer-nav { display: flex; flex-direction: column; gap: 8px; }
.footer-nav a {
  color: rgba(255,255,255,0.8);
  text-decoration: none; font-size: 0.92rem;
}
.footer-nav a:hover { color: #fff; }
.footer-social {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 12px;
}
.footer-social-links {
  display: flex; gap: 16px;
}
.footer-social-links a {
  color: rgba(255,255,255,0.8);
  text-decoration: none; font-size: 0.92rem;
  display: flex; align-items: center; gap: 6px;
}
.footer-social-links a:hover { color: #fff; }

.back-to-top {
  display: inline-flex; align-items: center; gap: 4px;
  color: rgba(255,255,255,0.8);
  text-decoration: none; font-size: 0.85rem; font-weight: 600;
  margin-top: 8px;
}
.back-to-top:hover { color: #fff; }
.back-to-top svg { width: 16px; height: 16px; }

.footer-bottom {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.15);
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-social { align-items: center; }
  .footer-social-links { justify-content: center; }
}

/* --- Services page specifics --- */
.services-programs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}
.service-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px; align-items: center;
  padding: 40px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--color-border);
}
.service-block:nth-child(even) .service-block-img { order: -1; }
.service-block img {
  width: 100%; height: 300px;
  object-fit: cover; border-radius: 12px;
}
.service-block h3 {
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 800;
  color: var(--color-heading);
  margin-bottom: 14px;
}
.service-block p {
  font-size: 0.95rem; color: #475569;
  margin-bottom: 16px; line-height: 1.7;
}
.service-block ul {
  list-style: none; padding: 0; margin-bottom: 24px;
}
.service-block li {
  padding: 5px 0 5px 24px; position: relative;
  font-size: 0.92rem;
}
.service-block li::before {
  content: '✓'; position: absolute; left: 0;
  color: var(--color-green); font-weight: 700;
}

@media (max-width: 768px) {
  .service-block {
    grid-template-columns: 1fr;
    padding: 24px;
  }
  .service-block:nth-child(even) .service-block-img { order: 0; }
  .hero { min-height: 400px; }
  .hero-content { padding: 60px 24px; }
  .section { padding: 56px 24px; }
}

/* --- Utility --- */
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.mb-24 { margin-bottom: 24px; }
