/* ══════════════════════════════════════════════════════════════
   GDPS Mega Menu — Frontend Styles
   Title + Description only (no thumbnails)
   ══════════════════════════════════════════════════════════════ */

.gdps-mm {
    --ink: #242424;
    --ink-soft: #5b5b5b;
    --ink-faint: #9a9a9a;
    --line: #e3e3e3;
    --paper: #ffffff;
    --tint: #fafafa;
    --accent: #2f6aa3;
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: relative;
    z-index: 80;
    width: 100%;
    display: block;
}
.gdps-mm *, .gdps-mm *::before, .gdps-mm *::after { box-sizing: border-box; }
.gdps-mm a { color: inherit; text-decoration: none; }

/* ── Scrim ───────────────────────────────────────────── */
.gdps-mm__scrim {
    position: fixed; inset: 0;
    background: rgba(20,20,20,.18);
    z-index: 60; opacity: 0; visibility: hidden;
    transition: opacity .18s ease, visibility .18s;
    pointer-events: none;
}
.gdps-mm__scrim.active {
    opacity: 1; visibility: visible; pointer-events: auto;
}

/* ── Nav bar ─────────────────────────────────────────── */
.gdps-mm__nav {
    position: relative; z-index: 80;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 2px -1px rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.04);
}
.gdps-mm__list {
    display: flex; list-style: none; margin: 0; padding: 0; width: 100%;
}
.gdps-mm__item {
    flex: 1 1 0; position: relative;
    border-left: 1px solid var(--line);
}
.gdps-mm__item:last-child { border-right: 1px solid var(--line); }

.gdps-mm__link {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 27px 14px;
    background: none; border: none;
    font-size: 15.5px; font-weight: 400; color: var(--ink);
    cursor: pointer; text-align: center;
    font-family: inherit; transition: color .28s ease, background .15s ease;
    outline: none;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.gdps-mm__link::-moz-focus-inner { border: 0; }
.gdps-mm__link:focus,
.gdps-mm__link:focus-visible,
.gdps-mm__link:active {
    outline: none;
    background: #e5e5e5;
}
.gdps-mm__link[aria-expanded="true"] { background: #e5e5e5; }
.gdps-mm__link { overflow: hidden; }

/* Colour-reveal + text flip on hover — background rises like a curtain while the
   label rolls up and out, replaced by a duplicate label rolling in from below */
.gdps-mm__link-bg {
    position: absolute; inset: 0;
    background: #fafafa;
    transform: translateY(100%);
    transition: transform .45s cubic-bezier(.4, 0, .2, 1);
    z-index: 1;
}
.gdps-mm__item:hover .gdps-mm__link-bg,
.gdps-mm__link[aria-expanded="true"] .gdps-mm__link-bg,
.gdps-mm__link.is-active .gdps-mm__link-bg {
    transform: translateY(0);
}

.gdps-mm__link-text-wrap {
    position: relative; z-index: 2;
    display: block;
    height: 22px;
    overflow: hidden;
}
.gdps-mm__link-text {
    display: block;
    line-height: 22px;
    color: var(--ink);
    transition: transform .45s cubic-bezier(.4, 0, .2, 1), color .45s ease;
}
.gdps-mm__link-text--bottom {
    position: absolute; top: 100%; left: 0; width: 100%;
    color: var(--accent);
}
.gdps-mm__item:hover .gdps-mm__link-text,
.gdps-mm__link[aria-expanded="true"] .gdps-mm__link-text,
.gdps-mm__link.is-active .gdps-mm__link-text {
    transform: translateY(-100%);
    color: var(--accent);
}
.gdps-mm__item:hover .gdps-mm__link-text--bottom,
.gdps-mm__link[aria-expanded="true"] .gdps-mm__link-text--bottom,
.gdps-mm__link.is-active .gdps-mm__link-text--bottom {
    transform: translateY(-100%);
}

/* Active state — current page open in the mega menu list (reveal held permanently, no animation on load) */
.gdps-mm__link.is-active .gdps-mm__link-bg,
.gdps-mm__link.is-active .gdps-mm__link-text,
.gdps-mm__link.is-active .gdps-mm__link-text--bottom {
    transition: none;
}
.gdps-mm__link.is-active {
    font-weight: 600;
}

/* ── Caret ───────────────────────────────────────────── */
.gdps-mm__caret {
    position: relative; z-index: 2;
    width: 7px; height: 7px;
    border-right: 1.3px solid currentColor; border-bottom: 1.3px solid currentColor;
    opacity: .6; transform: rotate(45deg); margin-top: -4px;
    transition: transform .18s ease, color .45s ease;
}
.gdps-mm__link[aria-expanded="true"] .gdps-mm__caret {
    transform: rotate(-135deg); margin-top: 3px;
}
.gdps-mm__item:hover .gdps-mm__caret,
.gdps-mm__link[aria-expanded="true"] .gdps-mm__caret,
.gdps-mm__link.is-active .gdps-mm__caret {
    color: var(--accent); opacity: .85;
}

/* ── Mega panels ─────────────────────────────────────── */
.gdps-mm__panels-wrap {
    position: absolute; top: 100%; left: 0; right: 0;
    z-index: 70; pointer-events: none;
}
.gdps-mm__panel {
    position: absolute; top: 0; left: 0; right: 0;
    background: var(--paper);
    border: 1px solid var(--line); border-top: none;
    box-shadow: 0 24px 44px rgba(0,0,0,.10);
    padding: 34px 40px 30px;
    opacity: 0; visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.gdps-mm__panel.active {
    opacity: 1; visibility: visible;
    transform: translateY(0); pointer-events: auto;
}

/* ── Panel header ──────────────────────────────────── */
.gdps-mm__panel-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 22px; padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.gdps-mm__panel-head h3 { font-size: 15px; font-weight: 600; margin: 0; }
.gdps-mm__view-all {
    font-size: 13px; color: var(--ink-soft);
    display: inline-flex; align-items: center; gap: 5px;
}
.gdps-mm__view-all:hover { color: var(--accent); }
.gdps-mm__view-all svg { transition: transform .15s ease; }
.gdps-mm__view-all:hover svg { transform: translateX(3px); }

/* ── Card grid ───────────────────────────────────────── */
.gdps-mm__grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 26px;
}

/* ── Cards ────────────────────────────────────────────── */
.gdps-mm__card {
    display: block;
    padding: 12px 14px;
    border-radius: 4px;
    transition: background .15s ease;
}
.gdps-mm__card:hover {
    background: var(--tint);
}
.gdps-mm__card-title {
    font-size: 14.5px; font-weight: 500; color: var(--ink);
    margin-bottom: 3px; transition: color .15s ease;
}
.gdps-mm__card:hover .gdps-mm__card-title { color: var(--accent); }
.gdps-mm__card-desc {
    font-size: 12.5px; color: var(--ink-faint); line-height: 1.5;
}

/* Active state — this card is the page currently being viewed */
.gdps-mm__card.is-active {
    background: var(--tint);
    box-shadow: inset 3px 0 0 var(--accent);
}
.gdps-mm__card.is-active .gdps-mm__card-title {
    color: var(--accent);
}

/* ── Panel footer ──────────────────────────────────── */
.gdps-mm__footer {
    margin-top: 24px; padding-top: 18px;
    border-top: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12.5px; color: var(--ink-faint);
}
.gdps-mm__tag { color: var(--accent); font-weight: 500; }

/* ── Mobile toggle ───────────────────────────────────── */
.gdps-mm__mobile-row { display: none; }
.gdps-mm__hamburger {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; background: none;
    border: 1px solid var(--line); border-radius: 6px;
    cursor: pointer; flex-direction: column; gap: 5px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.gdps-mm__hamburger span {
    width: 18px; height: 1.6px; background: var(--ink); display: block;
    transition: transform .25s ease, opacity .2s ease;
    transform-origin: center;
}
/* Hamburger → X animation */
body.gdps-mm-nav-open .gdps-mm__hamburger span:nth-child(1) {
    transform: translateY(6.6px) rotate(45deg);
}
body.gdps-mm-nav-open .gdps-mm__hamburger span:nth-child(2) {
    opacity: 0;
}
body.gdps-mm-nav-open .gdps-mm__hamburger span:nth-child(3) {
    transform: translateY(-6.6px) rotate(-45deg);
}

/* ── Mobile close button (inside drawer) ───────────── */
.gdps-mm__close { display: none; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 900px)
   ══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .gdps-mm__mobile-row {
        display: flex; align-items: center; justify-content: flex-end;
        padding: 10px 16px;
    }

    /* Entire nav becomes a slide-in drawer (list + panels scroll together) */
    .gdps-mm__nav {
        position: fixed; top: 0; right: 0; bottom: 0;
        width: 88vw; max-width: 380px;
        background: var(--paper);
        border-bottom: none; box-shadow: none;
        transform: translateX(100%);
        transition: transform .3s cubic-bezier(.4,0,.2,1);
        z-index: 9999;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        display: flex; flex-direction: column;
    }
    body.gdps-mm-nav-open .gdps-mm__nav {
        transform: translateX(0);
        box-shadow: -8px 0 30px rgba(0,0,0,.12);
    }

    /* Close button inside drawer */
    .gdps-mm__close {
        display: flex; align-items: center; justify-content: flex-end;
        padding: 14px 16px;
        border-bottom: 1px solid var(--line);
        flex-shrink: 0;
    }
    .gdps-mm__close-btn {
        display: flex; align-items: center; justify-content: center;
        width: 40px; height: 40px;
        background: none; border: 1.5px solid var(--line); border-radius: 8px;
        cursor: pointer; color: #000;
        -webkit-tap-highlight-color: transparent;
    }
    .gdps-mm__close-btn:active { background: #ececec; }
    .gdps-mm__close-btn svg { width: 20px; height: 20px; }

    /* Scrim covers full viewport behind drawer */
    .gdps-mm__scrim { z-index: 9998; }
    body.gdps-mm-nav-open .gdps-mm__scrim {
        opacity: 1; visibility: visible; pointer-events: auto;
    }

    /* List resets */
    .gdps-mm__list {
        flex-direction: column;
        padding: 0; margin: 0;
        flex-shrink: 0;
    }
    .gdps-mm__item {
        flex: none;
        border-left: none;
        border-bottom: 1px solid var(--line);
    }
    .gdps-mm__item:last-child { border-right: none; }
    .gdps-mm__link {
        justify-content: space-between;
        padding: 16px 20px;
        text-align: left;
        font-size: 15px;
        min-height: 52px;
    }

    /* Caret: right-aligned chevron */
    .gdps-mm__caret { width: 8px; height: 8px; margin-top: -2px; }

    /* Panels inline below their trigger (accordion) */
    .gdps-mm__panels-wrap {
        position: static;
        pointer-events: auto;
        flex-shrink: 0;
    }
    .gdps-mm__panel {
        position: static; display: none;
        opacity: 1; visibility: visible; transform: none;
        box-shadow: none; border: none;
        border-top: 1px solid var(--line);
        background: var(--tint);
        padding: 16px 20px 20px;
    }
    .gdps-mm__panel.active { display: block; }
    .gdps-mm__panel-head { margin-bottom: 12px; padding-bottom: 10px; }
    .gdps-mm__panel-head h3 { font-size: 14px; }
    .gdps-mm__view-all { font-size: 12px; }

    /* Cards: single column, list-style */
    .gdps-mm__grid { grid-template-columns: 1fr; gap: 0; }
    .gdps-mm__card {
        padding: 12px 0;
        border-bottom: 1px solid var(--line);
        border-radius: 0;
    }
    .gdps-mm__card:last-child { border-bottom: none; }
    .gdps-mm__card:hover { background: none; }
    .gdps-mm__card-title { font-size: 14px; margin-bottom: 2px; }
    .gdps-mm__card-desc { font-size: 12px; }

    /* Footer: visible but compact */
    .gdps-mm__footer {
        margin-top: 16px; padding-top: 12px;
        font-size: 11.5px;
    }
}

/* ── Tablet tweaks (481–900px) ─────────────────────── */
@media (min-width: 481px) and (max-width: 900px) {
    .gdps-mm__nav { width: 60vw; max-width: 400px; }
    .gdps-mm__grid { grid-template-columns: 1fr 1fr; gap: 8px 16px; }
    .gdps-mm__card {
        padding: 10px 8px;
        border-bottom: none;
        border-radius: 4px;
    }
    .gdps-mm__card:last-child { border-bottom: none; }
}

@media (min-width: 901px) {
    .gdps-mm__mobile-row { display: none; }
    .gdps-mm__close { display: none; }
}