/**
 * Arbutus — a white-label skin. The client's identity on SazAI's elements. (data-skin="arbutus")
 *
 * THE NAME. The madroño is evergreen, its bark is smooth and red-brown, and its fruit is a
 * single saturated red against dark leaves. It spends its whole chromatic budget on one colour,
 * which is exactly what this client does.
 *
 * THE RULE (Rames, 2026-09-11): elements and tokens.css are the guardrails; inside them the
 * skin may change whatever it wants, but it must keep every element. This file re-lays the
 * page: the rail becomes a single white bar, the hero becomes a static plane on a warm cream,
 * the clickable things become the only round objects on the page, and the footer becomes a
 * near-black plane. Nothing is removed.
 *
 * WHERE THE VALUES COME FROM. The client publishes a brand book and it corroborates the served
 * pages exactly: the reds and the cream measured off the live CSS match the published values,
 * two independent sources agreeing rather than a copy checked against itself. The book carries
 * no typography section at all, so every type value here is measured, not quoted.
 *
 * THE CHOICE THIS SKIN HAD TO MAKE. The client runs two design generations side by side: an
 * older home with a two-tier nav, a carousel, small 4px corners and display at weight 400 with
 * hard negative tracking, and a current interior generation with a single white nav, a static
 * hero on cream, 24px pills and cards, display at weight 300, and zero tracking. Both are live.
 * This skin follows the CURRENT generation, because a white-label surface should look like where
 * the client is going, not where they have been. The older generation is recorded here so the
 * decision is visible rather than silent.
 *
 * THE VOICE. Never uppercase, anywhere. Large sizes at light weights, which reads calm and
 * editorial rather than corporate-loud. Roundness is reserved for the things you click, and
 * that reservation is the identity: over 82% of elements carry no radius at all.
 *
 * TYPE. A bespoke commissioned family that cannot ship (white-label ruling 2026-08-31). Nothing
 * is downloaded. The client's own interior pages already fall back to two widely available
 * humanist sans faces, so this stack names those, then continues into Arabic, Hebrew and CJK.
 *
 * NO MARKS. No logo, no wordmark, no company name anywhere, comments included. The client's
 * book states that use and reproduction of the brand is prohibited unless expressly authorised,
 * which is one more reason the identity here is shape, scale and colour alone.
 *
 * DIRECTION. Every inline offset is logical, so the skin flips with the document in ar and he.
 */

:root[data-skin="arbutus"] {

  /* ========================= BRAND VALUES ========================= */
  --arb-red:#ec0000;          /* the whole chromatic budget, spent once */
  --arb-red-2:#cc0000;        /* the pressed state */
  --arb-red-3:#990000;        /* the deep stop, and the only gradient the client paints */
  --arb-cream:#fbf1ea;        /* the hero ground on the current generation */
  --arb-ink:#222222;          /* ink, and the footer plane */
  --arb-paper:#ffffff;
  --arb-body:#4c4c4c;
  --arb-hair:#e4ded9;

  /* geometry: square, except for the things you click */
  --arb-bar:4.75rem;
  --arb-measure:80rem;
  --arb-gutter:clamp(1.25rem, 5vw, 4.5rem);
  --arb-r-click:24px;         /* pills and cards, the current generation's one radius */

  --arb-sans:"Graphik", "Outfit", "Helvetica Neue", Arial,
             "Noto Sans Arabic", "Noto Sans Hebrew",
             "Hiragino Sans", "Noto Sans JP", "Noto Sans KR", "Noto Sans SC",
             system-ui, sans-serif;
  --arb-w-light:300; --arb-w-reg:400; --arb-w-med:500; --arb-w-bold:700;

  color-scheme: light dark;

  *, *::before, *::after { border-radius:0 !important; box-shadow:none !important;
                           letter-spacing:normal !important; }

  body { background:var(--arb-paper); color:var(--arb-body); font-family:var(--arb-sans);
         font-weight:var(--arb-w-reg); text-transform:none; }

  .page > #quartz-body { display:block !important; max-width:none !important;
                         padding-block-start:var(--arb-bar) !important; }
  .page > #quartz-body > * { max-width:none !important; }

  /* ===================== THE RAIL BECOMES A BAR, AND IT IS A GRID =====================
     Corrected 2026-09-11 after rendering the first skin on a served page and measuring it.
     My first version made the rail `display:flex` with a fixed `block-size`, and the children
     spilled down the page: `.flex-component` landed at y=354 and the nav mount at y=414 with
     the bar ending at y=84. The cause is one line of the HOST's own CSS: `.sazai-rail-chrome`
     computes `display: contents`, so it is not a box — its descendants are promoted into
     whatever formatting context the rail declares, they bring their own height, and 84px does
     not hold them. The reference skin solved this before me and I had read the file:
     a GRID with named areas, so the chrome gets a row of its OWN below the bar row, every
     child is placed explicitly, and the chrome is given a real `display` so it stops being
     `contents`. No fixed height on the rail: the rows size themselves. */
  .page > #quartz-body .sidebar.left {
    order:0; position:sticky !important; inset-block-start:0; z-index:120;
    inline-size:100% !important; max-inline-size:none !important;
    display:grid !important;
    grid-template-columns:auto 1fr auto;
    grid-template-areas:"title nav search" "chrome chrome chrome";
    column-gap:1.5rem; row-gap:0; align-items:center;
    /* The host gives the rail a height of its own and the grid rows then stretch to fill
       it: measured 842px, two rows of 431 and 411, with nothing inside taller than 120.
       A bar has to say so. */
    block-size:auto !important; margin:0 !important;
    padding-inline:var(--arb-gutter) !important; padding-block:0 !important;
    background:var(--arb-paper) !important; border-block-end:1px solid var(--arb-hair) !important; }

  .sidebar.left > .page-title { grid-area:title; margin:0 !important;
    block-size:var(--arb-bar); display:flex; align-items:center; }
  .sidebar.left > .sazai-nav-menu-mount { grid-area:nav; display:flex; align-items:center;
    block-size:var(--arb-bar); }
  .sidebar.left > .flex-component { grid-area:search; display:flex !important;
    align-items:center; block-size:var(--arb-bar); }
  .sidebar.left > .sazai-rail-chrome { grid-area:chrome; display:flex !important;
    align-items:center; gap:2rem; min-block-size:var(--arb-bar);
    margin-inline:calc(-1 * var(--arb-gutter)) !important; padding-inline:var(--arb-gutter); }
  .sazai-rail-chrome > .sazai-side-menu-mount { flex:1 1 auto; min-inline-size:0; }

  /* ============ THE SIDE MENU LIES DOWN, AND THIS IS THE OTHER HALF OF THE BAR ============
     Measured 2026-09-11: with the grid alone the bar rendered 842px tall. The chrome row got a
     row of its own, correctly, and then the side-menu component kept its own vertical layout
     inside it. A bar is not a bar until the component in it lies down. 48 of the reference
     skin's 139 rules are this conversion, and it is brand-independent: what follows is that
     structure, parameterised by this skin's own tokens. Every part below is one the component
     publishes; nothing reaches into its internals. */
  sz-side-menu::part(menu), sz-side-menu::part(panel), sz-side-menu::part(variable),
  sz-side-menu::part(vault), sz-side-menu::part(pitch) {
    display:flex; flex-direction:row; align-items:center; gap:1.5rem;
    flex:0 1 auto; min-inline-size:0; min-block-size:0; block-size:auto;
    background:transparent; border:0; outline:0; box-shadow:none; padding:0; margin:0; }
  sz-side-menu::part(menu) { gap:2.5rem; }
  sz-side-menu::part(panel) { flex:1 1 auto; }
  sz-side-menu::part(variable) { flex:1 1 auto; }
  sz-side-menu::part(variable)::before { display:none; }
  sz-side-menu::part(lockup) { display:flex; align-items:center; gap:.75rem;
    margin:0; padding:0; flex:0 0 auto; min-inline-size:0; order:2; }
  sz-side-menu::part(mark) { inline-size:1.25rem; block-size:1.25rem; flex:0 0 auto; opacity:.9; }
  sz-side-menu::part(ways) { display:flex; gap:1.5rem; margin:0; font-size:.75rem;
    text-transform:uppercase; letter-spacing:.08em; font-weight:600; }
  /* the two labels are for a screen reader, not for a bar: hidden visually, never removed */
  sz-side-menu::part(controls-label), sz-side-menu::part(vault-controls-label) {
    position:absolute; inline-size:1px; block-size:1px; overflow:hidden;
    clip-path:inset(50%); white-space:nowrap; margin:0; }
  sz-side-menu::part(controls), sz-user-panel::part(toolbar) { border:0; background:transparent; }
  sz-user-panel::part(panel) { display:flex; align-items:center; gap:1rem;
    background:transparent; border:0; padding:0; margin:0; }
  sz-user-panel::part(identity) { gap:.5rem; }
  sz-user-panel::part(welcome), sz-user-panel::part(email) { font-size:.6875rem; }
  sz-user-panel::part(name) { font-size:.8125rem; }

  .sidebar.left > .page-title a { color:var(--arb-red); font-weight:var(--arb-w-bold);
    font-size:1.1875rem; text-decoration:none; }

  .sazai-nav-menu-mount > .sazai-nav-content {
    display:flex !important; gap:1.75rem; align-items:center; position:static !important;
    background:transparent !important; border:0 !important; padding:0 !important; }
  sz-nav-menu::part(row) { color:var(--arb-ink); font-weight:var(--arb-w-reg);
                           font-size:.9375rem; }
  sz-nav-menu::part(row):hover { color:var(--arb-red); }
  sz-nav-menu::part(box) { background:var(--arb-paper); border:1px solid var(--arb-hair); }

  body > .search, .sidebar.left .search { margin-inline-start:auto; }
  .search-button { background:transparent !important; border:0 !important; }
  .search-button p, .search-button svg { color:var(--arb-ink); }

  /* ===================== A STATIC PLANE ON CREAM ===================== */
  .center > .page-header { background:var(--arb-cream); padding:6rem var(--arb-gutter) 4rem; }
  .center > .page-header h1, .center article h1 {
    color:var(--arb-ink); font-size:clamp(2.5rem, 6vw, 4.5rem); line-height:.96;
    font-weight:var(--arb-w-light); text-transform:none; }

  sz-lotus { background:var(--arb-cream) !important; }
  sz-lotus::part(stage) { background:var(--arb-cream); }
  sz-lotus > [slot="title"] { color:var(--arb-ink); font-weight:var(--arb-w-light);
    font-size:clamp(2.25rem, 5.2vw, 4rem); line-height:1; }

  .center > article { max-inline-size:var(--arb-measure); padding-inline:var(--arb-gutter); }
  .center article h2 { color:var(--arb-ink); font-size:2.375rem; line-height:1.1;
                       font-weight:var(--arb-w-light); }
  .center article h3 { color:var(--arb-ink); font-size:1.4375rem; line-height:1.25;
                       font-weight:var(--arb-w-med); }
  .center article p  { font-size:1.0625rem; line-height:1.65; color:var(--arb-body); }
  .center article p > strong { color:var(--arb-red); font-weight:var(--arb-w-bold); }
  .center > hr { border:0; border-block-start:1px solid var(--arb-hair); }

  .acts { display:grid; grid-template-columns:repeat(auto-fit, minmax(15rem, 1fr)); gap:1.25rem; }
  .act { background:var(--arb-cream); padding:2rem 1.75rem; border:0;
         border-radius:var(--arb-r-click) !important; }
  .act > b    { display:block; color:var(--arb-ink); font-size:1.1875rem;
                font-weight:var(--arb-w-med); margin-block-end:.5rem; }
  .act > span { color:var(--arb-body); font-size:.96rem; }

  a, a.internal { color:var(--arb-red); text-decoration:underline;
                  text-underline-offset:.2em; text-decoration-thickness:1px; }
  a:hover { color:var(--arb-red-3); }

  sz-vault-access::part(google), sz-vault-access::part(microsoft) {
    background:var(--arb-red); color:var(--arb-paper); border:0;
    border-radius:var(--arb-r-click) !important; padding:.9rem 2rem;
    font-weight:var(--arb-w-med); text-transform:none; }
  sz-vault-access::part(google):hover, sz-vault-access::part(microsoft):hover {
    background:var(--arb-red-2); }
  sz-vault-access::part(heading) { color:var(--arb-ink); font-weight:var(--arb-w-light); }
  sz-vault-access::part(box) { border-radius:var(--arb-r-click) !important; }

  .page > #quartz-body .sidebar.right { background:var(--arb-cream); padding:2rem 1.5rem;
    border-radius:var(--arb-r-click) !important; }
  .sidebar.right h3 { color:var(--arb-ink); font-size:.9375rem; font-weight:var(--arb-w-med); }

  .page > #quartz-body > footer { background:var(--arb-ink); color:var(--arb-paper);
                                  padding-block:3.5rem; }
  sz-site-footer::part(heading) { color:var(--arb-paper); font-size:.9375rem;
                                  font-weight:var(--arb-w-med); }
  sz-site-footer::part(row) { color:var(--arb-hair); font-weight:var(--arb-w-reg); }
  sz-site-footer::part(row):hover { color:var(--arb-paper); }
  sz-site-footer::part(copyright) { color:var(--arb-hair); font-size:.8125rem; }

  sz-side-menu::part(panel) { background:var(--arb-ink); color:var(--arb-paper); border:0; }
  sz-side-menu::part(pitch) { color:var(--arb-hair); font-weight:var(--arb-w-light);
    border-inline-start:1px solid rgba(255,255,255,.25); padding-inline-start:1.5rem; }
  sz-side-menu::part(here) { color:var(--arb-red); }
  sz-user-panel::part(panel) { background:var(--arb-ink); color:var(--arb-paper); }
  sz-user-panel::part(email) { color:var(--arb-hair); }

  sz-library::part(card) { background:var(--arb-paper); border:1px solid var(--arb-hair);
                           border-radius:var(--arb-r-click) !important; }
  sz-library::part(header) { color:var(--arb-ink); font-weight:var(--arb-w-med); }

  .center article pre { background:var(--arb-ink); color:var(--arb-paper); }
  .center article :not(pre) > code { background:var(--arb-cream); color:var(--arb-red-3); }
  .center article table { border-collapse:collapse; }
  .center article th { background:var(--arb-cream); color:var(--arb-ink);
                       font-weight:var(--arb-w-med); text-align:start; }
  .center article td { border-block-start:1px solid var(--arb-hair); }
  ::selection { background:var(--arb-red); color:var(--arb-paper); }
}

:root[data-skin="arbutus"][data-theme="dark"] {
  body { background:var(--arb-ink); color:var(--arb-hair); }
  .page > #quartz-body .sidebar.left { background:var(--arb-ink) !important;
    border-block-end-color:rgba(255,255,255,.16) !important; }
  sz-nav-menu::part(row) { color:var(--arb-paper); }
  .search-button p, .search-button svg { color:var(--arb-paper); }
  .center > .page-header { background:var(--arb-ink); }
  sz-lotus, sz-lotus::part(stage) { background:var(--arb-ink) !important; }
  .center > .page-header h1, .center article h1, .center article h2, .center article h3,
  sz-lotus > [slot="title"] { color:var(--arb-paper); }
  .center article p { color:var(--arb-hair); }
  .act { background:rgba(255,255,255,.06); }
  .act > b { color:var(--arb-paper); }
  .act > span { color:var(--arb-hair); }
  a, a.internal { color:var(--arb-paper); }
  a:hover { color:var(--arb-red); }
  .page > #quartz-body .sidebar.right { background:rgba(255,255,255,.06); }
  .sidebar.right h3 { color:var(--arb-paper); }
  sz-library::part(card) { background:rgba(255,255,255,.05);
                           border-color:rgba(255,255,255,.18); }
  sz-library::part(header) { color:var(--arb-paper); }
  .center article :not(pre) > code { background:rgba(255,255,255,.08); color:var(--arb-hair); }
  .center article th { background:rgba(255,255,255,.08); color:var(--arb-paper); }
  .center article td { border-block-start-color:rgba(255,255,255,.18); }
}
