/* ==========================================
   MASTER MOBILE RESPONSIVE FIXES (mobile.css)
   ========================================== */

/* 1. Global Overflow Fix to Prevent Horizontal Scroll */
html, body {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

/* 2. Media Element Scaling */
img, video, iframe {
  max-width: 100% !important;
  height: auto !important;
}

/* 3. Mobile Navbar Adjustments */
@media (max-width: 768px) {
  .navbar {
    padding: 0 10px !important;
    height: 55px !important;
  }
  .logo img {
    height: 30px !important;
  }
  .logo span {
    font-size: 0.75rem !important;
    letter-spacing: 0px !important;
  }
}

/* 4. Branch Subnav Horizontal Scrollable Bar on Mobile */
@media (max-width: 768px) {
  .branch-subnav {
    padding: 6px 8px !important;
    top: 55px !important;
  }
  .branch-subnav ul {
    justify-content: flex-start !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    gap: 8px !important;
    padding-bottom: 4px;
  }
  .branch-subnav ul::-webkit-scrollbar {
    height: 2px;
  }
  .branch-subnav ul::-webkit-scrollbar-thumb {
    background: #D4AF37;
  }
  .branch-subnav a {
    font-size: 0.72rem !important;
    padding: 5px 10px !important;
    flex-shrink: 0 !important;
  }
}

/* 5. Fullscreen Overlay Menu Stack for Mobile & Tablets */
@media (max-width: 992px) {
  .overlay {
    flex-direction: column !important;
  }
  .menu-left {
    width: 100% !important;
    padding: 65px 20px 10px 20px !important;
    max-height: 35vh !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  }
  .menu-left ul li {
    font-size: 1.1rem !important;
    padding: 6px 10px !important;
    margin: 4px 0 !important;
  }
  .menu-right {
    width: 100% !important;
    padding: 15px 20px 50px 20px !important;
    max-height: 65vh !important;
  }
}

/* 6. Timeline Single Column Stack (For About/History Pages) */
@media screen and (max-width: 768px) {
  .timeline-wrapper {
    padding: 0 10px !important;
    max-width: 100% !important;
  }
  .timeline-wrapper::after {
    left: 24px !important;
  }
  .timeline-item {
    width: 100% !important;
    padding-left: 50px !important;
    padding-right: 10px !important;
  }
  .timeline-item::after {
    left: 14px !important;
    top: 20px !important;
    width: 18px !important;
    height: 18px !important;
  }
  .right {
    left: 0% !important;
  }
  .card {
    padding: 15px !important;
  }
  .timeline-img {
    height: 160px !important;
  }
}

/* 7. Grid Cards Stack to Single Column on Mobile (Alumni, Achievers, Reels, Campuses, etc.) */
@media (max-width: 768px) {
  .insta-grid, 
  .static-alumni-grid, 
  .achievers-grid, 
  .footer-grid, 
  .campus-overview-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
    padding: 0 10px !important;
  }
  .static-alumni-card, 
  .insta-card, 
  .achiever-card, 
  .fancy-card {
    width: 100% !important;
    max-width: 100% !important;
  }
}