/* ============================================================
   utility-classes.css — utility classes
   ============================================================
   Single-purpose helper classes you compose onto elements.
   Single source of truth: every utility used on the site is
   defined here (Bricks' auto-generated utilities are OFF).
   New semantic colour token → add its utility here too.

   Contents
     1. Text colour
     2. Background colour
     3. Background gradient
     4. Border colour
     5. Highlight type treatment
     6. Heading size — generated by Bricks (pointer only)
     7. Elevations (box-shadow)
     8. Icon size
     9. Theme visibility
    10. Alignment (text axis + block placement)
    11. Panel width — block content-cap
    12. Display — transparent wrapper
    13. Media fit — object-fit in fixed-ratio boxes
    14. State — hidden component part

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


/* 1. Text colour ----------------------------------------------- */
.text-heading      { color: var(--text-heading); }
.text-base         { color: var(--text-base); }
.text-secondary    { color: var(--text-secondary); }
.text-inverse      { color: var(--text-inverse); }   /* flips per mode: white in light, black in dark */
.text-on-dark      { color: var(--text-on-dark); }   /* always white — for text on permanently dark surfaces */
.text-accent-soft  { color: var(--text-highlight-accent); }
.text-highlight    { color: var(--text-highlight-primary); }
.text-link         { color: var(--text-link); }
.text-link-hover   { color: var(--text-link-hover); }
/* Decorative brand orange — graphics and icons; too weak (2.2:1) for
   readable text or meaning-bearing marks on light surfaces. */
.accent-decorative { color: var(--accent-decorative); }

/* Feedback / state text — on the page background only, never on
   .bg-surface-error / .bg-surface-success (text there is black,
   --text-on-light; DESIGN-SYSTEM.md §2.7). Both flip per mode. */
.text-error        { color: var(--text-error); }
.text-success      { color: var(--text-success); }

/* Family inverse text — pairs with .bg-surface-inverse-* below: deep tint
   on light surfaces, light tint on dark surfaces and in dark mode. */
.text-inverse-primary { color: var(--text-inverse-primary); }
.text-inverse-accent  { color: var(--text-inverse-accent); }
.text-inverse-neutral { color: var(--text-inverse-neutral); }


/* 2. Background colour ----------------------------------------- */
.bg-surface-base    { background-color: var(--surface-base); }
.bg-surface-subtle  { background-color: var(--surface-subtle); }
.bg-surface-soft    { background-color: var(--surface-soft); }          /* warm beige tint */
.bg-surface-dark    { background-color: var(--surface-dark); }          /* always dark brand colour */
.bg-surface-dark-neutral { background-color: var(--surface-dark-neutral); } /* always neutral near-black */
/* No .bg-action-* utilities — the action colours belong to buttons,
   which Theme Styles handle; a background utility for them was unused. */
.bg-surface-error   { background-color: var(--surface-error); }   /* soft tint, the same in light and dark — alert panels; text on it is --text-on-light */
.bg-surface-success { background-color: var(--surface-success); }
.bg-surface-info    { background-color: var(--surface-info); }    /* soft blue tint — the .info-box surface */
.bg-surface-cta     { background-color: var(--surface-cta); }     /* brand CTA band — the .section--cta surface */
/* Family inverse surfaces — a label or pill that always stands opposite its
   surroundings (the label badge, the open filter): deep tone on light, light tint on dark and in dark mode. */
.bg-surface-inverse-primary { background-color: var(--surface-inverse-primary); }
.bg-surface-inverse-accent  { background-color: var(--surface-inverse-accent); }
.bg-surface-inverse-neutral { background-color: var(--surface-inverse-neutral); }


/* 3. Background gradient --------------------------------------- */
/* Studio-sweep backdrop; token in tokens.css §2. */
.bg-gradient-neutral { background-image: var(--gradient-neutral); }


/* 4. Border colour --------------------------------------------- */
/* Colour only — the element (or its component class) sets the width. */
.border-subtle      { border-color: var(--border-subtle); }
.border-default     { border-color: var(--border-default); }   /* same grey in both modes */
.border-strong      { border-color: var(--border-strong); }    /* the outline button's resting border */
/* Family highlight borders — hover feedback on a control already
   identified at rest by --border-strong; flip one step lighter on dark. */
.border-highlight-primary { border-color: var(--border-highlight-primary); }
.border-highlight-accent  { border-color: var(--border-highlight-accent); }


/* 5. Highlight type treatment ---------------------------------- */
/* Emphasised focus-word in the site's highlight font. Neutral by
   default: with no variables set, weight/size/letter-spacing simply
   follow the surrounding heading. A site whose highlight font runs
   visually smaller or lighter than its heading font opts in by
   setting the three --font-highlight-* variables in its own layer.
   They are UNSET on this site: the highlight is the heading face in an
   accent colour, so the word inherits weight and size. The em values
   resolve where the utility is USED, so they scale with the heading.
   Pair with .text-highlight / .text-accent-soft for colour. */
.font-highlight {
    font-family: var(--font-highlight, sans-serif);
    font-weight: var(--font-highlight-weight, inherit);
    font-size: var(--font-highlight-size, 1em);
    letter-spacing: var(--font-highlight-letter-spacing, normal);
}


/* 6. Heading size — the title scale ---------------------------- */
/* `.title-1` … `.title-6` are generated by Bricks from the Variables Manager
   category "01-Headings" (style-manager.min.css). They used to be repeated
   here as well — removed 06-09-2026 so there is one copy. Do not re-add. */

/* 7. Elevations (box-shadow + dark-mode surface overlay) -------- */
/* Raw scale — apply directly when you want a specific shadow weight.
   The overlay is `none` in light mode; in dark contexts it lightens
   the surface per level, because shadows alone can't show depth on
   dark (tokens.css §1). */
.elevation-0  { box-shadow: var(--elevation-0); background-image: var(--elevation-overlay-0); }
.elevation-1  { box-shadow: var(--elevation-1); background-image: var(--elevation-overlay-1); }
.elevation-2  { box-shadow: var(--elevation-2); background-image: var(--elevation-overlay-2); }
.elevation-3  { box-shadow: var(--elevation-3); background-image: var(--elevation-overlay-3); }
.elevation-4  { box-shadow: var(--elevation-4); background-image: var(--elevation-overlay-4); }
.elevation-5  { box-shadow: var(--elevation-5); background-image: var(--elevation-overlay-5); }

/* Semantic aliases. Card, button, dropdown, drawer and sticky-header
   elevation are NOT here — they're baked onto their own markup in
   their own component file. Only the modal alias remains: it's reserved for the
   future GDPR/cookie consent modal, which has no markup to bake onto yet. */
.modal-elevation         { box-shadow: var(--elevation-modal); background-image: var(--elevation-overlay-modal); }


/* 8. Icon size -------------------------------------------------- */
/* STANDALONE icons only — NOT the in-label CTA icons (.cta--*), which
   stay 1em to track their text. An icon-font <i> is sized by font-size;
   an inline <svg> gets a 1em box (rule below). */
.icon-s  { font-size: var(--icon-s); }
.icon-m  { font-size: var(--icon-m); }
.icon-l  { font-size: var(--icon-l); }
.icon-xl { font-size: var(--icon-xl); }

/* SVG: 1em box, width auto to keep ratio. Works on the <svg> or a wrapper. */
svg:is(.icon-s, .icon-m, .icon-l, .icon-xl),
:is(.icon-s, .icon-m, .icon-l, .icon-xl) svg {
    block-size: 1em;
    inline-size: auto;
}


/* 9. Theme visibility ------------------------------------------ */
/* Show/hide by active theme — for the dual logo (a light + a dark
   variant in the markup, one shown per mode via [data-brx-theme]). */
html[data-brx-theme="dark"] .hide-on-dark {
    display: none !important;
}

html:not([data-brx-theme="dark"]) .hide-on-light {
    display: none !important;
}

/* Header on top of a DARK hero in Light Mode (navigation.css §1): the
   see-through bar sits on a dark photo, so it shows the dark-background
   logo and hides the light one while it is at the top or rolling away.
   The see-through condition is the one defined in navigation.css §1 —
   keep the three copies identical. A flex item computes to block anyway,
   so `block` restores the logo's own display. */
html:not([data-brx-theme="dark"]) body:has(.section--dark-neutral > .header-over-hero) #brx-header:is(:not(.scrolling), .slide-up:not(:has(:focus-visible))) .hide-on-dark {
    display: none !important;
}
html:not([data-brx-theme="dark"]) body:has(.section--dark-neutral > .header-over-hero) #brx-header:is(:not(.scrolling), .slide-up:not(:has(:focus-visible))) .hide-on-light {
    display: block !important;
}


/* 10. Alignment utilities — note on `!important`
   ----------------------------------------------------------
   The `!important` is required: Bricks' Theme Styles load AFTER this
   file (unlayered), so without it these utilities silently lose. A
   utility winning the cascade on its one element is the correct,
   standard pattern. */

/* Text alignment (the TEXT axis) ---------------------------- */
/* Aligns text inside an element (inherits down; override on a child).
   justify-content is added so it also works on flex elements like a
   Bricks Text Link, where text-align can't move the flex children; it's
   inert on normal blocks. For placing the element itself, see
   .items-center below — a separate axis. */
.text-center {
    text-align: center !important;
    justify-content: center !important;
}

.text-left {
    text-align: left !important;
    justify-content: flex-start !important;
}

/* Block placement (the LAYOUT axis) ------------------------- */
/* Centres a flex container's children on the cross axis — where the
   element SITS, not how its text flows. Partner to .text-center. */
.items-center {
    align-items: center !important;
}


/* 11. Panel width — block content-cap utility -------------------
   Caps one self-contained block of UI (a form, a list) to
   --panel-width. Put it on a Block inside a full `.site-width`
   container (the block stays left; to centre a capped block, use
   `.section-header`). Not a site width: those are --max-site-width
   (the frame) and --narrow-site-width (text sections). A new cap
   gets its own role name, never a size step. */
.panel-width {
    max-inline-size: var(--panel-width);
}


/* 12. Display — transparent wrapper -----------------------------
   Removes the element's own box so its children lay out as if they
   were direct children of the grandparent. Main use: a Bricks query
   loop can't sit on a component instance, so the loop lives on a
   wrapper Div inside the grid — this class makes that wrapper
   invisible to the grid, and the looped cards become the grid items. */
.display-contents {
    display: contents;
}


/* 13. Media fit — how an image fills its fixed-ratio box --------
   For images in fixed-ratio containers (e.g. .card--cover's 16:9
   media area). Cover crops to fill (photos); contain shows the whole
   image letterboxed on the container's backdrop (mockups, logos).
   Used by the Card — Cover component's "Image fit" select. Loads
   after every component file, so these win over the component default. */
.object-cover {
    object-fit: cover;
}

.object-contain {
    object-fit: contain;
}


/* 14. State — hidden component part ---------------------------- */
/* Written by a component's "Visibility" select (Shown/Hidden) into the
   element's CSS classes field — a plain setting the builder canvas
   re-renders live, so the part disappears at once. On the frontend
   inc/hide-component-parts.php skips the element entirely, so this rule
   only ever acts inside the builder canvas. Its partner `is-shown` is
   deliberately inert (no rule) — it just makes "Shown" a real value.
   Neither is a Class Manager record: they are never typed by hand. */
.is-hidden { display: none; }

/* The Hero's "Third action" Type select writes ONE value onto both its
   button and its text link: `show-button` or `show-link` (or `is-hidden`
   for neither). The element the value does not name is skipped on the
   frontend (inc/hide-component-parts.php); these two rules hide it in
   the builder canvas, where the field re-renders live. */
.brxe-text-link.show-button,
.brxe-button.show-link { display: none; }
