/* ==========================================================================
   SEVEN STEPS PRE-SCHOOL - THE WONDER CANVAS RESPONSIVE ENGINE
   Flawless Multi-Device Fluidity: 360px up to 2560px
   ========================================================================== */

/* Universal Responsive Base Guard */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
}

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

img, video, iframe {
  max-width: 100% !important;
  height: auto;
}

/* --------------------------------------------------------------------------
   Large Displays (1440px and above)
   -------------------------------------------------------------------------- */
@media (min-width: 1440px) {
  .container {
    max-width: 1360px;
  }
}

/* --------------------------------------------------------------------------
   Laptops & Landscape Tablets (1199px and below)
   -------------------------------------------------------------------------- */
@media (max-width: 1199px) {
  /* Switch from desktop navigation to mobile drawer to prevent cramped or wrapping nav items */
  .desktop-nav,
  .header-cta-group .btn-wonder {
    display: none !important;
  }

  .mobile-menu-btn {
    display: flex !important;
  }

  .site-header {
    top: 0.5rem;
  }

  .header-inner {
    padding: 0.55rem 1.15rem;
  }

  .footer-grid-4col {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

/* --------------------------------------------------------------------------
   Tablet Landscape & Portrait (991px and below)
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .section-py {
    padding: clamp(3rem, 6vw, 4.5rem) 0;
  }

  /* Hero Layout Collapse to 1 Column */
  .hero-grid {
    grid-template-columns: 1fr !important;
    text-align: center;
    gap: 2.75rem !important;
  }

  .hero-content {
    order: 2;
  }

  .hero-lead {
    margin-inline: auto;
  }

  .hero-btn-row {
    justify-content: center;
  }

  .hero-trust-row {
    justify-content: center;
  }

  .hero-portrait-canvas {
    order: 1;
    max-width: 380px;
    margin: 0 auto;
  }

  .hero-badge-1 {
    left: 0 !important;
  }

  .hero-badge-2 {
    right: 0 !important;
  }

  /* Editorial Split Layouts Collapse */
  .editorial-split-layout,
  .editorial-split-layout.reverse {
    grid-template-columns: 1fr !important;
    direction: ltr !important;
    gap: 2.5rem !important;
    text-align: center;
  }

  .storybook-pillars-grid {
    max-width: 520px;
    margin-inline: auto;
  }

  /* Mentor Profile Cards Collapse */
  .mentor-profile-grid {
    grid-template-columns: 1fr !important;
    text-align: center;
    gap: 2rem !important;
  }

  .mentor-quote-deck blockquote {
    text-align: left;
  }

  /* Forms 2-Col Collapse */
  .form-grid-2col {
    grid-template-columns: 1fr !important;
  }

  .form-field-group.full-width {
    grid-column: span 1 !important;
  }
}

/* --------------------------------------------------------------------------
   Mobile Viewports (767px and below)
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  body {
    padding-bottom: 78px !important; /* Space for Mobile Bottom Action Dock */
  }

  /* Hide Top Notice Bar on Mobile to maximize screen area */
  .top-notice-bar {
    display: none !important;
  }

  .site-header {
    top: 0.35rem;
    padding: 0 0.65rem;
  }

  .header-inner {
    padding: 0.45rem 1rem;
  }

  .brand-logo img {
    height: 40px;
  }

  .brand-title {
    font-size: 1.02rem;
  }

  .brand-tagline {
    font-size: 0.82rem;
  }

  /* Hero Sizing on Mobile */
  .hero-headline {
    font-size: 2.15rem !important;
  }

  .hero-portrait-canvas {
    max-width: 290px !important;
  }

  .hero-sticker-badge {
    padding: 0.45rem 0.85rem !important;
    font-size: 0.78rem !important;
  }

  .hero-badge-1 { top: 0 !important; left: 0 !important; }
  .hero-badge-2 { bottom: 0 !important; right: 0 !important; }
  .hero-rotating-seal { display: none !important; }

  .hero-btn-row {
    flex-direction: column;
    width: 100%;
  }

  .hero-btn-row .btn-wonder {
    width: 100%;
  }

  /* Milestone Steps Grid (2 Columns on Mobile) */
  .milestone-trail-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.85rem !important;
  }

  .milestone-step-card {
    padding: 1.25rem 0.85rem !important;
  }

  .storybook-pillars-grid,
  .facilities-mosaic-grid,
  .pinboard-grid,
  .wall-of-pride-grid,
  .branches-wonder-grid,
  .admission-roadmap-grid,
  .career-openings-grid,
  .circular-timings-grid,
  .media-clippings-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  /* Events Timeline Stacking on Mobile */
  .timeline-milestone-item {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    padding-bottom: 2.5rem !important;
  }

  .timeline-milestone-item::before {
    display: none !important;
  }

  .timeline-date-stamp {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.15rem !important;
    transform: none !important;
    width: fit-content;
  }

  .date-stamp-num {
    font-size: 1.5rem !important;
  }

  .date-stamp-label {
    font-size: 0.95rem !important;
  }

  /* Hide Desktop Floating Side Action Pills */
  .floating-side-actions {
    display: none !important;
  }

  /* Show Native Mobile Bottom Dock */
  .mobile-bottom-dock {
    display: block !important;
  }

  .rocket-top-btn {
    bottom: 5.75rem !important;
    right: 1rem !important;
    width: 42px !important;
    height: 42px !important;
    font-size: 1rem !important;
  }

  /* Footer on Mobile */
  .footer-grid-4col {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    text-align: center;
  }

  .footer-col h4::after {
    left: 50% !important;
    transform: translateX(-50%);
  }

  .footer-social-links {
    justify-content: center;
  }

  .footer-bottom-bar {
    flex-direction: column;
    text-align: center;
  }

  .storybook-wave svg {
    height: 28px !important;
  }
}

/* --------------------------------------------------------------------------
   Compact Phones (420px and below - iPhone SE, Galaxy Z Fold, 360px)
   -------------------------------------------------------------------------- */
@media (max-width: 420px) {
  .container {
    width: min(100% - 1.5rem, 1280px) !important;
  }

  .brand-title {
    font-size: 0.95rem !important;
  }

  .brand-tagline {
    font-size: 0.75rem !important;
  }

  .hero-headline {
    font-size: 1.85rem !important;
  }

  .milestone-trail-grid {
    grid-template-columns: 1fr !important;
  }

  .workbook-form-card {
    padding: 1.5rem 1rem !important;
  }

  .mentor-profile-card {
    padding: 1.5rem 1rem !important;
  }

  .mobile-nav-drawer {
    width: 100vw !important;
    max-width: 100vw !important;
  }
}
