/*
 * تسک ۱۴۰۵/۰۸/۰۹، بند ۲ — photoaman's own colours on every menu of the panel:
 * the sidebar, its flyout window, the quick menu under «☰» (both of its
 * columns) and the sidebar's own controls in the top bar.
 *
 * The menus were drawn in the old template's yellow, and not by one rule: the
 * stripe beside the current entry, the wash under the pointer, the filled box
 * of the page you are on, the band down the flyout's edge and the open menu's
 * marks are a dozen rules across agency-navigation.css, agency-sidebar-flyout.css,
 * agency-quick-menu.css and agency-sidebar-toggle.css — and Filament's own
 * active entry is the panel's amber primary. Every one of them reads its colour
 * from a variable (`--warning-400/500/600`, `--std-color-warning-500/600`,
 * `--primary-*`), so the menus are given photoaman's palette by redefining
 * those variables on the menus' own boxes. Inside a menu they now mean
 * photoaman's red #B84249; outside one nothing changes — a warning on a page,
 * a yellow badge in a table, the panel's buttons keep their colours.
 *
 * This is the one place the menus' colours are decided, so a management added
 * tomorrow, or a menu rule added to any of those files, takes the same red
 * without being listed here. The companion light blue #91BFE3 marks the open
 * menu and keyboard focus, where a second red would read as a second current
 * page.
 */

.fi-sidebar,
.fi-sidebar-flyout-layer,
.fi-quick-menu,
.fi-quick-menu-panel,
.fi-agency-sidebar-controls {
    --pa-menu-red: #b84249;
    --pa-menu-red-dark: #9a353c;
    --pa-menu-blue: #91bfe3;

    --warning-300: #dd979c;
    --warning-400: var(--pa-menu-red);
    --warning-500: var(--pa-menu-red);
    --warning-600: var(--pa-menu-red-dark);
    --std-color-warning-500: var(--pa-menu-red);
    --std-color-warning-600: var(--pa-menu-red-dark);

    /* Filament draws its own active entry, its group chevrons and its focus
       rings in the panel's primary, which is amber. */
    --primary-50: #fbf1f2;
    --primary-100: #f6e0e1;
    --primary-200: #ecc0c3;
    --primary-300: #dd979c;
    --primary-400: #cb6970;
    --primary-500: #b84249;
    --primary-600: #9a353c;
    --primary-700: #7f2c32;
    --primary-800: #67252a;
    --primary-900: #551f23;
    --primary-950: #2f1012;
}

/* The page you are on is a filled red box; on red, the writing and the icon
   are white rather than the near-black they were on yellow. */
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon,
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-icon,
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label:where(.dark, .dark *),
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-icon:where(.dark, .dark *),
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-icon:where(.dark, .dark *) {
    color: #ffffff;
}

.fi-sidebar .fi-sidebar-item.fi-active
    > .fi-sidebar-item-btn
    > .fi-sidebar-item-grouped-border
    > .fi-sidebar-item-grouped-border-part {
    background-color: #ffffff;
}

.fi-sidebar-flyout-layer .fi-sidebar-flyout-current,
.fi-sidebar-flyout-layer .fi-sidebar-flyout-item.fi-sidebar-flyout-current:hover,
.dark .fi-sidebar-flyout-layer .fi-sidebar-flyout-item.fi-sidebar-flyout-current:hover,
.fi-quick-menu-panel .fi-quick-menu-current,
.fi-quick-menu .fi-quick-menu-current {
    color: #ffffff;
}

.fi-sidebar-flyout-layer .fi-sidebar-flyout-current *,
.fi-quick-menu-panel .fi-quick-menu-current *,
.fi-quick-menu .fi-quick-menu-current * {
    color: inherit;
}

/* The menu that is open in the quick menu's first column: its red edge, and a
   wash of the light blue so the open menu and the page you are on (filled red)
   are never the same mark. */
.fi-quick-menu .fi-quick-menu-parent.fi-quick-menu-open,
.fi-quick-menu-panel .fi-quick-menu-parent.fi-quick-menu-open {
    background-color: color-mix(in oklab, var(--pa-menu-blue) 16%, transparent);
}

/* Keyboard focus on any menu entry: the light blue, visible on red and on the
   page's own background alike. */
.fi-sidebar :is(a, button):focus-visible,
.fi-sidebar-flyout-layer :is(a, button):focus-visible,
.fi-quick-menu :is(a, button, input):focus-visible,
.fi-quick-menu-panel :is(a, button, input):focus-visible {
    outline: 2px solid var(--pa-menu-blue);
    outline-offset: 1px;
}

/* تسک ۱۴۰۵/۰۸/۰۹/۰۳، بند ۴ — the management being stood in, in the second
   column of every opening menu (the ☰ menu's managements, the sidebar's
   window), is a solid photoaman red with white writing and icon, in the light
   and the dark page alike.

   It was not always: `.fi-quick-menu-item:hover` (two parts) outranks
   `.fi-quick-menu-current` (one), so the moment the pointer reached the
   chosen entry its fill gave way to the pointer's pale wash and the chosen
   entry looked like any hovered one. Here the chosen entry keeps its fill
   under the pointer and only darkens a step, while an entry that is merely
   pointed at keeps the light wash — the two states never look alike. */
.fi-quick-menu-panel .fi-quick-menu-items-list .fi-quick-menu-item.fi-quick-menu-current,
.fi-quick-menu .fi-quick-menu-items-list .fi-quick-menu-item.fi-quick-menu-current,
.fi-quick-menu-panel .fi-quick-menu-result.fi-quick-menu-current,
.fi-sidebar-flyout-layer .fi-sidebar-flyout-panel .fi-sidebar-flyout-item.fi-sidebar-flyout-current {
    background-color: var(--pa-menu-red);
    color: #ffffff;
    font-weight: 700;
}

.fi-quick-menu-panel .fi-quick-menu-items-list .fi-quick-menu-item.fi-quick-menu-current:hover,
.fi-quick-menu .fi-quick-menu-items-list .fi-quick-menu-item.fi-quick-menu-current:hover,
.fi-quick-menu-panel .fi-quick-menu-result.fi-quick-menu-current:hover,
.fi-sidebar-flyout-layer .fi-sidebar-flyout-panel .fi-sidebar-flyout-item.fi-sidebar-flyout-current:hover {
    background-color: var(--pa-menu-red-dark);
    color: #ffffff;
}

.fi-quick-menu-panel .fi-quick-menu-row-current > .fi-quick-menu-newtab,
.fi-quick-menu .fi-quick-menu-row-current > .fi-quick-menu-newtab,
.fi-quick-menu-panel .fi-quick-menu-item.fi-quick-menu-current :is(svg, .fi-quick-menu-row-icon, .fi-quick-menu-label),
.fi-quick-menu .fi-quick-menu-item.fi-quick-menu-current :is(svg, .fi-quick-menu-row-icon, .fi-quick-menu-label),
.fi-sidebar-flyout-layer .fi-sidebar-flyout-item.fi-sidebar-flyout-current :is(svg, .fi-sidebar-flyout-item-icon, .fi-sidebar-flyout-item-label) {
    color: #ffffff;
}
