/* ─────────────────────────────────────────────────────────────────────────────
   Type weight scale — TRIAL OVERRIDE
   ─────────────────────────────────────────────────────────────────────────────
   Lightens the UI by taking a step out of the heavy end of the scale, leaving
   body copy where it has always been:

       Regular (400) all standard text — body copy, table cells (stock)
       Medium (500)  labels, buttons, nav (stock), inline bold, th, and most
                     headings — everything the markup calls `font-semibold`,
                     which stock renders as Bold
       Bold (600)    page titles and article H1 — one step down from stock 700

   History worth keeping: this shipped as Light (300) body with Regular/Medium
   headings, which is what was originally asked for. It was pulled back on
   07/08/2026 — 300 reads well in a wide article column at 18px, but the dense
   UI is mostly 12-14px, much of it in mid-grey, and Light made that faint. The
   homepage was the tell: a probe of every text-bearing element found 317 of
   them carrying `font-semibold` against 356 at body weight, so nearly half the
   page sat in the heading tier while the connective text disappeared.

   The lightening that remains is real and it is where the weight actually was:
   the `font-semibold` tier drops from Bold to Medium. Body text, nav and
   buttons are back at their stock weights.

   Kept deliberately separate from the design system (same pattern as
   public/css/hames-sharley-font.css) so it can be switched off or deleted
   without touching resources/css/app.css and without a rebuild.

   How it hooks in
     Tailwind v4 emits every weight utility as a variable reference —
     `.font-semibold { font-weight: var(--font-weight-semibold) }` — with the
     values declared on `:root` inside `@layer theme`. Re-declaring those nine
     variables in this plain (unlayered) stylesheet, loaded after the Vite
     bundle, repoints every `font-*` utility on the site at once. No `@theme`
     edit, no `npm run build`, no template churn.

   How to switch it off
     Set TYPE_WEIGHT_ENABLED=false in .env (the <link> is gated on it), or
     delete this file. See config/type-weight.php.

   Tuning it
     The variable block below IS the design decision — change a number to
     re-balance the trial. `--font-weight-semibold` is the one that matters:
     it is what most of this app's headings, card titles and labels carry, so
     it sets how light the whole UI reads. 500 (current) is the trial; 600 is
     back to stock. To try the Light body again, set `--font-weight-normal`
     and the `html` rule below to 300 — but see the history note above first.

   Faces behind the numbers
     Hames Sharley (the brand-font trial) ships a real Light, Regular, Medium,
     Bold and Black, so each number is a genuine cut, not a synthesised weight.
     There is no semibold in the family — 600 and 700 both resolve to Bold,
     which is why the stock scale reads heavy and why dropping the semibold
     tier to Medium is the change that shows. Plus Jakarta Sans — the fallback,
     and what renders if BRAND_FONT_ENABLED=false — has weight 300 in its
     bunny.net request in partials/head.blade.php; that is now only needed by
     an explicit `font-light` in the markup, but it is harmless and it is what
     the Light-body option above would need.

   Not covered
     PDF exports and HTML emails (they don't include the partial, and dompdf /
     mail clients need their own static faces), and the handful of pages that
     hard-code weights in their own <style> block — business-cards/show and
     studio-map keep their bespoke typography on purpose.
   ──────────────────────────────────────────────────────────────────────────── */

/* ── The scale ─────────────────────────────────────────────────────────────
   Unlayered, so these beat the `@layer theme` values from the bundle. Comments
   show the stock Tailwind value each one replaces. */
:root {
    --font-weight-thin: 100;        /* 100 — unchanged, effectively unused */
    --font-weight-extralight: 200;  /* 200 — unchanged, effectively unused */
    --font-weight-light: 300;       /* 300 — unchanged; only where the markup asks for it */
    --font-weight-normal: 400;      /* 400 — stock. Set to 300 for the Light-body variant */
    --font-weight-medium: 500;      /* 500 — stock. Nav and buttons need this to hold up */
    --font-weight-semibold: 500;    /* was 600 — THE change: card titles, labels, most headings */
    --font-weight-bold: 600;        /* was 700 — page titles keep a step above the tier above */
    --font-weight-extrabold: 700;   /* was 800 */
    --font-weight-black: 800;       /* was 900 */
}

/* ── Element defaults ──────────────────────────────────────────────────────
   Inside `@layer base` on purpose: the layer already exists in the bundle
   (Tailwind's preflight lives there), so joining it keeps these BELOW the
   utilities layer. A `font-semibold` in the markup still wins — as it should —
   it just now resolves to 500 via the variables above. Unlayered rules would
   outrank every utility regardless of specificity and make weight classes
   unusable. */
@layer base {
    /* Stock weight, stated so the body tier is explicit and so the Light-body
       variant is a one-line change here plus --font-weight-normal above. */
    html {
        font-weight: 400;
    }

    /* Preflight resets headings to `font-weight: inherit`, so an unclassed
       heading would otherwise be indistinguishable from body copy. */
    h1, h2, h3, h4, h5, h6 {
        font-weight: 500;
    }

    /* Preflight leaves `th` at the UA's bold, which in this family is the Bold
       face — the heaviest thing in a table of 400 cells. Medium is enough to
       read as a column label. */
    th {
        font-weight: 500;
    }

    /* Preflight uses the relative keyword `bolder`, which resolves against the
       inherited weight and lands on 700 — full Bold for an inline emphasis.
       Medium is the same step every other emphasis in this scale takes. */
    b, strong {
        font-weight: 500;
    }
}

/* ── Article / wiki typography ─────────────────────────────────────────────
   app.css hard-codes weights for the reading surfaces rather than going
   through utilities, so the variables above don't reach them. These selectors
   match app.css's exactly and win on source order (both unlayered, this file
   loads later). Editor micro-chrome — toolbar buttons, upload toasts, colour
   swatches, avatar initials — is deliberately left alone: those are 0.7rem
   affordances where the heavier weight is a legibility choice, not typography.
   .wiki-tiptap is included wherever app.css includes it so the editor keeps
   matching the published page. */

/* Article H1 is the page's title — it keeps the same step above the tier below
   that `font-bold` gets in the UI. */
.feed-article-body h1,
.wiki-article-body h1 {
    font-weight: 600;
}

/* Heading tier. */
.feed-article-body :is(h2, h3, h4, h5, h6),
.feed-article-body .wiki-panel-title,
.wiki-tiptap .wiki-panel-title,
.feed-article-body .wiki-toc-title,
.wiki-tiptap .wiki-toc-title,
.feed-article-body .wiki-attachments-title,
.wiki-tiptap .wiki-attachments-title,
.wiki-expand-title,
.wiki-expand-title-input {
    font-weight: 500;
}

/* Emphasis tier — inline bold, table headers and names take the same single
   step above body copy that the rest of the scale uses, instead of app.css's
   600 (which is the Bold face in this family). */
.feed-article-body strong,
.feed-article-body b,
.feed-article-body th,
.wiki-tiptap th,
.feed-article-body .wiki-person-name,
.wiki-tiptap .wiki-person-name,
.wiki-user-picker-name {
    font-weight: 500;
}

/* Legacy .wiki-article-body block (no live surface uses it today, but it is
   still shipped and the Confluence importer references it). h1 is excluded —
   it is set to 600 with the article H1 rule above, and this would tie on
   specificity and win on source order. */
.wiki-article-body :is(h2, h3, h4, h5, h6) {
    font-weight: 500;
}

.wiki-article-body strong,
.wiki-article-body b,
.wiki-article-body th {
    font-weight: 500;
}

/* The lead paragraph is body copy set large — it should not read as emphasis. */
.wiki-article-lead {
    font-weight: 400;
}
