/* ══════════════════════════════════════════════════════════════════════
   CONSTELLA — icônes célestes (constella-icons.js) · 2026-10-08
   Trait fin commun, currentColor ; tailles et tons en classes.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Icône ───────────────────────────────────────────────────────────── */
.ci {
  display: inline-block; flex-shrink: 0;
  width: 1.15em; height: 1.15em; vertical-align: -.22em;
  fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
  overflow: visible;
}
.ci-xs { width: 12px; height: 12px; }
.ci-sm { width: 16px; height: 16px; }
.ci-md { width: 20px; height: 20px; }
.ci-lg { width: 32px; height: 32px; stroke-width: 1.2; }
/* à très petite taille, le trait s'épaissit légèrement pour rester net */
.ci-xs, .ci-w .ci { stroke-width: 1.5; }

/* ── Tons (palette POLARISTAR) ───────────────────────────────────────── */
.ci-gold   { color: #e6c980; }
.ci-ivory  { color: #ece6f6; }
.ci-cyan   { color: #7fd3ee; }
.ci-sky    { color: #9cc2ff; }
.ci-violet { color: #b9a6ff; }
.ci-white  { color: #fffaf0; }
.ci-leaf   { color: #a9d48f; }
.ci-rose   { color: #f0a3bd; }
.ci-amber  { color: #f2b56a; }

/* ── Remplacement automatique d'un emoji ─────────────────────────────── */
/* Enveloppe en ligne : l'icône prend la place du caractère, le caractère
   d'origine reste lisible par les lecteurs d'écran et par textContent. */
.ci-w { display: inline-flex; align-items: center; justify-content: center; vertical-align: -.18em; line-height: 1; }
.ci-w .ci { vertical-align: 0; }
.ci-sr {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
/* Lune : léger halo de lumière, comme sur le cadran */
.ci-w[data-ci^="moon-"] .ci { filter: drop-shadow(0 0 3px rgba(236,230,246,.35)); }
.ci-w[data-ci="sun"] .ci { filter: drop-shadow(0 0 3px rgba(230,201,128,.4)); }
/* Enseignes de cartomancie : gardent la couleur du texte (rouge / noir de la carte) */
.ci-w[data-ci^="suit-"] { color: inherit; }
/* Icône seule dans une grande pastille (font-size élevée) : rien à faire, elle suit l'em */

/* Icône dessinée dans un SVG (cadran, roue) à la place d'un <text> */
.ci-svgt { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }

/* ── États interactifs (icône dans un élément cliquable) ─────────────── */
:is(button, a, [role="button"], [onclick]) .ci-w .ci,
:is(button, a, [role="button"]) > .ci {
  transition: transform .25s cubic-bezier(.2,.8,.2,1), filter .25s;
}
:is(button, a, [role="button"], [onclick]):hover .ci-w .ci,
:is(button, a, [role="button"]):hover > .ci,
:is(button, a, [role="button"]):focus-visible .ci {
  transform: translateY(-1px);
  filter: drop-shadow(0 0 4px color-mix(in srgb, currentColor 55%, transparent));
}

/* Les glyphes conservés (♀ ♂ ☉ ☽ …) restent en présentation « texte », jamais emoji */
html.ci-on body { font-variant-emoji: text; }
html.ci-on :is(.pm-unit, #ps-pm-scroll, #pg-root, textarea, input) { font-variant-emoji: normal; }

@media (prefers-reduced-motion: reduce) {
  .ci, .ci-w .ci { transition: none !important; }
  :is(button, a, [role="button"], [onclick]):hover .ci-w .ci { transform: none; }
}
