/* Kids Valley Preschool — Brand Design System */
:root {
  --yellow: #F5E6A3;
  --yellow-light: #FFF8E1;
  --yellow-dark: #E8D48B;
  --blue: #1B3A5C;
  --blue-light: #2A5080;
  --brown: #7D5A3C;
  --brown-light: #A67C52;
  --white: #FFFFFF;
  --black: #1A1A1A;
  --gray: #5C5C5C;
  --shadow: 0 4px 24px rgba(27, 58, 92, 0.08);
  --shadow-lg: 0 12px 40px rgba(27, 58, 92, 0.12);
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--navbar-height, 5rem) + 0.75rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Nunito', 'Poppins', system-ui, sans-serif;
  color: var(--black);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', 'Nunito', sans-serif;
  font-weight: 700;
  color: var(--blue);
  line-height: 1.2;
}

/* Typography utilities */
.text-blue { color: var(--blue); }
.text-brown { color: var(--brown); }
.text-gray { color: var(--gray); }
.bg-yellow { background-color: var(--yellow); }
.bg-yellow-light { background-color: var(--yellow-light); }
.bg-blue { background-color: var(--blue); }
.bg-brown { background-color: var(--brown); }

/* Navbar */
.navbar {
  transition: background var(--transition), box-shadow var(--transition), padding var(--transition);
}
.navbar.scrolled {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.nav-link {
  position: relative;
  color: var(--blue);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color var(--transition);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brown);
  transition: width var(--transition);
  border-radius: 2px;
}
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }
.nav-link:hover, .nav-link.active { color: var(--brown); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(27, 58, 92, 0.25);
}
.btn-primary:hover {
  background: var(--blue-light);
  box-shadow: 0 6px 24px rgba(27, 58, 92, 0.35);
}
.btn-secondary {
  background: var(--white);
  color: var(--blue);
  border: 2px solid var(--blue);
}
.btn-secondary:hover { background: var(--yellow-light); }
.btn-brown {
  background: var(--brown);
  color: var(--white);
}
.btn-brown:hover { background: var(--brown-light); }
.btn-whatsapp {
  background: #25D366;
  color: var(--white);
}
.btn-whatsapp:hover { background: #1fb855; }

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* Section styling */
.section-padding { padding: 4rem 0; }
@media (min-width: 768px) { .section-padding { padding: 6rem 0; } }

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0.5rem;
}
.section-subtitle {
  color: var(--gray);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 2.5rem;
}

/* Curved sections */
.curve-top {
  position: relative;
  margin-top: -1px;
}
.curve-top svg { display: block; width: 100%; height: auto; }

/* Blob shapes */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.blob-yellow { background: var(--yellow); }
.blob-blue { background: rgba(27, 58, 92, 0.15); }
.blob-brown { background: rgba(125, 90, 60, 0.2); }

/* Floating icons */
.float-icon {
  position: absolute;
  animation: float 4s ease-in-out infinite;
  opacity: 0.7;
}
.float-icon:nth-child(2) { animation-delay: 1s; }
.float-icon:nth-child(3) { animation-delay: 2s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(5deg); }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Hero */
.hero-gradient {
  background: linear-gradient(135deg, var(--yellow-light) 0%, var(--yellow) 50%, var(--yellow-light) 100%);
}
.hero-image-wrap {
  position: relative;
  border-radius: 2rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero-image-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 4px solid var(--white);
  border-radius: 2rem;
  z-index: 2;
  pointer-events: none;
}

/* Highlight cards */
.highlight-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  border: 2px solid transparent;
  transition: border-color var(--transition), transform var(--transition);
}
.highlight-card:hover {
  border-color: var(--yellow-dark);
  transform: translateY(-4px);
}
.highlight-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: var(--yellow-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

/* Program cards */
.program-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.program-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}
.program-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

/* Testimonials */
.testimonial-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--brown);
}
.testimonial-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--yellow);
}
#testimonial-carousel {
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

.testimonial-slide {
  flex-shrink: 0;
  width: 100%;
}
.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yellow-dark);
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.carousel-dot.active {
  background: var(--blue);
  transform: scale(1.3);
}

/* Gallery */
.gallery-grid {
  columns: 1;
  column-gap: 1rem;
}
@media (min-width: 640px) { .gallery-grid { columns: 2; } }
@media (min-width: 1024px) { .gallery-grid { columns: 3; } }

.gallery-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.gallery-item img {
  width: 100%;
  display: block;
  transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(27, 58, 92, 0);
  transition: background var(--transition);
}
.gallery-item:hover::after {
  background: rgba(27, 58, 92, 0.2);
}
.gallery-filter-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 2px solid var(--blue);
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  transition: all var(--transition);
}
.gallery-filter-btn.active,
.gallery-filter-btn:hover {
  background: var(--blue);
  color: var(--white);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
}
.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius);
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}

/* FAQ */
.faq-item {
  border: 2px solid var(--yellow);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
  background: var(--white);
}
.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  text-align: left;
  background: none;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  color: var(--blue);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Poppins', sans-serif;
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 1.5rem;
  color: var(--gray);
  line-height: 1.7;
}
.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 0 1.5rem 1.25rem;
}
.faq-icon { transition: transform var(--transition); font-size: 1.25rem; color: var(--brown); }
.faq-item.open .faq-icon { transform: rotate(45deg); }

/* Forms */
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 2px solid var(--yellow-dark);
  border-radius: var(--radius);
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(27, 58, 92, 0.1);
}
.form-label {
  display: block;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--yellow), var(--brown));
  border-radius: 3px;
}
.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0.25rem;
  width: 14px;
  height: 14px;
  background: var(--blue);
  border: 3px solid var(--yellow);
  border-radius: 50%;
  transform: translateX(-5.5px);
}

/* Counter animation */
.stat-number {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--blue);
  font-family: 'Poppins', sans-serif;
}

/* Sticky CTA */
.sticky-cta {
  position: fixed;
  bottom: 5.5rem;
  right: 1rem;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sticky-cta .btn { padding: 0.65rem 1rem; font-size: 0.85rem; }

/* WhatsApp float */
.whatsapp-float {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 1000;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  transition: transform var(--transition);
  text-decoration: none;
}
.whatsapp-float:hover { transform: scale(1.1); }
.whatsapp-float svg { width: 28px; height: 28px; fill: white; }

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 5.5rem;
  left: 1.25rem;
  z-index: 900;
  width: 44px;
  height: 44px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover { transform: translateY(-3px); }

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(27, 58, 92, 0.97);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}
.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}
.mobile-menu a {
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  transition: color var(--transition);
}
.mobile-menu a:hover { color: var(--yellow); }
.mobile-menu-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
}

/* Page header (inner pages) */
.page-hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  padding: 7rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: var(--yellow);
  border-radius: 50%;
  opacity: 0.15;
  top: -100px;
  right: -50px;
}
.page-hero h1 { color: var(--white); }
.page-hero p { color: rgba(255,255,255,0.85); }

/* Footer */
.footer {
  background: var(--blue);
  color: rgba(255, 255, 255, 0.85);
}
.footer a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color var(--transition);
}
.footer a:hover { color: var(--yellow); }
.footer h4 { color: var(--white); }

/* Process steps */
.process-step {
  position: relative;
  text-align: center;
  padding: 1.5rem;
}
.process-number {
  width: 48px;
  height: 48px;
  background: var(--brown);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  margin: 0 auto 1rem;
  font-family: 'Poppins', sans-serif;
}

/* Map embed */
.map-embed {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 4px solid var(--yellow);
}
.map-embed iframe {
  width: 100%;
  height: 350px;
  border: 0;
  display: block;
}
@media (min-width: 768px) { .map-embed iframe { height: 450px; } }

/* Lazy load placeholder */
img[loading="lazy"] {
  background: var(--yellow-light);
}

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

/* Print */
@media print {
  .navbar, .whatsapp-float, .back-to-top, .sticky-cta, .mobile-menu { display: none !important; }
}

/* ─── Accessibility ─── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0.75rem;
  z-index: 10000;
  padding: 0.65rem 1rem;
  background: var(--blue);
  color: var(--white);
  font-weight: 700;
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid var(--yellow-dark);
  outline-offset: 2px;
}

/* ─── Responsive: mobile, tablet, safe areas ─── */
img, video, svg, iframe {
  max-width: 100%;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

#menu-btn,
.mobile-menu-close,
.carousel-dot,
.gallery-filter-btn {
  min-height: 44px;
  min-width: 44px;
}

.btn,
.faq-question {
  min-height: 44px;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

@media (max-width: 639px) {
  .section-padding { padding: 2.75rem 0; }

  .section-subtitle {
    font-size: 0.95rem;
    margin-bottom: 1.75rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .playful-header { margin-bottom: 2rem; }
  .playful-header .section-emoji { font-size: 2rem; }

  .page-hero {
    padding-top: calc(var(--navbar-height, 5rem) + 1.5rem);
    padding-bottom: 3rem;
  }

  .page-hero h1 {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
  }

  .sticky-cta {
    bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
    right: max(0.75rem, env(safe-area-inset-right, 0px));
  }

  .whatsapp-float {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    right: max(1rem, env(safe-area-inset-right, 0px));
    width: 52px;
    height: 52px;
  }

  .back-to-top {
    bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
    left: max(0.75rem, env(safe-area-inset-left, 0px));
  }

  .map-embed iframe {
    height: min(55vh, 320px);
  }

  .lightbox-close {
    top: max(1rem, env(safe-area-inset-top, 0px));
    right: max(1rem, env(safe-area-inset-right, 0px));
  }

  .program-card img { height: 180px; }

  .gallery-filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
  }

  .gallery-filters::-webkit-scrollbar { display: none; }

  .gallery-filter-btn {
    flex-shrink: 0;
    min-width: auto;
    padding: 0.5rem 1rem;
  }

  .mobile-menu a { font-size: 1.25rem; }

  .card ul li.flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .max-w-7xl.mx-auto.px-4,
  .max-w-7xl.mx-auto.px-4.sm\:px-6 {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }
}

@media (max-width: 380px) {
  .hero-preschool .flex.flex-wrap.gap-3 .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .preschool-site .site-logo-img {
    max-width: min(260px, 38vw);
  }
}

@media (hover: none) {
  .card:hover,
  .program-card:hover,
  .highlight-card:hover,
  .play-card:hover {
    transform: none;
  }
}
