/*
 * BarabNeo theme overrides
 * Loaded AFTER Radzen Fluent theme; remaps Radzen CSS variables to the
 * SG Geotechnika brand (#f26532 orange + Open Sans) and engineering-tool
 * density (13px body, 28px row, 32px tab) per UI-Architecture.md.
 *
 * Keep this file minimal — additional shell-specific styling belongs in
 * scoped per-component CSS or in barabneo-shell.css (introduced when shell
 * components land in PRD-20 step 4+).
 */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

:root {
    /* ── Brand palette ─────────────────────────────────────────────────── */
    /* SG runs two oranges on purpose, and this token is the UI one.
         #f26532 — every painted surface on geotechnika.cz (top strip, hero panel,
                   section headings, article boxes). Sampled from the live site.
         #e86b25 — the logo artwork alone (geotechnika.cz/images/logo.svg, and our
                   logo-sg.svg), which keeps its own hex inside the asset.
       They differ by dE 8.2, so it is a visible difference, not a rounding error —
       but it is SG's own arrangement: on their site the orange strip and the logo
       sit 25px apart. So chrome follows the site, the mark keeps its artwork color.
       Do not "unify" these two without checking the site first. */
    --bn-orange:        #f26532;
    /* The brand orange is 3.14:1 on white — enough for icons, borders and
       text-free surfaces (WCAG 1.4.11 asks 3:1), not for text (1.4.3 asks 4.5:1).
       Text, links and filled buttons with white labels use this darker shade:
       4.93:1 on white, 4.72:1 on #fafafa (Pavel, 2026-10-23, #1891). On the pale
       orange tints use --rz-on-primary-lighter instead (5.58:1). */
    --bn-orange-text:   #c4471a;
    --bn-orange-rgb:    242, 101, 50;
    --bn-orange-soft:   rgba(242, 101, 50, 0.12);
    --bn-orange-hover:  rgba(242, 101, 50, 0.9);
    --bn-terracotta:    #b86e5a;
    --bn-info:          #3987c8;

    /* ── Status colors ─────────────────────────────────────────────────── */
    --bn-ok:    #3a7a3a;
    --bn-warn:  var(--bn-orange);  /* warning IS the brand color */
    --bn-err:   #b33a3a;
    --bn-stale: #797f84;

    /* ── Density tokens ────────────────────────────────────────────────── */
    --bn-row-h:      28px;
    --bn-tree-h:     24px;
    --bn-tab-h:      32px;
    --bn-header-h:   44px;
    --bn-status-h:   22px;
    --bn-activity-w: 44px;
    /* Width the Activity Bar grows to on hover / focus to reveal entry labels.
       Overlays the sidebar — it is NOT part of the shell grid template. */
    --bn-activity-w-expanded: 160px;
    /* Hover-intent delay before the Activity Bar expands — long enough that a pointer
       crossing the strip on its way elsewhere never triggers it. Applies to hover only;
       collapsing and keyboard focus are immediate. */
    --bn-activity-hover-delay: 1s;
    --bn-sidebar-w:  280px;
    --bn-pad-card:   12px;
    --bn-gap-card:   16px;

    /* ── Typography ────────────────────────────────────────────────────── */
    --bn-fs-body:    13px;
    --bn-fs-small:   11px;
    --bn-fs-label:   12px;
    --bn-fs-h-card:  14px;
    --bn-fs-h-page:  18px;

    /* ── Radzen Fluent overrides ───────────────────────────────────────── */
    /* Radzen's primary ramp has five rungs. Only three used to be remapped, so
       -lighter and -darker still resolved to Fluent's blue (#deedf9 / #005a9f)
       and leaked it into the eight border-/outline-/on- tokens derived from them.
       Most visibly: outlined and text primary buttons paint their hover state from
       -lighter, so hovering one turned it pale blue (verified live before the fix). */
    /* Radzen paints link text and white button labels from --rz-primary, so it
       takes the text shade, not the brand surface orange (#1891). */
    --rz-primary:         var(--bn-orange-text);
    --rz-primary-light:   #f4866b;
    --rz-primary-lighter: #fdece5;
    --rz-primary-dark:    #a83a12;
    --rz-primary-darker:  #8a2f0e;
    --rz-on-primary:      #ffffff;
    /* Foreground on the pale -lighter tint: 5.58:1, matching the 5.94:1 the
       Fluent blue pair gave. White would be 1.2:1 and unreadable there. */
    --rz-on-primary-lighter: #a83a12;

    /* Status color remapping */
    --rz-success:        var(--bn-ok);
    --rz-warning:        var(--bn-warn);
    --rz-danger:         var(--bn-err);
    --rz-info:           var(--bn-info);
    /* Only the base status colours are remapped; the -lighter alert tints are
       still Fluent's teal and yellow, and their Fluent foregrounds fail on them
       (#008992 on #def6f7 3.73:1, #bf9608 on #fff8df 2.60:1). Darker
       foregrounds on the same tints: 5.49:1 and 5.70:1 (#1891). */
    --rz-on-info-lighter:    #006c73;
    --rz-on-warning-lighter: #7a5f00;

    /* Base surfaces (kept close to Fluent defaults; only fine-tuned) */
    --rz-base-50:        #fafafa;
    --rz-base-100:       #f4f4f4;
    --rz-base-200:       #e1e1e1;
    --rz-base-300:       #cfcfcf;

    /* Text */
    --rz-text-color:           #2a2e31;
    --rz-text-secondary-color: #676c71;
    /* 5.00:1 on white, 4.79:1 on #fafafa (#797f84 was 4.05 / 3.88, #1891). */
    --rz-text-tertiary-color:  #6b7075;
    --rz-text-disabled-color:  #a0a4a8;

    /* Radzen draws the button focus ring at -1px, half on the button fill, where
       the dark ring is only 2.78:1 against the text orange. Outside the button
       it sits on the page surface instead (#1892). */
    --rz-button-focus-outline-offset: 2px;

    /* Typography family override */
    --rz-text-font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Engineering-tool density: 13px body baseline */
html, body {
    font-family: var(--rz-text-font-family);
    font-size: var(--bn-fs-body);
    color: var(--rz-text-color);
}

/* Title Case primary buttons (NOT uppercase per UI-Architecture decision) */
.rz-button {
    text-transform: none;
    letter-spacing: 0;
}

/* Keyboard focus (#1892, WCAG 2.4.7 / 1.4.11). Elements Radzen does not style
   fell back to the browser ring, which on macOS takes the system accent —
   a 1px #e59700 line, 2.40:1 on white. One dark 2px ring for all of them;
   Radzen's own :focus-visible rules are more specific and keep theirs. */
:focus-visible {
    outline: var(--rz-outline-focus);
    outline-offset: 2px;
}

/* The Activity Bar, the sidebar and grid cells clip their content
   (overflow: hidden / auto), which cuts an outside ring at the edges — the
   Activity Bar cells lost it entirely. Inside those, draw the ring inset. */
.bn-activity :focus-visible,
.bn-sidebar-mode :focus-visible,
.rz-cell-data :focus-visible {
    outline-offset: -2px;
}
