/* ==========================================================================
   Whole Kid School — Custom Stylesheet
   Warm, modern, Scandinavian-minimal design system layered on Tailwind.
   ========================================================================== */

:root {
  /* Primary brand blue, extracted from the Whole Kid School wordmark */
  --brand-100: #E2E5EF;
  --brand-200: #BBC2DE;
  --brand-300: #8C9ACD;
  --brand-400: #5268BB;
  --brand-500: #3B509F;
  --brand-600: #34478C;
  --brand-700: #2A3970;
  --brand-800: #202C57;
  --brand-900: #172041;

  /* Complementary warm neutrals — Montessori / Scandinavian interiors */
  --warm-white: #FCFAF7;
  --paper: #F9F6F0;
  --soft-sage: #97A587;
  --sage-deep: #74836A;
  --warm-sand: #E8DCC6;
  --sand-deep: #D8C6A3;
  --terracotta: #C1704F;
  --terracotta-deep: #A85B3D;
  --wood: #A9805C;
  --wood-deep: #8B6544;
  --ink: #29292C;
  --ink-soft: #47453F;
  --shadow-warm: 0 20px 60px -20px rgba(139, 101, 68, 0.22);
  --shadow-brand: 0 20px 45px -15px rgba(52, 71, 140, 0.35);
}

* {
  scroll-behavior: smooth;
}

html {
  scroll-padding-top: 96px;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  background-color: var(--warm-white);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, .font-display {
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ==========================================================================
   Organic background shapes
   ========================================================================== */

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

.blob-sage {
  background: radial-gradient(circle at 30% 30%, rgba(151, 165, 135, 0.55), rgba(151, 165, 135, 0));
}

.blob-sand {
  background: radial-gradient(circle at 40% 40%, rgba(216, 198, 163, 0.6), rgba(216, 198, 163, 0));
}

.blob-terracotta {
  background: radial-gradient(circle at 50% 50%, rgba(193, 112, 79, 0.35), rgba(193, 112, 79, 0));
}

.blob-brand {
  background: radial-gradient(circle at 45% 35%, rgba(82, 104, 187, 0.45), rgba(82, 104, 187, 0));
}

.organic-shape {
  border-radius: 63% 37% 54% 46% / 45% 41% 59% 55%;
}

.organic-shape-alt {
  border-radius: 42% 58% 66% 34% / 52% 40% 60% 48%;
}

/* ==========================================================================
   Glassmorphism
   ========================================================================== */

.glass-nav {
  background: rgba(251, 248, 243, 0.72);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(169, 128, 92, 0.08);
}

.glass-badge {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   Scroll reveal
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1.is-visible { transition-delay: 0.1s; }
.reveal-delay-2.is-visible { transition-delay: 0.2s; }
.reveal-delay-3.is-visible { transition-delay: 0.3s; }
.reveal-delay-4.is-visible { transition-delay: 0.4s; }
.reveal-delay-5.is-visible { transition-delay: 0.5s; }

/* ==========================================================================
   Floating / parallax animation
   ========================================================================== */

@keyframes float-slow {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(14px, -22px) rotate(4deg); }
}

@keyframes float-slower {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-18px, 16px) rotate(-3deg); }
}

.animate-float-slow {
  animation: float-slow 12s ease-in-out infinite;
}

.animate-float-slower {
  animation: float-slower 16s ease-in-out infinite;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
  animation: fade-in-up 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }

/* ==========================================================================
   Cards & hovers
   ========================================================================== */

.card-lift {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-lift:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-warm);
}

.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.img-zoom:hover img {
  transform: scale(1.08);
}

.underline-grow {
  position: relative;
}

.underline-grow::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 2px;
  width: 0;
  background: currentColor;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.underline-grow:hover::after {
  width: 100%;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn-primary {
  background: var(--brand-600);
  color: var(--warm-white);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px -10px rgba(52, 71, 140, 0.5);
}

.btn-primary:hover {
  background: var(--brand-700);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -10px rgba(52, 71, 140, 0.6);
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-secondary:hover {
  background: var(--ink);
  color: var(--warm-white);
  transform: translateY(-2px);
}

/* Book a Tour request form inputs */
.tour-input {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid rgba(169, 128, 92, 0.18);
  background: var(--warm-white);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--ink);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.tour-input::placeholder {
  color: rgba(71, 69, 63, 0.4);
}

.tour-input:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(52, 71, 140, 0.15);
}

/* ==========================================================================
   Testimonial carousel
   ========================================================================== */

.testimonial-track {
  display: flex;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
}

/* Fade used when switching between Google/Yelp datasets (see switchReviewSource).
   Only opacity is touched here — the track's transform is always driven by an
   inline style for carousel paging, which takes precedence over any class rule,
   so this can't fight with the slide position. */
.testimonial-track.is-fading {
  opacity: 0;
}

.testimonial-slide {
  flex: 0 0 100%;
}

@media (min-width: 768px) {
  .testimonial-slide {
    flex: 0 0 50%;
  }
}

@media (min-width: 1024px) {
  .testimonial-slide {
    flex: 0 0 33.3333%;
  }
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sand-deep);
  transition: all 0.4s ease;
}

.carousel-dot.active {
  width: 28px;
  border-radius: 999px;
  background: var(--brand-600);
}

/* Review summary card (rating + Google/Yelp source tabs) */
.review-summary-card {
  background: var(--warm-white);
  border: 1px solid rgba(169, 128, 92, 0.14);
  border-radius: 2rem;
  box-shadow: var(--shadow-warm);
  padding: 1.75rem 2rem;
}

/* Google / Yelp source tabs */
.review-source-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(169, 128, 92, 0.22);
  background: transparent;
  color: var(--ink-soft);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.review-source-tab:hover {
  transform: translateY(-1px);
}

.review-source-tab.active {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: var(--warm-white);
}

/* Animated cross-fade when switching review source */
.review-fade-swap {
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.review-fade-swap.is-fading {
  opacity: 0;
  transform: translateY(6px);
}

/* Individual review card */
.review-card {
  background: var(--warm-white);
  border: 1px solid rgba(169, 128, 92, 0.14);
  border-radius: 1.75rem;
  box-shadow: 0 12px 30px -18px rgba(41, 41, 44, 0.14);
}

.review-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.review-platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid rgba(169, 128, 92, 0.18);
  color: var(--ink-soft);
}

.review-text-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}

.review-text-clamp.expanded {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.review-read-more {
  color: var(--brand-600);
  font-weight: 600;
  font-size: 0.8rem;
}

.review-read-more:hover {
  text-decoration: underline;
}

/* Touch-drag affordance for the swipeable review track (see initTestimonialCarousel) */
.testimonial-track {
  touch-action: pan-y;
  cursor: grab;
}

.testimonial-track.dragging {
  cursor: grabbing;
  transition: none;
}

/* Lightbox */
#lightbox {
  transition: opacity 0.35s ease;
}

#lightbox img {
  transition: transform 0.35s ease;
}

/* ==========================================================================
   A Day at Whole Kid — vertical timeline
   Desktop: cards alternate left/right of a central line, each anchored by an
   icon dot. Mobile: collapses to a single left-aligned line with all cards
   on the right, since there's no room for the two-column alternation.
   ========================================================================== */

.daily-timeline {
  position: relative;
}

.daily-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 24px;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--terracotta) 6%, var(--terracotta) 94%, transparent);
  opacity: 0.35;
}

.daily-timeline-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  padding-left: 64px;
  margin-bottom: 2.5rem;
}

.daily-timeline-row:last-child {
  margin-bottom: 0;
}

.daily-timeline-dot {
  position: absolute;
  top: 0;
  left: 24px;
  transform: translateX(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 3px solid var(--warm-white);
  box-shadow: 0 0 0 2px rgba(169, 128, 92, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.daily-timeline-card {
  background: var(--warm-white);
  border: 1px solid rgba(169, 128, 92, 0.14);
  border-radius: 1.5rem;
  box-shadow: 0 12px 30px -18px rgba(41, 41, 44, 0.14);
  padding: 1.5rem 1.75rem;
}

.daily-timeline-time {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

@media (min-width: 768px) {
  .daily-timeline::before {
    left: 50%;
  }

  .daily-timeline-row {
    grid-template-columns: 1fr 1fr;
    column-gap: 3rem;
    padding-left: 0;
    align-items: center;
  }

  .daily-timeline-dot {
    left: 50%;
  }

  .daily-timeline-row .daily-timeline-card {
    grid-column: 2;
  }

  .daily-timeline-row.timeline-left .daily-timeline-card {
    grid-column: 1;
  }
}

/* ==========================================================================
   Our Environment — editorial gallery
   Mobile: swipeable snap-scroll row. Desktop (md+): dense mixed-size grid.
   ========================================================================== */

.editorial-grid {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.25rem 0.25rem 1rem;
  -webkit-overflow-scrolling: touch;
}

.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
  height: 0;
}

.editorial-item {
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: var(--shadow-warm);
  flex: 0 0 76%;
  height: 320px;
  scroll-snap-align: center;
}

@media (min-width: 480px) {
  .editorial-item { flex-basis: 58%; }
}

@media (min-width: 768px) {
  .editorial-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 150px;
    grid-auto-flow: dense;
    overflow: visible;
    padding: 0;
  }
  .editorial-item {
    flex: initial;
    height: auto;
  }
  .editorial-item.env-size-large { grid-column: span 2; grid-row: span 3; }
  .editorial-item.env-size-wide  { grid-column: span 2; grid-row: span 2; }
  .editorial-item.env-size-tall  { grid-column: span 1; grid-row: span 3; }
  .editorial-item.env-size-square { grid-column: span 1; grid-row: span 2; }
}

.editorial-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.editorial-item:hover img {
  transform: scale(1.08);
}

.editorial-item .env-badge {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  background: rgba(251, 248, 243, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  color: var(--ink);
}

.editorial-item .env-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(46, 43, 38, 0) 45%, rgba(46, 43, 38, 0.7) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.editorial-item:hover .env-overlay,
.editorial-item:focus-within .env-overlay {
  opacity: 1;
}

.editorial-item.env-hidden {
  display: none;
}

/* Desktop-only "Show More" cap on the Our Environment gallery (see
   initEnvironmentGalleryLimit in main.js). Items beyond the first 10 matches
   get this class; removing it reveals them with a smooth fade + rise. */
.editorial-item.env-limit-hidden {
  display: none;
}

.editorial-item.env-reveal {
  animation: envItemReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes envItemReveal {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.env-show-more {
  display: flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}

.env-show-more:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 3px;
}

.filter-pill {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--warm-white);
  color: var(--ink-soft);
  border: 1px solid rgba(169, 128, 92, 0.18);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.filter-pill:hover {
  border-color: var(--brand-600);
  color: var(--ink);
}

.filter-pill.active {
  background: var(--brand-600);
  color: var(--warm-white);
  border-color: var(--brand-600);
}

/* ==========================================================================
   FAQ accordion
   ========================================================================== */

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-item.open .faq-answer {
  max-height: 400px;
}

.faq-icon {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

/* ==========================================================================
   Nav mobile menu
   ========================================================================== */

#mobile-menu {
  transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

#mobile-menu.open {
  max-height: 600px;
  opacity: 1;
}

/* ==========================================================================
   Misc
   ========================================================================== */

.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(169,128,92,0.25), transparent);
}

.text-gradient {
  background: linear-gradient(90deg, var(--brand-500), var(--brand-800));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

::selection {
  background: var(--brand-300);
  color: var(--warm-white);
}

.rating-star {
  color: var(--terracotta);
}

img.fade-load {
  opacity: 0;
  transition: opacity 0.6s ease;
}

img.fade-load.loaded {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Our Educators — teacher cards
   -------------------------------------------------------------------------- */
.teacher-card {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.5s ease;
}

.teacher-card:hover {
  border-color: rgba(169, 128, 92, 0.28);
}

.teacher-bio-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.teacher-bio-clamp.expanded {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.teacher-read-more {
  color: var(--brand-600);
  font-weight: 600;
  font-size: 0.8rem;
}

.teacher-read-more:hover {
  text-decoration: underline;
}

.teacher-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
}

.teacher-linkedin-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.teacher-linkedin-btn:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: var(--shadow-warm);
}

.teacher-linkedin-btn:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
}

/* Scrollbar */
html {
  scrollbar-color: var(--brand-400) var(--warm-white);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--warm-white);
}

::-webkit-scrollbar-thumb {
  background: var(--brand-400);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand-600);
}
