/* ==========================================================================
   SPARKS CLASSES - RESPONSIVE BREAKPOINTS (320px to 4K)
   ========================================================================== */

/* ---- Global: prevent any element from causing horizontal scroll ---------- */
html {
  overflow-x: hidden;
  max-width: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  max-width: 100%;
}

/* Ultra Wide & 4K Displays (Above 1920px) */
@media (min-width: 1921px) {
  .container {
    max-width: 1600px;
  }

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

  .section-title {
    font-size: 3.2rem;
  }

  .stat-number {
    font-size: 3.8rem;
  }
}

/* Laptops & Standard Desktops (1025px - 1440px) */
@media (max-width: 1440px) {
  .container {
    max-width: 1140px;
  }

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

/* Tablets & Small Laptops (769px - 1024px) */
@media (max-width: 1024px) {
  .container {
    width: 92%;
  }

  /* Navbar */
  .nav-menu {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  /* Hero Section */
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-content {
    align-items: center;
  }

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

  .hero-subheading {
    margin: 0 auto 28px;
  }

  .hero-cta-group {
    justify-content: center;
  }

  .floating-badge-1 {
    top: 5px;
    left: -5px;
  }

  .floating-badge-2 {
    bottom: 10px;
    right: -5px;
  }

  /* Stats Section */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* About Section */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* Courses & Faculty */
  .courses-grid,
  .faculty-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Carousel arrows — slightly smaller on tablet */
  .carousel-btn {
    width: 38px;
    height: 38px;
  }

  /* Why Choose Sparks */
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Timeline */
  .timeline-wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* Gallery Grid */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }
}

/* Mobile Devices (up to 768px) */
@media (max-width: 768px) {

  /* ---- Base ---- */
  body {
    overflow-x: hidden;
  }

  .container {
    width: 94%;
    padding-left: 0;
    padding-right: 0;
  }

  section {
    overflow-x: hidden;
  }

  /* ---- Navbar ---- */
  .header-navbar {
    overflow: hidden;
  }

  /* ---- Hero ---- */
  .hero-section {
    padding-top: 100px;
    padding-bottom: 50px;
    overflow: hidden;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }

  .hero-content {
    align-items: center;
  }

  .hero-headline {
    font-size: 2rem;
    word-break: break-word;
  }

  .hero-subheading {
    font-size: 0.95rem;
    margin: 0 auto 24px;
  }

  .hero-cta-group {
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
  }

  /* Hero image — contain within screen */
  .hero-image-wrapper {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    overflow: hidden;
  }

  .hero-illustration {
    width: 100%;
    height: auto;
  }

  /* Floating badges — keep in bounds */
  .floating-badge {
    font-size: 0.72rem;
    padding: 6px 10px;
    max-width: 140px;
  }

  .floating-badge-1,
  .floating-badge-2 {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    display: none; /* hide on very small screens to avoid overflow */
  }

  /* ---- Stats ---- */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .stat-card {
    padding: 18px 12px;
  }

  .stat-number {
    font-size: 2rem;
  }

  /* ---- About ---- */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .about-image-wrapper {
    width: 100%;
    overflow: hidden;
  }

  .about-image-wrapper img {
    width: 100%;
    height: auto;
  }

  /* ---- Section headings ---- */
  .section-title {
    font-size: 1.75rem;
    word-break: break-word;
  }

  .section-subtitle {
    font-size: 0.92rem;
  }

  /* ---- Courses & Why grid ---- */
  .courses-grid,
  .faculty-grid,
  .why-grid {
    grid-template-columns: 1fr;
  }

  /* ---- Carousel ---- */
  .results-carousel {
    gap: 6px;
  }

  .carousel-btn {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }

  /* ---- Admissions / Timeline ---- */
  .timeline-wrapper {
    grid-template-columns: 1fr;
  }

  /* ---- Gallery ---- */
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  /* ---- Testimonials ---- */
  .testimonial-card {
    padding: 20px 14px;
  }

  .testimonial-text {
    font-size: 0.92rem;
  }

  /* ---- Contact ---- */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

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

  .form-control {
    max-width: 100%;
    width: 100%;
  }

  /* ---- FAQ ---- */
  .faq-question {
    font-size: 0.9rem;
  }

  /* ---- Footer ---- */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  /* ---- Floating actions ---- */
  .floating-actions {
    bottom: 16px;
    right: 16px;
  }

  .btn-float {
    width: 44px;
    height: 44px;
  }
}

/* Ultra Mobile (up to 425px) */
@media (max-width: 425px) {
  .container {
    width: 96%;
  }

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

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

  .btn {
    width: 100%;
    text-align: center;
  }

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

  .badge-icon {
    width: 30px;
    height: 30px;
  }

  .contact-form-card {
    padding: 20px 12px;
  }

  /* Make carousel cards slightly smaller on tiny phones */
  .ranker-card {
    min-width: 140px !important;
    max-width: 140px !important;
  }
}
