/*
 * comment.css — formulaire de depot inline PUBLIC (front wandaloo, DARK MODE).
 * Style templates/comment-form.php. Namespace wl-comment-* / wl-cm-*.
 * Tons alignes sur le theme sombre (forum-list-2025.css). Accent charte #DD4925.
 */

.wl-comment-form {
  width:100%; max-width:640px; margin:30px auto;
  font-size:15px; line-height:1.5; box-sizing:border-box;
}
.wl-comment-form *, .wl-comment-form *::before, .wl-comment-form *::after { box-sizing:border-box; }

/* --- Carte sombre : avatar + corps --- */
.wl-cm-box {
  display:flex; gap:12px;
  background:#2E353E; border:1px solid #3d4550; border-radius:12px;
  padding:16px 18px;
}
.wl-cm-avatar {
  flex-shrink:0; width:38px; height:38px; border-radius:50%;
  background:rgba(221,73,37,.15); color:#DD4925;
  display:flex; align-items:center; justify-content:center;
}
.wl-cm-body { flex:1; min-width:0; }

/* --- Textarea auto-grow (JS gere la hauteur) --- */
.wl-comment-form textarea {
  display:block; width:100%; min-height:38px; resize:none; overflow:hidden;
  padding:8px 12px; border:1px solid #3d4550; border-radius:8px;
  background:#242830; font-family:inherit; font-size:15px; line-height:1.5; color:#e6e6e6;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.wl-comment-form textarea:focus {
  outline:none; border-color:#DD4925; box-shadow:0 0 0 2px rgba(221,73,37,.2);
}
.wl-comment-form textarea::placeholder { color:#7d8794; }

/* --- Champs nom/email : caches, revelés au focus par JS --- */
.wl-cm-extra { max-height:0; overflow:hidden; transition:max-height .28s ease; }
.wl-cm-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px; }
.wl-comment-form input[type="text"],
.wl-comment-form input[type="email"] {
  display:block; width:100%; padding:9px 12px;
  border:1px solid #3d4550; border-radius:8px; background:#242830;
  font-family:inherit; font-size:14px; color:#e6e6e6;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.wl-comment-form input[type="text"]:focus,
.wl-comment-form input[type="email"]:focus {
  outline:none; border-color:#DD4925; box-shadow:0 0 0 2px rgba(221,73,37,.2);
}
.wl-comment-form input::placeholder { color:#7d8794; }

/*
 * --- Selecteur d'humeur : rangee discrete de 9 emojis (friction minimale) ---
 * Au repos : boutons ternes, sans fond. Survol : leger eclaircissement.
 * Selectionne (.wl-cm-humeur-on) : accent charte #DD4925. Un seul actif.
 */
.wl-cm-humeur { display:flex; flex-wrap:wrap; gap:4px; margin-top:12px; }
/* Chaque bouton = bloc vertical centre : emoji au-dessus, libelle en dessous. */
.wl-cm-humeur-btn {
  display:flex; flex-direction:column; align-items:center; gap:3px;
  border:1px solid transparent; border-radius:8px; background:none;
  padding:3px 8px; font-size:25px; line-height:1; cursor:pointer;
  filter:grayscale(.4); opacity:.75; transition:filter .12s ease, opacity .12s ease, background-color .12s ease, border-color .12s ease;
}
.wl-cm-humeur-emo { line-height:1; }
/* Libelle : tres discret au repos (#7d8794), passe en accent charte quand selectionne. */
.wl-cm-humeur-lbl { font-size:10px; line-height:1.1; color:#7d8794; transition:color .12s ease; }
.wl-cm-humeur-btn:hover { filter:none; opacity:1; background:#242830; }
.wl-cm-humeur-btn:focus-visible { outline:none; border-color:#DD4925; box-shadow:0 0 0 2px rgba(221,73,37,.2); }
.wl-cm-humeur-on, .wl-cm-humeur-on:hover {
  filter:none; opacity:1;
  background:rgba(221,73,37,.15); border-color:#DD4925;
}
.wl-cm-humeur-on .wl-cm-humeur-lbl { color:#DD4925; }

/* --- Barre d'action : cachee, revelée au focus par JS --- */
.wl-cm-actions {
  max-height:0; overflow:hidden; transition:max-height .28s ease;
  display:flex; align-items:center; justify-content:space-between;
}
.wl-cm-actions.wl-cm-open { max-height:70px; margin-top:14px; }
.wl-cm-extra.wl-cm-open   { max-height:240px; } /* desktop : 1 ligne (~107px) ; mobile : nom/email empiles + humeur sur 2 lignes (~194px, cas dimensionnant) + marge erreurs */
.wl-cm-hint { display:inline-flex; align-items:center; gap:5px; font-size:12px; color:#7d8794; }
.wl-cm-hint svg { flex-shrink:0; }

/* --- Bouton --- */
.wl-comment-submit {
  padding:9px 24px; border:none; border-radius:8px;
  background:#DD4925; color:#fff; font-family:inherit; font-size:15px; font-weight:600;
  cursor:pointer; transition:background-color .15s ease, opacity .15s ease;
}
.wl-comment-submit:hover { background:#c23d1d; }
.wl-comment-submit:disabled, .wl-comment-submit[disabled] { opacity:.6; cursor:not-allowed; background:#DD4925; }

/*
 * --- Erreur de champ obligatoire (reprise visuelle de custom-err legacy) ---
 * Meme rendu que jQuery Validation legacy : rouge #900, 10px, sous le champ.
 */
.wl-comment-form input.wl-cm-invalid { border-color:#A94442; box-shadow:0 0 0 2px rgba(169,68,66,.2); }
.wl-cm-err { grid-column:1 / -1; margin:2px 0 0; font-size:12px; color:#A94442; }

/* --- Etat vide : aucun commentaire (remplace l'alerte Bootstrap legacy) --- */
.wl-cm-empty {
  max-width:640px; margin:0 auto 30px; padding:18px;
  background:#272C34; border-radius:12px; text-align:center;
}
.wl-cm-empty p { margin:0; font-size:15px; color:#8f98a3; }
.wl-cm-empty p.wl-cm-empty-cta { margin-top:6px; font-size:14px; color:#DD4925; }

/* Bandeau legacy .comment-header : masque quand vide (aucun commentaire) */
.comment-header:empty { display:none; }

/*
 * --- Honeypot anti-bot : hors ecran, RESTE dans le DOM ---
 * Regle NON negociable (le style inline a ete retire du template : il vit ICI).
 */
.wl-cm-hp { position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden; }

/* --- Zone feedback (succes neutre / erreur) --- */
.wl-comment-msg { margin:10px 0 0; font-size:14px; }
.wl-comment-msg:empty { margin:0; }
.wl-comment-msg.is-ok    { padding:8px 12px; border:1px solid #2f5a3a; border-radius:6px; background:#1e3324; color:#7fca92; margin-bottom:10px; }
.wl-comment-msg.is-error { padding:8px 12px; border:1px solid #6b2f2f; border-radius:6px; background:#3a1e1e; color:#e39a9a; }

/* --- Responsive --- */
@media (max-width:767px) {
  .wl-cm-row { grid-template-columns:1fr; }
  .wl-comment-submit { padding:9px 20px; }
  /* Rangee d'humeur compacte sur mobile : padding-x reduit pour tenir sans debordement (wrap). */
  .wl-cm-humeur { gap:2px; }
  .wl-cm-humeur-btn { padding:3px 6px; font-size:22px; }
  .wl-cm-humeur-lbl { font-size:9px; }
}

/*
 * --- SHADOW DISPLAY : commentaire "fantome" visible du seul auteur ---
 * Insere cote client apres depot accepte (js/comment.js injectShadowComment).
 * Non persistant, neutre. Le <li> porte .wl-cm-item wl-cm-pending et vit DANS
 * .comment-list : il HERITE de tout l'habillage d'un commentaire de la liste
 * (avatar, meta, name, emo, time, text). .wl-cm-pending ne porte donc QUE le
 * differenciateur visuel (accent a gauche + fond legerement distinct) + le
 * badge « en attente » (maquette v2, section 5). PAS d'actions (👍/👎/répondre) :
 * le commentaire n'existe pas encore cote public, ces cibles n'existent pas.
 *
 * Anciennes regles .wl-comment-pending-* SUPPRIMEES (structure obsolete) :
 *   .wl-comment-pending / -badge / .wl-cm-pending-head / -avatar / -nom /
 *   .wl-comment-pending .message  -> remplacees par l'heritage .wl-cm-item.
 */
.comment-list .wl-cm-pending {
  border-left:3px solid #DD4925; border-radius:0 8px 8px 0;
  background:rgba(221,73,37,.06);
  margin-left:0;
  /* padding herite de .wl-cm-item (12px 14px) : ne PAS le redoubler ici.
     Le shadow ne porte plus que son differenciateur (accent gauche + fond). */
}
/* Badge « 🕐 en attente » (maquette v2 .cm-badge), reserve au shadow. */
.comment-list .wl-cm-badge {
  font-size:11px; color:#DD4925; background:rgba(221,73,37,.15);
  padding:2px 9px; border-radius:20px;
  display:inline-flex; align-items:center; gap:4px;
}

/*
 * ===================================================================
 *  LISTE DES COMMENTAIRES — maquette validee le 04/08/2026 (section img3 / .list)
 *  Valeurs reprises EXACTEMENT de x-maquette/maquette-liste-commentaires.html.
 *  Tout est confine sous .comment-list pour neutraliser le legacy
 *  (puces <li>, marges, styles de <a>) SANS toucher a forum-list-2025.css.
 *  DETTE v2 : baro (img1) et chips d'humeur (img2) non implementes (aucune
 *  donnee ne les alimente) ; l'emoji d'humeur par commentaire, lui, est rendu.
 * ===================================================================
 */

/* --- Neutralisation du legacy sur la liste --- */
.comment-list { margin:22px 0 0; padding:0; list-style:none; }
.comment-list > li { list-style:none; margin:0; padding:0; background:none; border:none; }
.comment-list > li::before { content:none; }
.comment-list a { text-decoration:none; }

/* --- .item : ligne avatar + corps (maquette .item) --- */
/* position:relative requis pour ancrer les connecteurs ::before du thread v2. */
.comment-list .wl-cm-item { display:flex; gap:12px; padding:12px 14px; margin-bottom:8px; position:relative; }

/* --- .av : avatar carre-arrondi (maquette .av) --- */
.comment-list .wl-cm-av {
  width:40px; height:40px; border-radius:12px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-weight:500; font-size:15px;
}
/* 4 tons STABLES derives du nom (maquette v2 : av-1..4), valeurs exactes maquette. */
.comment-list .wl-cm-av-1 { background:#E8EDF5; color:#2C5A8F; }
.comment-list .wl-cm-av-2 { background:#F5E8E4; color:#DD4925; }
.comment-list .wl-cm-av-3 { background:#E4EFE8; color:#2E7D51; }
.comment-list .wl-cm-av-4 { background:#EFE9DC; color:#8A6A2F; }

/* --- .body / .meta / .name / .emo / .time (maquette) --- */
.comment-list .wl-cm-item-body { flex:1; min-width:0; }
.comment-list .wl-cm-meta { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.comment-list .wl-cm-name { font-size:14px; font-weight:500; color:#e6e6e6; }
.comment-list .wl-cm-emo  { font-size:16px; }
.comment-list .wl-cm-time { font-size:12px; color:#7d8794; }

/* --- .text (maquette .text) --- */
.comment-list .wl-cm-text { font-size:15px; color:#b9c0c9; line-height:1.6; margin-top:3px; }

/* --- .actions (maquette .actions + .actions span) ---
 * Classe propre a la LISTE (.wl-cm-item-actions), distincte de la barre
 * repliable du FORMULAIRE (.wl-cm-actions) : plus de collision de namespace,
 * donc plus besoin de neutraliser max-height/overflow. */
.comment-list .wl-cm-item-actions {
  display:flex; gap:16px; margin-top:8px; font-size:13px; color:#7d8794; flex-wrap:wrap;
}
.comment-list .wl-cm-item-actions > span { cursor:pointer; display:inline-flex; align-items:center; gap:5px; }
.comment-list .wl-cm-item-actions > span:hover { color:#b9c0c9; }
/* Lien "repondre" en accent (maquette v2 : .actions .reply{color:var(--accent)}). */
.comment-list .wl-cm-item-actions .wl-cm-reply a { color:#DD4925; }
.comment-list .wl-cm-item-actions .nbReply a { color:inherit; }

/*
 * ===================================================================
 *  THREADING v2 — 1 SEUL NIVEAU (maquette v2, validee le 05/08/2026)
 *  x-maquette/maquette-liste-commentaires-v2-threading.html
 *  Variables CSS de la maquette traduites en hex ; namespace .wl-cm-*.
 *  --thread/--line #3d4550 · --card #2E353E · --field #242830
 *  --accent #DD4925 · --accent-soft rgba(221,73,37,.15) · --muted #7d8794
 *  --txt #e6e6e6 · --txt-2 #b9c0c9
 *
 *  ⚠️ Ces classes sont l'HABILLAGE CIBLE. Le rendu reel des reponses est
 *  encore alimente par inc/forum-list-reponse.php (markup legacy
 *  .first/.second/.thirth injecte en freres via .after()) ; le passage a
 *  .wl-cm-thread + toggle repliable = lot B (touche JS/POST). Scaffolding ici.
 * ===================================================================
 */

/* --- Thread : conteneur des reponses, 1 seul niveau d'imbrication --- */
.comment-list .wl-cm-thread { margin-left:52px; position:relative; padding-left:20px; }
.comment-list .wl-cm-thread::before {
  content:""; position:absolute; left:0; top:-6px; bottom:26px; width:1px; background:#3d4550;
}
.comment-list .wl-cm-thread .wl-cm-item { margin-bottom:16px; }
.comment-list .wl-cm-thread .wl-cm-item::before {
  content:""; position:absolute; left:-20px; top:20px; width:14px; height:1px; background:#3d4550;
}
.comment-list .wl-cm-thread .wl-cm-av { width:32px; height:32px; font-size:13px; }

/* --- Toggle : "N reponses ⌄" replie / "Masquer les reponses ⌃" deplie --- */
.comment-list .wl-cm-toggle {
  display:inline-flex; align-items:center; gap:6px; margin-left:52px;
  font-size:13px; color:#DD4925; cursor:pointer; background:none; border:none;
  font-family:inherit; padding:0 0 4px 20px; position:relative;
}
.comment-list .wl-cm-toggle::before {
  content:""; position:absolute; left:0; top:-14px; height:22px; width:14px;
  border-left:1px solid #3d4550; border-bottom:1px solid #3d4550;
  border-bottom-left-radius:8px;
}

/* --- Reply-box : formulaire de reponse contextuel (lot B, scaffolding CSS) --- */
.comment-list .wl-cm-reply-box { margin-left:52px; padding-left:20px; margin-bottom:18px; position:relative; }
.comment-list .wl-cm-reply-box::before {
  content:""; position:absolute; left:0; top:-6px; bottom:12px; width:1px; background:#3d4550;
}
.comment-list .wl-cm-reply-inner {
  display:flex; gap:10px; align-items:flex-start;
  background:#2E353E; border:1px solid #3d4550; border-radius:10px; padding:12px 14px;
}
.comment-list .wl-cm-reply-av {
  width:32px; height:32px; border-radius:50%; background:rgba(221,73,37,.15); color:#DD4925;
  flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:14px;
}
.comment-list .wl-cm-reply-body { flex:1; }
.comment-list .wl-cm-reply-field {
  width:100%; padding:7px 11px; border:1px solid #3d4550; border-radius:8px;
  background:#242830; color:#7d8794; font-size:14px;
}
.comment-list .wl-cm-reply-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:10px; }
.comment-list .wl-cm-btn-ghost {
  background:none; border:none; color:#7d8794; font-size:13px; cursor:pointer;
  padding:7px 14px; font-family:inherit;
}
.comment-list .wl-cm-btn-send {
  background:#DD4925; color:#fff; border:none; border-radius:8px;
  padding:7px 18px; font-size:13px; font-weight:500; cursor:pointer; font-family:inherit;
}
