/* ==========================================================================
   Background picture or texture - the hook for the site owner.
   Loaded after base.css, so a value set here wins. By default the page is a plain black (or white) colour
   and every example below is commented out. Copy one example, remove the comment marks, replace the file name.

   1. Put the picture in  public/assets/img/bg/  (JPEG or WebP for photos, PNG or SVG for patterns,
      up to about 300 KB for a full-page photo; wide photos about 1920 px).
   2. Uncomment an example and set --bg-image to  url("/assets/img/bg/<file>").
   3. If text sits on the picture, raise --bg-overlay until the text is easy to read (see the examples).
   4. Open the site in BOTH themes, then run  php scripts/check-contrast.php  to make sure the page colours
      still pass; a picture itself is not measured, so look at the pages with your eyes: the release grid,
      the distro table and the footer text must stay readable.

   Variables
     --bg-image       url("...") or none
     --bg-size        auto | cover | contain | 400px (tile width)
     --bg-position    center | top center | 50% 20%
     --bg-repeat      no-repeat | repeat | repeat-x | repeat-y
     --bg-attachment  scroll (moves with the page) | fixed (stays, ignored by iPhone Safari)
     --bg-overlay     a veil above the picture, for example color-mix(in srgb, var(--bg) 70%, transparent)

   Grain (optional film noise above everything, does not block clicks):
     --grain-display: block;  --grain-opacity: .06;
   Header and footer are almost opaque on purpose. To let the picture show through them:
     --header-bg: color-mix(in srgb, var(--bg) 80%, transparent);
     --footer-bg: color-mix(in srgb, var(--bg) 85%, transparent);
   ========================================================================== */


/* ---- BLACK theme (the default). Use :root so it applies when no theme is saved ------------------------------ */

/* Example 1: one large photo, fixed, darkened so text stays readable
:root {
  --bg-image: url("/assets/img/bg/black.jpg");
  --bg-size: cover;
  --bg-position: center top;
  --bg-repeat: no-repeat;
  --bg-attachment: fixed;
  --bg-overlay: color-mix(in srgb, var(--bg) 72%, transparent);
}
*/

/* Example 2: seamless texture tile (dust, paper, concrete), repeated, no veil needed
:root {
  --bg-image: url("/assets/img/bg/black-tile.png");
  --bg-size: 480px;
  --bg-repeat: repeat;
  --bg-attachment: scroll;
  --bg-overlay: transparent;
}
*/

/* Example 3: a glow or picture only at the top of the page, black below
:root {
  --bg-image: url("/assets/img/bg/black-top.jpg");
  --bg-size: 100% auto;
  --bg-position: top center;
  --bg-repeat: no-repeat;
  --bg-overlay: color-mix(in srgb, var(--bg) 40%, transparent);
}
*/


/* ---- WHITE theme. Needs the attribute selector, otherwise the black rule above would apply to it too -------- */

/* Example 1: photo on white, lightened with a paper-coloured veil
:root[data-theme="light"] {
  --bg-image: url("/assets/img/bg/white.jpg");
  --bg-size: cover;
  --bg-position: center top;
  --bg-repeat: no-repeat;
  --bg-attachment: fixed;
  --bg-overlay: color-mix(in srgb, var(--bg) 82%, transparent);
}
*/

/* Example 2: paper texture tile
:root[data-theme="light"] {
  --bg-image: url("/assets/img/bg/white-tile.png");
  --bg-size: 480px;
  --bg-repeat: repeat;
  --bg-overlay: transparent;
}
*/
