/* ==== v22_fix.css ==== */
/* ============================================================================
   MSHP Questions-Réponses — module v22
   Correctif du bloc « Réponse à synthétiser » : un SEUL bloc, une SEULE fois,
   mise en page propre (aucun éclatement incohérent, aucune duplication).
   Garde-fou défensif : neutralise tout enveloppement résiduel de type
   accordéon posé sur un bloc de synthèse par un module antérieur.
   Thème MSHP : #ED1C24 / noir / blanc.
   ========================================================================== */

/* ---------- 1. Le bloc de synthèse est un bloc, jamais un accordéon ------ */
.v21-sgblock {
  display: block !important;
  position: relative;
  width: 100%;
  max-width: 100%;
  padding: 14px 16px !important;
  overflow: visible !important;
}
/* Si un module antérieur a laissé la classe d'accordéon, on la neutralise :
   le corps doit rester visible et l'en-tête ne doit pas être un bouton. */
.v21-sgblock.v20-synth,
.v21-sgblock.v20-synth .v20-synth-body {
  display: block !important;
  padding: 14px 16px !important;
  overflow: visible !important;
}
.v21-sgblock > .v20-head,
.v21-sgblock .v20-head { display: none !important; }

/* Un bloc de synthèse ne contient JAMAIS un autre bloc de synthèse :
   si un empilement subsiste, l'intérieur est aplati (display: contents)
   pour que le contenu remonte dans le bloc unique. */
.v21-sgblock .v21-sgblock { display: contents !important; }

/* ---------- 2. Mise en page du résumé : une ligne par information -------- */
.v21-sghead {
  display: flex !important;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--mshp-border, #e6e8ec);
}
.v21-sghead > * { flex: 0 0 auto; }
.v21-sghead .v21-ref { flex: 0 0 auto; }
.v21-sghead .v21-dep,
.v21-sghead .v21-svc {
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v21-sghead .v21-ths { flex: 1 1 auto; min-width: 0; }
.v21-sghead .v21-st { margin-left: auto; }

/* ---------- 3. Les sections question / réponse / synthèse ---------------- */
.v21-sgblock .v21-sec {
  display: block;
  width: 100%;
  margin: 0 0 12px;
}
.v21-sgblock .v21-sec > h4 {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin: 0 0 6px;
}
.v21-sgblock .v21-sec > h4 .n { margin-left: auto; }

/* Le texte long reste dans son cadre : pas de débordement, pas de cassure
   de mot, interligne constant quelle que soit la longueur. */
.v21-sgblock .v21-qtext,
.v21-sgblock .v21-rt {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: none;
  line-height: 1.65;
  font-size: 13px;
}
.v21-sgblock .v21-qtext { border-left: 3px solid #111; background: #fafafa; }
.v21-sgblock .v21-rt   { border-left: 3px solid var(--mshp-red, #ED1C24); }

/* ---------- 4. Zone de synthèse et actions ------------------------------- */
.v21-sgblock .v21-lab {
  display: block;
  margin: 12px 0 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #111;
}
.v21-sgblock textarea.v21-ta {
  display: block;
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 84px;
  padding: 9px 11px;
  border: 1px solid var(--mshp-border, #e6e8ec);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}
.v21-sgblock textarea.v21-ta:focus {
  outline: none;
  border-color: var(--mshp-red, #ED1C24);
  box-shadow: 0 0 0 3px rgba(237, 28, 36, .12);
}
.v21-sgblock .v21-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--mshp-border, #e6e8ec);
}

/* Une seule en-tête de résumé par bloc : le bandeau v16 est neutralisé
   dans les vues qui rendent des blocs v21 (l'en-tête v21 porte déjà
   référence, député, circonscription, thématiques, statut et PJ). */
.v21-sgblock .qr-fiche-strip,
.v21-sgblock + .qr-fiche-strip { display: none !important; }

/* ---------- 5. Une seule réponse par question : marqueur visuel ---------- */
.v21-sgblock[data-v22="1"] {
  border-left-width: 4px;
  border-left-style: solid;
  border-left-color: var(--mshp-red, #ED1C24);
}

/* ---------- 6. Mobile : rien ne dépasse ---------------------------------- */
@media (max-width: 640px) {
  .v21-sgblock { padding: 12px 12px !important; }
  .v21-sghead { gap: 6px; }
  .v21-sghead .v21-dep,
  .v21-sghead .v21-svc { max-width: 100%; }
  .v21-sghead .v21-st { margin-left: 0; }
  .v21-sgblock .v21-acts .btn { flex: 1 1 100%; justify-content: center; }
  .v21-sgblock .v21-qtext,
  .v21-sgblock .v21-rt { font-size: 12.5px; }
}
