/* /core/assets/reactions.css — the reaction chips under an item, who reacted, and the add button's picker (1.20.0 Wave C3).
 * Pushed by core/components/reactions.php. Every colour, radius and font reads the theme contract's --cms-* tokens (site/themes/README.md
 * section 6) and falls back to the system colours, which follow the page's colour scheme, so a theme that defines none is readable in
 * light and dark. Rules are wrapped in :where() (zero specificity): a theme restyles any part with one plain rule. The add button's
 * picker borrows the emoji picker's card (core/assets/emoji-picker.css, pushed first) and draws it as a pill beside the button; with any
 * emoji on (1.21.0) it keeps that card whole (.cms-reactions__card), a sheet on a phone as in the editors. */

:where(.cms-reactions, .cms-reactions__tip, .cms-reactions__sheet, .cms-reactions__picker, .cms-reactions__card){--reactions-surface:var(--cms-surface, Canvas);--reactions-ink:var(--cms-text, CanvasText);--reactions-muted:var(--cms-muted, color-mix(in srgb, CanvasText 62%, Canvas));--reactions-line:var(--cms-line, color-mix(in srgb, CanvasText 22%, transparent));--reactions-sunk:var(--cms-sunk, color-mix(in srgb, CanvasText 5%, Canvas));--reactions-accent:var(--cms-accent, #2563eb);--reactions-wash:var(--cms-accent-wash, color-mix(in srgb, var(--reactions-accent) 14%, transparent))}

:where(.cms-reactions){display:flex;flex-direction:column;gap:.35rem;margin-top:.75rem;font-family:var(--cms-font, inherit)}
:where(.cms-reactions__row){display:flex;flex-wrap:wrap;align-items:center;gap:.5rem}
:where(.cms-reactions__chip){display:inline-flex;align-items:center;gap:.375rem;height:2rem;padding:0 .75rem;border:1px solid var(--reactions-line);border-radius:1rem;background:var(--reactions-sunk);color:var(--reactions-ink);font:600 .8125rem/1 var(--cms-font, inherit);font-variant-numeric:tabular-nums;cursor:pointer}
:where(.cms-reactions__chip.is-mine){border-color:var(--reactions-accent);background:var(--reactions-wash);color:var(--reactions-accent)}
:where(.cms-reactions__emoji){font-family:"Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;font-size:1rem;line-height:1}
:where(.cms-reactions__add){display:inline-grid;place-items:center;width:2rem;height:2rem;padding:0;border:1px dashed var(--cms-line-strong, var(--reactions-line));border-radius:1rem;background:var(--reactions-surface);color:var(--reactions-muted);cursor:pointer}
/* The editors' smiley with a plus in its open corner, so the button reads as "add a reaction", not "insert an emoji". */
:where(.cms-reactions__add-icon){display:block;width:1.15rem;height:1.15rem;background:currentColor;-webkit-mask:url(emoji/add.svg) center/contain no-repeat;mask:url(emoji/add.svg) center/contain no-repeat}
:where(.cms-reactions__add[aria-expanded="true"]){border-style:solid;background:var(--reactions-wash);color:var(--reactions-accent)}
:where(.cms-reactions__add[aria-expanded="true"]){border-color:var(--reactions-accent)}
:where(.cms-reactions__chip:focus-visible, .cms-reactions__add:focus-visible, .cms-reactions__close:focus-visible, .cms-reactions__act:focus-visible){outline:2px solid var(--reactions-accent);outline-offset:2px}
:where(.cms-reactions[aria-busy="true"] .cms-reactions__chip){cursor:progress}
:where(.cms-reactions[data-inert] .cms-reactions__chip, .cms-reactions:not([data-may]) .cms-reactions__chip){cursor:default}
:where(.cms-reactions__status){margin:0;color:var(--cms-danger, #b42318);font-size:.8125rem}
/* Empty, the status line stays in the accessibility tree (a live region hidden with display:none may not be announced when it fills)
 * but takes no room: out of the flow, so the row's gap is not doubled. */
:where(.cms-reactions__status:empty){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
/* Who reacted, the row's last button: the full list for anyone, also where a click reacts (a desktop) or no hover names show. */
:where(.cms-reactions__who){display:inline-grid;place-items:center;width:2rem;height:2rem;padding:0;border:1px solid transparent;border-radius:1rem;background:none;color:var(--reactions-muted);cursor:pointer}
:where(.cms-reactions__who:focus-visible){outline:2px solid var(--reactions-accent);outline-offset:2px}
:where(.cms-reactions__who-icon){display:block;width:1.1rem;height:1.1rem;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c0-3.6 2.9-6 6.5-6s6.5 2.4 6.5 6'/%3E%3Ccircle cx='17' cy='9' r='2.5'/%3E%3Cpath d='M16.5 14.2c2.9.2 5 2.2 5 5.3'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c0-3.6 2.9-6 6.5-6s6.5 2.4 6.5 6'/%3E%3Ccircle cx='17' cy='9' r='2.5'/%3E%3Cpath d='M16.5 14.2c2.9.2 5 2.2 5 5.3'/%3E%3C/svg%3E") center/contain no-repeat}

/* Who reacted, on a desktop: placed by the script through --reactions-x/--reactions-y, above the chip when it fits. */
:where(.cms-reactions__tip){position:fixed;z-index:1000;left:var(--reactions-x, 8px);top:var(--reactions-y, 8px);max-width:min(18rem, calc(100vw - 16px));padding:.5rem .65rem;border-radius:6px;background:var(--cms-ink, CanvasText);color:var(--cms-surface, Canvas);font:500 .75rem/1.4 var(--cms-font, inherit);box-shadow:var(--cms-shadow, 0 8px 24px rgba(20, 28, 45, .18));pointer-events:none}
.cms-reactions__tip[hidden]{display:none}

/* Who reacted, on a phone: a sheet along the bottom edge over a dimmed page; a card in the middle on a wider screen. The dimming is
 * --reactions-scrim, so a theme gives it the backdrop its own menus use (the contract has no --cms-* token for one). */
:where(.cms-reactions__backdrop){position:fixed;inset:0;z-index:1000;background:var(--reactions-scrim, rgba(20, 28, 45, .45))}
:where(.cms-reactions__sheet){position:fixed;z-index:1001;left:0;right:0;bottom:0;box-sizing:border-box;display:flex;flex-direction:column;gap:.75rem;max-height:80vh;overflow-y:auto;padding:1.1rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));border-radius:var(--cms-radius, 20px) var(--cms-radius, 20px) 0 0;background:var(--reactions-surface);color:var(--reactions-ink);font-family:var(--cms-font, inherit);font-size:.9375rem;box-shadow:0 -8px 24px rgba(20, 28, 45, .15)}
:where(.cms-reactions__grip){display:none}
:where(.cms-reactions__sheet-head){display:flex;align-items:center;gap:.5rem}
/* The heading carries a class's weight: the sheet sits on <body>, where a theme's bare h2 size would otherwise win. */
:where(.cms-reactions__sheet) .cms-reactions__title{flex:1;margin:0;font-family:var(--cms-font-display, inherit);font-size:1.125rem;font-weight:700;line-height:1.3;color:var(--reactions-ink)}
:where(.cms-reactions__tabs){display:flex;flex-wrap:wrap;gap:.5rem}
:where(.cms-reactions__close){flex:none;display:inline-grid;place-items:center;width:2.75rem;height:2.75rem;margin:-.4rem -.6rem -.4rem 0;padding:0;border:0;border-radius:50%;background:none;color:var(--reactions-muted);font-size:1.125rem;line-height:1;cursor:pointer}
/* The selected tab is drawn as selected, its own look; the member's own emoji keep the chips' is-mine wash, so the two never blur. */
:where(.cms-reactions__tab[aria-selected="true"]){border-color:var(--reactions-ink);box-shadow:inset 0 0 0 1px var(--reactions-ink)}
:where(.cms-reactions__names){display:flex;flex-direction:column;gap:.6rem;margin:0;padding:0;list-style:none}
:where(.cms-reactions__more){margin:0;color:var(--reactions-muted);font-size:.875rem}
:where(.cms-reactions__more:empty){display:none}
:where(.cms-reactions__act){align-self:flex-start;min-height:2.75rem;padding:0 1rem;border:1px solid var(--reactions-accent);border-radius:var(--cms-radius-sm, 8px);background:var(--reactions-accent);color:var(--cms-accent-contrast, #fff);font:600 .875rem var(--cms-font, inherit);cursor:pointer}
.cms-reactions__act[hidden]{display:none}
/* The add button's picker: core/assets/emoji-picker.js limited to the site's set (`only`) and placed by reactions.js (`place`): on every
 * screen size one pill over the add button, starting where the button starts and growing right (data-grow="right"), or, pushed left
 * by the window's edge, growing left from its right end (data-grow="left"). Its position, edges and padding are restated here because the emoji picker turns its card into a sheet
 * along the bottom on a phone; this file comes later at the same weight, so the pill wins there too. Never wider than the window: past
 * that its one row scrolls inside the pill. */
:where(.cms-reactions__picker){left:var(--emoji-x, 8px);top:var(--emoji-y, 8px);right:auto;bottom:auto;width:auto;max-width:calc(100vw - 16px);padding:.25rem;border-width:1px;border-radius:999px}
:where(.cms-reactions__picker .emoji-picker__grid){display:flex;flex-wrap:nowrap;gap:2px;overflow-x:auto;overscroll-behavior:contain;scrollbar-width:none}
:where(.cms-reactions__picker .emoji-picker__item){flex:none;width:2.25rem;border-radius:50%}
:where(.cms-reactions__picker .emoji-picker__item[aria-pressed="true"]){background:var(--reactions-wash)}
:where(.cms-reactions__picker .emoji-picker__item:focus-visible){outline:2px solid var(--reactions-accent);outline-offset:-2px}
/* Any emoji's card: the emoji picker's own card, placed and sized by it; only the member's own emoji are marked, as in the pill, in every
 * section they appear in (a pick of one takes it back). */
:where(.cms-reactions__card .emoji-picker__item[aria-pressed="true"]){background:var(--reactions-wash)}

@media (min-width:641px){
    :where(.cms-reactions__sheet){left:50%;right:auto;bottom:auto;top:50%;width:min(24rem, calc(100vw - 32px));transform:translate(-50%, -50%);border:1px solid var(--reactions-line);border-radius:var(--cms-radius, 12px)}
}
@media (max-width:640px){
    :where(.cms-reactions__picker .emoji-picker__item){width:2.75rem;height:2.75rem}
    :where(.cms-reactions__chip, .cms-reactions__add, .cms-reactions__who){height:2.75rem;min-width:2.75rem;border-radius:1.375rem}
    /* The sheet's grip: a full-width strip on its top edge that stays there while the names scroll, its bar drawn once the
       drag is wired (reactions.js). */
    :where(.cms-reactions__grip[data-sheet-grip]){display:block;position:sticky;top:-1.1rem;z-index:1;flex:none;height:1.5rem;margin:-1.1rem -1.25rem -.75rem;background:inherit;cursor:grab}
    :where(.cms-reactions__grip[data-sheet-grip])::before{content:"";display:block;width:40px;height:4px;margin:.625rem auto 0;border-radius:4px;background:var(--reactions-line)}
    :where(.cms-reactions__sheet.is-dragging){user-select:none}
}
/* A phone's sheet slides up over a scrim that fades in; reactions.js slides it down as it closes while the scrim fades out. */
@media (max-width:640px) and (prefers-reduced-motion:no-preference){
    :where(.cms-reactions__sheet){animation:reactions-sheet-in .2s ease-out}
    :where(.cms-reactions__backdrop){animation:reactions-scrim-in .2s ease-out;transition:opacity .2s ease-in}
    :where(.cms-reactions__backdrop.is-closing){opacity:0}
}
@keyframes reactions-sheet-in{from{transform:translateY(100%)}}
@keyframes reactions-scrim-in{from{opacity:0}}

/* A mouse gets a hover the add button can be seen to answer: solid, washed and in the accent, as it stays while open. A
   touch screen has no hover, and a sticky one would leave the button looking open after a tap. */
@media (hover:hover) and (pointer:fine){
    :where(.cms-reactions__add:hover){border-style:solid;background:var(--reactions-wash);color:var(--reactions-accent)}
}

@media (prefers-reduced-motion:no-preference){
    :where(.cms-reactions__chip, .cms-reactions__add){transition:background-color .12s, border-color .12s, color .12s}
    :where(.cms-reactions__add-icon){transition:transform .12s}
}
/* The pill opens by growing out of the add button (a clip that widens, so the emoji are never squashed) while the emoji pop in, one
 * after the other from the button outward. Without this block (reduced motion) it simply appears. The pill keeps no clip once open:
 * a clip held at the end would cut its shadow. */
@media (prefers-reduced-motion:no-preference){
    :where(.cms-reactions__picker[data-grow="right"]){animation:reactions-pill-right .22s cubic-bezier(.2, .8, .2, 1)}
    :where(.cms-reactions__picker[data-grow="left"]){animation:reactions-pill-left .22s cubic-bezier(.2, .8, .2, 1)}
    :where(.cms-reactions__picker .emoji-picker__item){animation:reactions-pop .26s cubic-bezier(.3, 1.4, .5, 1) backwards;animation-delay:calc(50ms + var(--reactions-i, 0) * 35ms)}
}
@keyframes reactions-pill-right{from{clip-path:inset(0 calc(100% - 2.5rem) 0 0 round 999px)}to{clip-path:inset(0 0 0 0 round 999px)}}
@keyframes reactions-pill-left{from{clip-path:inset(0 0 0 calc(100% - 2.5rem) round 999px)}to{clip-path:inset(0 0 0 0 round 999px)}}
@keyframes reactions-pop{from{opacity:0;transform:scale(.3)}70%{opacity:1;transform:scale(1.12)}to{opacity:1;transform:scale(1)}}
/* Under a mouse the pill's emoji answer the pointer (owner, 2026-11-03): the one under it rises, grows and tilts, springing a little
 * past and back. The glyph moves, not the button: the row scrolls sideways, so a moved button would be clipped at the pill's edge. */
@media (prefers-reduced-motion:no-preference) and (hover:hover) and (pointer:fine){
    :where(.cms-reactions__add:hover .cms-reactions__add-icon){transform:scale(1.12)}
    :where(.cms-reactions__picker .emoji-picker__glyph){transition:transform .18s cubic-bezier(.3, 1.6, .5, 1)}
    :where(.cms-reactions__picker .emoji-picker__item:hover .emoji-picker__glyph){transform:translateY(-3px) scale(1.25) rotate(-8deg)}
}

/* Hover looks only where there is a mouse (1.20.0): on a touch screen a tapped control kept its hover look until the
   next tap elsewhere. Kept last, as the media queries are, so each still follows the rules it followed before. */
@media (hover:hover){
    :where(.cms-reactions__chip:hover), :where(.cms-reactions__add:hover){border-color:var(--reactions-accent)}
    :where(.cms-reactions__who:hover){border-color:var(--reactions-line);color:var(--reactions-ink)}
}
