/*
 * StoneLink Light Color System 1.0 (Entwicklerbriefing „Light Mode · Mehr Farbe im gesamten Netzwerk“, 04.11.2026)
 *
 * Die helle Version bekommt kontrollierte Markenfarbe: Pine für Aktionen und Auswahl, Moss für den aktiven Ort,
 * Clay/Sand als warme Tönung für Tags, Early Access und weiche Flächen, Statusfamilien für Status. Das Dunkel-Theme
 * bleibt reduziert und wird hier nie berührt.
 *
 * Regeln:
 * - Jeder Selektor beginnt mit `html body.sl-theme-light`. Das eine Element mehr schlägt die Feature-Overrides
 *   `body.sl-theme-light .x` unabhängig von der Ladereihenfolge (diese Datei lädt über head-fonts.php vor dem
 *   Seiten-CSS). tests/unit/DesignSystemTest.php prüft das und dass hier keine Hex-Werte stehen.
 * - Nur Tokens und die Rollen-Aliase aus sl-ui.css (--sl-select-*, --sl-accent-primary-line, --sl-warm-*, --sl-status-*).
 * - Rollen: Primär-CTA = Pine-Fläche · Sekundär = Outline Pine · Segment-Reiter aktiv = Pine-Fläche ·
 *   Unterstrich-Reiter aktiv = Pine-Linie · Filter-Chip aktiv = Moss-Tönung + Moss-Kante + Pine-Label · Tag = Sand ·
 *   Navigation aktiv = Moss-Tönung + Moss-Linie · Status = eigene Familie (Erfolg Moss, offen Slate,
 *   in Arbeit Amber, Problem Muted Red, abgeschlossen neutral).
 * - Maximal ein Vollfarb-Element pro Gruppe; Karten bleiben hell (feine warme Kante, keine Farbflächen).
 * Regeln + Kontraste: .cursor/rules/design-tokens.mdc (Abschnitt „Light Color System 1.0“).
 */

/* ── 1 · Buttons ──────────────────────────────────────────────────────────────────────────────────── */

/* Primär: Pine (über --sl-action-primary/--accent). Hover = Pine tief statt Transparenz, Schatten im Pine-Ton. */
html body.sl-theme-light :is(.sl-btn-accent, .sl-btn-white, .sl-ui-btn:not(.sl-ui-btn--secondary, .sl-ui-btn--ghost, .sl-ui-btn--danger)):hover:not(:disabled, [aria-disabled="true"], .is-loading) {
    --sl-ui-btn-bg: var(--button-primary-hover);
    background: var(--button-primary-hover);
    opacity: 1;
    box-shadow: 0 6px 18px var(--sl-accent-primary-shadow), 0 0 14px var(--interactive-glow-soft);
}

html body.sl-theme-light :is(.sl-btn-accent, .sl-btn-white):active:not(:disabled, [aria-disabled="true"]) {
    background: var(--button-primary-hover);
    box-shadow: none;
}

/* Sekundär: Outline in Pine, Label in Pine; Hover = feine Pine-Tönung. */
html body.sl-theme-light :is(.sl-btn-outline, .sl-ui-btn--secondary) {
    --sl-ui-btn-fg: var(--sl-accent-primary);
    --sl-ui-btn-border: var(--sl-accent-primary-line);
    color: var(--sl-accent-primary);
    border-color: var(--sl-accent-primary-line);
}

html body.sl-theme-light :is(.sl-btn-outline, .sl-ui-btn--secondary):hover:not(:disabled, [aria-disabled="true"]) {
    background: var(--sl-select-bg);
    border-color: var(--sl-accent-primary);
    color: var(--sl-accent-primary);
}

html body.sl-theme-light .sl-ui-btn--ghost:hover:not(:disabled, [aria-disabled="true"]) {
    background: var(--sl-action-soft);
    color: var(--sl-accent-primary);
}

/* ── 2 · Navigation ───────────────────────────────────────────────────────────────────────────────── */

/* Early Access: warmes Label (Sand + Clay), damit es als Markenhinweis und nicht als graues Etikett liest. */
html body.sl-theme-light .sl-nav-ea-label {
    color: var(--sl-warm-text);
    background: var(--sl-warm-soft);
    border-color: var(--sl-warm-line);
}

/* „Problem melden“ gehört zu Early Access: gleiche warme Familie, Hover eine Stufe kräftiger. */
html body.sl-theme-light .sl-nav-support {
    color: var(--text);
    background: var(--sl-warm-soft);
    border-color: var(--sl-warm-line);
}

html body.sl-theme-light .sl-nav-support .sl-nav-support-icon {
    color: var(--sl-warm-text);
}

html body.sl-theme-light .sl-nav-support:hover,
html body.sl-theme-light .sl-nav-support[aria-expanded="true"] {
    background: var(--sl-warm-strong);
    border-color: var(--sl-warm-text);
}

@media (min-width: 769px) {
    /* Hover auf Reitern und Icons: feine Pine-Tönung statt Grau. */
    html body.sl-theme-light .sl-nav-links a:hover,
    html body.sl-theme-light .sl-nav-links a:focus-visible,
    html body.sl-theme-light .sl-nav-icon-link:hover:not(.sl-nav-logout-link),
    html body.sl-theme-light .sl-nav-icon-link:focus-visible:not(.sl-nav-logout-link),
    html body.sl-theme-light .sl-nav-badge:hover,
    html body.sl-theme-light .sl-nav-badge:focus-visible {
        background: var(--sl-action-soft);
        border-color: var(--sl-accent-primary-line);
    }

    /* Aktiver Hauptpunkt: Moss-Tönung + Moss-Kante + Moss-Linie (Ort = Moss, aria-current bleibt). */
    html body.sl-theme-light .sl-nav-links > a.active:not(.sl-nav-workspace-active) {
        color: var(--sl-nav-active);
        background: var(--sl-accent-readable-soft);
        box-shadow: 0 0 0 1px var(--sl-accent-readable-line) inset, 0 4px 14px var(--sl-accent-primary-shadow);
    }

    html body.sl-theme-light .sl-nav-links > a.active:not(.sl-nav-workspace-active)::before {
        background: linear-gradient(90deg, transparent, var(--sl-bg-surface), transparent);
    }

    html body.sl-theme-light .sl-nav-icon-link:hover:not(.sl-nav-logout-link) svg,
    html body.sl-theme-light .sl-nav-icon-link:focus-visible:not(.sl-nav-logout-link) svg,
    html body.sl-theme-light .sl-nav-icon-link.is-active svg {
        color: var(--sl-accent-primary);
    }

    /* Profil: auf der eigenen Profilseite Pine-Auswahl, sonst Pine-Hover. */
    html body.sl-theme-light .sl-nav-badge.is-active,
    html body.sl-theme-light a.sl-nav-badge:active {
        background: var(--sl-select-bg);
        border-color: var(--sl-select-line);
        color: var(--sl-select-ink);
    }

    html body.sl-theme-light .sl-nav-badge:is(:hover, :focus-visible, .is-active) .sl-nav-badge-icon {
        color: var(--sl-accent-primary);
    }

    /* Workspace-Pill: Werkzeug-Einstieg in Pine, aktiv = Pine-Auswahl mit Pine-Icon-Chip (wie dunkel). */
    html body.sl-theme-light .sl-nav-links a.sl-nav-workspace-link {
        border-color: var(--sl-accent-primary-line);
        background: var(--sl-action-soft);
        color: var(--sl-accent-primary);
    }

    html body.sl-theme-light .sl-nav-links a.sl-nav-workspace-link .sl-nav-workspace-icon {
        background: var(--sl-select-bg);
        color: var(--sl-accent-primary);
    }

    html body.sl-theme-light .sl-nav-links a.sl-nav-workspace-link:is(:hover, :focus-visible) {
        border-color: var(--sl-accent-primary);
        background: var(--sl-select-bg);
    }

    html body.sl-theme-light .sl-nav-links a.sl-nav-workspace-link:is(:hover, :focus-visible) .sl-nav-workspace-icon,
    html body.sl-theme-light .sl-nav-links > a.sl-nav-workspace-active .sl-nav-workspace-icon {
        background: var(--sl-accent-primary);
        color: var(--sl-action-primary-fg);
    }

    html body.sl-theme-light .sl-nav-links > a.sl-nav-workspace-active {
        border-color: var(--sl-accent-primary-line);
        background: var(--sl-select-bg);
        color: var(--sl-accent-primary);
    }
}

/* Mobile Tabbar: aktiver Reiter mit Moss-Label und -Icon (Marker oben bleibt). */
html body.sl-theme-light .sl-tabbar-item.is-active {
    color: var(--sl-nav-active);
}

/* Seitenleisten (Teams, Community, Workspace, Einstellungen, Notizen, Profil-Index): aktiver Ort wie oben —
   Moss-Tönung, Moss-Marker und -Icon, Label in Pine (liegt auf der Seitenfläche statt auf der weißen Nav);
   Hover = feine Tönung. */
html body.sl-theme-light :is(.sl-teams-nav-link, .sl-com-nav-link, .sl-wsa-nav-item, .sl-nb-rail-item, .sl-pv-nav-link:not(.sl-pv-tab)):is(.is-active, [aria-current="page"]),
html body.sl-theme-light .sl-settings-nav a[aria-current="true"] {
    /* Label in Pine: Moss tief erreicht auf der Moss-Tönung über der Seitenfläche nur 4,3:1, Pine 5,2:1. */
    color: var(--sl-select-ink);
    background: var(--sl-accent-readable-soft);
}

html body.sl-theme-light :is(.sl-teams-nav-link, .sl-com-nav-link):is(.is-active, [aria-current="page"]) {
    box-shadow: inset 2px 0 0 var(--sl-nav-active);
}

html body.sl-theme-light :is(.sl-teams-nav-link, .sl-com-nav-link, .sl-wsa-nav-item, .sl-nb-rail-item, .sl-pv-nav-link:not(.sl-pv-tab)):is(.is-active, [aria-current="page"]) :is(svg, .sl-icon) {
    color: var(--sl-nav-active);
}

html body.sl-theme-light :is(.sl-teams-nav-link, .sl-com-nav-link, .sl-wsa-nav-item, .sl-nb-rail-item):not(.is-active, [aria-current="page"]):hover {
    color: var(--text);
    background: var(--sl-action-soft);
}

/* ── 3 · Segment-Schalter (Reiter in einer Spur) ──────────────────────────────────────────────────── */
/* Aktiv = Pine-Fläche mit weißem Label; inaktiv neutral; Hover = feine Pine-Tönung. */

html body.sl-theme-light :is(
    .sl-pr-segment,
    .sl-pv-tab,
    .sl-search-tab,
    .sl-discover-switch-item,
    .sl-teams-tab,
    .sl-teams-seg-btn,
    .sl-beides-switch-btn,
    .sl-studio-tab:not(.sl-pp-tab),
    .sl-pr-tab,
    .sl-nc-tab,
    .sl-lf-view,
    .sl-workspace-tab,
    .sl-wp-tab,
    .sl-wsa-switch-item,
    .sl-bbudget-tab
):is(.is-active, .active, [aria-selected="true"]) {
    color: var(--sl-action-primary-fg);
    background: var(--sl-action-primary);
    border-color: transparent;
    box-shadow: 0 2px 8px var(--sl-accent-primary-shadow);
}

html body.sl-theme-light :is(
    .sl-pr-segment,
    .sl-pv-tab,
    .sl-search-tab,
    .sl-discover-switch-item,
    .sl-teams-tab,
    .sl-teams-seg-btn,
    .sl-beides-switch-btn,
    .sl-studio-tab:not(.sl-pp-tab),
    .sl-pr-tab,
    .sl-nc-tab,
    .sl-lf-view,
    .sl-workspace-tab,
    .sl-wp-tab,
    .sl-wsa-switch-item,
    .sl-bbudget-tab
):is(.is-active, .active, [aria-selected="true"]) :is(small, .sl-studio-tab-count, .sl-search-tab-count, .sl-nc-tab-count, svg) {
    color: inherit;
}

html body.sl-theme-light :is(.sl-search-tab, .sl-nc-tab, .sl-studio-tab):is(.is-active, .active) :is(.sl-search-tab-count, .sl-nc-tab-count, .sl-studio-tab-count) {
    background: color-mix(in srgb, var(--sl-action-primary-fg) 20%, transparent);
    color: var(--sl-action-primary-fg);
}

html body.sl-theme-light :is(
    .sl-pr-segment,
    .sl-pv-tab,
    .sl-search-tab,
    .sl-discover-switch-item,
    .sl-teams-tab,
    .sl-teams-seg-btn,
    .sl-beides-switch-btn,
    .sl-studio-tab:not(.sl-pp-tab),
    .sl-pr-tab,
    .sl-nc-tab,
    .sl-lf-view,
    .sl-workspace-tab,
    .sl-wp-tab,
    .sl-wsa-switch-item,
    .sl-bbudget-tab
):not(.is-active, .active, [aria-selected="true"]):hover {
    color: var(--text);
    background: var(--sl-action-soft);
}

/* Fortschritt (Profil-Vollständigkeit, Budget, Rollen-Startseite): Füllung Pine, Spur fein getönt. */
html body.sl-theme-light :is(.sl-editor-progress, .sl-budget-progress, .sl-role-dashboard-progress) {
    background: var(--sl-action-soft);
}

html body.sl-theme-light :is(.sl-editor-progress, .sl-budget-progress:not(.is-over), .sl-role-dashboard-progress) span {
    background: var(--sl-action-primary);
}

/* ── 4 · Unterstrich-Reiter (Profil, Community) ───────────────────────────────────────────────────── */

html body.sl-theme-light :is(.sl-pp-tab, .sl-com-tab):is(.is-active, .active),
html body.sl-theme-light .sl-studio-card-edit .sl-studio-tab.sl-pp-tab:is(.is-active, .active) {
    color: var(--sl-accent-primary);
    border-bottom-color: var(--sl-accent-primary);
}

html body.sl-theme-light :is(.sl-pp-tab, .sl-com-tab):not(.is-active, .active):hover {
    color: var(--text);
    border-bottom-color: var(--sl-accent-primary-line);
}

/* ── 5 · Filter- und Auswahl-Chips ────────────────────────────────────────────────────────────────── */
/* Aktiv = Moss-Tönung + Moss-Kante + Pine-Label (5,2:1 und mehr); Hover = feine Tönung. Keine Vollfarbe. */

html body.sl-theme-light :is(
    .sl-pj-view,
    .sl-pr-filter,
    .sl-wtask-filter,
    .sl-wsp-filter,
    .sl-net-chip,
    .sl-com-chip,
    .sl-teams-chip,
    .sl-filter-chip,
    .sl-chip,
    .sl-cl-filter-chip,
    .sl-admin-filter-chip,
    .sl-work-kind-pill,
    .sl-msg-filter,
    .sl-msg-hub-tab,
    .sl-msg-context-tab
):is(.is-active, .active, [aria-pressed="true"]) {
    color: var(--sl-select-ink);
    background: var(--sl-select-bg);
    border-color: var(--sl-select-line);
    /* Kante auch bei randlosen Chips (Messenger, Workspace-Filter) sichtbar. */
    box-shadow: inset 0 0 0 1px var(--sl-select-line);
}

html body.sl-theme-light :is(
    .sl-pj-view,
    .sl-pr-filter,
    .sl-wtask-filter,
    .sl-wsp-filter,
    .sl-net-chip,
    .sl-com-chip,
    .sl-teams-chip,
    .sl-filter-chip,
    .sl-chip,
    .sl-cl-filter-chip,
    .sl-admin-filter-chip,
    .sl-work-kind-pill,
    .sl-msg-filter,
    .sl-msg-hub-tab,
    .sl-msg-context-tab
):is(.is-active, .active, [aria-pressed="true"]) :is(svg, small) {
    color: inherit;
}

html body.sl-theme-light :is(
    .sl-pj-view,
    .sl-pr-filter,
    .sl-wtask-filter,
    .sl-wsp-filter,
    .sl-net-chip,
    .sl-com-chip,
    .sl-teams-chip,
    .sl-filter-chip,
    .sl-chip,
    .sl-cl-filter-chip,
    .sl-admin-filter-chip,
    .sl-work-kind-pill
):not(.is-active, .active, [aria-pressed="true"]):hover {
    color: var(--text);
    background: var(--sl-action-soft);
    border-color: var(--sl-accent-primary-line);
}

/* Chips mit verstecktem Eingabefeld (Locations-Vibes, Support-Kategorien): gleiche Auswahl-Sprache. */
html body.sl-theme-light .sl-lf-chip input:checked + span,
html body.sl-theme-light .sl-support-chip:has(input:checked) {
    color: var(--sl-select-ink);
    background: var(--sl-select-bg);
    border-color: var(--sl-select-line);
}

html body.sl-theme-light .sl-lf-chip:hover input:not(:checked) + span,
html body.sl-theme-light .sl-support-chip:not(:has(input:checked)):hover {
    background: var(--sl-action-soft);
    border-color: var(--sl-accent-primary-line);
}

/* Vibes sind Kategorien: im Ruhezustand warme Sand-Tönung statt grauer Kontur. */
html body.sl-theme-light .sl-lf-vibe-list .sl-lf-chip input:not(:checked) + span {
    background: var(--sl-warm-soft);
    border-color: var(--sl-warm-line);
}

/* ── 6 · Tags und Kategorien (nicht interaktiv): warme Sand-Tönung ───────────────────────────────── */

html body.sl-theme-light :is(.sl-badge, .sl-profile-type-badge, .sl-studio-type-badge, .sl-project-badge-own) {
    color: var(--sl-warm-text);
    background: var(--sl-warm-soft);
    border-color: var(--sl-warm-line);
}

/* Neutrales Status-Badge ohne Ton (z. B. „Wichtig“): Sand statt Grau; --muted bleibt bewusst neutral. */
html body.sl-theme-light .sl-ui-badge:not(.sl-ui-badge--success, .sl-ui-badge--warning, .sl-ui-badge--error, .sl-ui-badge--info, .sl-ui-badge--muted, [class*="sl-ui-badge--avail-"]) {
    --sl-ui-badge-tone: var(--sl-warm-text);
    background: var(--sl-warm-soft);
    border-color: var(--sl-warm-line);
}

/* ── 7 · Status: konsistente Familien ─────────────────────────────────────────────────────────────── */
/* Erfolg/live/angenommen = Moss · offen/wartend = Slate · in Arbeit = Amber · Problem = Muted Red ·
   Entwurf/abgeschlossen = neutral. Immer mit Text oder Punkt, nie nur Farbe. */

html body.sl-theme-light .sl-ui-badge:is(.sl-ui-badge--success, .sl-ui-badge--warning, .sl-ui-badge--error, .sl-ui-badge--info) {
    color: var(--sl-ui-badge-tone);
    background: color-mix(in srgb, var(--sl-ui-badge-tone) 12%, transparent);
    border-color: color-mix(in srgb, var(--sl-ui-badge-tone) 36%, transparent);
}

html body.sl-theme-light :is(.sl-status-accepted, .sl-project-badge-status-active, .sl-project-badge-open, .sl-job-status-open, .sl-support-status--done) {
    color: var(--sl-status-success);
    background: var(--sl-status-success-soft);
    border-color: var(--sl-status-success-line);
}

html body.sl-theme-light :is(.sl-status-pending, .sl-support-status--received, .sl-support-status--waiting) {
    color: var(--sl-status-info);
    background: var(--sl-status-info-soft);
    border-color: var(--sl-status-info-line);
}

html body.sl-theme-light :is(.sl-project-badge-status-progress, .sl-support-status--in) {
    color: var(--sl-status-warning);
    background: var(--sl-status-warning-soft);
    border-color: var(--sl-status-warning-line);
    border-style: solid;
}

html body.sl-theme-light .sl-status-declined {
    color: var(--sl-status-error);
    background: var(--sl-status-error-soft);
    border-color: var(--sl-status-error-line);
}

/* Projekt-Status auf Karten: Punkt in der Familie (offen = Moss, in Arbeit/pausiert = Amber). */
html body.sl-theme-light {
    --pj-progress: var(--sl-status-warning);
}

/* ── 8 · Eingaben ─────────────────────────────────────────────────────────────────────────────────── */

html body.sl-theme-light .sl-select-trigger {
    background: var(--input-bg);
    border-color: var(--input-border);
}

html body.sl-theme-light .sl-select-trigger:hover,
html body.sl-theme-light :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"]), textarea, select):hover:not(:focus, :disabled, [readonly]) {
    border-color: var(--sl-accent-primary-line);
}

/* Fokus und offenes Select: kein eigener Stil hier — das regelt Input Focus 2.0 zentral in sl-ui.css
   (getönte Feldfläche, kein Ring). */

html body.sl-theme-light .sl-select-option:is(:hover, .is-active, [aria-selected="true"]) {
    background: var(--sl-select-bg);
}

html body.sl-theme-light .sl-select-option-check {
    color: var(--sl-accent-primary);
}

/* ── 9 · Karten und Hinweisflächen ────────────────────────────────────────────────────────────────── */
/* Karten bleiben weiß und ruhig; Hover bekommt eine feine warme Kante statt eines grauen Rahmens. */

html body.sl-theme-light a.sl-talent-link:hover {
    border-color: var(--sl-warm-line);
}
