/* =====================================================================
   Opera Populi : groupes publics et vote (addendum V3, sections 3 et 4),
   case de réponse des groupes à préciser ou à relier, appels du journal
   ===================================================================== */

/* ---------- Liste des groupes (invité : top 10 ; membre : onglet "Voter pour des idées") ---------- */
.group-list { display: grid; gap: var(--sp-3); }
.group {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .75rem 1rem;
  padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.group:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.group__main { display: grid; gap: .4rem; min-width: 0; }
.group__head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.group__rank { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: var(--fw-bold); line-height: 1; color: var(--accent-text); }
.group__title { font-size: var(--fs-md); line-height: 1.3; overflow-wrap: anywhere; }
.group__summary { font-size: var(--fs-sm); color: var(--text-muted); overflow-wrap: anywhere; }
/* Question publique d'un groupe "À préciser" (data-tone warn) ou "À relier" (info), au ton de son étiquette */
.group__question { font-size: var(--fs-sm); font-style: italic; color: var(--tone-fg); overflow-wrap: anywhere; }
.group__meta { display: inline-flex; align-items: center; gap: .35rem; font-size: var(--fs-xs); color: var(--text-muted); }
.group__meta:empty { display: none; }
/* Case de réponse sous la question (ui/group-reply.js) : toute la largeur de la carte, sous le bouton de vote ; texte
   d'aide seul pour un invité, un compte anonyme ou un email à valider */
.group-reply { grid-column: 1 / -1; padding-top: .75rem; border-top: 1px dashed var(--line-strong); }
.group-reply__help { font-size: var(--fs-xs); color: var(--text-muted); }
.group-reply__form { --gap: var(--sp-3); }
.group-reply__input { min-height: 5.5rem; resize: vertical; }
.group-reply__form .btn { justify-self: start; }
/* Amélioration d'un groupe (ui/group-reply.js) : bouton sous la carte, case ouverte en dessous (même style). */
.group-improve { grid-column: 1 / -1; display: grid; gap: .5rem; min-width: 0; }
.group-improve__toggle { justify-self: start; max-width: 100%; white-space: normal; text-align: left; } /* libellé long : sur 2 lignes sur smartphone, jamais de débordement */
.group-improve__toggle[aria-expanded="true"] { background: var(--accent-soft); }

/* Bouton de vote : pouce + nombre de votes ; aria-pressed = "voté" (clic : annulation) */
.vote-btn {
  display: inline-grid; justify-items: center; align-content: center; gap: .1rem;
  min-width: 3.4rem; min-height: 3.4rem; padding: .4rem .55rem;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface);
  color: var(--text); font-weight: var(--fw-bold); font-size: var(--fs-sm); line-height: 1;
  transition: background-color var(--dur), border-color var(--dur), color var(--dur);
}
.vote-btn .icon { width: 1.25rem; height: 1.25rem; }
.vote-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-text); }
.vote-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.vote-btn[aria-pressed="true"]:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.vote-btn:disabled { cursor: not-allowed; opacity: .55; }
.vote-btn[aria-busy="true"] { cursor: progress; }
.vote-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Panneau "Voter pour des idées" (onglet du panneau Proposer) */
.panel > .tabs { margin-bottom: var(--sp-5); }
.tabs[data-active="vote"]::before { translate: 100% 0; }
.vote-panel { display: grid; gap: var(--sp-4); }
.vote-panel__quota { font-size: var(--fs-sm); color: var(--text-muted); }
.vote-panel__quota strong { font-family: var(--font-display); font-size: var(--fs-xl); color: var(--text); }
.vote-panel__block { display: grid; gap: .6rem; justify-items: start; padding: .75rem .9rem; border-radius: var(--r-md); background: var(--tone-bg); color: var(--tone-fg); font-size: var(--fs-sm); }
.vote-panel .group { grid-template-columns: minmax(0, 1fr) auto; padding: .85rem .9rem; }
.vote-panel .empty { padding: var(--sp-6) var(--sp-4); }

/* Invité : "Les idées les plus demandées" (juste après le hero) */
.top-ideas .group-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.auth-card__notice { padding: .6rem .8rem; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.auth-card__notice[data-tone] { background: var(--tone-bg); color: var(--tone-fg); }

/* ---------- Journal : appels à précision (ton warn) et appels à relier (ton info) ---------- */
.note-list { display: grid; gap: .6rem; font-size: var(--fs-sm); }
.note-list li { display: grid; gap: .15rem; padding: .6rem .8rem; border-radius: var(--r-sm); background: var(--tone-bg); color: var(--tone-fg); }
.note-list strong { font-weight: var(--fw-bold); }
