/*
 * daisyUI ↔ Poseidon CSS Bridge Layer (Sub-1.1 + Sub-1.2 amendment)
 *
 * Maps the 20+ legacy Sprint U1 CSS variables defined in
 * static/css/poseidon.css onto daisyUI v5 semantic tokens so the
 * theme switcher (`<html data-theme="...">` driven by
 * apps/theming/context_processors.theme_context) actually flows
 * through to legacy components.
 *
 * Strategy: COEXIST.  Sub-1.1 corrected the original ADR-0056 design:
 *   - selector :root[data-theme] (specificity 0,0,2,0) beats
 *     poseidon.css :root (0,0,1,0)
 *   - load order: tailwind → poseidon → bridge (bridge is LAST so
 *     equal-specificity ties go to bridge)
 *
 * Sub-1.2 expansion: alias the four vars poseidon declares but the
 * original bridge missed (text-primary/-secondary/-muted, sidebar-w-
 * collapsed). Tint differentiation via CSS color-mix (oklch).
 *
 * Reference: ADR-0056 (parent), ADR-0059 (this amendment).
 */

:root[data-theme] {
    /* Backgrounds — base palette */
    --bg-primary:    var(--color-base-100);
    --bg-secondary:  var(--color-base-200);
    --bg-tertiary:   var(--color-base-300);
    --bg-hover:      var(--color-base-200);
    --bg-input:      var(--color-base-200);

    /* Accent / brand — daisyUI primary + secondary */
    --accent:        var(--color-primary);
    --accent-hover:  var(--color-primary);
    --accent-light:  var(--color-primary);
    --brand:         var(--color-secondary);
    --brand-hover:   var(--color-secondary);
    --brand-light:   var(--color-secondary);

    /* Borders — base-300 with high-contrast hover */
    --border:        var(--color-base-300);
    --border-hover:  var(--color-base-content);

    /* Status — direct daisyUI counterparts */
    --danger:        var(--color-error);
    --info:          var(--color-info);
    --success:       var(--color-success);
    --warning:       var(--color-warning);

    /* Text — three brightness levels via color-mix on base-content
     * (Chrome 111+, Firefox 113+, Safari 16.4+ all support color-mix). */
    --text-primary:   var(--color-base-content);
    --text-secondary: color-mix(in oklch, var(--color-base-content) 70%, transparent);
    --text-muted:     color-mix(in oklch, var(--color-base-content) 50%, transparent);

    /* Layout primitives kept literal — daisyUI does not own these.
     * Defined here so theme-switch never wipes them. */
    --radius:               0.375rem;
    --radius-lg:            0.5rem;
    --shadow:               0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-lg:            0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
    --sidebar-w:            16rem;
    --sidebar-w-collapsed:  4rem;
}
