/* ============================================================
   list.css — lists in text content
   ============================================================
   Every list that is not a navigation, icon list or meta list:
     1. Lists typed in the editor with no class — automatic bullets,
        numbers and indents, so a client gets tidy lists without
        choosing anything.
     2. The classed content lists `.list--bullet` and `.list--check`,
        chosen in the builder.
   Every marker (dot, number, tick) takes `--list-marker-primary`: the
   family scopes (layout.css §3, headings.css §2) point it at the accent
   or neutral marker colour, and dark-sections.css at the dark value.
   Both follow the text alignment of what they sit in: in centred
   content the list block is centred, while the items inside keep a
   straight start edge so the markers hug the text.

   Spacing is NOT here. The air around and inside an editor list is
   set in Bricks: Style Manager › Theme Styles › Contextual spacing.
   Markers use ::before, not native ::marker, because Bricks Blocks
   default to display:flex, which hides native markers.
   Conventions: _shared/bricks-builder/css-conventions.md

   Contents
     1. Editor lists — automatic, no class
     2. Classed content lists — .list--bullet / .list--check

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


/* ------------------------------------------------------------
   1. Editor lists — automatic, no class
   ------------------------------------------------------------
   Styles a plain list typed in a Bricks Text element, in the post
   content, or in a rich subtitle (div.subtitle, Highlight Heading).
   The scoping must stay as is: limited to those wrappers AND
   :not([class]), so nav menus, the builder UI and classed lists are
   never hit. Post Content showing Bricks-built content is skipped too.
   ------------------------------------------------------------ */
/* Both kinds: an inline-level block, so the list follows the text
   alignment of its wrapper (centred text = centred list block),
   while the items keep a straight start edge. */
:is(.brxe-text, .brxe-post-content, .subtitle):not(:where([data-source="bricks"])) :is(ul, ol):not([class]) {
    display: inline-block;
    vertical-align: top;               /* no baseline gap under the list */
    max-inline-size: 100%;
    text-align: start;
}

/* Numbered lists — keep native numbers, just recolour them. */
:is(.brxe-text, .brxe-post-content, .subtitle):not(:where([data-source="bricks"])) ol:not([class]) {
    padding-inline-start: 1.5em;
}
:is(.brxe-text, .brxe-post-content, .subtitle):not(:where([data-source="bricks"])) ol:not([class]) li::marker {
    color: var(--list-marker-primary);
}

/* Bulleted lists — draw our own disc. */
:is(.brxe-text, .brxe-post-content, .subtitle):not(:where([data-source="bricks"])) ul:not([class]) {
    list-style: none;
    padding-inline-start: 0;
}
:is(.brxe-text, .brxe-post-content, .subtitle):not(:where([data-source="bricks"])) ul:not([class]) > li {
    position: relative;
    padding-inline-start: 1.5em;
}
:is(.brxe-text, .brxe-post-content, .subtitle):not(:where([data-source="bricks"])) ul:not([class]) > li::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0.7em;                        /* ≈ centre of the first line (lh 1.4) */
    transform: translateY(-50%);
    inline-size: 0.6em;
    block-size: 0.6em;
    border-radius: 50%;
    background-color: var(--list-marker-primary);
}


/* ------------------------------------------------------------
   2. Classed content lists — .list--bullet / .list--check
   ------------------------------------------------------------
   Scoped to the classes (NOT a global `ul`) so nav menus and the
   Bricks UI lists are safe.
   ------------------------------------------------------------ */
:is(.list--bullet, .list--check) {
    list-style: none;
    margin: 0;
    padding-inline-start: 0;
    inline-size: fit-content;      /* so a flex parent can centre the block */
    max-inline-size: 100%;
    display: inline-flex;          /* inline-level: follows the wrapper's text alignment */
    vertical-align: top;
    flex-direction: column;
    gap: var(--space-xs);
}

:is(.list--bullet, .list--check) > li {
    position: relative;
    padding-inline-start: 1.25em;
    text-align: start;             /* items keep a straight edge, even in centred text */
}

/* Bullet variant — disc drawn as a box so its size is controllable. */
.list--bullet > li::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0.7em;                    /* ≈ centre of the first line (lh 1.4) */
    transform: translateY(-50%);
    inline-size: 0.5em;            /* bullet diameter */
    block-size: 0.5em;
    border-radius: 50%;
    background-color: var(--list-marker-primary);
}

/* Check variant — tick drawn from an SVG mask so it takes a token colour. */
.list--check > li {
    padding-inline-start: 1.85em;  /* wider gutter for the bigger tick */
}
.list--check > li::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0.7em;                    /* ≈ centre of the first line (lh 1.4) */
    transform: translateY(-50%);
    inline-size: 1.1em;            /* tick size */
    block-size: 1.1em;
    background-color: var(--list-marker-primary);
    /* background-color shows THROUGH the mask, so the tick takes the token. */
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z'/%3E%3C/svg%3E") no-repeat center / contain;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath d='M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Divider between items — use the composable `.divider-gradient-rows`
   add-on, e.g. `class="list--check divider-gradient-rows"`. It lives with
   the rest of the divider family in layout.css → "Divider". */
