/* ==========================================================================
   WPS header + menu presentation
   Loaded AFTER style.css so it only re-styles the header / overlay menu.
   Colours, fonts and branding are the existing WPS tokens from style.css.
   ========================================================================== */

:root {
    /* no-JS fallback; header-menu.js replaces this with the measured height */
    --wps-header-h: 86px;
    --wps-topbar-bg: #1d1c4a;           /* darker shade of --color-darkblue */
    --wps-header-line: var(--color-red);
}

/* --------------------------------------------------------------------------
   1. Header shell    --wps-header-h: 130px;

   -------------------------------------------------------------------------- */
.main_header {
]    background: var(--color-darkblue) !important;
    box-shadow: 0 2px 14px rgba(0, 0, 0, .18);
}
.main_header::after {
    content: "";
    display: block;
    height: 3px;
    background: var(--wps-header-line);
}

/* keep page content clear of the fixed header on every breakpoint */
/*.page-content {*/
/*    margin-top: var(--wps-header-h) !important;*/
/*}*/

/* --------------------------------------------------------------------------
   2. Campus / utility top bar
   -------------------------------------------------------------------------- */
.header_topbar {
    background: var(--wps-topbar-bg);
}
.header_topbar > .container {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.school_tabs {
    display: flex;
    gap: 0;
    padding-right: 0;
    align-items: stretch;
}
.school_tabs > .campus_tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--color-white);
    background: transparent;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, .16);
    border-radius: 0;
    box-shadow: none;
    line-height: 1.2;
    transition: background .3s ease, color .3s ease;
}
.school_tabs > .campus_tab:first-child {
    border-left: 1px solid rgba(255, 255, 255, .16);
}
.school_tabs > .campus_tab::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-green);
    flex: 0 0 auto;
    transition: background .3s ease;
}
.school_tabs > .campus_tab:hover,
.school_tabs > .campus_tab:focus-visible {
    background: rgba(255, 255, 255, .1);
    color: var(--color-yellow);
}
.school_tabs > .campus_tab:hover::before {
    background: var(--color-yellow);
}

/* Book A School Tour / Apply Now -- the live wps.edu.in pill buttons, kept to
   their existing shape, size and brand colours (green + red). */
.header_ctas {
    display: flex;
    align-items: center;
    gap: 0 1rem;
    margin-left: auto;
    padding-block: 5px;
}
.hdr_cta {
    display: inline-flex;
    align-items: center;
    padding: .7rem 1.5rem;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-white);
    line-height: 1.4;
    white-space: nowrap;
    border: 0;
    border-radius: 3rem;
    transition: filter .3s ease;
}
.hdr_cta_tour  { background: var(--color-green); }
.hdr_cta_apply { background: var(--color-red); }
.hdr_cta:hover,
.hdr_cta:focus-visible {
    filter: brightness(1.12);
    color: var(--color-white);
}

/* Admission / School / Enquiry. These used to sit in a floating vertical rail
   over the banner; they now live in the header CTA area, next to Book A School
   Tour / Apply Now. Same links, same order -- just compact header chips. */
.hdr_quick {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 14px;
    border-right: 1px solid rgba(255, 255, 255, .18);
}
.hdr_quick_link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--color-white);
    line-height: 1.3;
    white-space: nowrap;
    background: rgba(255, 255, 255, .08);
    border-radius: 3rem;
    transition: background .3s ease, color .3s ease;
}
.hdr_quick_link > img {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    object-fit: contain;
}
.hdr_quick_link:hover,
.hdr_quick_link:focus-visible {
    background: rgba(255, 255, 255, .18);
    color: var(--color-yellow);
}

/* --------------------------------------------------------------------------
   3. Main header row : logo + CTA buttons + Menu button
   -------------------------------------------------------------------------- */
.navbar {
    padding: 0 !important;
}
.navbar > .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-direction: row;
    padding-block: 10px;
}
.site_brand {
    flex: 0 0 auto;
}
.site_brand > .navbar-brand {
    width: auto;
    display: block;
    padding: 0;
    margin: 0;
}
.site_brand > .navbar-brand > img {
    width: 200px;
    max-width: 100%;
    height: auto;
}
.site_nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    width: auto;
    flex: 1 1 auto;
    padding-top: 0;
    padding-left: 0;
    align-self: stretch;        /* full row height, so dropdowns anchor to the header edge */
}
/* inline main menu (sits where the CTA buttons used to be) */
.header_nav {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
    min-width: 0;
    align-self: stretch;        /* so the dropdowns can hang off the header edge */
}
.header_nav .hdr_menu {
    display: flex;
    align-items: stretch;
    gap: 0 4px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: nowrap;
}
.header_nav .hdr_item {
    position: relative;
    list-style: none;
    display: flex;
}
.header_nav .hdr_item > a {
    display: flex;
    align-items: center;
    padding: 10px 11px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--color-white);
    line-height: 1.3;
    white-space: nowrap;
    position: relative;
    transition: color .3s ease;
}
/* dropdown caret, same shape as the reference header */
.header_nav .hdr_item.has_drop > a::before {
    content: "";
    order: 1;
    align-self: center;
    width: 0;
    height: 0;
    margin-left: 8px;
    border-top: .32em solid;
    border-right: .32em solid transparent;
    border-bottom: 0;
    border-left: .32em solid transparent;
}
.header_nav .hdr_item > a::after {
    content: "";
    position: absolute;
    left: 11px;
    right: 11px;
    bottom: calc(50% - 15px);   /* tracks the text, not the full-height link box */
    height: 2px;
    background: var(--color-red);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .3s ease;
}
.header_nav .hdr_item:hover > a,
.header_nav .hdr_item > a:focus-visible {
    color: var(--color-yellow);
}
.header_nav .hdr_item:hover > a::after,
.header_nav .hdr_item > a:focus-visible::after {
    transform: scaleX(1);
}

/* second level */
.header_nav .hdr_drop {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    padding: 8px 0;
    margin: 13px 0 0;           /* clears the row padding + the red accent line */
    list-style: none;
    background: var(--color-darkblue);
    border-top: 3px solid var(--color-red);
    box-shadow: 0 12px 26px rgba(0, 0, 0, .28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .28s ease, transform .28s ease, visibility 0s linear .28s;
    z-index: 20;
}
.header_nav .hdr_item.has_drop:hover > .hdr_drop,
.header_nav .hdr_item.has_drop:focus-within > .hdr_drop {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .28s ease, transform .28s ease, visibility 0s;
}
/* invisible bridge so the pointer can travel from the item to the dropdown */
.header_nav .hdr_drop::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -16px;
    height: 16px;
}
.header_nav .hdr_drop > li { list-style: none; }
.header_nav .hdr_drop > li > a {
    display: block;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, .9);
    line-height: 1.4;
    white-space: nowrap;
    transition: background .25s ease, color .25s ease;
}
.header_nav .hdr_drop > li > a:hover,
.header_nav .hdr_drop > li > a:focus-visible {
    background: rgba(255, 255, 255, .1);
    color: var(--color-yellow);
}
/* keep the last dropdowns inside the viewport */
.header_nav .hdr_item:nth-last-child(-n+3) .hdr_drop { left: auto; right: 0; }

/* Menu button. On desktop the inline menu above carries navigation, so this is
   hidden there and only appears once the inline menu drops out (<1200px), which
   keeps the existing tablet / mobile menu behaviour untouched. */
.menu_toggle_btn { display: none; }
@media (max-width: 1199px) {
    .menu_toggle_btn { display: inline-flex; }
}
.menu_toggle_btn {
    align-items: center;
    gap: 10px;
    padding: .6rem 1.35rem;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 3rem;
    background: transparent;
    color: var(--color-white);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1.4;
    cursor: pointer;
    transition: background .35s ease, border-color .35s ease, color .35s ease;
}
.menu_toggle_btn:hover,
.menu_toggle_btn:focus-visible {
    background: var(--color-red);
    border-color: var(--color-red);
    color: var(--color-white);
}
.menu_toggle_btn .menu_bars {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 20px;
    flex: 0 0 auto;
}
.menu_toggle_btn .menu_bars > span {
    display: block;
    height: 2px;
    width: 100%;
    background: currentColor;
    border-radius: 2px;
    transition: width .35s ease;
}
.menu_toggle_btn .menu_bars > span:nth-child(2) { width: 70%; }
.menu_toggle_btn:hover .menu_bars > span:nth-child(2) { width: 100%; }

/* --------------------------------------------------------------------------
   4. Overlay menu
   -------------------------------------------------------------------------- */
.hamb_side {
    padding-left: 0;
    padding-right: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.hamb_side .container {
    height: 100%;
}
.ham_close {
    right: 0;
    top: 0;
    border: 0;
    cursor: pointer;
}
.ham_close:hover,
.ham_close:focus-visible {
    background-color: var(--color-darkblue);
    color: var(--color-white);
}
.hambmenu_main {
    grid-template-columns: 34% 66%;
}
.hamb_panel:nth-child(1) {
    padding-top: 110px;
    padding-left: 6vw;
    padding-right: 24px;
}
.hamb_panel:nth-child(2) {
    padding-top: 120px;
    padding-left: 40px;
}
.hamb_panel ul > li > a {
    letter-spacing: .02em;
}
.hamb_panel_one .sub_toggle {
    display: none;
}
.hamb_menu_item .sub-menu {
    height: auto;
    max-height: 62vh;
}
.menu_open_lock {
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   5. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1399px) {
    .site_brand > .navbar-brand > img { width: 180px; }
    .school_tabs > .campus_tab { padding: 11px 20px; font-size: 13px; }
    .menu_toggle_btn { padding: .55rem 1.15rem; font-size: 13px; }
    .page-content { margin-top: var(--wps-header-h) !important; }
    .site_brand > .navbar-brand > img { width: 150px; }
    .site_nav { gap: 10px; }
    .header_nav .hdr_menu { gap: 0 2px; }
    .header_nav .hdr_item > a { padding: 9px 8px; font-size: 14px; }
    .header_nav .hdr_item > a::after { left: 8px; right: 8px; }
    .hdr_cta { padding: .6rem 1.2rem; font-size: 14px; }
    .hdr_quick { padding-right: 12px; gap: 5px; }
    .hdr_quick_link { padding: 6px 10px; font-size: 12px; gap: 6px; }
}

/* below this the inline menu no longer fits: the Menu button carries it */
@media (max-width: 1199px) {
    .site_nav { gap: 10px; }
    .header_nav { display: none; }
    .site_brand > .navbar-brand > img { width: 180px; }

    /* the top bar now carries campus tabs + quick links + CTAs on one row:
       trim the paddings just enough that the row never wraps at 992-1199px */
    .header_ctas { gap: 0 .6rem; }
    .school_tabs > .campus_tab { padding: 11px 14px; letter-spacing: .02em; }
    .hdr_cta { padding: .55rem 1.05rem; font-size: 13px; }
    .hdr_quick { padding-right: 10px; gap: 4px; }
    .hdr_quick_link { padding: 5px 9px; font-size: 12px; gap: 5px; }
    .hdr_quick_link > img { width: 15px; height: 15px; }
}

/* tablet + mobile : header stacks, overlay becomes a single sliding panel */
@media (max-width: 991px) {
    :root { --wps-header-h: 108px; }    /* no-JS fallback */

    /* the campus buttons and the header row stay visible on tablet/mobile
       (style.css hides .school_tabs and columnises .navbar below 768px) */
    .navbar > .container {
        flex-direction: row !important;
        align-items: center;
        justify-content: space-between;
    }
    .site_nav { display: flex !important; }
    .school_tabs { display: flex !important; }

    /* the header Menu button now serves every breakpoint, so the duplicate
       Menu button in the bottom bar is hidden; its Schools / Admissions /
       Contact quick buttons are untouched and keep working. */
    .mobile-menu-wrapper .menu-button[data-target="#nav-menu"] { display: none; }

    .header_topbar > .container {
        justify-content: center;
        gap: 0;
    }
    /* tablet / mobile keep the existing utility strip: campus tabs only */
    .header_ctas { display: none; }
    .school_tabs {
        width: 100%;
        justify-content: center;
    }
    .school_tabs > .campus_tab {
        flex: 1 1 0;
        justify-content: center;
        padding: 10px 6px;
        font-size: 12px;
        gap: 6px;
        letter-spacing: .02em;
    }
    .school_tabs > .campus_tab:first-child { border-left: 0; }
    .school_tabs > .campus_tab:last-child { border-right: 0; }

    .navbar > .container { padding-block: 8px; }
    .site_brand > .navbar-brand > img { width: 160px; }
    .site_nav { gap: 8px; }

    /* overlay menu : single column, slide-in second level */
    .hamb_side {
        padding: 0;
    }
    .hamb_side .container {
        padding-left: 0;
        padding-right: 0;
        max-width: 100%;
    }
    .ham_close {
        width: 52px;
        height: 52px;
        font-size: 24px;
        padding: 10px;
        z-index: 6;                     /* stays above the sliding sub panel */
    }
    .hambmenu_main {
        display: block;
        height: 100dvh;
        overflow: hidden;
        position: relative;
    }
    .hamb_panel:nth-child(1) {
        padding: 80px 22px 40px;
        height: 100dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: rgb(33 37 40 / 55%);   /* keeps the list legible over the photo */
    }
    .hamb_panel_one::before { display: none; }
    .hamb_panel ul > li { margin-bottom: 6px; }
    .hamb_panel ul > li > a {
        font-size: 17px;
        padding: 12px 6px;
        border-bottom: 1px solid rgba(255, 255, 255, .12);
    }
    .hamb_panel_one li.dropmenu {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }
    .hamb_panel_one li.dropmenu > a { flex: 1 1 auto; }
    .hamb_panel_one .sub_toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        flex: 0 0 auto;
        background: rgba(255, 255, 255, .1);
        border: 0;
        border-radius: 50%;
        color: var(--color-white);
        font-size: 15px;
        line-height: 1;
        cursor: pointer;
    }
    .hamb_panel_one .sub_toggle:hover { background: var(--color-red); }
    .hamb_panel .dropmenu::after { display: none; }
    .dropmenu.active { background: transparent; }

    .hamb_panel:nth-child(2) {
        position: absolute;
        inset: 0;
        padding: 78px 22px 40px;
        background: #212528;               /* opaque: the first level must not bleed through */
        transform: translateX(100%);
        transition: transform .45s cubic-bezier(.4, 0, .2, 1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 3;
        height: 100dvh;
    }
    .hambmenu_main.subpanel_open .hamb_panel:nth-child(2) {
        transform: translateX(0);
    }
    .hamb_dropmenu {
        position: static !important;
        top: auto !important;
        transform: none;
        display: none;
    }
    .hamb_dropmenu.show {
        display: block;
        transform: none;
    }
    .hamb_menu_item .sub-menu {
        height: auto;
        max-height: none;
        overflow: visible;
        top: 0;
        left: 0;
        padding-left: 0;
    }
    .hamb_menu_item ul > li > a {
        font-size: 16px;
        padding: 11px 6px;
        border-bottom: 1px solid rgba(255, 255, 255, .12);
    }
    .sub_back_btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 18px;
        padding: 9px 16px;
        background: rgba(255, 255, 255, .12);
        border: 0;
        border-radius: 3rem;
        color: var(--color-white);
        font-size: 13px;
        font-weight: 700;
        letter-spacing: .05em;
        text-transform: uppercase;
        cursor: pointer;
    }
    .sub_back_btn:hover { background: var(--color-red); }
}

@media (min-width: 992px) {
    .sub_back_btn { display: none !important; }
}

@media (max-width: 767px) {
    :root { --wps-header-h: 98px; }     /* no-JS fallback */

    .site_brand > .navbar-brand { text-align: left; }
    .site_brand > .navbar-brand > img { width: 140px; }
    .site_nav { width: auto; }
    .menu_toggle_btn {
        padding: .5rem .9rem;
        font-size: 12px;
        gap: 8px;
    }
    .school_tabs > .campus_tab {
        font-size: 11px;
        padding: 9px 4px;
    }
    .school_tabs > .campus_tab::before { width: 6px; height: 6px; }
}

@media (max-width: 360px) {
    .site_brand > .navbar-brand > img { width: 118px; }
    .menu_toggle_btn .menu_label { display: none; }
    .menu_toggle_btn { padding: .55rem .75rem; border-radius: 50%; }
    .school_tabs > .campus_tab { letter-spacing: 0; }
}
