/*
 * App-owned corrections for upstream Egov.Fod.UIComponents 10.3.11 CSS bugs (ADR-014).
 * Each rule states the upstream defect it patches — drop the rule when the package fixes it.
 */

/*
 * Language switcher: every option shows a checkmark, not only the selected one.
 * The component marks state correctly (`li.active` + `aria-selected`), and main.css hides the
 * unselected checks with `.fod-language-switcher__menu ul svg { opacity: 0; visibility: hidden }`
 * — but the check is rendered as <mud-icon>, whose <svg> lives in the element's SHADOW ROOT, so a
 * light-DOM descendant selector can never match it. Hide the light-DOM wrapper span instead.
 */
.fod-language-switcher__menu ul .fod-language-switcher__check {
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.fod-language-switcher__menu ul .active .fod-language-switcher__check {
    opacity: 1;
    visibility: visible;
    color: var(--blue-sky-600);
}

/*
 * RT-LIFE-7: FodInput does not follow the theme. `.fod-input-wrapper--default` hardcodes the PALETTE
 * PRIMITIVES `--white`, `--gray-900` and `--gray-250` instead of the theme-aware `--color-*` roles, and the
 * dark token sheet only redefines the roles — so with data-theme="dark" the draft editor's surface goes dark
 * while ~1300 cell inputs stay white boxes with a light border. Contrast INSIDE each control is fine; the
 * defect is that the control never left the light theme.
 *
 * Patched app-wide rather than under the entry grid: the same wrapper backs every FodInput in the
 * back-office, so a grid-scoped rule would fix one screen and leave the rest half-themed.
 *
 * Specificity: upstream is `.fod-input-wrapper--default[b-t1mh6cxqtf]` (0,2,0) — the scope attribute the
 * RCL's CSS isolation adds. `:root[data-theme="dark"]` contributes an attribute selector, so this is (0,2,1)
 * and wins without !important.
 *
 * `:not(:has(:disabled))` is not cosmetic. Upstream's DISABLED variant is
 * `.fod-input-wrapper--default:has(:disabled)[b-t1mh6cxqtf]`, and `:has()` takes the specificity of its
 * argument — so that selector is (0,3,0), and this one, without the `:not()`, is (0,3,0) as well. A tie is
 * settled by SHEET ORDER, which is a link-tag ordering nobody on this side controls: one bundling change and
 * a disabled input in dark mode would repaint itself as an enabled one, losing the only signal that it cannot
 * be typed into. Excluded rather than out-specified, so the disabled appearance stays upstream's whatever the
 * order turns out to be. (Upstream's hover, focus-within and readonly variants already out-specify this rule.)
 *
 * Drop this rule when the package stops hardcoding primitives on the wrapper.
 */
:root[data-theme="dark"] .fod-input-wrapper--default:not(:has(:disabled)) {
    background-color: var(--color-background-base-default);
    color: var(--color-text-base-default);
    border-color: var(--color-border-base-default);
}
