/* ============================================
   St Michael's Pre-School - Custom Styles
   ============================================ */

/* --- Base Styles --- */
body {
  font-family: 'Nunito', sans-serif;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'DynaPuff', cursive;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: #F9A8D4;
  color: #fff;
  padding: 8px 16px;
  z-index: 100;
  font-weight: 700;
  border-radius: 0 0 8px 0;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* --- Animations --- */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-14px) rotate(1.5deg); }
  66% { transform: translateY(-7px) rotate(-1deg); }
}

@keyframes float-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

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

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

.animate-float { animation: float 6s ease-in-out infinite; }
.animate-float-delayed { animation: float 6s ease-in-out 2s infinite; }
.animate-float-slow { animation: float-slow 8s ease-in-out infinite; }
.animate-float-slower { animation: float-slow 9s ease-in-out 1s infinite; }
.animate-fade-in-up { animation: fade-in-up 0.7s ease-out forwards; }

/* Floating blobs */
.floating-blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* --- Button styles --- */
.btn-playful {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-playful:hover {
  transform: translateY(-3px) scale(1.04);
}
.btn-playful:active {
  transform: translateY(-1px) scale(1.01);
}

/* --- Card hover lift --- */
.card-lift {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.card-lift:hover {
  transform: translateY(-8px);
}

/* --- Heading underline accent --- */
.heading-underline {
  position: relative;
  display: inline-block;
}
.heading-underline::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 6px;
  border-radius: 999px;
}

/* --- Navigation --- */
.nav-link {
  position: relative;
  font-weight: 600;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 3px;
  border-radius: 999px;
  transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }

/* --- Mobile nav --- */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease, visibility 0.3s ease;
  opacity: 0;
  visibility: hidden;
}
#mobile-menu.open {
  max-height: 500px;
  opacity: 1;
  visibility: visible;
}

/* --- Testimonial slider --- */
.testimonial-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.testimonial-slide {
  min-width: 100%;
  padding-left: 12px;
  padding-right: 12px;
  opacity: 0.5;
  transition: opacity 0.5s ease;
}
.testimonial-slide.active {
  opacity: 1;
}
@media (min-width: 768px) {
  .testimonial-slide {
    padding-left: 16px;
    padding-right: 16px;
  }
}
@media (max-width: 767px) {
  .testimonial-slide {
    min-width: calc(100% - 60px);
    padding-left: 0;
    padding-right: 0;
    margin-right: 12px;
  }
}

/* --- Speech bubble --- */
.speech-bubble {
  position: relative;
}
.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 32px;
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 16px solid #FFF;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06));
}

/* --- Staff photo --- */
.staff-photo-wrap {
  transition: transform 0.3s ease;
}
.staff-card:hover .staff-photo-wrap {
  transform: scale(1.06);
}

/* --- Decorative shapes --- */
.deco-circle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* --- Squiggle divider --- */
.squiggle-divider {
  width: 100px;
  height: 12px;
}

/* --- Hours row colors --- */
.hours-row-mon { background: rgba(125, 211, 252, 0.12); }
.hours-row-tue { background: rgba(249, 168, 212, 0.12); }
.hours-row-wed { background: rgba(190, 242, 100, 0.15); }
.hours-row-thu { background: rgba(216, 180, 254, 0.15); }
.hours-row-fri { background: rgba(253, 230, 138, 0.2); }
.hours-row-sat { background: rgba(229, 231, 235, 0.3); }
.hours-row-sun { background: rgba(229, 231, 235, 0.3); }

/* --- Section blob backgrounds --- */
.section-blob-bg { position: relative; overflow: hidden; }

.section-blob-bg::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 400px;
  height: 400px;
  border-radius: 60% 40% 50% 50% / 40% 60% 50% 50%;
  background: rgba(125, 211, 252, 0.1);
  z-index: 0;
  pointer-events: none;
}
.section-blob-bg::after {
  content: '';
  position: absolute;
  bottom: -25%;
  left: -10%;
  width: 350px;
  height: 350px;
  border-radius: 40% 60% 60% 40% / 50% 40% 60% 50%;
  background: rgba(249, 168, 212, 0.08);
  z-index: 0;
  pointer-events: none;
}

.section-blob-bg > * { position: relative; z-index: 1; }

/* --- Fees card labels --- */
.fees-label {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Hero section --- */
.hero-section {
  position: relative;
  overflow: hidden;
}

/* --- Map container --- */
.map-container {
  overflow: hidden;
  border-radius: 24px;
}
.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* --- Focus styles for accessibility --- */
a:focus-visible,
button:focus-visible {
  outline: 3px solid #F9A8D4;
  outline-offset: 2px;
  border-radius: 8px;
}

/* --- Responsive enhancements --- */
@media (max-width: 768px) {
  .section-blob-bg::before {
    width: 250px;
    height: 250px;
    top: -20%;
    right: -20%;
  }
  .section-blob-bg::after {
    width: 200px;
    height: 200px;
    bottom: -15%;
    left: -15%;
  }
  .hero-heading {
    font-size: 2.5rem !important;
  }
}

@media (max-width: 480px) {
  .hero-heading {
    font-size: 2rem !important;
  }
}

/* ============================================
   Motion Design - Premium Animations
   ============================================ */

/* --- Staggered card reveal --- */
.stagger-group > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.stagger-group.visible > * {
  opacity: 1;
  transform: translateY(0);
}
.stagger-group.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger-group.visible > *:nth-child(2) { transition-delay: 0.08s; }
.stagger-group.visible > *:nth-child(3) { transition-delay: 0.16s; }
.stagger-group.visible > *:nth-child(4) { transition-delay: 0.24s; }
.stagger-group.visible > *:nth-child(5) { transition-delay: 0.32s; }
.stagger-group.visible > *:nth-child(6) { transition-delay: 0.4s; }
.stagger-group.visible > *:nth-child(7) { transition-delay: 0.48s; }
.stagger-group.visible > *:nth-child(8) { transition-delay: 0.56s; }

/* --- Hero entrance animation --- */
@keyframes hero-in {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-in {
  opacity: 0;
  animation: hero-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-in-d1 { animation: hero-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards; }
.hero-in-d2 { animation: hero-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards; }
.hero-in-d3 { animation: hero-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards; }
.hero-in-d4 { animation: hero-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.55s forwards; }

/* --- Header shadow on scroll --- */
.header-scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1) !important;
}

/* --- Nav link hover underline --- */
.nav-underline {
  position: relative;
}
.nav-underline::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 0;
  height: 3px;
  background: #F9A8D4;
  border-radius: 999px;
  transition: width 0.35s ease, left 0.35s ease;
}
.nav-underline:hover::after {
  width: 50%;
  left: 25%;
}
.nav-underline.active-page::after {
  width: 50%;
  left: 25%;
  background: #F472B6;
}

/* --- Social icon hover lift --- */
.social-icon-hover {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease;
}
.social-icon-hover:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 6px 16px rgba(244, 114, 182, 0.3);
}

/* --- Reveal scale variation --- */
.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .hero-in, .reveal, .reveal-left, .reveal-right,
  .reveal-scale, .stagger-group > * {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}
