/* ============================================================
   base.css — plain HTML element defaults
   ============================================================
   The few element-level rules that cannot live in Bricks Theme
   Styles: the font families, the focus ring's gap, and long words.

   Contents
     1. Font families
     2. The focus ring's gap
     3. Long words
     4. Link underline thickness
     5. The Text element's own spacing
     6. Light and dark mode for the browser's own parts

   The font families are a hard limitation, not a preference: the
   Theme Style font-family fields
   wrap whatever they hold in quotes, so `var(--font-body)` is
   emitted as the literal font name "var(--font-body)" and silently
   does nothing. So the families are applied here, and Theme Styles
   deliberately sets no font-family at all.

   The VALUES live in the Bricks Variables Manager, which is the
   single place to change them. Re-fonting the site is two variables
   and a font file — nothing in this file changes.
   Conventions: _shared/bricks-builder/css-conventions.md

   Last updated: 2026-10-13 (auto-stamped by the pre-commit hook)
   ============================================================ */

/* --- 1. Font families ----------------------------------------- */

body {
    font-family: var(--font-body);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}

/* Form controls don't inherit the body font — the browser gives them
   their own. Without this the fields fall back to the system font. */
button, input, optgroup, select, textarea {
    font-family: inherit;
}


/* --- 2. The focus ring's gap ----------------------------------- */

/* Holds the focus ring 2px clear of the element's own edge, so the edge
   stays visible through the ring. The ring itself is set in Bricks:
   Theme Style › Typography › "Focus outline" — that field writes only
   `outline`, so the gap has to live here. Change the ring in the field,
   never here. House rule: DESIGN-SYSTEM.md §6.5. */
:focus-visible {
    outline-offset: 2px;
}


/* --- 3. Long words --------------------------------------------- */

/* Breaks a word only when it is wider than its line, so it never pushes
   the page sideways. Danish compounds do that in large titles on phones
   ("forbedringsmuligheder" is 403 px in title-1; WCAG 1.4.10).
   No `hyphens: auto` on purpose — Katrine's call 2026-09-16 after a trial
   page and a source check (DESIGN-SYSTEM.md §12.4). */
p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}


/* --- 4. Link underline thickness -------------------------------- */

/* Makes the link underline twice as thick on hover and keyboard focus.
   Theme Styles decides whether a link is underlined but has no thickness
   field; links are underlined at rest (WCAG 1.4.1), so hover needed a
   signal of its own — Katrine, 16-09. `a[href]`, not `a`: Bricks writes
   the shorthand `text-decoration`, which resets thickness to `auto`. */
a[href] {
    text-decoration-thickness: var(--border-width-base);
}

a[href]:is(:hover, :focus-visible) {
    text-decoration-thickness: var(--border-width-strong);
}


/* --- 5. The Text element's own spacing -------------------------- */

/* Takes the bottom margin off a Text element, so the distance to the
   next element is the parent's `gap` alone. Bricks' reset gives every
   paragraph `margin-block: 0 1.2em`, which lands on top of the gap and
   makes a stack taller than its token says (54 px where the token says
   30). Only this element: a paragraph inside a Rich Text element keeps
   the margin, because there is no gap between those. */
p.brxe-text-basic {
    margin-block: 0;
}


/* --- 6. Light and dark mode for the browser's own parts ---------- */

/* Tells the browser which mode is on, so its own parts (form fields,
   scrollbars, date pickers) follow light and dark mode. Bricks switches
   `data-brx-theme` on <html> but sets no `color-scheme` itself
   (checked in Bricks 2.4.2). */
:root {
    color-scheme: light;
}

:root[data-brx-theme="dark"] {
    color-scheme: dark;
}
