/*
AU_aPostgraduate-Portal v58
Fixed compact header/navigation for every postgraduate section.

This file is injected by postgraduate.middleware into every /postgraduate/ HTML page.
It removes the large gap between the school heading and the menu, and keeps the menu visible on:
- PG Staff Accounts
- Students
- Courses
- Registration
- Scores
- Results
- Reports
- Settings
- Public Back Office
- Student/Lecturer/Public pages
*/

:root{
    --pg-fixed-header-h: 60px;
    --pg-fixed-nav-h: 42px;
    --pg-fixed-total-h: 102px;
    --pg-fixed-z-header: 3000;
    --pg-fixed-z-nav: 2999;
}

body.pg-fixed-header-ui{
    padding-top: var(--pg-fixed-total-h) !important;
}

/* Main header groups across all PG sections */
body.pg-fixed-header-ui .rp-pgbo-header,
body.pg-fixed-header-ui .pg-public-header,
body.pg-fixed-header-ui .pgfix-header,
body.pg-fixed-header-ui .pgpub-header,
body.pg-fixed-header-ui .pg-pay-header,
body.pg-fixed-header-ui .pglect-public-header{
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: var(--pg-fixed-z-header) !important;
    height: var(--pg-fixed-header-h) !important;
    min-height: var(--pg-fixed-header-h) !important;
    max-height: var(--pg-fixed-header-h) !important;
    margin: 0 !important;
    padding: 4px 22px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    background: rgba(255,255,255,.985) !important;
    border-bottom: 3px solid #064E3B !important;
    box-shadow: 0 6px 18px rgba(15,23,42,.10) !important;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
}

/* Known title/logo layouts */
body.pg-fixed-header-ui .rp-pgbo-title,
body.pg-fixed-header-ui .pg-public-title,
body.pg-fixed-header-ui .pgfix-title,
body.pg-fixed-header-ui .pg-pay-title,
body.pg-fixed-header-ui .pglect-title{
    flex: 1 1 auto !important;
    text-align: right !important;
    line-height: 1 !important;
}

body.pg-fixed-header-ui .pgfix-brand,
body.pg-fixed-header-ui .pglect-public-brand,
body.pg-fixed-header-ui .pgpub-brand,
body.pg-fixed-header-ui .pg-pay-brand{
    flex: 1 1 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    line-height: 1 !important;
}

body.pg-fixed-header-ui .rp-pgbo-title h1,
body.pg-fixed-header-ui .pg-public-title h1,
body.pg-fixed-header-ui .pgfix-title h1,
body.pg-fixed-header-ui .pg-pay-title h1,
body.pg-fixed-header-ui .pglect-title h1,
body.pg-fixed-header-ui .pgfix-brand h1,
body.pg-fixed-header-ui .pgpub-brand h1,
body.pg-fixed-header-ui .pg-pay-brand h1,
body.pg-fixed-header-ui .pgfix-brand div h1{
    margin: 0 !important;
    padding: 0 !important;
    font-size: clamp(20px, 1.5vw, 30px) !important;
    line-height: 1 !important;
    letter-spacing: .01em !important;
}

body.pg-fixed-header-ui .rp-pgbo-title h2,
body.pg-fixed-header-ui .pg-public-title h2,
body.pg-fixed-header-ui .pgfix-title h2,
body.pg-fixed-header-ui .pg-pay-title h2,
body.pg-fixed-header-ui .pglect-title h2,
body.pg-fixed-header-ui .pgfix-brand p,
body.pg-fixed-header-ui .pgpub-brand p,
body.pg-fixed-header-ui .pg-pay-brand p,
body.pg-fixed-header-ui .pgfix-brand div p{
    margin: 2px 0 0 !important;
    padding: 0 !important;
    font-size: clamp(13px, .95vw, 18px) !important;
    line-height: 1 !important;
}

body.pg-fixed-header-ui .rp-pgbo-logo,
body.pg-fixed-header-ui .pg-public-logo,
body.pg-fixed-header-ui .pgfix-logo,
body.pg-fixed-header-ui .pg-pay-logo,
body.pg-fixed-header-ui .pgpub-brand img,
body.pg-fixed-header-ui .pgfix-brand img,
body.pg-fixed-header-ui .pg-pay-header img,
body.pg-fixed-header-ui .pgfix-header img{
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    object-fit: contain !important;
    flex: 0 0 auto !important;
}

body.pg-fixed-header-ui .pgfix-user,
body.pg-fixed-header-ui .pglect-public-user,
body.pg-fixed-header-ui .rp-pgbo-identity,
body.pg-fixed-header-ui .pg-public-user{
    transform: scale(.82) !important;
    transform-origin: right center !important;
    margin-left: 6px !important;
    flex: 0 0 auto !important;
}

/* Navigation groups */
body.pg-fixed-header-ui .rp-pgbo-topnav,
body.pg-fixed-header-ui .pg-public-nav.pg-public-nav-submenu,
body.pg-fixed-header-ui .pg-public-nav-submenu,
body.pg-fixed-header-ui .pgfix-nav,
body.pg-fixed-header-ui .pg-pay-nav,
body.pg-fixed-header-ui .pg-pay-nav-dropdown,
body.pg-fixed-header-ui .rp-pay-linked-nav{
    position: fixed !important;
    top: var(--pg-fixed-header-h) !important;
    left: 0 !important;
    right: 0 !important;
    z-index: var(--pg-fixed-z-nav) !important;
    height: var(--pg-fixed-nav-h) !important;
    min-height: var(--pg-fixed-nav-h) !important;
    max-height: var(--pg-fixed-nav-h) !important;
    margin: 0 !important;
    padding: 5px 14px !important;
    box-sizing: border-box !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    flex-wrap: nowrap !important;
    background: linear-gradient(180deg,#343638,#292B2D) !important;
    border-top: 0 !important;
    border-bottom: 3px solid #064E3B !important;
    box-shadow: 0 8px 18px rgba(15,23,42,.18) !important;
    scrollbar-width: thin;
}

body.pg-fixed-header-ui .rp-pgbo-topnav a,
body.pg-fixed-header-ui .pg-public-nav-submenu .pg-nav-direct,
body.pg-fixed-header-ui .pg-public-nav-submenu .pg-menu-summary,
body.pg-fixed-header-ui .pgfix-nav a,
body.pg-fixed-header-ui .pg-pay-nav a,
body.pg-fixed-header-ui .rp-pay-linked-nav a,
body.pg-fixed-header-ui .rp-pay-linked-nav > a{
    min-height: 30px !important;
    height: 30px !important;
    padding: 6px 10px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
    font-size: 12.5px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    text-decoration: none !important;
}

body.pg-fixed-header-ui .pg-public-nav-submenu .pg-submenu-list{
    top: calc(100% + 8px) !important;
    z-index: 3100 !important;
}

/* Remove gaps previously created between header and menu. */
body.pg-fixed-header-ui .rp-pgbo-header + .rp-pgbo-topnav,
body.pg-fixed-header-ui .pg-public-header + .pg-public-nav,
body.pg-fixed-header-ui .pgfix-header + .pgfix-nav,
body.pg-fixed-header-ui .pgfix-header + .pg-public-nav,
body.pg-fixed-header-ui .pg-pay-header + .pg-pay-nav{
    margin-top: 0 !important;
}

/* Give content a professional width after the fixed header. */
body.pg-fixed-header-ui .rp-pgbo-content-wrap,
body.pg-fixed-header-ui .pgfix-content,
body.pg-fixed-header-ui .pg-public-content,
body.pg-fixed-header-ui .pg-pay-content,
body.pg-fixed-header-ui main{
    scroll-margin-top: calc(var(--pg-fixed-total-h) + 12px) !important;
}

/* Compact mode while scrolling: keep the same fixed height but reduce visual weight. */
body.pg-fixed-header-ui.pg-fixed-header-scrolled .rp-pgbo-header,
body.pg-fixed-header-ui.pg-fixed-header-scrolled .pg-public-header,
body.pg-fixed-header-ui.pg-fixed-header-scrolled .pgfix-header,
body.pg-fixed-header-ui.pg-fixed-header-scrolled .pgpub-header,
body.pg-fixed-header-ui.pg-fixed-header-scrolled .pg-pay-header,
body.pg-fixed-header-ui.pg-fixed-header-scrolled .pglect-public-header{
    box-shadow: 0 8px 20px rgba(15,23,42,.16) !important;
}

@media (max-width: 980px){
    :root{
        --pg-fixed-header-h: 54px;
        --pg-fixed-nav-h: 39px;
        --pg-fixed-total-h: 93px;
    }
    body.pg-fixed-header-ui .rp-pgbo-header,
    body.pg-fixed-header-ui .pg-public-header,
    body.pg-fixed-header-ui .pgfix-header,
    body.pg-fixed-header-ui .pgpub-header,
    body.pg-fixed-header-ui .pg-pay-header,
    body.pg-fixed-header-ui .pglect-public-header{
        padding: 4px 12px !important;
    }
    body.pg-fixed-header-ui .rp-pgbo-title h1,
    body.pg-fixed-header-ui .pg-public-title h1,
    body.pg-fixed-header-ui .pgfix-brand h1,
    body.pg-fixed-header-ui .pgpub-brand h1{
        font-size: 18px !important;
    }
    body.pg-fixed-header-ui .rp-pgbo-title h2,
    body.pg-fixed-header-ui .pg-public-title h2,
    body.pg-fixed-header-ui .pgfix-brand p,
    body.pg-fixed-header-ui .pgpub-brand p{
        font-size: 12px !important;
    }
    body.pg-fixed-header-ui .rp-pgbo-logo,
    body.pg-fixed-header-ui .pg-public-logo,
    body.pg-fixed-header-ui .pgfix-brand img,
    body.pg-fixed-header-ui .pgpub-brand img{
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
    }
    body.pg-fixed-header-ui .rp-pgbo-topnav,
    body.pg-fixed-header-ui .pg-public-nav.pg-public-nav-submenu,
    body.pg-fixed-header-ui .pg-public-nav-submenu,
    body.pg-fixed-header-ui .pgfix-nav,
    body.pg-fixed-header-ui .pg-pay-nav,
    body.pg-fixed-header-ui .rp-pay-linked-nav{
        justify-content: flex-start !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        -webkit-overflow-scrolling: touch;
    }
}

@media print{
    body.pg-fixed-header-ui{
        padding-top: 0 !important;
    }
    body.pg-fixed-header-ui .rp-pgbo-header,
    body.pg-fixed-header-ui .pg-public-header,
    body.pg-fixed-header-ui .pgfix-header,
    body.pg-fixed-header-ui .pgpub-header,
    body.pg-fixed-header-ui .pg-pay-header,
    body.pg-fixed-header-ui .pglect-public-header,
    body.pg-fixed-header-ui .rp-pgbo-topnav,
    body.pg-fixed-header-ui .pg-public-nav.pg-public-nav-submenu,
    body.pg-fixed-header-ui .pg-public-nav-submenu,
    body.pg-fixed-header-ui .pgfix-nav,
    body.pg-fixed-header-ui .pg-pay-nav,
    body.pg-fixed-header-ui .rp-pay-linked-nav{
        position: static !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        box-shadow: none !important;
    }
}
/* ============================================================
   v59 DROPDOWN VISIBILITY FIX
   These submenu groups must open above page content:
   - Academic Records
   - Accounts & Roles
   - Reports
   ============================================================ */

body.pg-fixed-header-ui .pg-public-nav.pg-public-nav-submenu,
body.pg-fixed-header-ui .pg-public-nav-submenu,
body.pg-fixed-header-ui .pglect-public-nav,
body.pg-fixed-header-ui nav#pgLecturerSubmenuNav{
    overflow: visible !important;
    white-space: nowrap !important;
}

body.pg-fixed-header-ui .pg-public-nav-submenu .pg-menu-group{
    position: relative !important;
    overflow: visible !important;
    flex: 0 0 auto !important;
    z-index: 3200 !important;
}

body.pg-fixed-header-ui .pg-public-nav-submenu .pg-menu-group[open]{
    z-index: 3500 !important;
}

body.pg-fixed-header-ui .pg-public-nav-submenu .pg-menu-summary{
    cursor: pointer !important;
    list-style: none !important;
}

body.pg-fixed-header-ui .pg-public-nav-submenu .pg-menu-summary::-webkit-details-marker{
    display: none !important;
}

body.pg-fixed-header-ui .pg-public-nav-submenu .pg-submenu-list{
    position: absolute !important;
    top: calc(100% + 10px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    min-width: 270px !important;
    max-width: 360px !important;
    width: max-content !important;
    display: grid !important;
    gap: 6px !important;
    padding: 9px !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    border: 1px solid rgba(6,78,59,.18) !important;
    box-shadow: 0 20px 48px rgba(15,23,42,.22) !important;
    z-index: 3600 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

body.pg-fixed-header-ui .pg-public-nav-submenu .pg-submenu-list::before{
    content: "" !important;
    position: absolute !important;
    top: -8px !important;
    left: 50% !important;
    width: 16px !important;
    height: 16px !important;
    transform: translateX(-50%) rotate(45deg) !important;
    background: #ffffff !important;
    border-left: 1px solid rgba(6,78,59,.18) !important;
    border-top: 1px solid rgba(6,78,59,.18) !important;
}

body.pg-fixed-header-ui .pg-public-nav-submenu .pg-submenu-list a{
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    min-height: 42px !important;
    height: auto !important;
    padding: 10px 12px !important;
    border-radius: 13px !important;
    background: #F8FBFA !important;
    color: #053F31 !important;
    border: 1px solid transparent !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
    text-align: left !important;
    white-space: normal !important;
}

body.pg-fixed-header-ui .pg-public-nav-submenu .pg-submenu-list a i{
    color: #064E3B !important;
    font-size: 16px !important;
}

body.pg-fixed-header-ui .pg-public-nav-submenu .pg-submenu-list a:hover,
body.pg-fixed-header-ui .pg-public-nav-submenu .pg-submenu-list a.is-active{
    background: #FFF7DC !important;
    color: #000000 !important;
    border-color: #D4AF37 !important;
}

/* Remove unwanted visual gap after the header/menu zone on all PG pages. */
body.pg-fixed-header-ui .rp-pgbo-page-shell,
body.pg-fixed-header-ui .pgfix-shell,
body.pg-fixed-header-ui .pg-public-shell,
body.pg-fixed-header-ui .pg-pay-shell{
    padding-top: 0 !important;
    margin-top: 0 !important;
}

body.pg-fixed-header-ui .rp-pgbo-content-wrap,
body.pg-fixed-header-ui .pgfix-content,
body.pg-fixed-header-ui .pg-public-content,
body.pg-fixed-header-ui .pg-pay-content{
    margin-top: 0 !important;
}

/* On smaller screens, keep dropdown readable and prevent it from being clipped. */
@media (max-width: 980px){
    body.pg-fixed-header-ui .pg-public-nav.pg-public-nav-submenu,
    body.pg-fixed-header-ui .pg-public-nav-submenu,
    body.pg-fixed-header-ui .pglect-public-nav,
    body.pg-fixed-header-ui nav#pgLecturerSubmenuNav{
        overflow-x: auto !important;
        overflow-y: visible !important;
    }

    body.pg-fixed-header-ui .pg-public-nav-submenu .pg-submenu-list{
        position: fixed !important;
        top: calc(var(--pg-fixed-total-h) + 6px) !important;
        left: 12px !important;
        right: 12px !important;
        transform: none !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    body.pg-fixed-header-ui .pg-public-nav-submenu .pg-submenu-list::before{
        display: none !important;
    }
}


/* v60 CONTROL ORDER HARD HIDE
   Hide any stale Control Order Summary text/link if browser cache or old markup remains. */
a[href*="/postgraduate/lecturer-accounts/permissions/"],
[href*="/postgraduate/lecturer-accounts/permissions/"],
.pg-control-order-summary,
#control-order-summary {
    display: none !important;
}
