﻿/* =============================================================
   Side rail restyle — DO13071
   --------------------------------------------------------------
   Aligns the right side rail of DetailViews (DxDrawer with class
   dxext-siderail, from GiPStech.DxExtensions.Blazor) to the rest of
   the app: the panel mirrors the left navigation menu, its items
   use the menu's typography and selection, and the box above an
   opened list uses the detail-view group header band.

   Scoped under .main-content, where gipstechDetailView.css defines the
   --gipstech-dv-* tokens reused here (accent, border, radius, row and
   icon size). Load AFTER gipstechDetailView.css.

   Real DOM facts (DevExpress 26.1.x):
   - drawer:     dxbl-drawer.dxext-siderail (direct child of .main-content)
   - panel:      .dxbl-drawer-panel > .dxbl-drawer-header + .dxbl-drawer-body
   - pin button: .dxext-siderail-pin (only content of the header)
   - item:       .dxbl-accordion-item (.dxbl-active when selected)
                 > .dxbl-accordion-group-header > .dxbl-accordion-item-content
                 > img.dxbl-image + .dxbl-accordion-item-text
   - list box:   [data-dxext-siderail-content] .dxbl-group-header.dxbl-fl-caption-tmpl
   ============================================================= */

.main-content .dxext-siderail {
    /* Same values as the left menu (gipstechSidebar.css), whose tokens are
       scoped to .xaf-sidebar and therefore not inherited here. */
    --gipstech-sr-fg: var(--dxds-color-content-neutral-default-rest);
    --gipstech-sr-item-fs: 14px;
    --gipstech-sr-row-h: 28px;
    --gipstech-sr-accent-bar-w: 3px;
}

/* =============================================================
   Panel reaching the right edge of the screen
   --------------------------------------------------------------
   main-content keeps 16px of right padding: drop it while it hosts
   the side rail, so the panel touches the screen edge as the left
   menu touches the opposite one. The content of the DetailView
   keeps its own lateral padding inside the drawer.
   ============================================================= */
.main-content:has(> .dxext-siderail) {
    padding-right: 0;
}

/* Panel frame — same light border as the detail-view cards, rounded
   on the left only: the right side runs into the screen edge. */
.main-content .dxext-siderail .dxbl-drawer-panel {
    border: 1px solid var(--gipstech-dv-border);
    border-right: 0;
    border-radius: var(--gipstech-dv-radius) 0 0 var(--gipstech-dv-radius);
    overflow: hidden;
}

/* =============================================================
   Header band — holds only the pin button
   --------------------------------------------------------------
   Same height and tint as the detail-view group headers, so the
   band lines up with "Informazioni generali" or with the box of the
   opened list, and separates the command from the items below.
   ============================================================= */
.main-content .dxext-siderail .dxbl-drawer-header {
    min-height: var(--gipstech-dv-row-h);
    background: var(--gipstech-dv-accent-weak);
    color: var(--gipstech-dv-accent);
    border-bottom: 1px solid var(--gipstech-dv-border);
}

.main-content .dxext-siderail .dxext-siderail-pin {
    color: var(--gipstech-dv-accent);
}

/* Panel title next to the pin — same typography as the detail-view
   group header captions (gipstechDetailView.css), so the band reads like
   "Informazioni generali". */
.main-content .dxext-siderail .dxext-siderail-title {
    color: var(--gipstech-dv-accent);
    font-weight: 600;
    line-height: 1.3;
    text-transform: var(--gipstech-dv-caption-case);
}

/* =============================================================
   Items — typography and icon size of the left menu
   ============================================================= */
.main-content .dxext-siderail .dxbl-accordion-group-header {
    min-height: var(--gipstech-sr-row-h);
}

.main-content .dxext-siderail .dxbl-accordion-item-content > .dxbl-image {
    width: var(--gipstech-dv-icon-size);
    height: var(--gipstech-dv-icon-size);
}

.main-content .dxext-siderail .dxbl-accordion-item-text {
    font-size: var(--gipstech-sr-item-fs);
    color: var(--gipstech-sr-fg);
}

/* =============================================================
   Selected item — same highlight as the left menu
   --------------------------------------------------------------
   accent-weak background plus a 3px accent bar on the left, label
   in accent color and semibold.
   ============================================================= */
.main-content .dxext-siderail .dxbl-accordion-item.dxbl-active > .dxbl-accordion-group-header {
    position: relative;
    background-color: var(--gipstech-dv-accent-weak);
}

.main-content .dxext-siderail .dxbl-accordion-item.dxbl-active > .dxbl-accordion-group-header::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: var(--gipstech-sr-accent-bar-w);
    background: var(--gipstech-dv-accent);
    border-radius: 0 2px 2px 0;
    pointer-events: none;
}

.main-content .dxext-siderail .dxbl-accordion-item.dxbl-active > .dxbl-accordion-group-header .dxbl-accordion-item-text {
    color: var(--gipstech-dv-accent);
    font-weight: 600;
}

/* =============================================================
   Box of the opened list — group header band
   --------------------------------------------------------------
   The box gets the band of gipstechDetailView.css through the caption
   template. Its icon is the list's own, so the generic 2×2 section
   glyph is dropped and the icon takes the glyph's size.
   ============================================================= */
.main-content .dxext-siderail [data-dxext-siderail-content] .dxbl-group-header.dxbl-fl-caption-tmpl::before {
    display: none;
}

.main-content .dxext-siderail [data-dxext-siderail-content] .dxbl-group-header.dxbl-fl-caption-tmpl > .dxbl-image {
    width: var(--gipstech-dv-icon-size);
    height: var(--gipstech-dv-icon-size);
}
