/* ==========================================================================
   Page pilier /culture-generale-et-expression (21/11/2026) : 73 BTS
   S'appuie sur les composants cj-* (cejm-v4.css) et ajoute :
   citations, lexique, quiz vrai/faux, bibliographie filtrable, corpus des sujets blancs.
   Règles : aucun z-index, aucun sticky, encadrés à bordure gauche droits à gauche,
   aucun débordement horizontal sur mobile.
   ========================================================================== */

/* Encadré métier */
.cg-page .cg-metier em {
  display: block;
  margin-top: 8px;
  color: var(--cj-muted);
  font-style: normal;
}

/* Points des questions */
.cg-pts {
  color: var(--cj-muted);
  font-size: 0.88rem;
  font-weight: 400;
  white-space: nowrap;
}

/* Lexique : grille de définitions */
.cg-lex-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
}

.cg-lex-grid > div:nth-last-child(2):nth-child(odd) {
  border-bottom: 0;
}

/* Citations */
.page-content .cg-page ul.cg-quotes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 8px;
  padding: 0;
  list-style: none;
}

.page-content .cg-quotes li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 14px 16px;
  border-left: 4px solid var(--primary-color);
  border-radius: 0 12px 12px 0;
  background: var(--cj-soft);
}

.cg-quotes q {
  color: var(--cj-text);
  font-size: 0.98rem;
  font-style: italic;
  line-height: 1.55;
}

.cg-quotes li > span {
  color: var(--cj-muted);
  font-size: 0.88rem;
}

/* Quiz vrai / faux */
.cg-quiz {
  margin: 12px 0;
  padding: 16px 18px;
  border: 1px solid var(--cj-line);
  border-radius: 14px;
  background: #fff;
}

.cg-quiz-score {
  margin: 0 0 8px;
  color: var(--cj-ink);
  font-weight: 700;
}

.page-content .cg-page ol.cg-quiz-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: cgq;
}

.page-content .cg-quiz-item {
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid #eef2f7;
  counter-increment: cgq;
}

.cg-quiz-item:first-child {
  border-top: 0;
}

.cg-quiz-q {
  margin: 0 0 8px;
  font-weight: 600;
}

.cg-quiz-q::before {
  content: counter(cgq) ". ";
  color: var(--cj-ink);
}

.cg-quiz-btns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 120px));
  gap: 8px;
}

.cg-quiz-btns button {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--cj-line);
  border-radius: 10px;
  background: var(--cj-soft);
  color: var(--cj-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.cg-quiz-btns button:hover:not(:disabled) {
  border-color: var(--primary-color);
}

.cg-quiz-btns button.is-right {
  border-color: #16a34a;
  background: #dcfce7;
  color: #14532d;
}

.cg-quiz-btns button.is-wrong {
  border-color: #dc2626;
  background: #fee2e2;
  color: #7f1d1d;
}

.cg-quiz-btns button:disabled {
  cursor: default;
}

.cg-quiz-exp {
  margin: 8px 0 0;
  color: #334155;
  font-size: 0.95rem;
}

/* Bibliographie filtrable */
.cg-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.cg-filter {
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--cj-line);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.cg-filter[aria-pressed="true"] {
  border-color: var(--cj-ink);
  background: var(--cj-ink);
  color: #fff;
}

.page-content .cg-page ul.cg-works {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
  padding: 0;
  list-style: none;
}

.page-content .cg-work {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--cj-line);
  border-radius: 12px;
  background: #fff;
}

.cg-work[hidden] {
  display: none;
}

.cg-work-type {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--cj-tint);
  color: var(--cj-ink);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.cg-work-main {
  line-height: 1.45;
}

.cg-work-main small {
  display: block;
  margin-top: 4px;
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Corpus des sujets blancs */
.cg-doc-nature {
  display: block;
  margin: 2px 0 8px;
  color: var(--cj-muted);
  font-size: 0.88rem;
}

.cg-doc-text {
  font-size: 0.95rem;
  line-height: 1.7;
}

.cg-doc-text p {
  margin: 0 0 10px;
}

@media (max-width: 720px) {
  .cg-lex-grid,
  .page-content .cg-page ul.cg-quotes,
  .page-content .cg-page ul.cg-works {
    grid-template-columns: minmax(0, 1fr);
  }

  .cg-lex-grid > div:nth-last-child(2):nth-child(odd) {
    border-bottom: 1px solid #eef2f7;
  }

  .cg-quiz {
    padding: 14px;
  }

  .cg-quiz-btns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media print {
  .cg-filters,
  .cg-quiz-btns {
    display: none;
  }

  .cg-work[hidden],
  .cg-quiz-exp[hidden] {
    display: block !important;
  }
}

/* Composition du sujet : 4 blocs en 2 x 2 sur grand écran (évite un bloc orphelin) */
@media (min-width: 721px) {
  .cg-page .cj-anatomy {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ==========================================================================
   Retouches issues de la relecture par avatars (21/11/2026)
   ========================================================================== */

/* Accordéons maison : pastille aux couleurs du site (pas les couleurs CEJM) */
.cg-page .cj-disc-dot {
  background: var(--primary-color);
}

.cg-page .cg-fold {
  margin: 12px 0 16px;
}

/* Liens secondaires de L'essentiel */
.cg-fact-link {
  color: var(--cj-muted);
  font-size: 0.9em;
}

/* Encadré métier : exemple et lien CEJM sur leur propre ligne */
.cg-page .cg-metier em,
.cg-page .cg-metier .cg-metier-link {
  display: block;
  margin-top: 8px;
}

.cg-page .cg-metier .cg-metier-link {
  font-size: 0.92rem;
}

/* Problématique simple : 4 lignes numérotées */
.page-content .cg-page ol.cg-pb {
  margin: 8px 0 12px;
  padding-left: 22px;
}

.page-content .cg-page ol.cg-pb li {
  margin: 6px 0;
  line-height: 1.55;
}

.cg-rich > p:first-child {
  margin-top: 0;
}

.cg-axe-title {
  margin-top: 4px;
}

/* Feuille de route BTS PD */
.page-content .cg-page ol.cg-steps-plain {
  margin: 8px 0;
  padding-left: 20px;
}

.page-content .cg-page ol.cg-steps-plain li {
  margin: 6px 0;
}

/* Simulateur : curseur plus facile à saisir au doigt */
.cg-page #cj-note-range {
  -webkit-appearance: none;
  appearance: none;
  height: 44px;
  background: transparent;
}

.cg-page #cj-note-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: var(--cj-tint-2);
}

.cg-page #cj-note-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -11px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--primary-color);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
}

.cg-page #cj-note-range::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--cj-tint-2);
}

.cg-page #cj-note-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--primary-color);
}

/* Corrigés repliables : chevron et libellé Voir / Masquer */
.cg-page .cj-q summary,
.cg-page .cj-annexes > summary,
.cg-page .cg-quiz-more > summary,
.cg-page .cg-desc > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  list-style: none;
  cursor: pointer;
}

.cg-page .cj-q summary::-webkit-details-marker,
.cg-page .cj-annexes > summary::-webkit-details-marker,
.cg-page .cg-quiz-more > summary::-webkit-details-marker,
.cg-page .cg-desc > summary::-webkit-details-marker {
  display: none;
}

.cg-page .cj-q summary::after,
.cg-page .cj-annexes > summary::after,
.cg-page .cg-quiz-more > summary::after,
.cg-page .cg-desc > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.cg-page .cj-q details[open] > summary::after,
.cg-page .cj-annexes[open] > summary::after,
.cg-page .cg-quiz-more[open] > summary::after,
.cg-page .cg-desc[open] > summary::after {
  transform: rotate(225deg) translateY(-2px);
}

.cg-page .cg-hide,
.cg-page details[open] > summary .cg-show {
  display: none;
}

.cg-page details[open] > summary .cg-hide {
  display: inline;
}

/* Consignes et encadrés de la section 2026 */
.cg-consigne {
  margin: 4px 0 12px;
  color: #334155;
  font-style: italic;
}

.cg-download {
  font-weight: 600;
}

.cg-jump {
  margin-top: 12px;
  font-weight: 600;
}

.cg-page p.cg-cta {
  margin: 16px 0;
}

.cg-page p.cg-cta > a.primary-trigger {
  display: flex;
  justify-content: center;
  min-height: 48px;
  padding: 14px 20px;
  border-radius: 14px;
  text-align: center;
}

.cg-tag-new {
  background: #dcfce7;
  color: #14532d;
}

/* Essai complet : critère de la grille en marge */
.cg-essay-body .cg-essay-part {
  margin: 16px 0 6px;
}

.cg-essay-par {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 16px;
  align-items: start;
  margin: 0 0 12px;
}

.cg-crit {
  padding: 8px 10px;
  border-left: 3px solid var(--primary-color);
  border-radius: 0 8px 8px 0;
  background: var(--cj-tint);
  color: var(--cj-ink);
  font-size: 0.85rem;
  line-height: 1.45;
}

/* Documents iconographiques des sujets blancs */
.cg-doc-figure {
  margin: 8px 0 12px;
}

.cg-doc-figure img {
  display: block;
  max-width: min(100%, 600px);
  height: auto;
  border: 1px solid var(--cj-line);
  border-radius: 8px;
}

.cg-doc-figure figcaption {
  margin-top: 6px;
  color: var(--cj-muted);
  font-size: 0.88rem;
}

/* Quiz : score et bouton Recommencer sous la liste */
.cg-quiz-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #eef2f7;
}

.cg-quiz-foot .cg-quiz-score {
  margin: 0;
}

.cg-quiz-reset,
.cg-more,
.cg-close {
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--cj-line);
  border-radius: 10px;
  background: #fff;
  color: var(--cj-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.cg-more {
  display: block;
  width: 100%;
  margin: 8px 0;
}

.cg-more[hidden] {
  display: none;
}

.cg-count {
  margin: 4px 0;
  color: var(--cj-muted);
  font-size: 0.9rem;
}

.cg-quiz-more > summary {
  margin: 8px 0;
  color: var(--cj-ink);
  font-weight: 600;
}

.cg-quiz-btns button.is-chosen::after {
  content: " (ta réponse)";
  font-weight: 400;
}

/* Onglets : libellé court sur petit écran */
.cg-tab-short {
  display: none;
}

/* Citations : guillemets français avec espaces insécables */
.cg-quotes q {
  quotes: "«\00a0" "\00a0»";
}

/* FAQ repliable (option du module, page CGE uniquement) */
#post-faq details.faq-fold {
  border-bottom: 1px solid #eef2f7;
}

#post-faq details.faq-fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  list-style: none;
  cursor: pointer;
}

#post-faq details.faq-fold > summary::-webkit-details-marker {
  display: none;
}

#post-faq details.faq-fold > summary::after {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  transform: rotate(45deg);
}

#post-faq details.faq-fold[open] > summary::after {
  transform: rotate(225deg);
}

#post-faq details.faq-fold .faq-q {
  margin: 10px 0;
}

@media (min-width: 900px) {
  .cg-quiz-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    column-gap: 16px;
    align-items: center;
  }

  .cg-quiz-item .cg-quiz-exp {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .page-content .cg-page :is(p, li, dd),
  #post-faq .faq-a {
    font-size: 1rem;
    line-height: 1.6;
  }

  .page-content .cg-page h2.aid-h2 {
    font-size: 1.5rem;
    line-height: 1.25;
  }

  .cg-tab-long {
    display: none;
  }

  .cg-tab-short {
    display: inline;
  }

  .cg-page .cj-tabs[data-tabs="sujets"],
  .cg-page .cj-tabs[data-tabs="methode"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cg-changes tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 8px;
  }

  .cg-changes td.cj-td-head {
    grid-column: 1 / -1;
  }

  .cg-history tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 8px;
  }

  .cg-history td:last-child {
    grid-column: 1 / -1;
  }

  .page-content .cg-work {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .cg-work-type {
    justify-self: start;
  }

  .page-content .cg-page .cj-myths li {
    display: block;
  }

  .cg-page .cj-myth-tag {
    display: inline-block;
    min-width: 0;
    margin-right: 8px;
    padding: 1px 8px;
  }

  .cg-essay-par {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.cg-desc > summary {
  color: var(--cj-ink);
  font-weight: 600;
}

#post-faq details.faq-fold > summary .faq-q {
  flex: 1 1 auto;
}

/* Liens « source » : zone tactile suffisante */
.cg-page .res-cite {
  display: inline-block;
  margin: -6px 0;
  padding: 6px 4px;
  font-size: 0.8rem;
}

/* Notes de vocabulaire sous un document */
.cg-doc-notes {
  margin: 8px 0 0;
  color: #475569;
  font-size: 0.88rem;
  font-style: italic;
}

@media (max-width: 720px) {
  .page-content .cg-page .cg-changes tr:nth-child(even),
  .page-content .cg-page .cg-history tr:nth-child(even) {
    background: #fff;
  }

  .cg-history tr {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  }

  .cg-history td.cj-td-head .cj-tag {
    display: inline-block;
    margin: 4px 4px 0 0;
  }
}
