/* ==========================================================================
   SECTION HEAD (.verser-sec-head): a section's eyebrow over a list or grid, with a count and a trailing action.
   CSS only.

   Default look = the app's eyebrow .k after minimal.css (about 93 uses): JetBrains Mono 12px/500, no tracking (since 27 Oct),
   muted text. The row around it follows ui-kit .sec-head: at least 40px, the action at the inline end.

     .verser-sec-head-label    the eyebrow (use an h2/h3 when it heads a section)
     .verser-sec-head-count    a mono count beside it; hidden when empty
     .verser-sec-head-action   a trailing link-coloured action (button or a); 36px, 44px hit area on touch
     .verser-btn               or a kit button (any variant and size, e.g. secondary sm with a plus for "Add …"): it
                               keeps its own look and sits at the inline end, centred on the label (mirrors in Arabic)

   data-variant="fold": the whole head is the button that folds its section (the Tasks group heads). Put the class
   on the <button aria-expanded aria-controls> (inside an h2/h3 when it heads a section) with the label, the count and
   a trailing .verser-sec-head-chev (a right-pointing chevron icon). 44px tall, 4px sides, 8px gaps, no fill; the
   chevron (18px, at the inline end) points down while aria-expanded="true" and to the inline end while folded
   (mirrored in right-to-left). No margin of its own (the wrapping heading or section spaces it). The app's markup: h3.task-list-head > button.task-group-toggle.

   .verser-sec-head-row: a fold head with a trailing kit button (a project's sections: Add task). The button cannot sit
   inside the fold button, so the row holds both: <div class="verser-sec-head-row"><h3>(the fold head)</h3>
   <button class="verser-btn" data-variant="secondary" data-size="sm">…</button></div>. The heading takes the room;
   the button keeps its own look at the inline end (mirrors in Arabic). In a row under 400px (a phone, a desktop list
   beside its pane) the button shows its icon alone, square, so the section's name keeps the room; give it an
   aria-label and a title that say what it adds.
   ========================================================================== */

.verser-sec-head{
  box-sizing:border-box;display:flex;align-items:center;gap:var(--verser-section-head-gap,var(--space-2));
  min-block-size:var(--verser-section-head-min-height,40px);
  margin-block:var(--verser-section-head-margin-block,var(--space-4) var(--space-2));margin-inline:0;padding-inline:2px
}
.verser-sec-head-label{
  display:inline-flex;align-items:center;gap:6px;margin:0;
  font-family:var(--verser-section-head-font,var(--font-mono));font-size:var(--verser-section-head-font-size,12px);
  font-weight:var(--verser-section-head-font-weight,500);letter-spacing:var(--verser-section-head-letter-spacing,.06em);
  line-height:1.3;color:var(--verser-section-head-text,var(--text-muted))
}
.verser-sec-head-label>svg,.verser-sec-head-label .icon{inline-size:15px;block-size:15px}
/* The mono has no Arabic and tracking pulls Arabic letters apart: Arabic and right-to-left text use the UI face. */
.verser-sec-head-label:is(:lang(ar),:dir(rtl)){font-family:var(--font-mono-rtl);letter-spacing:0;text-transform:none}
.verser-sec-head-count{
  font-family:var(--font-mono);font-size:var(--verser-section-head-font-size,12px);font-weight:500;
  color:var(--verser-section-head-count,var(--text-secondary));font-variant-numeric:tabular-nums
}
.verser-sec-head-count:empty{display:none}
.verser-sec-head-count:is(:lang(ar),:dir(rtl)){font-family:var(--font-mono-rtl);letter-spacing:0}
.verser-sec-head-action{
  position:relative;box-sizing:border-box;display:inline-flex;align-items:center;gap:6px;
  min-block-size:var(--control-height-sm);margin-block:0;margin-inline:auto calc(var(--space-2) * -1);
  padding-block:0;padding-inline:var(--space-3);border:0;border-radius:var(--radius-pill);background:none;
  color:var(--vx-violet-text);font:inherit;font-family:var(--font-ui);font-size:var(--font-size-small);font-weight:600;text-decoration:none;
  cursor:pointer;-webkit-tap-highlight-color:transparent
}
.verser-sec-head-action>svg,.verser-sec-head-action .icon{inline-size:16px;block-size:16px}
.verser-sec-head-action:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring);outline-offset:var(--focus-ring-offset)}
.verser-sec-head-action:active{opacity:.6}
@media (pointer:coarse){.verser-sec-head-action::after{content:"";position:absolute;inset-block:min(0px,calc((100% - var(--tap-min)) / 2));inset-inline:0}}
@media (hover:hover) and (pointer:fine){.verser-sec-head-action:hover{background:var(--surface-fill-1)}}

/* ---- A kit button as the trailing action: its own look, at the inline end ---- */
.verser-sec-head>.verser-btn:not(.verser-sec-head-action){flex:none;margin-block:0;margin-inline:auto 0}

/* ---- A fold head and a kit button side by side ---- */
.verser-sec-head-row{display:flex;align-items:center;gap:var(--space-2);min-inline-size:0}
.verser-sec-head-row>:first-child{flex:1 1 auto;min-inline-size:0}
.verser-sec-head-row>.verser-btn{flex:none}
.verser-sec-head-row{container:verser-sec-head-row / inline-size}
@container verser-sec-head-row (max-width:399px){
  .verser-sec-head-row>.verser-btn:has(>svg){inline-size:var(--control-height-sm);padding-inline:0}
  .verser-sec-head-row>.verser-btn:has(>svg)>span{display:none}
}

/* ---- Fold variant: the head is one button ---- */
.verser-sec-head[data-variant="fold"]{
  position:relative;inline-size:100%;min-block-size:var(--verser-section-head-fold-min-height,var(--tap-min));margin:0;
  padding-block:0;padding-inline:var(--verser-section-head-fold-padding-inline,var(--space-1));
  border:0;border-radius:var(--verser-section-head-fold-radius,var(--radius-sm));background:none;color:inherit;
  font:inherit;text-align:start;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation
}
.verser-sec-head[data-variant="fold"]:focus-visible{outline:var(--focus-ring-width) solid var(--focus-ring);outline-offset:var(--focus-ring-offset)}
.verser-sec-head[data-variant="fold"]:disabled{cursor:default}
.verser-sec-head-chev{
  flex:none;inline-size:var(--verser-section-head-chev-size,18px);block-size:var(--verser-section-head-chev-size,18px);
  margin-inline-start:auto;color:var(--verser-section-head-chev,var(--text-secondary));
  transform:rotate(90deg);transition:transform 160ms var(--ease-out)
}
.verser-sec-head-chev>svg,.verser-sec-head-chev .icon{display:block;inline-size:100%;block-size:100%}
.verser-sec-head[aria-expanded="false"] .verser-sec-head-chev{transform:none}
.verser-sec-head[aria-expanded="false"] .verser-sec-head-chev:dir(rtl){transform:scaleX(-1)}
[dir="rtl"] .verser-sec-head[aria-expanded="false"] .verser-sec-head-chev{transform:scaleX(-1)}
@media (prefers-reduced-motion:reduce){.verser-sec-head-chev{transition:none}}

/* ---- Group variant (data-variant="group", 2 Nov 2026): a sub-group inside a section (Projects grouped by status). The
   UI face at the small size in the secondary text, a leading glyph (a status glyph colours itself), tighter room. ---- */
.verser-sec-head[data-variant="group"]{min-block-size:32px;margin-block:var(--space-3) var(--space-2)}
.verser-sec-head[data-variant="group"] .verser-sec-head-label{font-family:var(--font-ui);font-size:var(--font-size-small);
  font-weight:var(--vx-fw-semibold);letter-spacing:0;color:var(--text-secondary)}
