/* ==========================================================
   Mobile drill-down menu  (screens below 992px, Bootstrap "lg")
   Pairs with mobile-menu.js
   The drawer (.pm-drawer) lives in <body>, so a sticky/transformed
   navbar cannot break its position:fixed.
   ========================================================== */

/* ---- Theme tokens (override these to match your brand) ---- */
.navbar,
.pm-drawer,
.pm-quick {
    --pm-bg: #ffffff;
    --pm-fg: var(--prink-blue, #130453);
    --pm-muted: #5f5a7a;
    --pm-line: rgba(19, 4, 83, 0.10);
    --pm-hover: rgba(19, 4, 83, 0.05);
    --pm-accent: var(--prink-primary, #F26637);
    --pm-accent-tint: rgba(242, 102, 55, 0.12);
    --pm-cta-bg: var(--prink-blue, #130453);
    --pm-cta-fg: #ffffff;
    --pm-speed: 0.3s;
}

/* Adjust the selector to whatever class your dark-mode toggle puts on <body> / <html> */
.dark-mode .navbar, .dark-mode .pm-drawer, .dark-mode .pm-quick,
body.dark .navbar, body.dark .pm-drawer, body.dark .pm-quick,
[data-bs-theme="dark"] .navbar, [data-bs-theme="dark"] .pm-drawer, [data-bs-theme="dark"] .pm-quick,
[data-theme="dark"] .navbar, [data-theme="dark"] .pm-drawer, [data-theme="dark"] .pm-quick {
    --pm-bg: #0b0720;
    --pm-fg: #f3f1fa;
    --pm-muted: #a9a4c4;
    --pm-line: rgba(255, 255, 255, 0.11);
    --pm-hover: rgba(255, 255, 255, 0.07);
    --pm-accent-tint: rgba(242, 102, 55, 0.18);
    --pm-cta-bg: var(--prink-primary, #F26637);
    --pm-cta-fg: var(--prink-blue, #130453);
}

/* Hidden on desktop */
.pm-drawer {
    display: none;
}

.navbar .navbar-toggler .toggler-close {
    display: none;
}

html.pm-lock,
html.pm-lock body {
    overflow: hidden;
}

/* ---- Footer: CTA + social ---- */
.pm-foot {
    flex: none;
    padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--pm-line);
    background: var(--pm-bg);
}

.pm-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    border-radius: 12px;
    background: var(--pm-cta-bg);
    color: var(--pm-cta-fg);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
}

.pm-cta:hover,
.pm-cta:focus-visible {
    color: var(--pm-cta-fg);
    filter: brightness(1.15);
}

.pm-social {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.pm-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--pm-line);
    border-radius: 50%;
    color: var(--pm-fg);
    font-size: 1rem;
    text-decoration: none;
    transition: background var(--pm-speed) ease, color var(--pm-speed) ease, border-color var(--pm-speed) ease;
}

.pm-social a:hover,
.pm-social a:focus-visible {
    border-color: var(--pm-accent);
    background: var(--pm-accent-tint);
    color: var(--pm-accent);
}

@keyframes pm-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

@media (max-width: 991.98px) {

    /* Desktop list + the old collapse are replaced by .pm-drawer */
    .navbar .navbar-nav {
        display: none !important;
    }

    .navbar #navbarSupportedContent.navbar-collapse {
        display: none !important;
    }

    /* ---- Toggle button ---- */
    .navbar .navbar-toggler {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin-left: auto;
        padding: 0;
        border: 0;
        background: transparent;
        color: inherit;
        font-size: 1.25rem;
        line-height: 1;
        cursor: pointer;
    }

    .navbar .navbar-toggler:focus-visible,
    .pm-back:focus-visible,
    .pm-link:focus-visible,
    .pm-cta:focus-visible,
    .pm-social a:focus-visible {
        outline: 2px solid var(--pm-accent);
        outline-offset: -2px;
    }

    .navbar.pm-open .navbar-toggler .toggler-open {
        display: none;
    }

    .navbar.pm-open .navbar-toggler .toggler-close {
        display: inline-block;
    }

    /* ---- Drawer: full screen, starts right under the navbar ---- */
    .pm-drawer {
        position: fixed;
        top: var(--pm-top, 72px);
        right: 0;
        bottom: 0;
        left: 0;
        display: flex;
        flex-direction: column;
        background: var(--pm-bg);
        color: var(--pm-fg);
        visibility: hidden;
        opacity: 0;
        transform: translateY(-8px);
        pointer-events: none;
        transition: opacity var(--pm-speed) ease,
                    transform var(--pm-speed) ease,
                    visibility 0s linear var(--pm-speed);
        z-index: 1040;
    }

    .pm-drawer.is-open {
        visibility: visible;
        opacity: 1;
        transform: none;
        pointer-events: auto;
        transition-delay: 0s;
    }

    .pm-stage {
        position: relative;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    /* ---- Panels ---- */
    .pm-panel {
        position: absolute;
        inset: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-bottom: 16px;
        background: var(--pm-bg);
        transform: translateX(100%);
        visibility: hidden;
        transition: transform var(--pm-speed) ease,
                    visibility 0s linear var(--pm-speed);
    }

    .pm-panel.is-behind {
        transform: translateX(-24%);
    }

    .pm-panel.is-active {
        transform: none;
        transition-delay: 0s;
    }

    /* the active panel is only visible while the menu is open */
    .pm-drawer.is-open .pm-panel.is-active {
        visibility: visible;
    }

    /* when the menu closes, hide the panel after the fade (not instantly) */
    .pm-drawer:not(.is-open) .pm-panel.is-active {
        transition-delay: 0s, var(--pm-speed);
    }

    .pm-head {
        padding: 8px 12px 0;
    }

    .pm-back {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 44px;
        padding: 0 12px;
        border: 0;
        border-radius: 999px;
        background: none;
        color: var(--pm-muted);
        font: inherit;
        font-size: 0.9375rem;
        cursor: pointer;
    }

    .pm-back:active {
        background: var(--pm-hover);
    }

    .pm-title {
        margin: 6px 24px 8px;
        font-size: 1.875rem;
        font-weight: 700;
        letter-spacing: -0.02em;
        line-height: 1.15;
        color: var(--pm-fg);
    }

    .pm-desc {
        max-width: 60ch;
        margin: 0 24px 12px;
        color: var(--pm-muted);
        font-size: 0.9375rem;
        line-height: 1.55;
    }

    .pm-list {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .pm-panel--root .pm-list {
        padding-top: 4px;
    }

    /* ---- Rows ---- */
    .pm-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        min-height: 58px;
        padding: 14px 24px;
        border: 0;
        border-bottom: 1px solid var(--pm-line);
        background: transparent;
        color: var(--pm-fg);
        font: inherit;
        font-size: 1.0625rem;
        font-weight: 500;
        line-height: 1.3;
        text-align: left;
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .pm-panel--root .pm-link {
        min-height: 68px;
        font-size: 1.375rem;
        font-weight: 600;
        letter-spacing: -0.015em;
    }

    .pm-link:hover,
    .pm-link:focus-visible,
    .pm-link:active {
        background: var(--pm-hover);
        color: var(--pm-fg);
    }

    /* chevron sits in a small circle */
    .pm-link i {
        display: inline-flex;
        flex: none;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--pm-hover);
        font-size: 0.8rem;
        color: var(--pm-muted);
    }

    /* "Explore all ..." row: tinted card */
    .pm-link--overview,
    .pm-link--overview:hover,
    .pm-link--overview:focus-visible,
    .pm-link--overview:active {
        width: calc(100% - 32px);
        min-height: 54px;
        margin: 12px 16px 8px;
        padding: 12px 16px;
        border: 0;
        border-radius: 12px;
        background: var(--pm-accent-tint);
        color: var(--pm-fg);
        font-weight: 600;
    }

    .pm-link--overview i {
        width: auto;
        height: auto;
        background: none;
        color: var(--pm-accent);
    }

    /* ---- Current page / section indicator (single links) ---- */
    .pm-link.is-ancestor {
        box-shadow: inset 3px 0 0 var(--pm-accent);
    }

    .pm-link.is-current:not(.pm-link--overview),
    .pm-link.is-current:not(.pm-link--overview):hover {
        background: var(--pm-accent-tint);
        box-shadow: inset 4px 0 0 var(--pm-accent);
        font-weight: 700;
    }

    .pm-link:not(.pm-link--overview).is-ancestor i,
    .pm-link:not(.pm-link--overview).is-current i {
        background: var(--pm-accent-tint);
        color: var(--pm-accent);
    }

    /* small dot on the page you are on */
    a.pm-link.is-current:not(.pm-link--overview)::after {
        content: "";
        flex: none;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--pm-accent);
    }

    .pm-link--overview.is-current {
        box-shadow: inset 0 0 0 1.5px var(--pm-accent);
    }

    /* ---- One orchestrated moment: first level rises in when the menu opens ---- */
    .pm-drawer.is-open .pm-panel--root .pm-list > li,
    .pm-drawer.is-open .pm-foot {
        animation: pm-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    }

    .pm-drawer.is-open .pm-panel--root .pm-list > li:nth-child(1) { animation-delay: 0.04s; }
    .pm-drawer.is-open .pm-panel--root .pm-list > li:nth-child(2) { animation-delay: 0.08s; }
    .pm-drawer.is-open .pm-panel--root .pm-list > li:nth-child(3) { animation-delay: 0.12s; }
    .pm-drawer.is-open .pm-panel--root .pm-list > li:nth-child(4) { animation-delay: 0.16s; }
    .pm-drawer.is-open .pm-panel--root .pm-list > li:nth-child(5) { animation-delay: 0.20s; }
    .pm-drawer.is-open .pm-foot { animation-delay: 0.26s; }
}

@media (prefers-reduced-motion: reduce) {
    .pm-drawer,
    .pm-panel,
    .pm-quick,
    .pm-quick-backdrop,
    .pm-qbar,
    .pm-q,
    .pm-q-end,
    .pm-social a {
        transition: none !important;
    }

    .pm-drawer.is-open .pm-panel--root .pm-list > li,
    .pm-drawer.is-open .pm-foot {
        animation: none !important;
    }
}

/* ==========================================================
   Desktop safeguard
   The desktop mega menu builds its 2nd/3rd columns with JS
   (.generated-level). If a mobile-only rule such as
   ".mega-menu-content > .generated-level { display:none }"
   ever ends up outside its @media block, it would hide them.
   This rule is more specific, so desktop always wins.
   ========================================================== */
@media (min-width: 992px) {
    .mega-menu-content > .mega-menu-level.generated-level {
        display: block;
        padding: 30px 20px;
    }
}


/* ==========================================================
   Quick links
   - desktop (>=992px): hamburger in the navbar + right side panel
   - mobile: same list sits inside the first menu level
   ========================================================== */

/* ---- shared items (panel + mobile block) ---- */
.pm-qgroup + .pm-qgroup {
    margin-top: 28px;
}

.pm-qlabel {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    color: var(--pm-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.pm-qlabel::before {
    content: "";
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--pm-accent);
}

.pm-qlist {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pm-q {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--pm-line);
    border-radius: 14px;
    background: transparent;
    color: var(--pm-fg);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.pm-q:hover,
.pm-q:focus-visible {
    border-color: var(--pm-accent);
    background: var(--pm-hover);
    color: var(--pm-fg);
    text-decoration: none;
}

.pm-q:focus-visible {
    outline: 2px solid var(--pm-accent);
    outline-offset: 2px;
}

.pm-q-ico {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--pm-accent-tint);
    color: var(--pm-accent);
    font-size: 1rem;
}

.pm-q-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pm-q-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.pm-q-desc {
    color: var(--pm-muted);
    font-size: 0.8125rem;
    line-height: 1.4;
}

.pm-q-end {
    flex: none;
    color: var(--pm-muted);
    font-size: 0.85rem;
    transition: transform 0.25s ease, color 0.25s ease;
}

.pm-q:hover .pm-q-end,
.pm-q:focus-visible .pm-q-end {
    color: var(--pm-accent);
}

/* tool = opens another website: arrow nudges up-right */
.pm-q--tool:hover .pm-q-end {
    transform: translate(2px, -2px);
}

/* download = button-like: solid brand tile, icon nudges down */
.pm-q--download .pm-q-ico {
    background: var(--pm-cta-bg);
    color: var(--pm-cta-fg);
}

.pm-q--download:hover .pm-q-end {
    transform: translateY(2px);
}

/* inside the mobile menu */
.pm-panel .pm-qblock {
    padding: 28px 24px 12px;
}

/* ---- Desktop hamburger (right end of navbar) ---- */
.pm-quick-toggle {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    flex: none;
    width: 46px;
    height: 46px;
    margin-left: 16px;
    padding: 0 13px;
    border: 1px solid var(--pm-line);
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.pm-qbar {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--pm-fg);
    transition: width 0.25s ease;
}

.pm-qbar:nth-child(2) {
    width: 14px;
}

.pm-quick-toggle:hover,
.pm-quick-toggle[aria-expanded="true"] {
    border-color: var(--pm-accent);
    background: var(--pm-hover);
}

.pm-quick-toggle:hover .pm-qbar:nth-child(2) {
    width: 20px;
}

.pm-quick-toggle:focus-visible {
    outline: 2px solid var(--pm-accent);
    outline-offset: 2px;
}

/* ---- Desktop side panel ---- */
.pm-quick,
.pm-quick-backdrop {
    display: none;
}

@media (min-width: 992px) {

    .pm-quick-toggle {
        display: inline-flex;
    }

    .pm-quick-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(19, 4, 83, 0.45);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.3s ease, visibility 0s linear 0.3s;
        z-index: 1056;
    }

    .pm-quick-backdrop.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s;
    }

    .pm-quick {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(440px, 100vw);
        background: var(--pm-bg);
        color: var(--pm-fg);
        box-shadow: -24px 0 60px rgba(19, 4, 83, 0.18);
        transform: translateX(100%);
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
                    visibility 0s linear 0.35s;
        z-index: 1057;
    }

    .pm-quick.is-open {
        transform: none;
        visibility: visible;
        pointer-events: auto;
        transition-delay: 0s;
    }

    .pm-quick-head {
        display: flex;
        flex: none;
        align-items: center;
        justify-content: space-between;
        padding: 22px 28px 14px;
    }

    .pm-quick-title {
        margin: 0;
        color: var(--pm-fg);
        font-size: 1.375rem;
        font-weight: 700;
        letter-spacing: -0.015em;
    }

    .pm-quick-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: 50%;
        background: var(--pm-hover);
        color: var(--pm-fg);
        font-size: 1rem;
        cursor: pointer;
        transition: background 0.25s ease, color 0.25s ease;
    }

    .pm-quick-close:hover,
    .pm-quick-close:focus-visible {
        background: var(--pm-accent-tint);
        color: var(--pm-accent);
    }

    .pm-quick-close:focus-visible {
        outline: 2px solid var(--pm-accent);
        outline-offset: 2px;
    }

    .pm-quick-body {
        flex: 1 1 auto;
        min-height: 0;
        padding: 8px 28px 28px;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}

/* the mobile hamburger + drawer own small screens */
@media (max-width: 991.98px) {
    .pm-quick-toggle,
    .pm-quick,
    .pm-quick-backdrop {
        display: none !important;
    }
}