/* =========================================
   WATER ACADEMY — Responsive Styles
   ========================================= */

/* Global overflow guard */
html, body { overflow-x: hidden; max-width: 100%; }

/* =========================================
   Large Desktop  xl  (≥ 1200px)
   ========================================= */
@media (min-width: 1200px) {
  .hero-title { font-size: 4rem; }
}

/* =========================================
   Desktop-wide  lg  (992px – 1199px)
   ========================================= */
@media (max-width: 1199px) {
  :root { --section-padding: 80px 0; }

  /* About — pull floated stats in so they don't bleed */
  .about-stat-float.stat-top    { right: 0; }
  .about-stat-float.stat-bottom { left: 0; }

  /* Timeline — go linear */
  .timeline::before { left: 28px; }

  .timeline-item,
  .timeline-item:nth-child(even) {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 76px;
    position: relative;
  }

  /* Hide the spacer divs that only make sense in 2-col layout */
  .timeline-spacer { display: none; }

  .timeline-content,
  .timeline-item:nth-child(odd) .timeline-content {
    width: 100%;
    text-align: left;
    margin: 0;
  }

  .timeline-connector {
    position: absolute;
    left: 0;
    top: 0;
    width: auto;
  }

  .timeline-dot { width: 48px; height: 48px; }

  /* Testimonials — 2 per view */
  .testimonial-slide { flex: 0 0 50%; }
}

/* =========================================
   Tablet  md  (768px – 991px)
   ========================================= */
@media (max-width: 991px) {
  :root { --section-padding: 64px 0; }

  /* Navbar — dropdown panel */
  .navbar-collapse {
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-top: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
  }

  .navbar-nav .nav-link          { color: var(--text)    !important; padding: 10px 8px !important; }
  .navbar-nav .nav-link:hover    { color: var(--primary) !important; }
  .navbar-nav .nav-link::after   { display: none; }
  .btn-nav-cta                   { margin-top: 10px; width: 100%; justify-content: center; }

  /* Hero */
  .hero-image-col    { display: none; }
  .hero-title        { font-size: clamp(1.9rem, 5vw, 2.8rem); }
  .hero-content      { padding: 110px 0 60px; text-align: center; }
  .hero-subtitle     { margin-left: auto; margin-right: auto; }
  .hero-stats        { justify-content: center; }
  .hero-actions      { justify-content: center; }
  .hero-badge        { margin-left: auto; margin-right: auto; }

  /* About */
  .about-content          { padding-left: 0; padding-top: 32px; }
  .about-img-wrap img     { height: 360px; }
  .about-stat-float       { position: static !important; margin-bottom: 12px; }
  .about-stat-float + .about-stat-float { margin-left: 0; }

  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* Gallery */
  .gallery-grid { columns: 2; }

  /* Testimonials */
  .testimonial-slide { flex: 0 0 50%; }

  /* Schedule */
  .schedule-table-wrap  { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .schedule-table       { min-width: 480px; font-size: 0.82rem; }
  .schedule-table thead th,
  .schedule-table td    { padding: 10px 12px; }

  /* CTA */
  .cta-card { padding: 48px 32px; }

  /* Page hero inner pages */
  .page-hero { padding: 140px 0 60px; }
}

/* =========================================
   Mobile  sm  (576px – 767px)
   ========================================= */
@media (max-width: 767px) {
  :root { --section-padding: 56px 0; }

  .section-title  { font-size: clamp(1.5rem, 6vw, 2rem); }
  .section-header { margin-bottom: 32px; }

  /* Hero */
  .hero         { min-height: 100svh; }
  .hero-content { padding: 100px 0 60px; text-align: center; }
  .hero-title   { font-size: clamp(1.75rem, 7vw, 2.4rem); }
  .hero-subtitle { font-size: 0.97rem; }
  .hero-stats   { gap: 14px; justify-content: center; }
  .hero-stat    { font-size: 0.82rem; }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .hero-actions .btn-accent-wa,
  .hero-actions .btn-primary-wa,
  .hero-actions .btn-outline-wa {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

  /* About */
  .about-img-wrap img { height: 260px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-number { font-size: 1.8rem; }

  /* Programs */
  .program-card-img  { height: 180px; }
  .program-card-body { padding: 36px 20px 22px; }

  /* Timeline */
  .timeline-content { padding: 20px 18px; }
  .timeline-title   { font-size: 1rem; }

  /* Gallery */
  .gallery-grid { columns: 2; column-gap: 10px; }
  .gallery-item { margin-bottom: 10px; }

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

  /* Pool tabs — scrollable row */
  .pool-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    gap: 8px;
  }
  .pool-tab {
    flex-shrink: 0;
    font-size: 0.78rem;
    padding: 8px 14px;
  }

  /* Schedule */
  .schedule-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .schedule-table      { min-width: 440px; }

  /* CTA */
  .cta-card    { padding: 36px 20px; border-radius: var(--radius-lg); }
  .cta-title   { font-size: 1.5rem; }
  .cta-subtitle { font-size: 0.95rem; }
  .cta-actions {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .cta-actions .btn-accent-wa,
  .cta-actions .btn-outline-wa {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }
  .cta-contact-info { flex-direction: column; gap: 10px; }

  /* Contact form */
  .contact-form-card { padding: 24px 16px; }

  /* Page hero */
  .page-hero       { padding: 120px 0 56px; }
  .page-hero-title { font-size: clamp(1.6rem, 7vw, 2.2rem); }
  .page-hero-sub   { font-size: 0.95rem; }

  /* Inner page hero actions */
  .page-hero .hero-actions {
    flex-direction: column;
    gap: 12px;
  }
  .page-hero .btn-accent-wa,
  .page-hero .btn-outline-wa {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

  /* Benefits */
  .benefits-grid { grid-template-columns: 1fr 1fr; }

  /* Lightbox nav buttons */
  .lightbox-prev { left: -36px; }
  .lightbox-next { right: -36px; }
}

/* =========================================
   Small mobile  xs  (< 576px)
   ========================================= */
@media (max-width: 575px) {
  :root { --section-padding: 44px 0; }

  .container { padding-left: 16px; padding-right: 16px; }

  /* Hero */
  .hero-stats   { flex-direction: column; gap: 8px; align-items: center; }
  .hero-badge   { font-size: 0.78rem; }

  /* Stats */
  .stats-grid   { grid-template-columns: 1fr 1fr; }
  .stat-number  { font-size: 1.6rem; }

  /* About floats — stack as simple cards */
  .about-stat-float {
    flex-direction: column;
    gap: 6px;
    text-align: center;
    padding: 14px 16px;
  }
  .about-img-wrap img { height: 220px; }

  /* Gallery — single column */
  .gallery-grid { columns: 1; }

  /* Benefits — single column */
  .benefits-grid { grid-template-columns: 1fr; }

  /* Testimonials slider */
  .testimonials-slider { overflow: hidden; }

  /* Schedule */
  .schedule-section    { padding: 36px 0; }
  .schedule-table-wrap { overflow-x: auto; }
  .schedule-table      { min-width: 380px; font-size: 0.78rem; }
  .schedule-table thead th,
  .schedule-table td   { padding: 9px 10px; }

  /* Pool tabs */
  .pool-tab { font-size: 0.75rem; padding: 7px 12px; }

  /* Lightbox */
  .lightbox-img-wrap          { max-width: 96vw; }
  .lightbox-prev, .lightbox-next { display: none; }

  /* CTA */
  .cta-card { padding: 32px 16px; }

  /* Contact form */
  .contact-form-card { padding: 20px 14px; }

  /* Footer */
  .footer-cards       { gap: 6px; }
  .footer-card-badge  { font-size: 0.72rem; padding: 3px 8px; }
  .footer-social-link { width: 36px; height: 36px; font-size: 1rem; }

  /* Class type cards — tighter on very small screens */
  .class-type-card { padding: 22px 16px; }

  /* Page hero box on inner pages */
  .page-hero > .container > .row > div:last-child { margin-top: 20px; }
  .page-hero > .container > .row > div:last-child > div { max-width: 100% !important; }

  /* Inline flex contact info items — wrap text */
  .cta-contact-item { font-size: 0.83rem; }
}

/* =========================================
   Print
   ========================================= */
@media print {
  #navbar, footer, .cta-card, .scroll-indicator, .hero-bubbles { display: none; }
  body { background: white; color: black; }
  .schedule-table { font-size: 9pt; }
  .schedule-table-wrap { overflow: visible; }
}

/* =========================================
   Reduced motion
   ========================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .fade-up, .fade-left, .fade-right { opacity: 1; transform: none; }
}
