/* ==========================================================================
   BRIGHT – THE SCHOOL | Responsive Media Queries & Mobile Overrides
   Creative Direction: "A Little World of Big Dreams"
   ========================================================================== */

@import url('./hero-cinematic.css');

/* ==========================================================================
   Tablet & Small Laptop Viewports (max-width: 1160px)
   ========================================================================== */

@media (max-width: 1160px) {
  :root {
    --section-spacing: 5rem;
    --section-spacing-sm: 3.25rem;
    --header-height: 72px;
  }

  .nav-desktop {
    display: none !important;
  }

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

  .hero-grid,
  .hero-container {
    grid-template-columns: 1fr;
    gap: 3.5rem;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
    margin: 0 auto;
  }

  .hero-badge-container {
    display: flex;
    justify-content: center;
  }

  .hero-actions {
    justify-content: center;
  }

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

  .hero-media-wrapper {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
  }

  .hero-photo-img {
    height: 420px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.75rem;
  }

  .roadmap-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .playful-cta-banner {
    flex-direction: column;
    text-align: center;
    padding: 3.5rem 2.5rem;
  }

  .cta-banner-content {
    max-width: 100%;
  }

  .cta-banner-actions {
    width: 100%;
    align-items: center;
  }
}

/* ==========================================================================
   Tablet Portrait Viewports (max-width: 900px)
   ========================================================================== */

@media (max-width: 900px) {
  .features-playful-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
  }

  .why-bright-grid {
    grid-template-columns: 1fr;
  }

  .facilities-playful-grid {
    grid-template-columns: 1fr;
  }

  .two-col-responsive-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .contact-layout-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .admissions-overview-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* ==========================================================================
   Mobile Viewports (max-width: 767px)
   ========================================================================== */

@media (max-width: 767px) {
  :root {
    --section-spacing: 3.75rem;
    --section-spacing-sm: 2.5rem;
    --header-height: 66px;
  }

  /* Container mobile breathing room & strict boundary containment */
  .container,
  .container-wide,
  .container-narrow {
    padding-left: 1.15rem !important;
    padding-right: 1.15rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .section,
  .section-sm,
  .blog-hero,
  .article-hero,
  .hero-section,
  .hero-cinematic {
    overflow-x: clip !important;
    max-width: 100% !important;
  }

  .site-announcement-ribbon {
    font-size: 0.8rem;
    padding: 0.45rem 0.75rem;
  }

  .site-brand {
    display: inline-flex;
    align-items: center;
    max-width: calc(100% - 56px);
  }

  .brand-logo-img {
    height: 46px;
    max-height: 48px;
    width: auto;
    max-width: min(250px, 72vw);
    object-fit: contain;
  }

  .mobile-nav-header img {
    height: 46px !important;
    max-height: 48px !important;
    width: auto !important;
    max-width: 220px !important;
    object-fit: contain;
  }

  @media (max-width: 540px) {
    .header-actions .btn-admissions-cta {
      display: none !important;
    }
  }

  @media (max-width: 360px) {
    .brand-logo-img {
      height: 40px;
      max-width: 200px;
    }
    .mobile-nav-header img {
      height: 40px !important;
      max-width: 190px !important;
    }
  }

  .grade-explorer-box {
    padding: 1.5rem 1.25rem;
  }

  .grade-panel-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .grade-panel-pillars {
    grid-template-columns: 1fr;
  }

  .grade-tabs {
    gap: 0.45rem;
  }

  .grade-tab-btn {
    font-size: 0.85rem;
    padding: 0.5rem 0.95rem;
  }

  .hero-headline {
    font-size: 2.25rem;
  }

  .hero-lead {
    font-size: 1.05rem;
  }

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

  .hero-actions .btn {
    width: 100%;
  }

  .hero-photo-img {
    height: 320px;
  }

  .floating-tour-badge {
    left: 10px;
    bottom: -15px;
    padding: 0.5rem 1rem;
  }

  .deco-sun {
    width: 60px;
    height: 60px;
    top: -20px;
    right: -15px;
  }

  .deco-cloud {
    display: none;
  }

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

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

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .footer-bottom-copy,
  .footer-agency-credit {
    align-items: center;
    justify-content: center;
    text-align: center;
  }

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

  .playful-cta-banner {
    padding: 2.75rem 1.75rem;
    border-radius: 28px;
  }

  .cta-banner-title {
    font-size: 1.85rem;
  }

  .cta-banner-lead {
    font-size: 1rem;
  }

  .btn-white-pill {
    width: 100%;
  }

  .gallery-responsive-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Hero Floating Badges mobile optimization */
  .hero-floating-badge {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0.75rem 0 0 0 !important;
    padding: 0.75rem 1.15rem !important;
    box-sizing: border-box !important;
  }

  .hero-media-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  /* Curricular Tiles mobile grid */
  .curricular-tiles-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Hero trust row wrapping on mobile */
  .hero-trust-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .trust-item {
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
  }

  /* CTA Banner Card mobile breathing room */
  .cta-banner-section {
    padding-bottom: calc(var(--section-spacing) + 3rem);
  }

  .cta-banner-card {
    padding: 2.25rem 1.25rem !important;
  }

  .cta-banner-btn-group {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1rem !important;
    width: 100% !important;
    padding-bottom: 0.75rem !important;
  }

  .cta-banner-btn-group .btn,
  .cta-banner-card .btn-clay {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Eligibility Calculator & Routine Timeline mobile */
  .eligibility-calc-box {
    padding: 1.75rem 1.15rem !important;
    border-radius: 24px;
  }

  .eligibility-age-selector {
    gap: 0.5rem;
  }

  .age-btn {
    padding: 0.55rem 0.95rem;
    font-size: 0.85rem;
    flex: 1 1 calc(50% - 0.5rem);
    text-align: center;
  }

  .eligibility-result-card {
    padding: 1.5rem 1.15rem;
  }

  .result-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .result-details-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  .safety-pillars-grid,
  .routine-timeline-grid {
    grid-template-columns: 1fr !important;
    gap: 1.15rem !important;
  }

  /* All Critical Layout Grids Single-Column Mobile Overrides */
  .documents-checklist-grid,
  .gallery-editorial-grid,
  .gallery-preview-grid,
  .age-criteria-grid,
  .fee-pillars-row,
  .programmes-playful-grid,
  .testimonial-grid,
  .parent-info-grid,
  .features-playful-grid,
  .facilities-playful-grid,
  .why-bright-grid,
  .roadmap-grid,
  .two-col-responsive-grid,
  .admissions-overview-grid,
  .contact-layout-grid,
  .tour-form-row {
    grid-template-columns: 1fr !important;
    gap: 1.15rem !important;
  }

  /* Specific Card & Component Mobile Padding & Spacing */
  .fee-transparency-card {
    padding: 1.75rem 1.15rem !important;
    border-radius: 22px !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
  }

  .age-criteria-card,
  .document-item,
  .fee-pillar,
  .testimonial-card,
  .parent-info-card,
  .facility-playful-card,
  .feature-playful-card,
  .gallery-card {
    box-sizing: border-box !important;
    max-width: 100% !important;
  }

  /* Hero Stat Counters Mobile Scaling */
  .hero-stats-row {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
  }

  /* Mobile Doodles & Decorative Floating Graphics Containment */
  .doodle-sun {
    width: 68px !important;
    height: 68px !important;
    right: 2% !important;
    top: 10px !important;
    opacity: 0.7 !important;
  }

  .doodle-cloud {
    width: 76px !important;
    height: 50px !important;
    left: 2% !important;
    top: 15px !important;
    opacity: 0.6 !important;
  }

  .doodle-stars,
  .deco-sun,
  .deco-cloud,
  .deco-stars {
    display: none !important;
  }

  .doodle-airplane,
  .doodle-rainbow,
  .doodle-flower {
    max-width: 76px !important;
    height: auto !important;
    opacity: 0.65 !important;
  }

  /* Prevent inline flex containers from pushing past frame */
  [style*="display:flex"],
  [style*="display: flex"] {
    flex-wrap: wrap !important;
  }

  .instant-pass-card {
    padding: 2rem 1.15rem !important;
    border-radius: 24px;
  }

  .pass-perks-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    max-width: 290px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Safe Area Inset & Touch Target Compliance */
  .mobile-floating-bar {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  body {
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .fab-btn {
    min-height: 46px;
  }

  .btn {
    min-height: 44px;
  }

  /* Prevent iOS Safari Auto-Zoom on form input focus */
  .form-input,
  .form-select,
  .form-textarea,
  .tour-form-input,
  .tour-form-select,
  .blog-search-input {
    font-size: 16px !important;
  }

  /* Safeguard mobile tables & long URLs from breaking layout */
  .article-prose {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .article-prose table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ==========================================================================
   Small Mobile Viewports (320px - 380px)
   ========================================================================== */

@media (max-width: 380px) {
  :root {
    --section-spacing: 3rem;
    --section-spacing-sm: 2rem;
  }

  .container,
  .container-wide,
  .container-narrow {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  .hero-stats-row {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }

  .hero-headline {
    font-size: 1.95rem;
  }

  .hero-lead {
    font-size: 0.95rem;
  }

  .hero-photo-img {
    height: 270px;
  }

  .feature-playful-card,
  .facility-playful-card,
  .parent-info-card,
  .roadmap-step-card,
  .why-pill-card {
    padding: 1.5rem 1.15rem;
    border-radius: 22px;
  }

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

  .btn-lg {
    padding: 0.8rem 1.4rem;
    font-size: 1rem;
  }
}

/* ==========================================================================
   Large Desktop & Ultra-Wide Viewports (1440px - 1920px)
   ========================================================================== */

@media (min-width: 1440px) {
  .container {
    max-width: 1240px;
  }

  .hero-content {
    max-width: 660px;
  }

  .hero-headline {
    font-size: 4.25rem;
  }
}

@media (min-width: 1920px) {
  body {
    font-size: 1.125rem;
  }

  .container {
    max-width: 1300px;
  }
}
