/* =====================================================
   INRADR — Tabs — DxTabs tokens and mobile tab scrolling
   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).
   ===================================================== */

/* ---- DxTabs tokens ----
   Inactive: text-secondary, 500, a grey underline on hover only. Active: accent, 700, accent underline
   (OQ-01: accent where A overrode DX). DX draws the underline as the item's ::after from
   --dxbl-tabs-tab-bg; its 3px thickness and 2px radius already equal A. The active weight also sizes
   DX's width reservation (.dxbl-tabs-space-reservation), so selecting a tab does not shift the strip.
   Focus keeps the Fluent ring (OQ-02).
   Internal tokens, declared on .dxbl-tabs (26.1.4). Re-verify on DX upgrade. */
.dxbl-tabs {
    --dxbl-tabs-tab-default-color: var(--inradr-color-text-secondary);
    --dxbl-tabs-tab-default-hover-color: var(--inradr-color-text-secondary);
    --dxbl-tabs-tab-default-font-weight: var(--inradr-text-body-strong-weight);
    --dxbl-tabs-tab-default-hover-bg: var(--inradr-color-text-secondary);
    --dxbl-tabs-tab-active-color: var(--inradr-color-accent);
    --dxbl-tabs-tab-active-hover-color: var(--inradr-color-accent);
    --dxbl-tabs-tab-active-font-weight: var(--inradr-text-body-bold-weight);
    --dxbl-tabs-tab-active-bg: var(--inradr-color-accent);
    --dxbl-tabs-tab-active-hover-bg: var(--inradr-color-accent);
}

/* ---- Tab groups of the form layout (div.dxbl-fl-gt > dxbl-tabs.dxbl-tabs-top) ----
   Geometry is scoped to the form layout, so DX-internal tabs (e.g. the date/time tabs of a
   DateTime drop-down) keep their own layout. */
.dxbl-fl-gt > .dxbl-tabs {
    /* 4 + 2 (text padding) + 20 (line) + 2 + 4 = 32px items (A). Declared on .dxbl-tabs; re-verify on DX upgrade. */
    --dxbl-tabs-tab-padding-y: var(--inradr-space-xxs);
}

/* 32px below the whole tabs component (A: the margin sits below the tab content, not the strip). */
.dxbl-fl-gt > .dxbl-tabs.dxbl-tabs-top {
    margin-bottom: var(--inradr-space-lg);
}

/* First tab flush with the captions and fields below: no start padding, and the underline starts at
   the item edge. --dxbl-tabs-tab-border-left is declared on the tablist (inherited) and overridden on
   the item, as DX itself does for .dxbl-active:hover. The ul keeps DX's 2px padding so the scroll
   viewer (overflow:hidden) does not clip the focus ring: the tab text lands 2px right of the captions.
   The path mirrors DX's item and text rules ((0,6,2) / (0,8,2)) to win without !important.
   Re-verify on DX upgrade. */
.dxbl-fl-gt > .dxbl-tabs.dxbl-tabs-top > .dxbl-tabs-tablist > .dxbl-scroll-viewer > .dxbl-scroll-viewer-content > ul > li:first-child > .dxbl-tabs-item {
    --dxbl-tabs-tab-border-left: 0;
    padding-inline-start: 0;
}

/* Both .dxbl-text children: the label and its bold width-reservation copy. */
.dxbl-fl-gt > .dxbl-tabs.dxbl-tabs-top > .dxbl-tabs-tablist > .dxbl-scroll-viewer > .dxbl-scroll-viewer-content > ul > li:first-child > .dxbl-tabs-item > .dxbl-tabs-text-container > .dxbl-text {
    padding-inline-start: 0;
}

/* ---- Phone: native horizontal scrolling instead of the scroll buttons (A) ----
   DOM (B Detail): dxbl-tab-list.dxbl-tabs-tablist.dxbl-tabs-tablist-scrollable > button.dxbl-btn (prev/next)
   + dxbl-scroll-viewer > div.dxbl-scroll-viewer-content > ul > li > dxbl-tab-item.dxbl-tabs-item.
   DX's scroll-viewer JS leaves the overflow alone (measured at 390px, WP-26 8.8-11). */
@media (max-width: 768px) {
    /* Beats DX's `.dxbl-tabs-tablist-has-overflow>.dxbl-btn{display:inline-flex}` (0,5,0). */
    .dxbl-fl-gt > .dxbl-tabs.dxbl-tabs-top > .dxbl-tabs-tablist.dxbl-tabs-tablist-scrollable > .dxbl-btn {
        display: none;
    }

    .dxbl-fl-gt > .dxbl-tabs.dxbl-tabs-top > .dxbl-tabs-tablist > .dxbl-scroll-viewer > .dxbl-scroll-viewer-content {
        overflow-x: auto;
        overflow-y: hidden;
    }

    /* The list keeps its natural width, so the strip overflows and scrolls instead of squeezing the tabs. */
    .dxbl-fl-gt > .dxbl-tabs.dxbl-tabs-top > .dxbl-tabs-tablist > .dxbl-scroll-viewer > .dxbl-scroll-viewer-content > ul {
        width: max-content;
    }

    .dxbl-fl-gt > .dxbl-tabs.dxbl-tabs-top > .dxbl-tabs-tablist > .dxbl-scroll-viewer > .dxbl-scroll-viewer-content > ul > li {
        flex: 0 0 auto;
    }
}
