/* =====================================================
   INRADR — Navigation — DxMenu tokens, active item, drop-down, CTA, hamburger
   inradr-feature layer (adapter): DevExpress / XAF / vendor selectors and tokens only.
   Maps inradr-design values (var(--inradr-*)) onto the framework; no new base values and
   no hex literals. Internal --dxbl-* tokens are set on the element that declares them and
   carry "re-verify on DX upgrade" (full list: inradr-feature/README.md).
   Never target a bare .dxbl-modal (it also matches the XAF skip link).
   ===================================================== */

/* Hooks set in INRADR.Blazor.Shell/Navigation/InradrNavigationItemActionControlComponent.razor:
     .inradr-nav-menu       DxMenu CssClass, on the dxbl-menu root in the header (.inradr-shell-nav)
     .inradr-nav-dropdown   DxMenu SubMenuCssClass, on every sub-menu dialog and on the hamburger panel
                            (dxbl-dropdown-dialog.dxbl-menu-dropdown, rendered at the end of <body>)
     .inradr-nav--active    li of the current root section (DxMenuDataMapping.CssClass)
     .inradr-nav--cta       li of the call-to-action entry (set by FundInvestmentSetupRequestNavigationController)
   The items are centred by DxMenu itself (ItemsPosition=Center renders flex spacers around them), so
   the adaptive collapse measures the real layout. DOM: 26.1 captures "Navigation drop-down and CTA
   (WP-10)" and "Hamburger DOM (WP-10)". */

/* ── Root menu on the navy header ─────────────────────────────────
   Colour tokens are declared on '.dxbl-menu,.dxbl-menu-dropdown', the size set on
   '.dxbl-menu.dxbl-menu-horizontal' (core.min.css 26.1.4); both sit on the dxbl-menu root, which is this
   element. (0,3,0) wins against both. The root items never fill: hover, open and pressed stay on the
   transparent rest bg (ClickUp 124ca7cqpkd, matching the inradr-app nav) - the feedback is the underline
   below and the sub-menu preview; the current section is marked only by .inradr-nav--active (A).
   An open sub-menu puts .dxbl-active on
   the root button (capture), which reads the selected-* tokens. The menu runs in DxMenu's Click mode;
   INRADR.Blazor.Shell/wwwroot/js/inradr-nav-menu.js opens the sub-menus on hover (preview) and pins them on click. The focus
   outline is white on navy (OQ-02). Re-verify on DX upgrade. */
.dxbl-menu.dxbl-menu-horizontal.inradr-nav-menu {
    --dxbl-menu-bg: transparent;
    --dxbl-menu-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-hover-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-hover-bg: transparent;
    --dxbl-menu-item-image-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-hover-image-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-dropdown-toggle-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-hover-dropdown-toggle-color: var(--inradr-color-text-on-navy);
    /* Hovering a root item opens its sub-menu as a preview (inradr-nav-menu.js), which puts .dxbl-active on
       the button: the open state must stay as unfilled as hover itself (124ca7cqpkd). Fluent's selected
       and pressed fills would show otherwise, so the tokens are overridden, not dropped. */
    --dxbl-menu-item-selected-bg: transparent;
    --dxbl-menu-item-selected-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-selected-hover-bg: transparent;
    --dxbl-menu-item-selected-hover-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-selected-focused-bg: transparent;
    --dxbl-menu-item-selected-focused-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-pressed-bg: transparent;
    --dxbl-menu-item-pressed-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-pressed-image-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-focus-outline-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-font-size: var(--inradr-text-h3-size);
    --dxbl-menu-item-line-height: var(--inradr-text-h3-line-height);
    --dxbl-menu-item-font-weight: var(--inradr-text-h3-weight);
    /* DxMenu re-measures its items only when its own root resizes, so the root fills the nav column. */
    width: 100%;
}

/* A drops the root items to 14px at 1440px and below (the 16px triplet keeps its 22px line box). */
@media (max-width: 1440px) {
    .dxbl-menu.dxbl-menu-horizontal.inradr-nav-menu {
        --dxbl-menu-item-font-size: var(--inradr-text-body-size);
    }
}

/* A shows no chevrons on the root items. */
.inradr-nav-menu .dxbl-menu-dropdown-toggle {
    display: none;
}

/* Click mode selects a parent that a keyboard click toggles (MenuDropDownService.Expand, mustSelectItem), the
   selection outlives the toggle-close, and the theme paints selected like open. Only the open state
   (.dxbl-active) may fill: a selected but closed parent shows its rest and hover fill. Pointer clicks never
   select (inradr-nav-menu.js opens through DevExpress's expand request). On a selected button the theme
   redeclares --dxbl-menu-item-bg and --dxbl-menu-item-hover-bg from the selected-* tokens (core.min.css
   26.1.4), so the two fills are read on the li first - pointing selected-* back at them on the button would
   be a cycle. The colours need nothing: selected and rest colours are the same here. Re-verify on DX upgrade. */
.inradr-nav-menu .dxbl-menu-list-item,
.dxbl-menu-dropdown.inradr-nav-dropdown .dxbl-menu-list-item {
    --inradr-nav-item-rest-bg: var(--dxbl-menu-item-bg, transparent);
    --inradr-nav-item-hover-bg: var(--dxbl-menu-item-hover-bg, transparent);
}

.inradr-nav-menu .dxbl-btn.dxbl-selected:not(.dxbl-active),
.dxbl-menu-dropdown.inradr-nav-dropdown .dxbl-btn.dxbl-selected:not(.dxbl-active) {
    --dxbl-menu-item-selected-bg: var(--inradr-nav-item-rest-bg);
    --dxbl-menu-item-selected-hover-bg: var(--inradr-nav-item-hover-bg);
}

.inradr-nav-menu .dxbl-btn.dxbl-selected:not(.dxbl-active):hover,
.dxbl-menu-dropdown.inradr-nav-dropdown .dxbl-btn.dxbl-selected:not(.dxbl-active):hover {
    --dxbl-menu-item-selected-bg: var(--inradr-nav-item-hover-bg);
}

/* ── Current section (.inradr-nav--active) ───────────────────────
   Accent text in weight 500 and no fill, also while its sub-menu is open (preview or pinned) or the item
   is focused. The tokens are set on the li: below the declaring menu root, above the reading button,
   and not redeclared in between. Re-verify on DX upgrade. */
.inradr-nav-menu .dxbl-menu-list-item.inradr-nav--active {
    --dxbl-menu-item-color: var(--inradr-color-accent);
    --dxbl-menu-item-hover-color: var(--inradr-color-accent);
    --dxbl-menu-item-selected-color: var(--inradr-color-accent);
    --dxbl-menu-item-selected-hover-color: var(--inradr-color-accent);
    --dxbl-menu-item-selected-focused-color: var(--inradr-color-accent);
    --dxbl-menu-item-pressed-color: var(--inradr-color-accent);
    --dxbl-menu-item-hover-bg: transparent;
    --dxbl-menu-item-selected-bg: transparent;
    --dxbl-menu-item-selected-hover-bg: transparent;
    --dxbl-menu-item-font-weight: var(--inradr-text-body-strong-weight);
}

/* ── Underline indicator (A) ─────────────────────────────────────
   No DX token draws an indicator, so it is a pseudo-element under the item text: grows from the
   centre, white on hover and while the item's sub-menu is open (.dxbl-active on the button), accent
   on the current section. The open/hover rule is lowered with :where() so the active rule always wins.
   bottom -12px (A) is measured from the inline text box and lands on the button's bottom edge. */
.inradr-nav-menu .dxbl-menu-item-text {
    position: relative;
}

.inradr-nav-menu .dxbl-menu-item-text::after {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    bottom: -12px;
    width: 100%;
    height: var(--inradr-tab-indicator-h);
    border-radius: var(--inradr-radius-xs);
    background: transparent;
    transform: scaleX(0);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.inradr-nav-menu .dxbl-menu-list-item:where(:hover, :has(> .dxbl-menu-item > .dxbl-btn.dxbl-active)) .dxbl-menu-item-text::after {
    background: var(--inradr-color-text-on-navy);
    transform: scaleX(1);
}

.inradr-nav-menu .dxbl-menu-list-item.inradr-nav--active .dxbl-menu-item-text::after {
    background: var(--inradr-color-accent);
    transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
    .inradr-nav-menu .dxbl-menu-item-text::after {
        transition: none;
    }
}

/* ── Hamburger button (OQ-06) ────────────────────────────────────
   Below the width the items need, DxMenu switches to its navbar: a dxbl-btn-text-secondary button
   (capture), not a menu item, so the menu-item colours do not reach it. Its text-button tokens are
   declared on .dxbl-btn, i.e. on this button itself; the icon paints with currentcolor. Like the root
   items it never fills (124ca7cqpkd): hover and open stay transparent - Fluent's text-secondary fills
   would show if the tokens were dropped. Its focus ring already follows
   --dxbl-menu-item-focus-outline-color (white, above). Re-verify on DX upgrade. */
.inradr-nav-menu .dxbl-menu-nav-bar > .dxbl-menu-hamburger-btn {
    --dxbl-btn-text-color: var(--inradr-color-text-on-navy);
    --dxbl-btn-text-secondary-hover-color: var(--inradr-color-text-on-navy);
    --dxbl-btn-text-secondary-hover-bg: transparent;
    --dxbl-btn-text-secondary-active-color: var(--inradr-color-text-on-navy);
    --dxbl-btn-text-secondary-active-bg: transparent;
    cursor: pointer; /* DX sets the pointer only on menu items */
}

/* ── Sub-menus and the hamburger panel (.inradr-nav-dropdown) ────
   Scoped by SubMenuCssClass, so combo boxes, toolbars and context menus keep their own drop-downs.
   The menu tokens are declared on .dxbl-menu-dropdown, the dialog that carries the class (0,2,0 wins).
   White surface without border and with Fluent's 4px radius (both defaults), A's #1F2324 text in every
   state, Fluent's #f4f4f3 hover, 8px list padding, 30px items (20px line + 2 x 2px item border +
   2 x 3px padding), 16px icons with an 8px gap. --dxbl-dropdown-box-shadow is declared on the
   dxbl-itemlist-dropdown wrapper and read by its dialog, so setting it on the dialog wins
   (--dxbl-menu-dropdown-box-shadow has no reader in 26.1.4). No z-index: DevExpress stacks its
   popup cells itself. Re-verify on DX upgrade. */
.dxbl-menu-dropdown.inradr-nav-dropdown {
    --dxbl-menu-bg: var(--inradr-color-surface);
    --dxbl-menu-item-color: var(--inradr-color-text-primary);
    --dxbl-menu-item-hover-color: var(--inradr-color-text-primary);
    --dxbl-menu-item-selected-color: var(--inradr-color-text-primary);
    --dxbl-menu-item-selected-hover-color: var(--inradr-color-text-primary);
    --dxbl-menu-item-selected-focused-color: var(--inradr-color-text-primary);
    --dxbl-menu-item-pressed-color: var(--inradr-color-text-primary);
    --dxbl-menu-dropdown-padding-y: var(--inradr-space-xs);
    --dxbl-menu-item-padding-y: var(--dxds-spacing-30);
    --dxbl-menu-item-image-spacing: var(--inradr-space-xs);
    /* Icon-less items reserve the 16px icon box instead of Fluent's 20px, so all texts line up. */
    --dxbl-menu-item-empty-space: var(--dxds-spacing-160);
    --dxbl-dropdown-box-shadow: var(--inradr-elevation-menu-shadow);
}

/* The item icons are <img> data URLs (IconUrl); Fluent sizes only svg icons, an img keeps its
   intrinsic size. */
.dxbl-menu-dropdown.inradr-nav-dropdown img.dxbl-image {
    width: var(--dxds-spacing-160);
    height: var(--dxds-spacing-160);
}

/* ── Call-to-action entry (.inradr-nav--cta) ─────────────────────
   Accent button in the sub-menu, white text wrapping at 180px, 42px high, 10px above (A). The class is
   on the li, as for .inradr-nav--active (capture); the tokens reach the button through the li. The
   4px radius is Fluent's sub-menu item radius. Keyboard focus keeps Fluent's dark inset ring (OQ-02).
   Re-verify on DX upgrade. */
.dxbl-menu-dropdown.inradr-nav-dropdown .inradr-nav--cta {
    --dxbl-menu-item-bg: var(--inradr-color-accent);
    --dxbl-menu-item-hover-bg: var(--inradr-color-accent-hover);
    --dxbl-menu-item-pressed-bg: var(--inradr-color-accent-hover);
    --dxbl-menu-item-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-hover-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-pressed-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-image-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-hover-image-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-pressed-image-color: var(--inradr-color-text-on-navy);
    --dxbl-menu-item-line-height: 1.15;
    /* The plus glyph below stands in for an icon: the text keeps only the 8px gap. */
    --dxbl-menu-item-empty-space: 0px;
    margin-top: 10px;
}

/* On the button, not the li: the li's height does not stretch the button (height:100% of an auto height). */
.dxbl-menu-dropdown.inradr-nav-dropdown .inradr-nav--cta > .dxbl-menu-item > .dxbl-btn {
    min-height: 42px;
}

.dxbl-menu-dropdown.inradr-nav-dropdown .inradr-nav--cta .dxbl-menu-item-text-container {
    max-width: 180px;
}

/* Fluent sets nowrap on the text span itself at (0,6,0); (0,7,0) lets the CTA wrap. */
.dxbl-menu-dropdown.inradr-nav-dropdown .dxbl-dropdown-body .dxbl-menu-item-list > .dxbl-menu-list-item.inradr-nav--cta .dxbl-menu-item-text {
    white-space: normal;
}

/* White plus from the vendored Lucide font (lucide-static 0.542.0, glyph "plus"; re-verify on a Lucide
   upgrade). It paints in the button colour and switches itself off once the item gets an IconUrl. The
   button's aria-label names the entry, so the glyph is not announced. */
.dxbl-menu-dropdown.inradr-nav-dropdown .inradr-nav--cta > .dxbl-menu-item > .dxbl-btn:not(:has(> .dxbl-image))::before {
    content: "\e141";
    flex: 0 0 auto;
    width: var(--dxds-spacing-160);
    font-family: "lucide";
    font-size: var(--dxds-spacing-160);
    font-style: normal;
    line-height: 1;
    text-align: center;
}

/* Only a list with icons reserves the placeholder margin that separates the glyph from the text.
   ANNAHME (WP-00): the CTA's list always has icons (captured for "Fonds & Vehikel"); this covers the
   other case. */
.dxbl-menu-dropdown.inradr-nav-dropdown .dxbl-menu-item-list:not(.dxbl-menu-item-list-with-icons) > .inradr-nav--cta > .dxbl-menu-item > .dxbl-btn:not(:has(> .dxbl-image))::before {
    margin-inline-end: var(--dxbl-menu-item-image-spacing);
}
