/* =============================================================================
   EDL design tokens + shared chrome.

   Single source of truth for the palette and the cross-surface user chip.
   Loaded before each surface's stylesheet:
     - templates/base.html          (public site)
     - accounts/.../_base.html      (account shell)
     - home/wagtail_hooks.py        (CMS admin via insert_global_admin_css)

   Editing a brand color or font here propagates to all three surfaces.
   ========================================================================== */

:root {
    --bg: #0a0a0f;
    --bg-elev: #12121a;
    --bg-panel: #161622;
    --surface: var(--bg-panel);
    --surface-sunken: var(--bg);
    --border: #2a2a3a;
    --border-bright: #3a3a50;
    --text: #e8e8f0;
    --text-muted: #8c8ca2;
    --text-dim: #62627a;
    --text-placeholder: #62627a;
    --accent: #ff7a1a;
    --accent-bright: #ffa260;
    --accent-dim: #cc6115;
    --accent-soft: rgba(255, 122, 26, 0.14);
    --signal: #7ba65a;
    --warn: #d4a017;
    --danger: #c0392b;
    --danger-bright: #e04a3a;
    --info: #5a8bb5;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --display: 'Rajdhani', 'Inter', system-ui, sans-serif;
    --c-orange: var(--accent);
    --c-orange-dim: var(--accent-dim);
    --c-orange-glow: rgba(255, 122, 26, 0.15);
    --c-orange-glow-strong: rgba(255, 122, 26, 0.3);
    --c-bg: var(--bg);
    --c-bg-elevated: var(--bg-elev);
    --c-bg-card: var(--bg-panel);
    --c-bg-card-hover: #1c1c2e;
    --c-border: var(--border);
    --c-border-light: var(--border-bright);
    --c-text: #c8c8d8;
    --c-text-bright: var(--text);
    --c-text-muted: var(--text-muted);
    --c-text-dim: var(--text-dim);
    --c-btn-primary-text: #0a0a0f;
    --font-display: var(--display);
    --font-body: var(--mono);
    --max-width: 1200px;
    --radius: 4px;
    --radius-lg: 8px;
}

:root[data-theme="dark"],
[data-theme="dark"] {
    --bg: #0a0a0f;
    --bg-elev: #12121a;
    --bg-panel: #161622;
    --surface: var(--bg-panel);
    --surface-sunken: var(--bg);
    --border: #2a2a3a;
    --border-bright: #3a3a50;
    --text: #e8e8f0;
    --text-muted: #8c8ca2;
    --text-dim: #62627a;
    --text-placeholder: #62627a;
    --accent: #ff7a1a;
    --accent-bright: #ffa260;
    --accent-dim: #cc6115;
    --accent-soft: rgba(255, 122, 26, 0.14);
    --c-bg: var(--bg);
    --c-bg-elevated: var(--bg-elev);
    --c-bg-card: var(--bg-panel);
    --c-bg-card-hover: #1c1c2e;
    --c-border: var(--border);
    --c-border-light: var(--border-bright);
    --c-text: #c8c8d8;
    --c-text-bright: var(--text);
    --c-text-muted: var(--text-muted);
    --c-text-dim: var(--text-dim);
    --c-btn-primary-text: #0a0a0f;
}

:root[data-theme="light"],
[data-theme="light"] {
    --bg: #f5f5f7;
    --bg-elev: #eaeaee;
    --bg-panel: #ffffff;
    --surface: var(--bg-panel);
    --surface-sunken: #f1f1f5;
    --border: #bfc0ca;
    --border-bright: #9fa1af;
    --text: #1a1a2a;
    --text-muted: #505064;
    --text-dim: #6f7080;
    --text-placeholder: #6f7080;
    --accent: #ff7a1a;
    --accent-bright: #cc6115;
    --accent-dim: #cc6115;
    --accent-soft: rgba(255, 122, 26, 0.14);
    --c-bg: var(--bg);
    --c-bg-elevated: var(--bg-elev);
    --c-bg-card: var(--bg-panel);
    --c-bg-card-hover: #f0f0f4;
    --c-border: var(--border);
    --c-border-light: var(--border-bright);
    --c-text: #262638;
    --c-text-bright: var(--text);
    --c-text-muted: var(--text-muted);
    --c-text-dim: var(--text-dim);
    --c-btn-primary-text: #111118;
}

/* =============================================================================
   Shared user chip — avatar + name + role + sign-out icon.

   Used by both the account-shell sidebar footer (rendered inline by
   accounts/_account_sidenav.html via {% include "_user_chip.html" %}) and the
   Wagtail CMS sidebar footer (rendered hidden in admin_base.html, then
   relocated into .sidebar-footer by static/js/cms-sidebar.js).

   Both surfaces import the same partial AND the same CSS — one widget,
   one implementation.
   ========================================================================== */

.edl-user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
}

.edl-user-avatar {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    object-fit: cover;
    display: block;
    border-radius: 0;
}

.edl-user-avatar--fallback {
    background: var(--bg);
    color: var(--accent);
    font-family: var(--display);
    font-size: 15px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.edl-user-chip-text {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.2;
}

.edl-user-name {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edl-user-role {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--text-dim);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-top: 2px;
}

.edl-user-logout-form {
    margin: 0;
    flex: 0 0 auto;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
}

.edl-user-logout-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    padding: 6px 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: color 120ms ease, border-color 120ms ease;
}

.edl-user-logout-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: transparent;
}
