/*  Reactions under a post (Pages/Reactions/_PostReactions.cshtml; Core/Reactions).

    A chip per emoji with its count, then "React" and "Who reacted", at the left of the row
    under a post; the post's own buttons stay at the right. Only custom properties from
    site.css.

    The block itself is no box (display: contents): its chips and buttons are items of the
    post's row (.post-actions, threads.css), so on a phone they wrap one by one and the
    post's buttons share the last line with whatever is left, instead of every group
    taking a line of its own.

    A chip that is the reader's own is told apart by its accent border, its ground and
    bold count, never by color alone (it is aria-pressed too).

    "React" is a <details>: its panel hangs over the page under the button, and starts at
    the row's left edge so it stays on a phone's screen wherever the button has wrapped to
    (editor/reactions.js measures that into --react-left; without scripts the panel hangs
    under the whole row).
    The panel holds the five standard emoji; editor/reactions.js adds the recent ones, a
    "More" button and, when that is pressed, the shared emoji picker (styled in
    editor.css, .rf-symbols). */
.reactions, .reactions-form { display: contents; }
/* A row with reactions starts at the left; the post's buttons are pushed right (.post-buttons). */
.post-actions:has(.reactions) { justify-content: flex-start; position: relative; }

/* A chip is a small round pill, the same at every width (Alex, 2026-11-16, of 44 px boxes
   with dark borders on a phone: "This doesnt look great"). */
.reaction {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 44px; height: 30px; margin: 7px 0; padding: 0 8px;
  border: 1px solid var(--line); border-radius: var(--radius-round);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13px; line-height: 1;
}
button.reaction { cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* A finger still gets 44 px to aim at: the pill's own area reaches above and below it,
   into its margin, so two rows of chips never overlap. */
button.reaction::after { content: ""; position: absolute; inset: -8px 0; }
button.reaction:focus-visible, .react-choice:focus-visible, .react-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.reaction.is-mine { border-color: var(--accent); background: var(--band); font-weight: 700; }
.reaction[aria-busy="true"] { opacity: 0.6; }
.reaction-emoji { font-family: var(--font-emoji); font-size: 16px; font-weight: 400; }
.reaction-count { font-variant-numeric: tabular-nums; }

/* A chip that is a link (a visitor's: it opens who reacted) looks like any chip. */
a.reaction { text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a.reaction::after { content: ""; position: absolute; inset: -8px 0; }
a.reaction:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Pressing and holding a chip opens who reacted (reactions.js): no text selection or callout meanwhile. */
.reaction { -webkit-touch-callout: none; user-select: none; }

/* The names shown when a chip is pointed at or reached by keyboard (reactions.js): one
   small bubble for the page, placed over the chip. */
.reaction-tip {
  position: fixed; z-index: 60; max-width: min(280px, calc(100vw - 16px)); padding: 6px 10px;
  border: 1px solid var(--card-line); border-radius: var(--radius-small);
  background: var(--surface-raised); box-shadow: var(--elev-3); color: var(--ink);
  font-size: 13px; line-height: 1.35; pointer-events: none; overflow-wrap: anywhere;
}
.reaction-tip[hidden] { display: none; }
.reaction-tip strong { font-weight: 700; }

/* Who reacted (Pages/Reactions/Who): an emoji with its count, then the members who chose it. */
.who-reacted { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.who-kind { display: flex; flex-direction: column; gap: 8px; }
.who-head { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; }
.who-head .reaction-emoji { font-size: 22px; }
.who-count { color: var(--muted); font-family: var(--font); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.who-list { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0; list-style: none; }
.who-person { display: flex; align-items: center; gap: 8px; min-height: 44px; min-width: 0; overflow-wrap: anywhere; }
.who-kind > .muted { margin: 0; }

/* What just happened, when it was refused: one quiet line under the chips. */
.reaction-note:not(.visually-hidden) { flex: 0 0 100%; margin: 4px 0 0; padding: 6px 10px; font-size: 14px; }

.react { display: inline-flex; }
html.js .react { position: relative; }
.react > summary { list-style: none; cursor: pointer; min-width: 44px; padding: 0 12px; }
.react > summary::-webkit-details-marker { display: none; }
.post-actions .react[open] > summary { background: var(--band); color: var(--ink); }

.react-panel {
  position: absolute; top: calc(100% + 6px); left: var(--react-left, 0px); z-index: 10;
  width: max-content; max-width: min(480px, calc(100vw - 48px)); padding: 6px;
  border: 1px solid var(--card-line); border-radius: var(--radius-small);
  background: var(--surface-raised); box-shadow: var(--elev-3);
}
.react-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.react-choice, .react-more { border: 1px solid transparent; }
.react-choice.is-mine { border-color: var(--ink); background: var(--band); }
.react-line { align-self: stretch; width: 1px; margin: 8px 4px; background: var(--line); }
.react-more { color: var(--muted); }
/* "More" was pressed: the picker takes the panel. */
.react-panel.has-picker { width: min(340px, calc(100vw - 48px)); }
.react-panel.has-picker .react-quick { display: none; }

/* A post with "React" open lets the panel hang over the posts below (as its "…" menu does, threads.css). */
.post:has(.react[open]) { overflow: visible; position: relative; z-index: 3; }

@media (hover: hover) {
  button.reaction:hover, a.reaction:hover { background: var(--band); }
}
/* A mouse needs less to aim at. */
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .reaction { min-width: 0; }
  button.reaction::after, a.reaction::after { content: none; }
}
