/* ==========================================================================
   Uses: css/brand-base.css
   Palette only. The shared component rules (the former section 2) are in
   css/brand-base.css, which the theme loads right after this file because of
   the "Uses:" line above (theme.php, theme::css()) - the same order as when
   both parts were one file.

   Brand — hpkizi.sk
   Load after tabler.min.css, before style.css.

   Two brand colours, mapped straight onto Tabler's own variables. There is no
   second vocabulary: where Tabler already has a variable, this file sets it.

     1. Palette + Tabler mapping   the only part edited per site
     2. Components                 copy verbatim between sites

   Section 2 exists only because Tabler declares several of its variables
   INSIDE the component block that reads them (.navbar, .dropdown-menu, .card,
   .accordion). A value set on :root is reset the moment the component
   matches, so those have to be set on the component itself. That is Tabler's
   design, not a choice made here.

   No shadows. Emphasis comes from borders and from the accent strip, which do
   not blur, do not bleed into the gutters between columns, and are not
   clipped by the overflow on .col-sticky.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Palette and Tabler mapping
   -------------------------------------------------------------------------- */

:root {
  /* Colour 1 — purple. Structure: navigation, panel headers, borders, links. */
  --brand-1:         #5f4b8b;
  --brand-1-hover:   #4c3c6f;
  --brand-1-head:    #48396a;  /* closed panel headers */
  --brand-1-bar:     #322749;  /* navigation bar */
  --brand-1-light:   #b6a6d6;  /* dark mode */

  /* Colour 2 — salmon. Accent: the strip, panel bodies, badges. */
  --brand-2:         #e69a8d;
  --brand-2-tint:    #f8e4e1;  /* panel bodies */

  /* Neutrals */
  --brand-white:     #ffffff;
  --brand-page:      #f5f6f7;
  --brand-line:      #cccccc;
  --brand-mute:      #6c757d;
  --brand-ink:       #212529;
  --brand-on-accent: #201310;
  --brand-on-dark:   #ffffff;  /* label colour on any dark brand surface */

  /* Dark mode surfaces and text */
  --brand-d-text:    #e9e4f2;
  --brand-d-link:    #c3b4e0;
  --brand-d-hover:   #d9c9f0;
  --brand-d-header:  #1c1726;
  --brand-d-panel:   #241d33;
  --brand-d-on-primary: #171020;

  /* Shape */
  --brand-radius:      0;
  --brand-accent-size: 3px;

  /* The only RGB triplets here, and the only colours written twice. Tabler
     reads --tblr-primary-rgb as a comma triplet in 23 places of its own CSS
     (.bg-primary, .text-primary, focus rings, link underlines) and
     --tblr-link-color-rgb in 2. CSS cannot derive a triplet from a hex, so
     keep each in step with the hex above. */
  --brand-1-rgb:       95,  75, 139;  /* #5f4b8b */
  --brand-1-hover-rgb:  76,  60, 111; /* #4c3c6f */
  --brand-1-light-rgb: 182, 166, 214; /* #b6a6d6 */
  --brand-d-link-rgb:  195, 180, 224; /* #c3b4e0 */
  --brand-d-hover-rgb: 217, 201, 240; /* #d9c9f0 */

  /* --- Tabler --- */
  --tblr-primary:              var(--brand-1);
  --tblr-primary-rgb:          var(--brand-1-rgb);
  --tblr-primary-fg:           #ffffff;
  --tblr-primary-lt:           color-mix(in srgb, var(--brand-1) 12%, transparent);

  --tblr-link-color:           var(--brand-1);
  --tblr-link-color-rgb:       var(--brand-1-rgb);
  --tblr-link-hover-color:     var(--brand-1-hover);
  --tblr-link-hover-color-rgb: var(--brand-1-hover-rgb);

  --tblr-focus-ring-color:     color-mix(in srgb, var(--brand-1) 25%, transparent);
  --tblr-body-bg:              var(--brand-page);

  /* --tblr-secondary is NOT a brand accent in Tabler. Its default is the grey
     #6b7280 and it feeds muted text, .btn-secondary and - through
     --tblr-navbar-color - every navbar link. Left alone on purpose. */
}

[data-bs-theme=dark] {
  --tblr-primary:              var(--brand-1-light);
  --tblr-primary-rgb:          var(--brand-1-light-rgb);
  --tblr-primary-fg:           var(--brand-d-on-primary);
  --tblr-primary-lt:           color-mix(in srgb, var(--brand-1-light) 16%, transparent);

  --tblr-link-color:           var(--brand-d-link);
  --tblr-link-color-rgb:       var(--brand-d-link-rgb);
  --tblr-link-hover-color:     var(--brand-d-hover);
  --tblr-link-hover-color-rgb: var(--brand-d-hover-rgb);

  --tblr-focus-ring-color:     color-mix(in srgb, var(--brand-1-light) 30%, transparent);

  /* Surfaces. Tabler's dark surfaces are blue-greys (gray-800 / gray-900);
     next to the dark page and panels of this brand they read as a different
     colour scheme. --tblr-bg-surface is what .card reads through
     --tblr-card-bg; -secondary and -tertiary feed card headers and footers,
     table heads and similar bands. */
  --tblr-bg-surface:           var(--brand-d-panel);
  --tblr-bg-surface-secondary: var(--brand-d-header);
  --tblr-bg-surface-tertiary:  var(--brand-d-header);

  /* Re-point the brand tokens the components below read, so one set of
     component rules serves both colour schemes. */
  --brand-1:      var(--brand-1-light);
  --brand-2-tint: var(--brand-d-panel);
  --brand-white:  var(--brand-d-header);
  --brand-ink:    var(--brand-d-text);
  --brand-line:   var(--brand-1-light);
  --brand-page:   var(--brand-d-header);
  --brand-on-dark: var(--brand-d-text);
}
