/* Notes en étoiles des lecteurs (templates/partials/rating.php, public/js/notes.js).
   Cosmic-dark par défaut ; .nt--light pour la page claire /theme-astral.
   Aucun style en ligne : compatible avec la CSP stricte style-src 'self'. */

.nt {
  --nt-text: #f5f5f7;
  --nt-soft: #a1a1aa;
  --nt-faint: rgba(196, 181, 253, 0.32);
  --nt-line: rgba(255, 255, 255, 0.12);
  --nt-panel: rgba(255, 255, 255, 0.035);
  --nt-accent: #c4b5fd;
  --nt-glow: rgba(139, 92, 246, 0.55);
  --nt-link: #c4b5fd;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--nt-text);
}

.nt--light {
  --nt-text: #211b32;
  --nt-soft: #655d73;
  --nt-faint: rgba(116, 49, 170, 0.35);
  --nt-line: #dcd3e8;
  --nt-panel: #f5f0fa;
  --nt-accent: #7431aa;
  --nt-glow: rgba(116, 49, 170, 0.25);
  --nt-link: #7431aa;
}

.nt-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.nt-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.nt-row { display: inline-flex; align-items: center; }
.nt-svg { display: block; overflow: visible; }
.nt-empty { fill: none; stroke: var(--nt-faint); stroke-width: 1.1; stroke-linejoin: round; }
.nt-full { stroke: none; }

/* --- Résumé compact sous un titre ------------------------------------- */
a.nt--compact {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 0.6rem;
  font-size: 0.9rem; color: var(--nt-soft);
  text-decoration: none;
  border: 0;
}
.nt--compact .nt-star { position: static; padding: 0; }
.nt--compact .nt-row { gap: 2px; }
.nt--compact strong { color: var(--nt-text); font-weight: 600; }
.nt--compact:hover .nt-compact__text { color: var(--nt-text); text-decoration: underline; text-underline-offset: 3px; }
.nt--compact:focus-visible { outline: 2px solid var(--nt-accent); outline-offset: 4px; border-radius: 4px; }

/* --- Encart de vote --------------------------------------------------- */
.nt--box {
  display: grid;
  /* Colonnes bornees : un message long sous les etoiles (vote enregistre, admin)
     ne doit jamais ecraser la colonne du titre. */
  grid-template-columns: minmax(14rem, 1fr) minmax(0, 20rem);
  grid-template-areas: "intro form";
  align-items: center;
  column-gap: 2.5rem;
  row-gap: 1.1rem;
  margin: 3rem auto 0;
  max-width: 760px;
  padding: 1.75rem 2rem 1.4rem;
  border: 1px solid var(--nt-line);
  border-radius: 20px;
  background: var(--nt-panel);
  scroll-margin-top: 6rem;
}
.nt-intro { grid-area: intro; }
.nt-form { grid-area: form; display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; }
.nt-legal { grid-area: legal; }

.nt-q {
  margin: 0;
  font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  font-weight: 500;
  font-size: clamp(1.6rem, 3vw, 2rem);
  line-height: 1.15;
  color: var(--nt-text);
}
.nt--light .nt-q { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; }
.nt-sub { margin: 0.45rem 0 0; font-size: 0.95rem; line-height: 1.5; color: var(--nt-soft); }
.nt-demo {
  display: inline-block;
  margin: 0.8rem 0 0; padding: 0.3rem 0.65rem;
  border: 1px dashed var(--nt-accent); border-radius: 8px;
  font-size: 0.82rem; color: var(--nt-accent);
}

.nt-field { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; align-items: center; }

/* Les étoiles reliées par un trait de constellation, qui s'allume avec elles. */
.nt-row--vote { gap: 14px; }
.nt-star {
  position: relative;
  display: block;
  padding: 4px;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nt-row--vote .nt-star + .nt-star::before {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(100% - 2px);
  width: 18px;
  height: 1px;
  background: var(--nt-faint);
  opacity: 0.6;
  transition: background 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}
.nt-row--vote .nt-star.is-lit + .nt-star.is-lit::before {
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  opacity: 1;
  box-shadow: 0 0 6px var(--nt-glow);
}
.nt-star .nt-svg { transition: transform 0.18s ease, filter 0.2s ease; }
.nt-star.is-lit .nt-svg { filter: drop-shadow(0 0 6px var(--nt-glow)); }
.nt-star.is-preview .nt-svg { transform: scale(1.12); }
.nt-star:has(input:focus-visible) { outline: 2px solid var(--nt-accent); outline-offset: 2px; }

.nt-hint { min-height: 1.3em; margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--nt-accent); letter-spacing: 0.01em; }

.nt-send {
  margin-top: 0.6rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--nt-accent);
  border-radius: 999px;
  background: transparent;
  color: var(--nt-text);
  font: inherit; font-size: 0.9rem;
  cursor: pointer;
}
.nt-send:hover { background: rgba(139, 92, 246, 0.16); }
.nt-send:focus-visible { outline: 2px solid var(--nt-accent); outline-offset: 3px; }
/* Le clic vote directement : le bouton ne sert qu'au clavier (et jamais sans JavaScript). */
.nt .nt-send { display: none; }
.nt.is-js.is-keyboard .nt-send { display: inline-block; }

.nt-score { margin: 0.55rem 0 0; font-size: 1rem; font-weight: 500; color: var(--nt-text); text-align: center; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.nt-status { margin: 0.2rem 0 0; min-height: 1.2em; font-size: 0.92rem; color: var(--nt-text); text-align: center; }
.nt-status:empty { display: none; }

.nt-legal {
  margin: 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--nt-line);
  font-size: 0.8rem; line-height: 1.5; color: var(--nt-soft);
}
.nt-legal a { color: var(--nt-link); text-underline-offset: 3px; }

/* Vote fait, ou vote de l'équipe : les étoiles montrent la moyenne, sans interaction. */
.nt.is-done .nt-star { cursor: default; }
.nt.is-done .nt-send, .nt.is-done .nt-hint { display: none; }
.nt-field:disabled .nt-star { cursor: default; }

/* Un seul moment animé : l'onde qui traverse les étoiles choisies après le vote. */
@keyframes nt-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.22); }
  100% { transform: scale(1); }
}
.nt-star.is-voted .nt-svg { animation: nt-pulse 0.5s ease both; }
.nt-star.is-voted:nth-child(2) .nt-svg { animation-delay: 0.06s; }
.nt-star.is-voted:nth-child(3) .nt-svg { animation-delay: 0.12s; }
.nt-star.is-voted:nth-child(4) .nt-svg { animation-delay: 0.18s; }
.nt-star.is-voted:nth-child(5) .nt-svg { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  .nt-star .nt-svg, .nt-row--vote .nt-star + .nt-star::before { transition: none; }
  .nt-star.is-voted .nt-svg { animation: none; }
  .nt-star.is-preview .nt-svg { transform: none; }
}

@media (max-width: 640px) {
  .nt--box {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "form";
    text-align: center;
    margin-top: 2.5rem;
    padding: 1.5rem 1rem 1.2rem;
  }
  .nt-row--vote { gap: 10px; }
  .nt-row--vote .nt-star + .nt-star::before { width: 14px; }
}

/* Encart ajouté par le layout en bas des pages importantes. */
.nt-wrap { padding: 0 1rem 3.5rem; }


/* --- Version minimaliste (20/10/2026, demande de Paul) : une simple ligne a droite
   sous le contenu, facon KK Star Ratings : etoiles cliquables + « 4,8/5 - (12 votes) ».
   Pas de cadre, pas de titre visible (il reste pour les lecteurs d'ecran). --- */
.nt--box {
  display: block;
  max-width: none;
  margin: 2rem 0 0;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 0;
}
.nt--box .nt-form {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  column-gap: 0.9rem;
  row-gap: 0.2rem;
  text-align: right;
}
.nt--box .nt-field { margin: 0; padding: 0; border: 0; min-width: 0; }
.nt--box .nt-row--vote { gap: 4px; }
.nt--box .nt-row--vote .nt-star + .nt-star::before { display: none; }
.nt--box .nt-score { margin: 0; font-size: 1.05rem; font-weight: 500; color: var(--nt-text); white-space: nowrap; }
.nt--box .nt-hint { display: none; }
.nt--box .nt-status { flex-basis: 100%; margin: 0; font-size: 0.8rem; text-align: right; }
.nt--box .nt-status:empty { display: none; }
.nt-wrap .nt--box { max-width: 1120px; margin: 0 auto; }
@media (max-width: 640px) {
  .nt--box { margin-top: 1.6rem; padding: 0; }
  .nt--box .nt-form { justify-content: center; text-align: center; }
  .nt--box .nt-status { text-align: center; }
}

/* Ligne placée par la page juste sous son bloc principal (partials/rating-inline.php),
   alignée à droite de la colonne de contenu ; --nt-col = largeur d'un outil centré. */
.nt-slot { max-width: var(--nt-col, none); margin: 1.5rem auto 0; }
.nt-slot .nt--box { margin: 0; }
/* /theme-astral : sous le formulaire, dans sa colonne. */
.form-column > .nt--box { margin-top: 1.4rem; }
/* Horoscope d'un signe : entre deux sections séparées par un filet, même respiration dessus et dessous. */
.hgs-layout .nt-slot { margin: 0 0 3rem; }
