/* =========================================================
   AIESEC GLOBAL HEADER v2.0 — aiesec.hr
   Colors: #037EF3 blue | #1C244B navy | #FFFFFF white
   NO GREEN anywhere
   ========================================================= */

/* --- Kill all duplicate/old headers --- */
#site-header,
.elementor-location-header,
.site-header,
.hfe-header,
body > header:not(#aiesec-global-header) {
    display: none !important;
}

/* --- Root tokens --- */
:root {
    --ah-blue:   #037EF3;
    --ah-navy:   #1C244B;
    --ah-white:  #FFFFFF;
    --ah-height: 72px;
}

/* --- Header wrapper --- */
#aiesec-global-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--ah-height);
    z-index: 9990;
    background: transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}
#aiesec-global-header.is-scrolled {
    background: var(--ah-white);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* Admin bar offset */
body.admin-bar #aiesec-global-header {
    top: var(--wp-admin--admin-bar--height, 32px);
}
@media screen and (max-width: 782px) {
    body.admin-bar #aiesec-global-header {
        top: 46px;
    }
}

/* Offset page content so it doesn't hide under fixed header */
body {
    padding-top: var(--ah-height) !important;
    margin-top: 0 !important;
}
/* But hero sections that should overlap the header — undo padding */
body.has-hero {
    padding-top: 0 !important;
}
body.has-hero #aiesec-global-header {
    background: transparent;
}

/* --- Inner container --- */
.aiesec-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

/* --- Logo --- */
.aiesec-header .aiesec-logo img {
    height: 44px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* --- Desktop nav --- */
.aiesec-desktop-nav {
    display: flex;
    align-items: center;
}
.aiesec-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 36px;
}
.aiesec-nav-list > li {
    position: relative;
}
.aiesec-nav-list > li > a {
    text-decoration: none;
    color: var(--ah-navy);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.2s;
    white-space: nowrap;
}
#aiesec-global-header.is-scrolled .aiesec-nav-list > li > a {
    color: var(--ah-navy);
}
/* White nav text when header is transparent over a dark hero */
#aiesec-global-header:not(.is-scrolled) .aiesec-nav-list > li > a {
    color: var(--ah-white);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.aiesec-nav-list > li > a:hover,
.aiesec-nav-list > li > a:focus {
    color: var(--ah-blue) !important;
    text-shadow: none;
}

/* Submenu */
.aiesec-nav-list .sub-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    list-style: none;
    margin: 0;
    padding: 12px 0;
    min-width: 200px;
    background: var(--ah-white);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: all 0.25s ease;
    z-index: 100;
}
.aiesec-nav-list > li:hover > .sub-menu,
.aiesec-nav-list > li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.aiesec-nav-list .sub-menu a {
    display: block;
    padding: 9px 20px;
    color: var(--ah-navy);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.15s, color 0.15s;
}
.aiesec-nav-list .sub-menu a:hover {
    background: #EAF5FF;
    color: var(--ah-blue);
}

/* --- Hamburger button --- */
.aiesec-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    -webkit-tap-highlight-color: transparent;
}
.aiesec-burger-bar {
    display: block;
    width: 26px;
    height: 2.5px;
    background: var(--ah-white);
    border-radius: 2px;
    transition: background 0.2s;
}
#aiesec-global-header.is-scrolled .aiesec-burger-bar {
    background: var(--ah-navy);
}

/* =========================================================
   MOBILE FULL-SCREEN OVERLAY
   ========================================================= */
#aiesec-mobile-overlay {
    position: fixed;
    inset: 0;
    background: var(--ah-blue);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.77,0,0.175,1);
    font-family: 'Montserrat', sans-serif;
    overflow-y: auto;
}
/* hidden attr used for accessibility — remove display:none when visible */
#aiesec-mobile-overlay[hidden] {
    display: flex; /* keep flex, JS controls visibility via is-open */
}
#aiesec-mobile-overlay.is-open {
    opacity: 1;
    transform: translateY(0);
}

body.admin-bar #aiesec-mobile-overlay {
    top: var(--wp-admin--admin-bar--height, 32px);
}
@media screen and (max-width: 782px) {
    body.admin-bar #aiesec-mobile-overlay {
        top: 46px;
    }
}

/* Overlay top bar */
.aiesec-overlay-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 72px;
    flex-shrink: 0;
}
.aiesec-overlay-top .aiesec-logo img {
    height: 44px;
    width: auto;
}
.aiesec-overlay-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

/* Overlay nav */
.aiesec-overlay-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 24px 48px;
}
.aiesec-overlay-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.aiesec-overlay-list > li {
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.aiesec-overlay-list > li:last-child {
    border-bottom: none;
}
.aiesec-overlay-list > li > a {
    display: block;
    padding: 20px 0;
    color: var(--ah-white);
    font-size: clamp(20px, 5vw, 26px);
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    transition: opacity 0.2s;
}
.aiesec-overlay-list > li > a:hover,
.aiesec-overlay-list > li > a:focus {
    opacity: 0.75;
}

/* Sub-menu in overlay */
.aiesec-overlay-list .sub-menu {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: transparent;
    position: static;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
}
.aiesec-overlay-list .sub-menu a {
    display: block;
    padding: 10px 0;
    color: rgba(255,255,255,0.8);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.2s;
}
.aiesec-overlay-list .sub-menu a:hover {
    color: var(--ah-white);
}

/* =========================================================
   BREAKPOINTS
   ========================================================= */
@media (max-width: 1024px) {
    .aiesec-desktop-nav { display: none; }
    .aiesec-burger      { display: flex; }
}
@media (min-width: 1025px) {
    #aiesec-mobile-overlay { display: none !important; }
}
