/* ═══════════════════════════════════════════════
   DESKTOP NAVBAR  (≥ 992px)
═══════════════════════════════════════════════ */
@media only screen and (min-width: 992px) {
  .desktop-nav .container {
    display: flex;
    justify-content: center;
  }

  .desktop-nav .navbar {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    justify-content: center;
    position: relative;
  }

  .desktop-nav .navbar .navbar-collapse {
    justify-content: center;
  }

  .desktop-nav .navbar .navbar-nav {
    margin-left: 0 !important;
    margin-right: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
  }

  .desktop-nav .navbar .navbar-nav .nav-item a {
    display: flex;
    align-items: center;
    margin-left: 12px;
    margin-right: 12px;
  }

  .desktop-nav .navbar .navbar-nav .nav-item:first-child a,
  .desktop-nav .navbar .navbar-nav .nav-item:last-child a {
    margin-left: 12px;
    margin-right: 12px;
  }

  .desktop-nav .navbar .others-options {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
  }
}

/* ═══════════════════════════════════════════════
   MOBILE NAVBAR  (≤ 991px)
═══════════════════════════════════════════════ */
@media only screen and (max-width: 991px) {

  .navbar-area {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    position: relative;
    z-index: 1000;
  }

  /* Hide the tall desktop header strip on mobile */
  .header-top {
    display: none;
  }

  .mobile-responsive-nav {
    display: block;
    padding: 0;
    background: #fff;
    border-bottom: 0;
    box-shadow: none;
  }

  .navbar-area.nav-bg-2,
  .navbar-area.nav-bg-2 .mobile-responsive-nav {
    background: #fff;
    border-bottom: 0;
    box-shadow: none;
  }

  .mobile-responsive-nav .container {
    position: relative;
    padding-left: 0;
    padding-right: 0;
  }

  .mobile-responsive-nav .mobile-responsive-menu {
    position: relative;
    min-height: 66px;
  }

  .mobile-responsive-nav .mobile-responsive-menu .logo {
    max-width: none;
    width: 100%;
  }

  /* ── 3-Column Grid Header Bar ──────────────────
     Col 1 (48px) : hamburger (meanmenu injects here)
     Col 2 (1fr)  : logo + college name (centered)
     Col 3 (48px) : sidebar toggle button
  ────────────────────────────────────────────── */
  .mobile-brand-bar {
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;
    min-height: 66px;
    padding: 6px 8px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(22, 61, 122, 0.10);
    border-bottom: 2px solid rgba(22, 61, 122, 0.09);
    position: relative;
  }

  /* ── Center column: brand link ── */
  .mobile-brand {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    justify-content: center;
    overflow: hidden;
    min-width: 0;
  }

  .mobile-brand img {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
  }

  .mobile-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-width: 0;
    flex: 1 1 0;
  }

  .mobile-brand-title,
  .mobile-brand-subtitle {
    margin: 0;
    line-height: 1.25;
    text-align: left;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .mobile-brand-title {
    font-size: 8px;
    font-weight: 800;
    color: #163d7a;
    text-transform: uppercase;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .mobile-brand-subtitle {
    font-size: 8px;
    font-weight: 600;
    color: #c62828;
    text-transform: uppercase;
    margin-top: 2px;
  }

  /* ── Right column: sidebar toggle ── */
  .mobile-sidebar-toggle {
    grid-column: 3;
    justify-self: center;
    align-self: center;
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
    color: #163d7a;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    /* override any accidental absolute/transform from themes */
    position: static !important;
    transform: none !important;
  }

  .mobile-sidebar-toggle:hover,
  .mobile-sidebar-toggle:focus {
    background: rgba(22, 61, 122, 0.09);
    color: #0b234f;
    outline: none;
  }

  /* ── meanmenu overrides (left column) ── */

  /* The meanmenu .mean-bar spans full width but pointer-events off
     so it sits behind the grid; the injected <a> is absolutely
     positioned and falls in the left 48px slot               */
  .mobile-responsive-nav .mobile-responsive-menu.mean-container .mean-bar {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    width: 100%;
    height: 66px;
    padding: 0;
    background: transparent;
    pointer-events: none;
  }

  /* ── meanmenu reveal button: full override of meanmenu.css defaults ── */
  .mobile-responsive-nav .mobile-responsive-menu.mean-container a.meanmenu-reveal {
    /* Position: left slot of the 3-column grid */
    left: 5px !important;
    right: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    /* Override meanmenu.css height:22px + padding:13px that clips spans */
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    /* Override text-indent:-9999em (hides any text fallback) */
    text-indent: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    /* Flexbox to stack 3 spans evenly */
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    /* Override meanmenu.css background:#0c1923 */
    background: transparent !important;
    color: #163d7a !important;
    border-radius: 8px;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.25s ease;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  .mobile-responsive-nav .mobile-responsive-menu.mean-container a.meanmenu-reveal:hover {
    background: rgba(22, 61, 122, 0.09) !important;
  }

  /* When nav is OPEN: meanmenu adds .meanclose and replaces spans with ✕ text */
  .mobile-responsive-nav .mobile-responsive-menu.mean-container a.meanmenu-reveal.meanclose {
    font-size: 22px !important;
    line-height: 1 !important;
    color: #163d7a !important;
    font-weight: 700;
    text-indent: 0 !important;
    justify-content: center !important;
    align-items: center !important;
    flex-direction: row !important;
  }

  /* Each of the 3 injected spans = one hamburger bar */
  .mobile-responsive-nav .mobile-responsive-menu.mean-container a.meanmenu-reveal span {
    display: block !important;
    width: 22px !important;
    height: 3px !important;
    /* Override meanmenu.css background:#fff (white = invisible on white bg) */
    background: #163d7a !important;
    border-radius: 999px !important;
    margin: 0 !important;       /* remove meanmenu.css margin-top:3px */
    padding: 0 !important;
    flex-shrink: 0 !important;
    position: static !important;
    text-indent: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    overflow: visible !important;
  }

  /* Kill pseudo-elements — we have 3 real spans, no need for ::before/::after */
  .mobile-responsive-nav .mobile-responsive-menu.mean-container a.meanmenu-reveal span::before,
  .mobile-responsive-nav .mobile-responsive-menu.mean-container a.meanmenu-reveal span::after {
    display: none !important;
    content: none !important;
  }

  /* Dropdown nav panel — opens below the 66px bar */
  .mobile-responsive-nav .mobile-responsive-menu.mean-container .mean-nav {
    position: absolute;
    top: 66px;
    left: 0;
    width: 100%;
    margin-top: 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    pointer-events: auto;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1001;
  }

  .mobile-responsive-nav .mobile-responsive-menu.mean-container .navbar-nav {
    max-height: calc(100vh - 80px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    padding-bottom: 20px;
  }

  /* Legacy standalone toggle button (if used on other pages) */
  .mobile-toggle-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
    color: #163d7a;
    cursor: pointer;
    transition: background 0.2s ease;
  }

  .mobile-toggle-button--left  { left: 5px; }
  .mobile-toggle-button--right { right: 5px; }

  .mobile-toggle-button:hover,
  .mobile-toggle-button:focus {
    background: rgba(22, 61, 122, 0.09);
    outline: none;
  }

  /* Hamburger icon lines (used by standalone toggle) */
  .hamburger-lines {
    position: relative;
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
  }

  .hamburger-lines::before,
  .hamburger-lines::after {
    content: "";
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
  }

  .hamburger-lines::before { top: -7px; }
  .hamburger-lines::after  { top:  7px; }

  .others-option-for-responsive {
    display: none !important;
  }

  .mobile-responsive-nav .logo-link.visually-hidden {
    display: none !important;
  }
}

/* ── Tiny phones ≤ 380px ── */
@media only screen and (max-width: 380px) {
  .mobile-brand-bar {
    grid-template-columns: 44px 1fr 44px;
    padding: 4px 4px;
    min-height: 60px;
  }

  .mobile-brand img {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    height: 34px;
  }

  .mobile-brand-title  { font-size: 10px; }
  .mobile-brand-subtitle { font-size: 7px; }

  .mobile-responsive-nav .mobile-responsive-menu.mean-container .mean-bar {
    height: 60px;
  }

  .mobile-responsive-nav .mobile-responsive-menu.mean-container .mean-nav {
    top: 60px;
  }
}
