/* Codex PMU - specifique du programme. Tout le reste vient du socle.
   par Crise et Resilience */

/* Le socle declare des display sur ses composants : sans ce rappel, un
   element marque [hidden] resterait visible (piege connu du socle). */
[hidden] { display: none !important; }


.sous-titre {
  color: var(--text-muted);
  max-width: 62rem;
  margin: 0 0 var(--gap-lg);
}

/* --- La boite de question --- */
.boite-question {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--gap-lg);
  margin-bottom: var(--gap-lg);
}
.boite-question textarea {
  width: 100%;
  resize: none;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.5;
}
.ligne-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--gap-md);
  flex-wrap: wrap;
  margin-top: var(--gap-md);
}
.filtres { display: flex; gap: var(--gap-md); flex-wrap: wrap; }
.boutons { display: flex; gap: var(--gap-sm); margin-left: auto; }

.field-inline { display: flex; align-items: center; gap: var(--gap-sm); }
.field-inline > span { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.field-inline select {
  width: auto;
  min-width: 9rem;
  color-scheme: dark;
}
body.theme-light .field-inline select { color-scheme: light; }

/* --- Etat / attente --- */
.zone-etat {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  color: var(--text-muted);
  background: var(--glass-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--gap-md);
  margin-bottom: var(--gap-lg);
}
.zone-etat.erreur { color: var(--error-text); border-color: var(--error); }
.pastille-attente {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  animation: tourne .8s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }

/* --- La reponse redigee ---
   Lisibilite d'abord : une colonne de largeur confortable, de l'air entre les
   blocs, et l'or reserve aux titres et aux annonces. */
.texte-riche {
  font-size: 15px;
  line-height: 1.7;
  max-width: 68rem;
}
.reponse > p:first-child {
  font-size: 16px;
  color: var(--text);
  padding-bottom: var(--gap-md);
  border-bottom: 1px solid var(--border-light);
}
.texte-riche h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--accent);
  margin: var(--gap-xl) 0 var(--gap-sm);
  padding-left: var(--gap-sm);
  border-left: 3px solid var(--accent);
  line-height: 1.3;
}
.texte-riche p { margin: 0 0 var(--gap-md); color: var(--text-dim); }
.texte-riche strong { color: var(--text); font-weight: 600; }

.texte-riche ul, .texte-riche ol {
  margin: 0 0 var(--gap-lg);
  padding: 0;
  list-style: none;
  counter-reset: point;
}
.texte-riche li {
  position: relative;
  padding-left: 2.1rem;
  margin-bottom: var(--gap-sm);
  color: var(--text-dim);
}
.texte-riche ul > li::before {
  content: "";
  position: absolute;
  left: .7rem;
  top: .68em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.texte-riche ol > li {
  counter-increment: point;
  padding-left: 2.4rem;
}
.texte-riche ol > li::before {
  content: counter(point);
  position: absolute;
  left: 0;
  top: .12em;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent-alpha);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.renvoi {
  display: inline-block;
  min-width: 1.4rem;
  text-align: center;
  padding: 0 5px;
  margin: 0 1px;
  border-radius: var(--radius-sm);
  background: var(--accent-alpha);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  vertical-align: 1px;
}
.renvoi:hover { background: var(--accent); color: var(--accent-on); }

/* L'annonce (ce qui precede les deux points) est doree, la phrase reste en clair. */
.chapeau { color: var(--accent); font-weight: 600; }

/* --- Les passages sources --- */
.passage {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--gap-md);
  margin-bottom: var(--gap-md);
  background: var(--bg-surface);
}
.passage.vise { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.passage-tete {
  display: flex;
  align-items: baseline;
  gap: var(--gap-sm);
  flex-wrap: wrap;
  margin-bottom: var(--gap-sm);
}
.passage-num {
  background: var(--accent-alpha);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
}
.passage-titre { font-weight: 600; color: var(--text); }
.passage-meta { color: var(--text-comment); font-size: 12px; margin-left: auto; }
.passage-texte {
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 11rem;
  overflow: hidden;
  position: relative;
}
.passage-texte.ouvert { max-height: none; }
.passage-pied { display: flex; gap: var(--gap-sm); margin-top: var(--gap-sm); }
.lien-sobre {
  background: none; border: none; padding: 0;
  color: var(--accent); font-size: 12px; cursor: pointer;
}
.lien-sobre:hover { text-decoration: underline; }

/* --- Jetons de portee --- */
.jeton {
  display: inline-block;
  padding: 1px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}
.jeton.qc { background: var(--accent-alpha); color: var(--accent); }
.jeton.ca { background: var(--info-alpha); color: var(--info-text); }
.jeton.prive { background: var(--warning-alpha); color: var(--warning-text); }

/* --- Suggestions dans la barre laterale --- */
.suggestion {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 12.5px;
  line-height: 1.4;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.suggestion:hover { background: var(--bg-card-hover); color: var(--accent); }

/* --- Le guide --- */
.bloc-guide {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--gap-lg);
  margin-bottom: var(--gap-md);
}
.bloc-guide-tete {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-sm);
}
.bloc-guide-tete h3 { margin: 0; font-size: 15px; color: var(--accent); flex: 1; }

/* --- Le corpus --- */
.liste-corpus { margin-top: var(--gap-md); }
.doc-ligne {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  padding: var(--gap-sm) var(--gap-md);
  border-bottom: 1px solid var(--border-light);
}
.doc-ligne:hover { background: var(--bg-card-hover); }
.doc-titre { flex: 1; min-width: 0; }
.doc-titre strong { display: block; font-weight: 600; font-size: 13.5px; }
.doc-titre small { color: var(--text-comment); font-size: 12px; }
.doc-pages { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

/* --- Lecture a voix haute et documents de reference --- */
.etiquette-vitesse { color: var(--text-comment); font-size: 11.5px; margin-right: 4px; }
#reglageLecture { display: flex; align-items: center; gap: 4px; }
#reglageLecture select {
  width: auto;
  min-width: 5.2rem;
  padding: 3px 6px;
  font-size: 12px;
  color-scheme: dark;
}
body.theme-light #reglageLecture select { color-scheme: light; }

.btn-lire {
  font-family: var(--font-icon);
  font-size: 13px;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  width: 26px;
  height: 22px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.btn-lire:hover, .btn-lire.actif { border-color: var(--accent); color: var(--accent); }
.btn-lire.actif { background: var(--accent-alpha); }

.etoile {
  font-family: var(--font-icon);
  font-size: 14px;
  background: none;
  border: none;
  padding: 0 2px;
  color: var(--text-comment);
  cursor: pointer;
  transition: var(--transition-fast);
}
.etoile:hover { color: var(--accent); transform: scale(1.15); }
.etoile.active { color: var(--accent); }

/* Le passage reprend la mise en forme de la reponse, en plus sobre. */
.passage-texte.texte-riche { font-size: 13.5px; line-height: 1.6; max-width: none; }
.passage-texte.texte-riche p { margin-bottom: var(--gap-sm); }
.passage-texte.texte-riche h3 {
  font-family: var(--font);
  font-size: 13.5px;
  margin: var(--gap-md) 0 4px;
  border-left-width: 2px;
}
.passage-texte.texte-riche ul, .passage-texte.texte-riche ol { margin-bottom: var(--gap-sm); }
.passage-texte.texte-riche li { margin-bottom: 3px; }
.passage-texte.texte-riche ul > li::before { top: .62em; width: 5px; height: 5px; }

/* --- Les ateliers : tuiles carrees, comme partout dans le socle --- */
.tuiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--gap-lg);
  margin-bottom: var(--gap-lg);
}
.tuile {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: var(--gap-sm);
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--gap-lg);
  color: var(--text);
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition-norm);
}
.tuile:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.tuile-icone {
  font-family: var(--font-icon);
  font-size: 30px;
  color: var(--accent);
  margin-bottom: auto;
}
.tuile-nom { font-family: var(--font-serif); font-size: 17px; color: var(--accent); }
.tuile-resume { color: var(--text-muted); font-size: 12.5px; line-height: 1.45; }

.atelier-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
  margin-bottom: var(--gap-md);
}
.atelier-tete h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--accent);
}
#champsAtelier .field { margin-bottom: var(--gap-md); }
#champsAtelier select, #champsAtelier textarea, #champsAtelier .champ-atelier { width: 100%; }
#champsAtelier select { color-scheme: dark; }
body.theme-light #champsAtelier select { color-scheme: light; }
.depot {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-xs);
}
.depot input[type=file] { color: var(--text-muted); font-size: 12px; max-width: 20rem; }
.depot-nom { color: var(--text-comment); font-size: 12px; }

/* --- La veille reglementaire --- */
.veille {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--gap-md) var(--gap-lg);
  margin-bottom: var(--gap-lg);
}
.veille-tete { display: flex; align-items: center; gap: var(--gap-sm); margin-bottom: var(--gap-xs); }
.veille-tete strong { color: var(--accent); font-size: 13.5px; }
.veille-date { color: var(--text-comment); font-size: 12px; margin-left: auto; }
.veille-pastille {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
}
.veille-pastille.bouge { background: var(--warning); }
.veille-ligne { color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }
.veille-ligne.change { color: var(--warning-text); }
.veille-ligne.souci { color: var(--error-text); }
