/* Global theme config. Loaded before styles.css; keep site-wide
   design tokens here. Light is the default; dark mode (Tier A)
   follows the OS setting via prefers-color-scheme. */
:root {
    --text: #111;
    --bg: #fff;
    --button: #222;
    --button-text: #fff;
    --button-hover: #333;

    /* Sidebar palette is derived from the page colors with color-mix(),
       so it adapts to dark mode without a second set of definitions. */
    --sidebar-bg: var(--bg);
    --sidebar-text: color-mix(in srgb, var(--text) 90%, var(--bg));
    --sidebar-border: color-mix(in srgb, var(--text) 20%, var(--bg));
    --sidebar-item-hover-bg: color-mix(in srgb, var(--text) 8%, var(--bg));
    --sidebar-active-bg: color-mix(in srgb, var(--text) 13%, var(--bg));

    /* Family reading. Quiet text and lines, cards and the live banner are
       derived from --text/--bg so they follow dark mode by themselves. */
    --quiet: color-mix(in srgb, var(--text) 58%, var(--bg));
    --quiet-border: color-mix(in srgb, var(--text) 22%, var(--bg));
    --card-bg: color-mix(in srgb, var(--text) 5%, var(--bg));
    --live-bg: color-mix(in srgb, #19703f 10%, var(--bg));
    --live-border: color-mix(in srgb, #19703f 45%, var(--bg));
    --danger: #b42318;
    /* The reader and the camera are always dark, in both modes: pictures
       look best on a dark surround, and Arvid's screen should not glare. */
    --reader-bg: #121212;
    --reader-text: #f2f2f2;
    --reader-muted: #a8a8a8;
    --reader-line: rgba(255, 255, 255, 0.3);
    --reader-bar-bg: rgba(18, 18, 18, 0.88);
    --present: #3ecf6e;

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --text: #eee;
        --bg: #111;
        --button: #ddd;
        --button-text: #111;
        --button-hover: #ccc;
        --danger: #f97066;
        color-scheme: dark;
    }
}
