/* ============================================================
   TABORA BOYS SECONDARY SCHOOL — RESPONSIVE OVERRIDES
   Updated: Khaki palette + 3D canvas sizing
   Breakpoints:
     • Desktop    : > 1200px  (minor tweaks)
     • Laptop     : ≤ 1100px
     • Tablet     : ≤ 992px   (nav collapse, 2-col grids)
     • Sm Tablet  : ≤ 768px   (hero / card / grid tweaks)
     • Mobile     : ≤ 640px   (1-col, compact padding)
     • Sm Mobile  : ≤ 480px   (ultra-compact)
   ============================================================ */

/* ----------------------------------------------------------
   DESKTOP  (> 1200px) — subtle polish
   ---------------------------------------------------------- */
@media (min-width: 1201px) {
  .hero-wrapper {
    min-height: 100vh;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .gallery-grid-modern {
    grid-template-columns: repeat(3, 1fr);
  }

  .premium-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .news-layout {
    grid-template-columns: 2fr 1fr;
  }
}

/* ----------------------------------------------------------
   LAPTOP / TABLET  (≤ 1100px)
   ---------------------------------------------------------- */
@media (max-width: 1100px) {
  .navbar-wrapper {
    padding: 0.6rem 1.5rem;
  }

  .nav-links {
    gap: 1.2rem;
  }

  .btn-nav-glass {
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
  }

  .hero-wrapper {
    padding: 6rem 1.5rem 4rem;
  }

  .hero-title {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
  }

  .hero-content-container {
    gap: 40px;
  }

  .hero-3d-container {
    flex: 0 0 300px;
    height: 300px;
  }

  .quick-actions {
    padding: 3rem 1.5rem;
  }

  .actions-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }

  .legacy-section {
    padding: 4rem 1.5rem;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
  }

  .premium-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
  }

  .results-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
  }

  .news-layout {
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
  }

  .gallery-grid-modern {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  .cta-panel {
    padding: 3rem 2rem;
  }
}

/* ----------------------------------------------------------
   TABLET  (≤ 992px) — nav collapse, 2-col grids
   ---------------------------------------------------------- */
@media (max-width: 992px) {
  /* ---- Navbar ---- */
  .nav-links {
    display: none;
  }
  
  .navbar-brand img.nav-logo {
      display: none !important;
  }
  
  .navbar-brand span.brand-text {
      display: inline !important;
  }

  .mobile-toggle {
    display: flex;
    flex-direction: column;
  }

  .btn-nav-glass {
    display: none;
  }

  .mega-panels-wrapper {
    display: none;
  }

  .navbar-wrapper {
    padding: 0.5rem 1rem;
  }

  /* ---- Hero ---- */
  .hero-wrapper {
    padding: 5rem 1.25rem 3.5rem;
    min-height: 85vh;
  }

  .hero-content-container {
    flex-direction: column;
    text-align: center;
    gap: 30px;
  }

  .hero-text-layers {
    text-align: center;
  }

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

  .hero-3d-container {
    flex: 0 0 250px;
    height: 250px;
    order: -1;
  }

  .hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
  }

  .hero-motto {
    font-size: 1.1rem;
  }

  .hero-subtitle {
    font-size: 1rem;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-btns {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }

  .hero-badge {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
  }

  /* ---- Quick Actions ---- */
  .actions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .action-card {
    padding: 1.5rem 1rem;
  }

  /* ---- Legacy ---- */
  .legacy-section {
    padding: 3.5rem 1.25rem;
  }

  .legacy-image-wrapper {
    max-width: 100%;
  }

  .floating-badge {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }

  .mini-timeline {
    gap: 1rem;
  }

  .timeline-item {
    font-size: 0.9rem;
  }

  /* ---- Stats ---- */
  .stats-section {
    padding: 3.5rem 1.25rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }

  .stat-card {
    padding: 1.5rem 1rem;
  }

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

  /* ---- Why Choose ---- */
  .why-choose-section {
    padding: 3.5rem 1.25rem;
  }

  .premium-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }

  .premium-card {
    padding: 1.75rem 1.25rem;
  }

  /* ---- Results ---- */
  .results-preview-section {
    padding: 3.5rem 1.25rem;
  }

  .results-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }

  .result-card {
    padding: 1.5rem 1rem;
  }

  /* ---- News ---- */
  .news-preview-section {
    padding: 3.5rem 1.25rem;
  }

  .news-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .news-card.horizontal {
    flex-direction: column;
    height: auto;
  }

  .news-card.horizontal .card-img-wrapper {
    width: 100%;
    min-width: unset;
    height: 180px;
  }

  .news-sidebar {
    order: 2;
  }

  .btn-view-all {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* ---- Admissions CTA ---- */
  .admissions-cta-section {
    padding: 3.5rem 1.25rem;
  }

  .cta-panel {
    padding: 2.5rem 1.5rem;
    border-radius: 1rem;
  }

  .cta-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .btn-cta-premium {
    width: 100%;
    max-width: 320px;
    text-align: center;
  }

  /* ---- Gallery ---- */
  .gallery-preview-section {
    padding: 3.5rem 1.25rem;
  }

  .gallery-grid-modern {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .gallery-item {
    border-radius: 0.75rem;
  }

  /* ---- Testimonials ---- */
  .testimonials-section {
    padding: 3.5rem 1.25rem;
  }

  .testimonials-slider-wrapper {
    max-width: 100%;
  }

  .card-glass {
    padding: 2rem 1.5rem;
  }

  .slider-controls {
    gap: 0.75rem;
    margin-top: 1.5rem;
  }

  /* ---- Footer ---- */
  .site-footer {
    padding: 3rem 1.25rem 1.5rem;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

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

  .footer-logo img {
    height: 36px;
  }

  /* ---- Loader ---- */
  .site-loader {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .loader-content {
    max-width: 90%;
    text-align: center;
  }
  
  .loader-logo-container {
    width: clamp(80px, 20vw, 120px) !important;
    height: clamp(80px, 20vw, 120px) !important;
  }
}

/* ----------------------------------------------------------
   SMALL TABLET  (≤ 768px)
   ---------------------------------------------------------- */
@media (max-width: 768px) {
  /* ---- Hero ---- */
  .hero-wrapper {
    padding: 4.5rem 1rem 3rem;
    min-height: 80vh;
  }

  .hero-title {
    font-size: clamp(1.8rem, 6vw, 2.8rem);
    line-height: 1.15;
  }

  .hero-motto {
    font-size: 1rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    max-width: 95%;
  }

  .hero-btns {
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
  }

  .hero-btns a,
  .hero-btns button {
    width: 100%;
    max-width: 300px;
    text-align: center;
  }

  .hero-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.85rem;
  }

  .hero-3d-container {
    flex: 0 0 200px;
    height: 200px;
  }

  .hero-3d-fallback {
    width: 180px;
    height: 180px;
  }

  .scroll-indicator {
    bottom: 1rem;
    transform: scale(0.85) translateX(-50%);
    transform-origin: bottom center;
  }

  /* ---- Quick Actions ---- */
  .actions-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .action-card {
    padding: 1.25rem 0.75rem;
    font-size: 0.9rem;
  }

  /* ---- Legacy ---- */
  .legacy-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .legacy-image-wrapper {
    order: -1;
    width: 100%;
    max-height: 280px;
    overflow: hidden;
    border-radius: 1rem;
  }

  .floating-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.85rem;
  }

  .mini-timeline {
    flex-direction: column;
    gap: 0.75rem;
  }

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

  .stat-card {
    padding: 1.25rem 0.85rem;
  }

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

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

  .premium-card {
    padding: 1.5rem 1rem;
  }

  /* ---- Results ---- */
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  /* ---- News ---- */
  .news-card {
    border-radius: 0.75rem;
  }

  .news-card.horizontal {
    flex-direction: column;
    height: auto;
  }

  .news-card.horizontal .card-img-wrapper {
    width: 100%;
    min-width: unset;
    height: 160px;
  }

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

  /* ---- Testimonials ---- */
  .card-glass {
    padding: 1.5rem 1.25rem;
  }

  .slider-controls button {
    width: 38px;
    height: 38px;
  }

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

  /* ---- Loader ---- */
  .loader-logo-container {
    width: clamp(70px, 18vw, 90px) !important;
    height: clamp(70px, 18vw, 90px) !important;
  }
}

/* ----------------------------------------------------------
   MOBILE  (≤ 640px) — single-column, compact
   ---------------------------------------------------------- */
@media (max-width: 640px) {
  /* ---- Hero ---- */
  .hero-wrapper {
    padding: 4rem 0.85rem 2.5rem;
    min-height: 75vh;
  }

  .hero-title {
    font-size: clamp(1.6rem, 7vw, 2.4rem);
  }

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

  .hero-subtitle {
    font-size: 0.88rem;
  }

  .hero-3d-container {
    flex: 0 0 180px;
    height: 180px;
  }

  .hero-3d-fallback {
    width: 150px;
    height: 150px;
  }

  /* ---- Quick Actions ---- */
  .quick-actions {
    padding: 2rem 0.85rem;
  }

  .actions-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .action-card {
    padding: 1.15rem 1rem;
  }

  /* ---- Legacy ---- */
  .legacy-section {
    padding: 2.5rem 0.85rem;
    overflow: hidden; /* Prevent badge from blowing out container */
  }

  .legacy-image-wrapper {
    max-height: 240px;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
  }

  .floating-badge {
    font-size: 0.75rem;
    bottom: 10px;
    right: 10px;
    padding: 15px 20px;
  }

  .timeline-item {
    font-size: 0.85rem;
    word-break: break-word;
  }

  /* ---- Stats ---- */
  .stats-section {
    padding: 2.5rem 0.85rem;
  }

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

  .stat-card {
    padding: 1.25rem 1rem;
  }

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

  /* ---- Why Choose ---- */
  .why-choose-section {
    padding: 2.5rem 0.85rem;
  }

  .premium-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .premium-card {
    padding: 1.25rem 1rem;
  }

  /* ---- Results ---- */
  .results-preview-section {
    padding: 2.5rem 0.85rem;
  }

  .results-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .result-card {
    padding: 1.25rem 1rem;
  }

  /* ---- News ---- */
  .news-preview-section {
    padding: 2.5rem 0.85rem;
  }

  .news-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .news-card {
    border-radius: 0.6rem;
  }

  .news-card.featured .card-img-wrapper {
    height: 240px;
  }

  .news-card.featured .card-content {
    padding: 20px;
  }

  .news-card.horizontal {
    flex-direction: column;
    height: auto;
  }

  .news-card.horizontal .card-img-wrapper {
    width: 100%;
    min-width: unset;
    height: 150px;
  }

  .news-sidebar {
    display: none;
  }

  .btn-view-all {
    font-size: 0.9rem;
    padding: 0.65rem 1.25rem;
  }

  /* ---- Admissions CTA ---- */
  .admissions-cta-section {
    padding: 2.5rem 0.85rem;
  }

  .cta-panel {
    padding: 2rem 1.15rem;
    border-radius: 0.85rem;
  }

  .cta-actions {
    flex-direction: column;
    gap: 0.6rem;
  }

  .btn-cta-premium {
    width: 100%;
    font-size: 0.95rem;
    padding: 0.7rem 1.25rem;
  }

  /* ---- Gallery ---- */
  .gallery-preview-section {
    padding: 2.5rem 0.85rem;
  }

  .gallery-grid-modern {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .gallery-item {
    border-radius: 0.6rem;
    aspect-ratio: 16/10;
  }

  /* ---- Testimonials ---- */
  .testimonials-section {
    padding: 2.5rem 0.85rem;
  }

  .card-glass {
    padding: 1.25rem 1rem;
    border-radius: 0.85rem;
  }

  .slider-controls {
    gap: 0.5rem;
    margin-top: 1rem;
  }

  .slider-controls button {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  /* ---- Footer ---- */
  .site-footer {
    padding: 2.5rem 0.85rem 1.25rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.6rem;
    padding-top: 1.25rem;
    font-size: 0.82rem;
  }

  .footer-logo {
    justify-content: center;
  }

  .footer-logo img {
    height: 32px;
  }

  .footer-socials {
    justify-content: center;
  }

  .footer-contact {
    text-align: left;
  }

  /* ---- Loader ---- */
  .site-loader {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .loader-content {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .loader-logo-container {
    width: 64px;
    height: 64px;
  }
}

/* ----------------------------------------------------------
   SMALL MOBILE  (≤ 480px) — ultra-compact
   ---------------------------------------------------------- */
@media (max-width: 480px) {
  /* ---- Navbar ---- */
  .navbar-wrapper {
    padding: 0.4rem 0.65rem;
    width: 95%;
    top: 15px;
  }

  .nav-logo {
    height: 36px;
  }

  /* ---- Hero ---- */
  .hero-wrapper {
    padding: 3.5rem 0.65rem 2rem;
    min-height: 70vh;
  }

  .hero-title {
    font-size: clamp(1.4rem, 8vw, 2rem);
    letter-spacing: -0.02em;
  }

  .hero-motto {
    font-size: 0.88rem;
  }

  .hero-subtitle {
    font-size: 0.82rem;
  }

  .hero-btns {
    gap: 0.5rem;
  }

  .hero-btns a,
  .hero-btns button {
    font-size: 0.88rem;
    padding: 0.6rem 1rem;
  }

  .hero-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.7rem;
  }

  .hero-3d-container {
    flex: 0 0 150px;
    height: 150px;
  }

  .hero-3d-fallback {
    width: 120px;
    height: 120px;
  }

  /* ---- Quick Actions ---- */
  .actions-grid {
    gap: 0.6rem;
  }

  .action-card {
    padding: 1rem 0.75rem;
    border-radius: 12px;
  }

  .card-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }

  .action-card h3 {
    font-size: 1rem;
  }

  .action-card p {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }

  /* ---- Legacy ---- */
  .floating-badge {
    display: none;
  }

  /* ---- Stats ---- */
  .stat-number {
    font-size: 1.4rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  /* ---- Section Titles ---- */
  .section-title-premium {
    font-size: 1.6rem;
  }

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

  /* ---- Mobile Drawer ---- */
  .mobile-drawer {
    width: 100%;
    max-width: 100%;
    padding: 20px;
  }

  .drawer-link {
    font-size: 1rem;
  }

  /* ---- Testimonials ---- */
  .quote-icon {
    font-size: 2rem;
  }

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

  /* ---- CTA ---- */
  .cta-panel h2 {
    font-size: 1.5rem;
  }

  .cta-panel p {
    font-size: 0.95rem;
  }
}

/* ----------------------------------------------------------
   ULTRA-SMALL  (≤ 360px) — minimum viable
   ---------------------------------------------------------- */
@media (max-width: 360px) {
  .hero-title {
    font-size: 1.3rem;
  }

  .hero-3d-container {
    flex: 0 0 120px;
    height: 120px;
  }

  .hero-3d-fallback {
    width: 100px;
    height: 100px;
  }

  .navbar-wrapper {
    padding: 0.35rem 0.5rem;
    border-radius: 30px;
  }

  .nav-logo {
    height: 30px;
  }
}
