/**
 * CoconSEM - SEO Table of Contents
 * Front styles
 */

/* =============================
   BLOC TOC - LOOK & FEEL THEME
   (STYLE 1 - CARTE BEIGE)
   ============================= */

.coconsem-toc {
  background: #f7f4ef;          /* beige clair du thème */
  border: 1px solid #e6e0d8;    /* gris-beige très léger */
  border-radius: 14px;
  padding: 1.3rem 1.6rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
  font-family: "Montserrat", sans-serif;
  font-size: 0.95rem;
  color: #3f2f23;               /* brun léger, proche du texte global */
  position: relative;
  overflow: hidden;
  max-width: 850px;
  margin: 50px auto 0;

  /* Variables par défaut pour le style dynamique du sommaire */
  --csmk-toc-color: #333333;
  --csmk-toc-font-size: 16px;
}

@media (min-width: 991px) {
    body.coconsem .brz-container{
        max-width: 880px !important;
    }
}

/* petit hack pour un autre bouton du site, inchangé */
.prose button.cs-soft-cta-btn {
  border-radius: 5px;
}



/* Ligne colorée à gauche pour rappeler le code couleur du site */
.coconsem-toc::after {
  content: "";
  position: absolute;
  top: 0.6rem;
  left: 0;
  bottom: 0.6rem;
  width: 0.22rem;
  border-radius: 999px;
  background: linear-gradient(to bottom, #e64c3c, #b6251c);
  opacity: 0.8;
}

/* header titre + bouton */
.coconsem-toc__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.coconsem-toc__title {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

/* Bouton toggle Afficher / Masquer */
.coconsem-toc__toggle {
  border: none;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: #b6251c;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.coconsem-toc__toggle:hover {
  text-decoration: underline;
}

.coconsem-toc__toggle-label {
  white-space: nowrap;
}

.coconsem-toc__toggle-icon {
  font-size: 0.75rem;
  transform-origin: center;
  transition: transform 0.2s ease;
}

/* État replié : flèche tournée */
.coconsem-toc--collapsed .coconsem-toc__toggle-icon {
  transform: rotate(-90deg) translateY(1px);
}

/* Contenu interne */
.coconsem-toc__inner {
  margin-top: 0.4rem;
}

/* Liste principale (base) */
.coconsem-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Éléments de liste */
.coconsem-toc__item {
  margin: 0;
  padding: 0.1rem 0;
}

/* Liens */
.coconsem-toc__item a {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  line-height: 1.4;
}

.coconsem-toc__item a:hover {
  text-decoration: underline;
}

/* Hierarchie visuelle selon le niveau de titre */
.coconsem-toc__item--h1 a {
  font-weight: 600;
}

.coconsem-toc__item--h2 a {
  font-weight: 500;
}

.coconsem-toc__item--h3 a {
  font-weight: 400;
}

.coconsem-toc__item--h4 a,
.coconsem-toc__item--h5 a {
  font-weight: 400;
  opacity: 0.95;
}

/* ===== STYLE 2 : BANDE ROUGE + BLOCS SCO ===== */

.coconsem-toc.coconsem-toc--style2 {
  background: #fffdf9;
  border-radius: 12px;
  border: 1px solid #f0d6c8;
  box-shadow: 0 3px 10px rgba(0,0,0,0.03);
  padding: 1.2rem 2.4rem 2.25rem 3.4rem;
  color: #43312a;
  max-width:fit-content;
}
@media (max-width: 600px) {
	.coconsem-toc.coconsem-toc--style2 {	 
	  padding: 1.2rem 1.4rem 2.25rem 1.4rem;
        margin-left: 36px;
        margin-right: 36px;
	}
}


.coconsem-toc.coconsem-toc--style2::after {
  background: #c1272d;
}

/* Liste dans le style 2 : puces classiques décalées */
.coconsem-toc.coconsem-toc--style2 .coconsem-toc__list {
  margin-left: -0.6rem;
}

@media (max-width: 600px) {
	.coconsem-toc.coconsem-toc--style2 .coconsem-toc__list {
	  margin-left: 0.3rem;
	}
}

/* Alignement général */
.coconsem-toc.coconsem-toc--style2 .coconsem-toc__item {
  padding: 0.15rem 0;
}

/* Styles de liens en style 2 */
.coconsem-toc.coconsem-toc--style2 .coconsem-toc__item a {
  color: #3b2b25;
}

/* Hover : léger changement de couleur */
.coconsem-toc.coconsem-toc--style2 .coconsem-toc__item a:hover {
  color: #c1272d;
  text-decoration: underline;
}

/* Bouton toggle style 2 */
.coconsem-toc.coconsem-toc--style2 .coconsem-toc__toggle {
  color: #c1272d;
}

/* =============================
   État replié / étendu (JS)
   ============================= */

.coconsem-toc--collapsed .coconsem-toc__inner {
  display: none;
}

/* Pour éviter de casser la mise en page sur petits écrans */
@media (max-width: 600px) {
  .coconsem-toc {
    padding: 1rem 1.1rem;
  }

  .coconsem-toc__header {
  
    align-items: flex-start;
    gap: 0.25rem;
  }

  .coconsem-toc__title {
    font-size: 0.96rem;
  }
}

/* =============================
   Affichage puces / numérotation
   ============================= */

.coconsem-toc__list.coconsem-toc__list--numbers,
.coconsem-toc__list.coconsem-toc__list--bullets {
  list-style-position: outside;
  margin-left: 1.5rem;
}

/* 1?? Le bloc numéroté doit sortir en outside pour que ::marker soit contrôlable */
.coconsem-toc__list.coconsem-toc__list--numbers {
    list-style-position: outside !important;
    padding-left: 1.6rem; /* espace réservé pour les numéros */
}

/* 2?? Style du numéro (uniquement pour les H2) */
.coconsem-toc__item.coconsem-toc__item--h2::marker {
        font-size: 0.9em;
    font-weight: 500;
    color: saddlebrown;
}

/* 3?? Le LI redevient propre, sans indentation "inside" */
.coconsem-toc__item.coconsem-toc__item--h2 {
    display: list-item;
    padding-left: 0;
    margin-left: 0;
    line-height: 1.25; /* meilleure cohérence verticalement */
}

/* 4?? Remonter le texte pour simuler un marker "top" */
.coconsem-toc__item.coconsem-toc__item--h2 > a {
    display: inline-block;
    vertical-align: top;
    margin-top: 0px; /* ajuste entre -2 et -5 selon ton rendu */
}

/* Puces */
.coconsem-toc__list.coconsem-toc__list--bullets {
  list-style-type: revert-layer;
}

/* Numérotation (le type exact vient de l'attribut type=) */
.coconsem-toc__list.coconsem-toc__list--numbers {
  list-style-type: decimal;
}

/* =============================
   Alinéas par niveau (H3–H5)
   ============================= */

.coconsem-toc.coconsem-toc--with-indent .coconsem-toc__item--h1,
.coconsem-toc.coconsem-toc--with-indent .coconsem-toc__item--h2 {
  margin-left: 0;
}

.coconsem-toc.coconsem-toc--with-indent .coconsem-toc__item--h3 {
  margin-left: 10px;
}

.coconsem-toc.coconsem-toc--with-indent .coconsem-toc__item--h4 {
  margin-left: 20px;
}

.coconsem-toc.coconsem-toc--with-indent .coconsem-toc__item--h5 {
  margin-left: 30px;
}

/* =============================
   Styles personnalisés (couleur / taille)
   ============================= */

.coconsem-toc.coconsem-toc--custom .coconsem-toc__item a {
  font-size: var(--csmk-toc-font-size);
  color: var(--csmk-toc-color);
  text-indent:2px
}

/* Mise en évidence : options séparées taille / couleur */

/* 1) Différenciation de taille uniquement */
.coconsem-toc.coconsem-toc--custom.coconsem-toc--highlight-size .coconsem-toc__item--h1 a,
.coconsem-toc.coconsem-toc--custom.coconsem-toc--highlight-size .coconsem-toc__item--h2 a {
  font-size: var(--csmk-toc-font-size);
}

.coconsem-toc.coconsem-toc--custom.coconsem-toc--highlight-size .coconsem-toc__item--h3 a {
  font-size: calc(var(--csmk-toc-font-size) * 0.85);
  text-indent: -4px !important;
}

.coconsem-toc.coconsem-toc--custom.coconsem-toc--highlight-size .coconsem-toc__item--h4 a,
.coconsem-toc.coconsem-toc--custom.coconsem-toc--highlight-size .coconsem-toc__item--h5 a {
  font-size: calc(var(--csmk-toc-font-size) * 0.85);
}

/* 2) Différenciation de couleur uniquement */
.coconsem-toc.coconsem-toc--custom.coconsem-toc--highlight-color .coconsem-toc__item--h1 a,
.coconsem-toc.coconsem-toc--custom.coconsem-toc--highlight-color .coconsem-toc__item--h2 a {
  color: var(--csmk-toc-color);
  text-indent: 2px
}

.coconsem-toc.coconsem-toc--custom.coconsem-toc--highlight-color .coconsem-toc__item--h3 a {
  color: color-mix(in srgb, var(--csmk-toc-color) 80%, #000 20%);
}

.coconsem-toc.coconsem-toc--custom.coconsem-toc--highlight-color .coconsem-toc__item--h4 a,
.coconsem-toc.coconsem-toc--custom.coconsem-toc--highlight-color .coconsem-toc__item--h5 a {
  color: color-mix(in srgb, var(--csmk-toc-color) 70%, #000 30%);
  text-indent: -6px !important;
}

/* 3) Compat : si un ancien markup utilise encore .coconsem-toc--highlight,
      on garde le comportement mixte (taille + couleur) */
.coconsem-toc.coconsem-toc--custom.coconsem-toc--highlight .coconsem-toc__item--h1 a,
.coconsem-toc.coconsem-toc--custom.coconsem-toc--highlight .coconsem-toc__item--h2 a {
  font-size: var(--csmk-toc-font-size);
  color: var(--csmk-toc-color);
}

.coconsem-toc.coconsem-toc--custom.coconsem-toc--highlight .coconsem-toc__item--h3 a {
  font-size: calc(var(--csmk-toc-font-size) * 0.85);
  color: color-mix(in srgb, var(--csmk-toc-color) 80%, #000 20%);
}

.coconsem-toc.coconsem-toc--custom.coconsem-toc--highlight .coconsem-toc__item--h4 a,
.coconsem-toc.coconsem-toc--custom.coconsem-toc--highlight .coconsem-toc__item--h5 a {
  font-size: calc(var(--csmk-toc-font-size) * 0.80);
  color: color-mix(in srgb, var(--csmk-toc-color) 70%, #000 30%);
}

/* =============================
   Renforcement contre le thème
   (évite le gros bouton gris)
   ============================= */

.coconsem-toc .coconsem-toc__header {
      display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 1rem;
    margin: 10px 0 28px;
	text-indent: -4px !important;
}

.coconsem-toc .coconsem-toc__toggle {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: #b6251c !important;
  font-size: 0.85rem;
  font-weight: 500;
}
