/* ============================================================
   hamburger-nav.css  —  GESNew Enhanced Responsive Navigation
   Loads AFTER main.css; overrides all hamburger-related rules.
   Separate file: do not merge into main.css.
   ============================================================ */

/* ── Burger button (overrides main.css lines 535–570) ────────── */
.burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid rgba(27, 43, 107, .18);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.burger:hover {
  background: rgba(27, 43, 107, .07);
  border-color: rgba(27, 43, 107, .32);
}
.burger:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-color: var(--gold);
}
.burger.open {
  background: rgba(27, 43, 107, .09);
  border-color: rgba(27, 43, 107, .28);
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  pointer-events: none;
  transform-origin: center;
  transition:
    transform .34s cubic-bezier(.22, 1, .36, 1),
    opacity   .22s ease,
    width     .22s ease;
}
.burger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.burger.open span:nth-child(2) {
  opacity: 0;
  width: 0;
}
.burger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ══════════════════════════════════════════════════════════════
   Mobile drawer block — overrides main.css @media(max-width:1400px)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1400px) {

  :root { --nav-h: var(--nav-h-mob); }

  .nav-list,
  .nav-cta .btn-sm {
    display: none;
  }

  .burger {
    display: flex;
  }

  .nav-wrap {
    align-items: center;
  }

  /* ── Backdrop overlay ─────────────────────────────────────── */
  #nav-backdrop {
    display: block;             /* override old display:none so opacity can animate */
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 40, .52);
    z-index: 1200;
    -webkit-tap-highlight-color: transparent;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
  }
  #nav-backdrop.on {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  /* ── Slide-in drawer panel ────────────────────────────────── */
  #mob-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: clamp(280px, 85vw, 380px);
    height: 100dvh;
    background: var(--white);
    z-index: 1300;
    display: flex;
    flex-direction: column;
    transform: translateX(110%);
    transition: transform .34s cubic-bezier(.22, 1, .36, 1);
    box-shadow:
      -1px 0 0 rgba(27, 43, 107, .06),
      -4px 0 20px rgba(0, 0, 0, .06),
      -12px 0 60px rgba(27, 43, 107, .18);
    overflow: hidden;
    will-change: transform;
    border-radius: 16px 0 0 16px;
    padding-top: env(safe-area-inset-top, 0px);
  }
  #mob-drawer.open {
    transform: translateX(0);
  }

  /* ── Drawer header ────────────────────────────────────────── */
  .mob-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    background: var(--navy);
    flex-shrink: 0;
    gap: 12px;
  }

  .mob-drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .mob-drawer-logo {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 8px;
    object-fit: cover;
  }

  .mob-drawer-name {
    display: block;
    color: var(--white);
    font-family: var(--fh);
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
  }

  .mob-drawer-sub {
    display: block;
    color: rgba(253, 208, 23, .82);
    font-size: .65rem;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
  }

  .mob-drawer-close {
    background: rgba(255, 255, 255, .12);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    flex-shrink: 0;
    cursor: pointer;
    transition: background .2s;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-drawer-close:hover { background: rgba(255, 255, 255, .22); }
  .mob-drawer-close:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
  }

  /* ── Admission enquiry CTA ────────────────────────────────── */
  .mob-enq-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 28px);
    margin: 12px 14px 0;
    padding: 13px 18px;
    background: var(--gold);
    color: var(--navy);
    font-family: var(--fb);
    font-weight: 700;
    font-size: .9rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    min-height: 48px;
    flex-shrink: 0;
    transition: background .18s, transform .15s, box-shadow .18s;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 10px rgba(253, 208, 23, .35);
    text-decoration: none;
  }
  .mob-enq-cta:hover {
    background: #e8c016;
    box-shadow: 0 4px 16px rgba(253, 208, 23, .45);
  }
  .mob-enq-cta:active { transform: scale(.97); }
  .mob-enq-cta:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
  }

  /* ── Scrollable nav area ──────────────────────────────────── */
  .mob-nav {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 10px 10px 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(27, 43, 107, .18) transparent;
  }
  .mob-nav::-webkit-scrollbar {
    width: 4px;
  }
  .mob-nav::-webkit-scrollbar-track {
    background: transparent;
  }
  .mob-nav::-webkit-scrollbar-thumb {
    background: rgba(27, 43, 107, .22);
    border-radius: 4px;
  }

  .mob-nav-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .mob-nav-li {
    width: 100%;
  }

  /* ── Nav link / accordion button ─────────────────────────── */
  .mob-nav-a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    background: transparent;
    color: var(--navy);
    font-family: var(--fb);
    font-size: .92rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    min-height: 48px;
    text-align: left;
    letter-spacing: .01em;
    transition: background .18s;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-nav-a:hover,
  .mob-nav-a:active {
    background: rgba(27, 43, 107, .07);
  }
  .mob-nav-a:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: -2px;
    background: rgba(27, 43, 107, .05);
  }
  .mob-nav-a.mob-active {
    background: rgba(27, 43, 107, .08);
    color: var(--navy);
    font-weight: 600;
  }
  .mob-nav-a.mob-active::before {
    content: '';
    display: block;
    width: 3px;
    height: 16px;
    background: var(--gold);
    border-radius: 2px;
    margin-right: 10px;
    flex-shrink: 0;
  }

  /* ── Dropdown chevron ─────────────────────────────────────── */
  .mob-chevron {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    opacity: .5;
    transition: transform .3s cubic-bezier(.22, 1, .36, 1);
  }
  .mob-nav-li.mob-open .mob-chevron {
    transform: rotate(180deg);
    opacity: .82;
  }
  .mob-nav-li.mob-open > .mob-nav-a {
    background: rgba(27, 43, 107, .07);
    font-weight: 600;
  }

  /* ── Accordion dropdown ─────────────────────────────────── */
  /* max-height on open is set via JS (hamburger-nav.js) to exact
     scrollHeight for a perfectly smooth animation. */
  .mob-dd {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;                 /* collapsed by default; JS inline-style overrides on open */
    overflow: hidden;
    transition: max-height .32s cubic-bezier(.22, 1, .36, 1);
  }

  .mob-dd-a {
    display: flex;
    align-items: center;
    padding: 10px 14px 10px 26px;
    margin: 1px 0;
    border-radius: 8px;
    background: rgba(27, 43, 107, .03);
    color: var(--navy);
    font-size: .86rem;
    font-weight: 400;
    text-decoration: none;
    min-height: 44px;
    border-left: 3px solid rgba(253, 208, 23, .3);
    transition: background .18s, border-color .18s;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-dd-a:hover {
    background: rgba(27, 43, 107, .07);
    border-left-color: var(--gold);
  }
  .mob-dd-a:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: -2px;
  }
  .mob-dd-parent {
    font-weight: 600;
    border-left-color: var(--gold);
  }

  /* ── Drawer footer ────────────────────────────────────────── */
  .mob-drawer-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--gray-2);
    padding: 10px 14px max(10px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mob-contact-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .77rem;
    color: var(--gray-5);
    text-decoration: none;
    padding: 6px 4px;
    border-radius: 6px;
    transition: color .18s, background .18s;
    -webkit-tap-highlight-color: transparent;
  }
  .mob-contact-link:hover {
    color: var(--navy);
    background: rgba(27, 43, 107, .04);
  }
  .mob-contact-link:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
  }
}


/* ══════════════════════════════════════════════════════════════
   Device-tier responsive tuning
   ══════════════════════════════════════════════════════════════ */

/* Very small phones (≤ 375px) */
@media (max-width: 375px) {
  #mob-drawer {
    width: 92vw;
    border-radius: 12px 0 0 12px;
  }
  .mob-nav-a {
    font-size: .88rem;
    padding: 11px 12px;
    min-height: 46px;
  }
  .mob-enq-cta {
    font-size: .85rem;
    padding: 11px 14px;
    min-height: 46px;
  }
  .mob-dd-a {
    font-size: .83rem;
    padding: 9px 12px 9px 22px;
  }
  .mob-drawer-name {
    font-size: .78rem;
    max-width: 140px;
  }
}

/* Standard phones (376px – 480px): base defaults are fine */
@media (min-width: 376px) and (max-width: 480px) {
  #mob-drawer {
    width: 88vw;
  }
}

/* Tablets (481px – 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  #mob-drawer {
    width: min(400px, 78vw);
  }
  .mob-nav-a {
    font-size: .95rem;
    padding: 13px 16px;
    min-height: 50px;
  }
  .mob-dd-a {
    font-size: .88rem;
    padding: 11px 16px 11px 30px;
    min-height: 46px;
  }
  .mob-enq-cta {
    font-size: .95rem;
    padding: 14px 20px;
    min-height: 52px;
  }
  .mob-drawer-logo {
    width: 40px;
    height: 40px;
  }
  .mob-drawer-name {
    font-size: .86rem;
    max-width: 200px;
  }
  .mob-drawer-sub {
    font-size: .7rem;
  }
}

/* Large tablets / small laptops (769px – 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  #mob-drawer {
    width: min(420px, 55vw);
    border-radius: 18px 0 0 18px;
  }
  .mob-nav-a {
    font-size: .96rem;
    padding: 13px 16px;
  }
  .mob-enq-cta {
    font-size: .96rem;
  }
  .mob-drawer-name {
    max-width: 220px;
  }
}

/* Medium laptops (1025px – 1400px) */
@media (min-width: 1025px) and (max-width: 1400px) {
  #mob-drawer {
    width: min(380px, 36vw);
    border-radius: 18px 0 0 18px;
  }
  .mob-nav-a {
    font-size: .94rem;
  }
  .mob-drawer-name {
    font-size: .84rem;
    max-width: 200px;
  }
}


/* ══════════════════════════════════════════════════════════════
   Footer — Responsive fixes for mobile & tablet
   ══════════════════════════════════════════════════════════════ */

/* Phone landscape + portrait (≤ 767px):
   Brand full-width → Quick Links + Academics side by side → Contact full-width */
@media (max-width: 767px) {
  #ftr {
    padding-top: 36px;
  }
  .ftr-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px 20px;
    padding-bottom: 28px;
  }
  /* Brand spans both columns */
  .ftr-grid > .ftr-brand {
    grid-column: 1 / -1;
    text-align: center;
  }
  /* Quick Links (child 2) and Academics (child 3) sit side by side — auto-placed */
  /* Contact Us (child 4) spans both columns */
  .ftr-grid > :nth-child(4) {
    grid-column: 1 / -1;
  }

  .ftr-brand img {
    height: 52px;
    margin-bottom: 10px;
  }
  .ftr-brand p {
    font-size: .83rem;
    line-height: 1.7;
    max-width: 400px;
    margin: 0 auto;
  }
  .ftr-social {
    justify-content: center;
    margin-top: 14px;
    gap: 8px;
  }
  .ftr-social a {
    width: 38px;
    height: 38px;
  }
  .ftr-col h4 {
    font-size: .9rem;
    margin-bottom: 10px;
    padding-bottom: 7px;
  }
  .ftr-links {
    gap: 1px;
  }
  .ftr-links a {
    font-size: .81rem;
    padding: 5px 1px;
    min-height: 38px;
    display: flex;
    align-items: center;
  }
  .ftr-ci {
    font-size: .82rem;
    line-height: 1.5;
    margin-bottom: 9px;
    gap: 9px;
  }
  .ftr-ci svg {
    flex-shrink: 0;
    margin-top: 2px;
  }
  .ftr-ci span {
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .ftr-bot {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 5px;
    padding: 14px 0;
    font-size: .76rem;
  }
}

/* Very small phones (≤ 375px) */
@media (max-width: 375px) {
  #ftr {
    padding-top: 28px;
  }
  .ftr-grid {
    gap: 20px 14px;
    padding-bottom: 20px;
  }
  .ftr-brand img {
    height: 44px;
  }
  .ftr-brand p {
    font-size: .78rem;
  }
  .ftr-social a {
    width: 34px;
    height: 34px;
  }
  .ftr-col h4 {
    font-size: .82rem;
    margin-bottom: 8px;
  }
  .ftr-links a {
    font-size: .76rem;
    min-height: 34px;
  }
  .ftr-ci {
    font-size: .76rem;
  }
  .ftr-bot {
    font-size: .72rem;
  }
}

/* ── Footer bottom bar: override inline flex on inner .wrap ─── */
/* components.js injects style="display:flex;justify-content:space-between"
   on .ftr-bot .wrap — we must use !important to override inline styles    */
@media (max-width: 767px) {
  .ftr-bot .wrap {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 6px !important;
  }
}

/* ── Footer brand: ensure logo never overflows on tiny screens ─ */
.ftr-brand img {
  max-width: 100%;
  display: block;
}
@media (max-width: 480px) {
  .ftr-brand img {
    margin-left: auto;
    margin-right: auto;
  }
}
