/* Named, shared color values instead of the same hex/rgb codes retyped
   across header.css/menu.css/operations.css/responsive.css. Each name
   keeps its own existing value - this doesn't unify the site's several
   different blues into one, only gives each a single source of truth. */
:root {
    --color-heading-accent: rgb(13, 167, 255);
    --color-border-accent: rgb(34, 133, 195);
    --color-navy: rgb(15, 60, 88);
    --color-bootstrap-primary: #0d6efd;
    --color-menu-border: #45adff;
    --color-menu-text: #1a1a2e;
    --color-menu-surface: #f8f7f4;
    --color-menu-hover: #cce8ff;
    --color-menu-active: #e5f2ff;

    /* Shared tokens for the nav/menu redesign - one place to keep
       radius/shadow/timing consistent across header.css, menu.css and
       responsive.css instead of each re-picking its own numbers. */
    --radius-sm: 8px;
    --radius-md: 12px;
    --shadow-dropdown: 0 16px 32px rgba(15, 23, 42, .12), 0 2px 8px rgba(15, 23, 42, .06);
    --transition-fast: 150ms ease;
    --transition-base: 200ms cubic-bezier(.22, .8, .32, 1);

    /* Dark-mode tokens. Light values here match what every page already
       used as literal colors (#fff cards, #e6ebf1 borders, inherited
       black text) - switching a card's hardcoded #fff to var(--surface)
       is a no-op in light mode and only takes effect once [data-theme]
       flips these below. Toggled by the header button (header.html),
       which sets data-theme on <html> and persists it to localStorage;
       an inline script in base.html's <head> applies the saved choice
       before first paint to avoid a light-mode flash. */
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-alt: #f8f7f4;
    --text: #1a1a2e;
    --text-muted: #475569;
    --border-subtle: #e6ebf1;
}

:root[data-theme="dark"] {
    --color-navy: rgb(205, 221, 232);
    --color-menu-text: #e7ecef;
    --color-menu-surface: #1b222b;
    --color-menu-hover: #28343f;
    --color-menu-active: #233038;

    --bg: #12161b;
    --surface: #1b222b;
    --surface-alt: #202933;
    --text: #e7ecef;
    --text-muted: #9aa7b2;
    --border-subtle: #2c3842;

    color-scheme: dark;
}

/* Single source of truth for body - this used to be declared three times
   (here, an inline <style> in base.html, and header.css), each winning a
   different subset of properties depending on cascade order. Consolidated
   to the values that were actually taking effect, so nothing visually
   changes. */
body {
    font-family: 'Alegreya Sans', Arial, Helvetica, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100%;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Decorative blue bars flanking every h1 - previously duplicated between
   here and base.html's inline <style>. */
h1 {
    display: flex;
    align-items: center;
}

h1::before,
h1::after {
    content: '';
    flex: 1;
    height: 8px;
    background-color: var(--color-heading-accent);
    font-size: 3rem;
    text-align: center;
}

h1::before {
    margin-right: 1.5rem;
}

h1::after {
    margin-left: 1.5rem;
}

/* Flash-message toast (templates/base/base.html) - Bootstrap's own
   default (max-width: 350px, compact padding) reads fine for a short
   one-liner but cramps a message with several sentences of real
   information, like the post-registration one. */
.app-toast {
    max-width: 420px;
    min-width: 300px;
    box-shadow: var(--shadow-dropdown, 0 16px 32px rgba(15, 23, 42, .18));
}
.app-toast .toast-body {
    padding: 16px 18px;
    font-size: 0.95rem;
    line-height: 1.55;
}

/* The one file a topic page gives away. Sits beside that file's button. */
.free-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.free-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--color-menu-active);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}