/* ===========================================================================
   Brand palette — the one place the site's colours are decided.
   ===========================================================================

   Change a value here and it changes everywhere. That is the whole point:
   before this file the brand colour was a blue that existed as raw hex in
   about twenty-five files, as var(--blue) in roughly a hundred and ninety
   places, and inside sixteen rgba() shadows that no find-and-replace would
   ever have caught.

   This file must load BEFORE base_modern.css / homepage.css / site-nav.css.
   Those files still declare the legacy token names, but they now declare them
   as references back to the tokens here, so there is a single source of truth
   and no cascade-ordering trap.

   ---------------------------------------------------------------------------
   Colours that are NOT brand and must never be pulled in here
   ---------------------------------------------------------------------------
   The site uses colour to carry meaning in places, and most of that meaning
   lives as inline style= inside Shiur.content in the database, written by
   Python and read back as a classifier:

     #000000 Gemara, #0000ff Rashi, #ff0000 Tosfos  library/talmud/markup.py
     #008080  HebrewBooks + English footnote links  library/talmud/markup_en.py
     #0275d8  bilingual footnote markers            library/transcription/bilingual.py
     #ff0000  editor's glosses on un-prepared pages library/prepare/red_notes.py
     #e53935  YouTube buttons inside shiur content  shiur.html

   Rashi is blue. A blanket blue-to-red sweep would have destroyed the Talmud
   colour system on the page and in the Word exports.

   And one hard constraint on the red below: library/talmud/parse.py classifies
   a paragraph as Tosfos when its colour is one of #ff0000, #f00, #e60000,
   #cc0000, #dd0000 or #c00. The brand red must never be any of those.
   --------------------------------------------------------------------------- */

:root {
  /* --- The palette ------------------------------------------------------ */

  /* Maroon carries the brand: header, navigation, primary buttons. 12.1:1 on
     white, and seventeen lightness points clear of the error red, so a
     primary button can never be mistaken for a destructive one. */
  --brand: #6a1420;
  --brand-dark: #4f0d16;          /* hover / pressed            15.0:1 */

  /* Red is the accent: links, active tabs, highlights. Bright enough to read
     as a link, dark enough to pass AA on white at 5.9:1. */
  --brand-accent: #c8102e;
  --brand-accent-dark: #a40d25;   /* accent hover                7.9:1 */

  /* Tints. Backgrounds only -- neither has the contrast to carry text. */
  --brand-tint: #fdf4f5;          /* panels, header gradients */
  --brand-tint-2: #f7e4e7;        /* chips, hover rows, badges */

  /* --- Derived ---------------------------------------------------------- */

  /* Focus rings and drop shadows. These replace sixteen hand-written
     rgba(0,117,255,...) values that were scattered across the templates. */
  --brand-ring: rgba(200, 16, 46, 0.22);
  --brand-shadow: rgba(106, 20, 32, 0.25);
  --brand-shadow-soft: rgba(106, 20, 32, 0.10);

  /* The page-header gradient. It was copy-pasted identically into seven
     templates (shiur, dir, msearch, topic_detail, listing, shiur_listing,
     prayer); now there is one of it. */
  --brand-header-gradient: linear-gradient(135deg, var(--brand-tint) 0%, #ffffff 100%);

  /* --- Legacy aliases --------------------------------------------------- */
  /* Roughly 190 rules still say var(--blue). Rather than rewrite every one,
     the old names point at the new palette and follow it from now on. New
     code should use the --brand-* names above. */
  --blue: var(--brand-accent);
  --blue-soft: var(--brand-tint);
  --light-blue: var(--brand-tint-2);
  --bg-blue: var(--brand-tint);
}
