/*
 * Site menu (desktop bar + mobile drawer). Everything is scoped under .gnm-* so it cannot clash with
 * the older page stylesheets (style.css, style2.css, homeNew.css), which style plain ul/li/a/button.
 * Sizes are in px on purpose: the site changes the root font-size, which makes rem unreliable.
 * Breakpoint: 900px. Above = horizontal bar with dropdowns, below = burger + slide-in drawer.
 */

.gnm-header,
.gnm-drawer,
.gnm-overlay {
    --gnm-navy-1: #081a52;
    --gnm-navy-2: #0f2f9c;
    --gnm-blue: #1a47d6;
    --gnm-accent: #f57e2f;          /* brand orange (from the old header gradient) */
    --gnm-panel: #0f1a47;
    --gnm-text: #ffffff;
    --gnm-muted: rgba(255, 255, 255, .72);
    --gnm-line: rgba(255, 255, 255, .16);
    --gnm-hover: rgba(255, 255, 255, .13);
    /* Same font as the rest of the site (style2.css / homeNew.css set body to "Lato", loaded from Google Fonts) */
    font-family: "Lato", sans-serif;
    font-size: 15px;
    line-height: 1.35;
    letter-spacing: normal;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

/* ---- reset against the site's global element styles ----
 * :where() gives these rules ZERO specificity, so every .gnm-* / .ak-notif-* class below (and in
 * header.php) wins over them, while they still beat the browser defaults and most plain-element rules. */
:where(.gnm-header, .gnm-drawer) *, .gnm-overlay { box-sizing: border-box; }
:where(.gnm-header, .gnm-drawer) ul { list-style: none; margin: 0; padding: 0; }
:where(.gnm-header, .gnm-drawer) li { margin: 0; padding: 0; float: none; width: auto; height: auto; background: none; border: 0; list-style: none; display: block; position: static; }
:where(.gnm-header, .gnm-drawer) a { color: inherit; text-decoration: none; background: none; }
:where(.gnm-header, .gnm-drawer) button { font: inherit; color: inherit; margin: 0; background: none; border: 0; cursor: pointer; text-transform: none; letter-spacing: normal; box-shadow: none; text-shadow: none; }
:where(.gnm-header, .gnm-drawer) img { max-width: none; }
.gnm-ico { flex: 0 0 auto; display: block; }
/* The site's older CSS styles button:hover / :focus with borders and shadows; none of that belongs here */
.gnm-header button:hover, .gnm-header button:focus, .gnm-header button:active,
.gnm-drawer button:hover, .gnm-drawer button:focus, .gnm-drawer button:active { border: 0; box-shadow: none; text-shadow: none; }

.gnm-header :focus-visible, .gnm-drawer :focus-visible {
    outline: 2px solid #ffd166;
    outline-offset: 2px;
    border-radius: 8px;
}

/* ====================================================================== bar */
.gnm-header {
    position: relative;
    z-index: 40;
    color: var(--gnm-text);
    background: linear-gradient(95deg, var(--gnm-navy-1) 0%, var(--gnm-navy-2) 58%, var(--gnm-blue) 100%);
    box-shadow: 0 2px 14px rgba(0, 0, 0, .28);
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.gnm-header::after {                      /* thin brand-orange accent line under the bar */
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 3px;
    background: linear-gradient(90deg, var(--gnm-accent), rgba(245, 126, 47, 0) 70%);
    pointer-events: none;
}
.gnm-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1320px;
    min-height: 70px;
    margin: 0 auto;
    padding: 10px 20px;
}

/* ---- brand ---- */
.gnm-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; color: #fff; }
.gnm-brand img { width: 46px; height: 46px; border-radius: 12px; background: #fff; object-fit: cover; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.gnm-brand-text { font-size: 17px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- desktop navigation ---- */
.gnm-nav { margin-left: auto; }
.gnm-nav-list { display: flex; align-items: center; gap: 4px; }
.gnm-nav-list > li { position: relative; }
.gnm-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color .15s ease;
}
.gnm-link .gnm-ico { display: none; }                         /* icons are for the touch drawer */
.gnm-link:hover { background: var(--gnm-hover); color: #fff; }
.gnm-link.is-active { background: rgba(255, 255, 255, .16); font-weight: 600; box-shadow: inset 0 -3px 0 var(--gnm-accent); }
.gnm-caret { width: 16px; height: 16px; transition: transform .2s ease; }
.is-open > .gnm-sub-toggle .gnm-caret { transform: rotate(180deg); }

/* ---- dropdown panels (More, user menu) ---- */
.gnm-sub {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 60;
    min-width: 230px;
    padding: 8px;
    border-radius: 14px;
    background: var(--gnm-panel);
    border: 1px solid var(--gnm-line);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}
.gnm-sub::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; } /* hover bridge */
.gnm-sub-right { left: auto; right: 0; }
.is-open > .gnm-sub { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
@media (hover: hover) {
    .gnm-has-sub:hover > .gnm-sub, .gnm-has-sub:focus-within > .gnm-sub { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
    .gnm-has-sub:hover > .gnm-sub-toggle .gnm-caret { transform: rotate(180deg); }
}
.gnm-sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    color: #e9edff;
    font-size: 14.5px;
    font-weight: 500;
    text-align: left;
}
.gnm-sub-item .gnm-ico { width: 18px; height: 18px; opacity: .85; }
a.gnm-sub-item:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.gnm-sub-item.is-active { background: rgba(245, 126, 47, .2); }
.gnm-sub-item.is-disabled { opacity: .5; cursor: default; }
.gnm-sub-item.is-danger { color: #ffb4a8; }
.gnm-sub-item.is-danger:hover { background: rgba(255, 90, 70, .18); color: #ffd2cb; }
.gnm-soon { margin-left: auto; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; color: #3a2a00; background: #ffc107; }
.gnm-sub-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--gnm-line); margin-bottom: 6px; }
.gnm-sub-head strong { display: block; font-size: 14.5px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
.gnm-sub-head small { color: var(--gnm-muted); font-size: 12px; }
.gnm-sub-sep { height: 1px; margin: 6px 4px; background: var(--gnm-line); }

/* ---- right-hand actions ---- */
.gnm-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.gnm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease;
}
.gnm-btn:active { transform: translateY(1px); }
.gnm-btn-ghost { color: #fff; border: 1.5px solid rgba(255, 255, 255, .55); }
.gnm-btn-ghost:hover { background: var(--gnm-hover); border-color: #fff; color: #fff; }
.gnm-btn-solid { color: #fff; background: var(--gnm-accent); box-shadow: 0 4px 14px rgba(245, 126, 47, .45); }
.gnm-btn-solid:hover { background: #ff8c3f; color: #fff; }
.gnm-btn-danger { color: #ffd2cb; border: 1.5px solid rgba(255, 130, 110, .55); }
.gnm-btn-danger:hover { background: rgba(255, 90, 70, .18); color: #fff; }

.gnm-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #fff; flex: 0 0 auto; border: 2px solid rgba(255, 255, 255, .55); }
.gnm-avatar-initial { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #0a1d5c; background: #ffd9bd; }
.gnm-user { position: relative; }
.gnm-user-btn { display: inline-flex; align-items: center; gap: 9px; padding: 5px 10px 5px 6px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 14.5px; font-weight: 600; }
.gnm-user-btn:hover { background: rgba(255, 255, 255, .2); }
.gnm-user-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* notification bell (markup + behaviour live in header.php; this is only its look) */
.ak-notif-bell-btn { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 50%; background: rgba(255, 255, 255, .13); color: #fff; line-height: 1; transition: background-color .15s ease; }
.ak-notif-bell-btn:hover { background: rgba(255, 255, 255, .22); }
.ak-notif-bell-btn .gnm-ico { width: 22px; height: 22px; }

.gnm-burger { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 12px; background: rgba(255, 255, 255, .14); color: #fff; }
.gnm-burger:hover { background: rgba(255, 255, 255, .24); }
.gnm-burger .gnm-ico { width: 24px; height: 24px; }

/* ================================================================== drawer */
.gnm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10040;
    background: rgba(4, 10, 35, .62);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility 0s linear .25s;
}
.gnm-overlay.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }

.gnm-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 10050;
    width: min(88vw, 360px);
    display: flex;
    flex-direction: column;
    color: #fff;
    background: linear-gradient(180deg, #0a1d5c 0%, #0f2a86 100%);
    box-shadow: -12px 0 40px rgba(0, 0, 0, .45);
    transform: translateX(104%);
    visibility: hidden;
    transition: transform .28s cubic-bezier(.22, .8, .24, 1), visibility 0s linear .28s;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .28) transparent;
}
.gnm-drawer::-webkit-scrollbar { width: 6px; }
.gnm-drawer::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .28); border-radius: 6px; }
.gnm-drawer.is-open { transform: none; visibility: visible; transition-delay: 0s; }

.gnm-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--gnm-line); }
.gnm-drawer-head .gnm-brand img { width: 40px; height: 40px; }
.gnm-drawer-head .gnm-brand-text { font-size: 16px; }
.gnm-close { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: rgba(255, 255, 255, .12); color: #fff; }
.gnm-close:hover { background: rgba(255, 255, 255, .22); }
.gnm-close .gnm-ico { width: 22px; height: 22px; }

.gnm-drawer-user { display: flex; align-items: center; gap: 12px; margin: 14px 16px 6px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .09); border: 1px solid var(--gnm-line); }
.gnm-drawer-user .gnm-avatar { width: 48px; height: 48px; }
.gnm-drawer-user strong { display: block; font-size: 16px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }
.gnm-drawer-user small { color: var(--gnm-muted); font-size: 12.5px; }

.gnm-drawer-list { padding: 8px 10px; }
.gnm-drawer-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 52px;                      /* comfortable touch target */
    padding: 12px 14px;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    text-align: left;
}
.gnm-drawer-link .gnm-ico { width: 22px; height: 22px; opacity: .9; }
.gnm-drawer-link:hover, .gnm-drawer-link:active { background: rgba(255, 255, 255, .12); color: #fff; }
.gnm-drawer-link.is-active { background: rgba(255, 255, 255, .15); font-weight: 600; }
.gnm-drawer-link.is-active::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 4px; background: var(--gnm-accent); }
.gnm-drawer-link.is-disabled { opacity: .5; cursor: default; }
.gnm-drawer-link .gnm-caret { margin-left: auto; width: 18px; height: 18px; }
.gnm-acc.is-open > .gnm-acc-toggle .gnm-caret { transform: rotate(180deg); }
.gnm-acc-panel { display: none; margin: 2px 0 6px 22px; padding-left: 10px; border-left: 2px solid var(--gnm-line); }
.gnm-acc.is-open > .gnm-acc-panel { display: block; }
.gnm-acc-panel .gnm-drawer-link { min-height: 46px; font-size: 15px; }

/* Pinned to the bottom of the drawer, so Login / Sign up / Logout stay visible even when "More" is expanded */
.gnm-drawer-foot {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    display: grid;
    gap: 10px;
    border-top: 1px solid var(--gnm-line);
    background: #0e2878;
    box-shadow: 0 -10px 18px rgba(8, 20, 70, .55);
}
.gnm-drawer-foot .gnm-btn { width: 100%; padding: 13px 18px; font-size: 16px; }

body.gnm-lock { overflow: hidden; }

/* =============================================================== responsive */
@media (max-width: 900px) {
    .gnm-bar { min-height: 64px; padding: 8px 14px; gap: 10px; }
    .gnm-nav, .gnm-actions > .gnm-btn, .gnm-actions > .gnm-user { display: none; }   /* account lives in the drawer */
    .gnm-actions { margin-left: auto; gap: 8px; }
    .gnm-burger { display: inline-flex; }
    .gnm-brand img { width: 42px; height: 42px; }
    .gnm-brand-text { font-size: 16px; }
}
@media (max-width: 380px) {
    .gnm-brand-text { font-size: 14.5px; }
    .gnm-bar { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .gnm-header *, .gnm-drawer, .gnm-overlay { transition: none !important; animation: none !important; }
}
