/* =====================================================================
   Articles « Comment installer/désinstaller le module … » (préfixe .ssi-)
   - cadre commun des articles (templates/single.html) : bandeau fil d'Ariane,
     titre, date, navigation Précédent / Suivant, colonne « Catégories » ;
   - contenu (patterns/page-module-*.php) : onglets, accordéons, étapes numérotées.
   Mesures reprises du site actuel (Elementor) à 1440, 1024 et 375 px :
   largeurs en % comme l'original. Complète pages.css (.ssp).
   ===================================================================== */

/* Variables aussi sur .ssi : le contenu s'affiche seul dans l'éditeur, sans le cadre du modèle */
.ssi-article,
.ssi {
  --ssp-navy: #121254;
  --ssp-shadow: 0 4px 18px rgba(18, 18, 84, 0.14);
  --ssi-red: #C00039;
  --ssi-num: #B3002F; /* rouge des pastilles numérotées de l'original */
  --ssi-night: #0C0836;
  --ssi-text: #303030;
  --ssi-line: #D5D8DC;
  --ssi-tab: #F1F2F3;
  --ssi-lavender: rgba(224, 226, 255, 0.34);
}

.ssi-article {
  font-size: 1rem;
  line-height: 1.5;
}

/* ---------- Bandeau : fil d'Ariane + « Créer un ticket Support » ---------- */
.ssi-article .ssi-band {
  background: var(--ssi-lavender);
  padding: 5vw 5%;
}

.ssi-article .ssi-band__inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ssi-article .ssi-band__inner > *,
.ssi-article .ssi-crumbs > * {
  margin: 0;
}

.ssi-article .ssi-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 0 0 10px;
  color: var(--ssi-night);
  font-weight: 500;
  line-height: 1.5;
}

.ssi-article .ssi-crumbs a {
  color: inherit;
  text-decoration: none;
}

.ssi-article .ssi-crumbs a:hover,
.ssi-article .ssi-crumbs a:focus-visible {
  text-decoration: underline;
}

.ssi-article .ssi-ticket {
  padding: 0;
}

.ssi-article .ssi-ticket .wp-block-button__link {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid var(--ssi-night);
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--ssi-night);
  font-size: inherit;
  font-weight: 500;
  line-height: 1.1;
  text-decoration: none;
}

.ssi-article .ssi-ticket .wp-block-button__link:hover,
.ssi-article .ssi-ticket .wp-block-button__link:focus-visible {
  background: var(--ssi-night);
  color: #FFFFFF;
}

@media (min-width: 768px) {
  .ssi-article .ssi-band {
    padding-block: 0;
  }

  .ssi-article .ssi-band__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
  }

  .ssi-article .ssi-crumbs,
  .ssi-article .ssi-ticket {
    padding: 0 10px;
    font-size: 1.1rem;
  }

  .ssi-article .ssi-crumbs {
    row-gap: 0;
  }
}

/* ---------- Mise en page : article + colonne « Catégories » ---------- */
.ssi-article .ssi-layout {
  width: 90%;
  margin: calc(46px + 1.8vw) auto 0;
  padding-block: 10px 60px;
}

.ssi-article .ssi-layout > * {
  margin: 0;
  min-width: 0;
}

@media (min-width: 768px) {
  .ssi-article .ssi-layout {
    display: grid;
    /* Comme l'original : colonnes 70 % / 25 % (75 % / 25 % sur grand écran) + 40 px d'écart. */
    grid-template-columns: 70% 25%;
    column-gap: 40px;
    align-items: start;
    width: calc((100% - 20px) * 0.9);
  }
}

@media (min-width: 1025px) {
  .ssi-article .ssi-layout {
    grid-template-columns: 75% 25%;
  }
}

/* ---------- Titre, filet, date ---------- */
.ssi-article .ssi-main > *,
.ssi-article .ssi-head > * {
  margin-block: 0;
}

.ssi-article .ssi-title {
  color: var(--ssp-navy);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  -webkit-hyphens: auto;
  hyphens: auto; /* « installer/désinstaller » ne tient pas sur une ligne de téléphone */
}

.ssi-article .ssi-head .ssi-rule {
  margin: 35px 0;
  border: 0;
  border-top: 1px solid rgba(18, 18, 84, 0.45);
  opacity: 1;
  width: 100%;
}

.ssi-article .ssi-date {
  padding-left: 14px;
  color: var(--ssi-text);
  line-height: 1.5;
}

@media (min-width: 768px) {
  .ssi-article .ssi-title {
    font-size: 2.2rem;
  }

  .ssi-article .ssi-date {
    font-size: 1.1rem;
  }
}

/* ---------- Colonne « Catégories » ---------- */
.ssi-article .ssi-aside {
  margin-top: 60px !important;
  padding: 7%;
  border-radius: 10px;
  background: var(--ssi-lavender);
}

.ssi-article .ssi-aside__title {
  margin: 0;
  color: var(--ssp-navy);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
}

.ssi-article .ssi-aside__list {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.ssi-article .ssi-aside__list li {
  padding-bottom: 5px;
  line-height: 1.5;
}

.ssi-article .ssi-aside__list a {
  color: var(--ssp-navy);
  text-decoration: none;
}

.ssi-article .ssi-aside__list a:hover,
.ssi-article .ssi-aside__list a:focus-visible {
  color: var(--ssi-red);
  text-decoration: underline;
}

@media (min-width: 768px) {
  .ssi-article .ssi-aside {
    margin-top: 0 !important;
    padding: 8%;
  }

  .ssi-article .ssi-aside__title {
    font-size: 1.65rem;
  }
}

/* ---------- Navigation Précédent / Suivant ---------- */
.ssi-article .ssi-main > .ssi-postnav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 60px;
}

@media (min-width: 1025px) {
  /* Même grand blanc que l'original au-dessus de Précédent / Suivant */
  .ssi-article .ssi-main > .ssi-postnav {
    margin-top: 284px;
  }
}

.ssi-article .ssi-postnav > * {
  flex: 0 1 50%;
  min-width: 0;
  margin: 0;
}

/* WordPress place la flèche à côté du lien : flèche + lien (libellé au-dessus du titre) */
.ssi-article .ssi-postnav > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ssi-article .ssi-postnav__next {
  justify-content: flex-end;
  text-align: right;
}

.ssi-article .ssi-postnav a {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--ssp-navy);
  text-decoration: none;
}

.ssi-article .ssi-postnav .is-arrow-chevron {
  flex: 0 0 auto;
  width: 16px;
  height: 26px;
  margin: 0;
  overflow: hidden;
  background: var(--ssp-navy);
  color: transparent;
  font-size: 0;
  /* Chevrons Font Awesome Free 6.5.2 (CC BY 4.0) */
  -webkit-mask: url("../images/icons/chevron-left.svg") center / contain no-repeat;
  mask: url("../images/icons/chevron-left.svg") center / contain no-repeat;
}

.ssi-article .ssi-postnav .wp-block-post-navigation-link__arrow-next {
  -webkit-mask-image: url("../images/icons/chevron-right.svg");
  mask-image: url("../images/icons/chevron-right.svg");
}

.ssi-article .ssi-postnav .post-navigation-link__label {
  color: var(--ssi-text);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
}

.ssi-article .ssi-postnav .post-navigation-link__title {
  overflow: hidden;
  font-size: 1rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ssi-article .ssi-postnav a:hover .post-navigation-link__title,
.ssi-article .ssi-postnav a:focus-visible .post-navigation-link__title {
  color: var(--ssi-red);
  text-decoration: underline;
}

/* ---------- Bouton « revenir au début » (fixe, en bas à gauche) ---------- */
.ssi-article .ssi-top {
  position: fixed;
  left: 10px;
  bottom: 10px;
  z-index: 20;
  margin: 0;
}

.ssi-article .ssi-top a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ssp-navy);
  box-shadow: var(--ssp-shadow);
}

.ssi-article .ssi-top a::before {
  content: "";
  width: 18px;
  height: 18px;
  background: #FFFFFF;
  /* Flèche (Font Awesome Free 6.5.2, « arrow-up », CC BY 4.0) */
  -webkit-mask: url("../images/icons/arrow-up.svg") center / contain no-repeat;
  mask: url("../images/icons/arrow-up.svg") center / contain no-repeat;
}

.ssi-article .ssi-top a:hover,
.ssi-article .ssi-top a:focus-visible {
  background: var(--ssi-red);
}

.ssi-article .ssi-top a:focus-visible {
  outline: 3px solid var(--ssp-navy);
  outline-offset: 3px;
}

@supports (animation-timeline: scroll()) {
  .ssi-article .ssi-top {
    animation: ssi-top-in linear both;
    animation-timeline: scroll(root);
    animation-range: 0 600px;
  }

  @keyframes ssi-top-in {
    0%, 60% { opacity: 0; visibility: hidden; }
    100% { opacity: 1; visibility: visible; }
  }
}

/* =====================================================================
   Contenu de l'article
   ===================================================================== */

.ssi {
  --ssi-pad: 52px;    /* espace au-dessus d'un titre d'étape (pastille à 8 px au-dessus du titre) */
  --ssi-indent: 9%;   /* retrait de la pastille, en % de la largeur comme l'original */
  margin-top: 31px !important;
  padding-inline: 10px;
  color: var(--ssp-navy);
}

.ssi p,
.ssi h2,
.ssi h3,
.ssi ul,
.ssi figure {
  margin: 0;
}

/* ---------- Onglets ---------- */
.ssi-tablist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ssi-tab,
.ssi-tabs:not(.is-tabs) .ssi-panel__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  min-height: 54px;
  padding: 15px 35px;
  border: 0;
  border-radius: 0;
  background: var(--ssi-red);
  color: #FFFFFF;
  font: 500 1rem/1.8 var(--wp--preset--font-family--poppins, Poppins, sans-serif);
  text-align: center;
  cursor: pointer;
}

.ssi-tab::before,
.ssi-tabs:not(.is-tabs) .ssi-panel__title::before {
  content: "";
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  background: currentColor;
  /* Icônes Font Awesome Free 6.5.2 (CC BY 4.0) : file-arrow-down, file-export */
  -webkit-mask: url("../images/icons/file-arrow-down.svg") center / contain no-repeat;
  mask: url("../images/icons/file-arrow-down.svg") center / contain no-repeat;
}

.ssi-tab--uninstall::before,
.ssi-tabs:not(.is-tabs) .ssi-panel__title--uninstall::before {
  -webkit-mask-image: url("../images/icons/file-export.svg");
  mask-image: url("../images/icons/file-export.svg");
}

.ssi-tab[aria-selected="false"] {
  background: var(--ssi-tab);
  color: var(--ssi-text);
}

.ssi-tab[aria-selected="false"]:hover {
  background: #E2E4E7;
}

.ssi-tab:focus-visible {
  outline: 3px solid var(--ssp-navy);
  outline-offset: 2px;
}

/* Avec les onglets, le titre <h2> reste lu par les lecteurs d'écran mais n'est plus affiché */
.ssi-tabs.is-tabs .ssi-panel__title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ssi-panel {
  margin-top: 9px;
  padding: 20px;
}

.ssi-panel[hidden] {
  display: none;
}

.ssi-panel:focus {
  outline: none;
}

.ssi-tabs:not(.is-tabs) .ssi-panel {
  margin-top: 0;
  padding-inline: 0;
}

.ssi-tabs:not(.is-tabs) .ssi-panel__title {
  margin-bottom: 20px;
}

/* Onglets côte à côte au-delà de 1024 px (l'un sous l'autre en dessous, comme l'original ;
   toujours l'un sous l'autre avec .ssi-tabs--stack, cas de Chrome / Opera) */
@media (min-width: 1025px) {
  .ssi-tabs:not(.ssi-tabs--stack) .ssi-tablist {
    flex-direction: row;
  }

  .ssi-tab {
    flex: 1 1 auto;
    width: auto;
    min-height: 59px;
  }
}

/* ---------- Rythme vertical (mêmes écarts que l'original) ---------- */
.ssi .ssi-panel > * + *,
.ssi .ssi-option__body > * + *,
.ssi .ssi-note > * + * {
  margin-top: 20px;
}

.ssi .ssi-tabs.is-tabs .ssi-panel__title + * {
  margin-top: 0;
}

/* Capture d'écran : centrée, 768 px au plus, 44 px sous l'image */
.ssi .ssi-shot {
  padding-bottom: 45px; /* padding (et non marge) : ne fusionne pas avec l'écart de 20 px qui suit */
}

.ssi .ssi-shot img {
  margin-inline: auto;
  max-width: min(100%, 768px); /* largeur réelle (attribut width) si plus petite */
  height: auto;
}

.ssi .ssi-shot:last-child {
  padding-bottom: 0;
}

/* ---------- Étapes ---------- */
.ssi-step {
  position: relative;
}

.ssi-step--num {
  counter-increment: ssi-step;
}

.ssi-panel,
.ssi-option__body {
  counter-reset: ssi-step;
}

.ssi .ssi-step__title {
  color: var(--ssp-navy);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.ssi .ssi-step__title a {
  color: inherit;
  text-decoration: none;
}

.ssi .ssi-step__title a:hover,
.ssi .ssi-step__title a:focus-visible {
  color: var(--ssi-red);
  text-decoration: underline;
}

.ssi .ssi-step__title {
  margin-bottom: 16px;
}

/* Titre seul : l'espace reste dans l'étape (une marge sortirait du bloc et fusionnerait) */
.ssi .ssi-step__title:last-child {
  margin-bottom: 0;
  padding-bottom: 16px;
}

.ssi .ssi-step__text {
  margin-top: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Pastille numérotée (compteur CSS, remplace les images SVG « 1 », « 2 »…) */
.ssi-step--num .ssi-step__title::before {
  content: counter(ssi-step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 28px;
  border-radius: 50%;
  background: var(--ssi-num);
  color: #FFFFFF;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
}

.ssi-step--num {
  padding-top: 14px;
}

/* Première étape de Firefox (« Téléchargez… ») et « OU suivez les étapes ci-dessous » */
.ssi .ssi-step--lead .ssi-step__title {
  font-size: 1.2rem;
}

.ssi-step--or {
  padding-top: 33px;
  border-top: 1px solid var(--ssi-night);
}

.ssi .ssi-step--or .ssi-step__title {
  font-size: 1.1rem;
  line-height: 1.4;
}

.ssi .ssi-step--or .ssi-step__text {
  font-size: 1rem;
}

/* « OU » (Chrome) */
.ssi .ssi-or {
  color: var(--ssi-red);
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1;
}

.ssi .ssi-nb {
  padding-bottom: 14px;
  font-size: 1rem;
}

.ssi .ssi-buttons {
  justify-content: center;
  gap: 0;
  padding-bottom: 28px;
}

.ssi .ssi-btn .wp-block-button__link {
  min-height: 44px;
  padding: 12px 24px;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.1;
}

@media (min-width: 768px) {
  .ssi .ssi-step__title,
  .ssi .ssi-step__text,
  .ssi .ssi-nb {
    font-size: 1.21rem;
  }

  .ssi .ssi-step__text {
    line-height: 1.5;
  }

  .ssi .ssi-step--lead .ssi-step__title {
    font-size: 1.43rem;
  }

  .ssi .ssi-step--or .ssi-step__title {
    font-size: 1.32rem;
  }

  .ssi .ssi-step--or .ssi-step__text {
    font-size: 1.21rem;
  }

  .ssi .ssi-btn .wp-block-button__link {
    font-size: 1.1rem;
  }

  .ssi .ssi-buttons {
    padding-bottom: 8px;
  }

  /* Pastille à gauche du titre, à 9 % du bord (comme l'original) */
  .ssi-step--num {
    padding-top: var(--ssi-pad);
    padding-left: calc(var(--ssi-indent) + 65px);
  }

  /* Positionnée par rapport au titre (l'éditeur rend chaque bloc « position: relative ») */
  .ssi-step--num .ssi-step__title {
    position: relative;
  }

  .ssi-step--num .ssi-step__title::before {
    position: absolute;
    top: -8px;
    left: -65px;
    width: 50px;
    height: 50px;
    margin: 0;
    font-size: 1.65rem;
  }

  /* Étapes sans pastille alignées sur le texte des étapes numérotées */
  .ssi-step:not(.ssi-step--num):not(.ssi-step--or) {
    padding-top: 8px;
  }

  .ssi-step--lead {
    padding-top: var(--ssi-pad) !important;
  }

  /* Firefox : étapes moins espacées ; Chrome : pastilles au bord du cadre */
  .ssi-panel--tight {
    --ssi-pad: 35px;
  }

  /* Firefox : titres d'étape de 26 px de haut sur l'original (liens dans les titres) */
  .ssi .ssi-panel--tight .ssi-step--num .ssi-step__title,
  .ssi .ssi-panel--tight .ssi-note__title {
    line-height: 26px;
  }

  .ssi-panel--flush {
    --ssi-pad: 53px;
    --ssi-indent: 0%;
  }

  .ssi-panel--flush .ssi-step:not(.ssi-step--num) {
    padding-left: 65px;
  }

  /* Chrome, 1re étape : pastille au-dessus du titre */
  .ssi-step--num.ssi-step--stacked {
    padding: 0;
  }

  .ssi-step--stacked .ssi-step__title::before {
    position: static;
    margin-bottom: 32px;
  }

  /* Désinstallation : « Option 1 / 2 » collées au-dessus de leur liste */
  .ssi-panel--options .ssi-step--num {
    --ssi-pad: 8px;
    padding-top: 8px;
  }

}

@media (min-width: 1025px) {
  .ssi .ssi-buttons {
    justify-content: flex-start;
  }
}

/* ---------- Listes ---------- */
.ssi .ssi-list {
  padding: 0 0 0 10%;
  list-style: none;
  font-size: 1rem;
  line-height: 1.5;
}

.ssi .ssi-list li {
  position: relative;
  padding: 2px 0 2px 24px;
}

.ssi .ssi-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(0.75em - 5px);
  width: 15px;
  height: 15px;
  background: var(--ssi-red);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.ssi .ssi-list--pm li {
  padding-left: 30px;
}

.ssi .ssi-list--pm li::before {
  width: 20px;
  height: 20px;
  top: calc(0.75em - 7px);
  clip-path: none;
  /* Icônes Font Awesome Free 6.5.2 (CC BY 4.0) : plus, minus */
  -webkit-mask: url("../images/icons/plus.svg") center / contain no-repeat;
  mask: url("../images/icons/plus.svg") center / contain no-repeat;
}

.ssi .ssi-list--pm li.ssi-minus::before {
  -webkit-mask-image: url("../images/icons/minus.svg");
  mask-image: url("../images/icons/minus.svg");
}

@media (min-width: 768px) {
  .ssi .ssi-list--tri {
    font-size: 1.1rem;
  }
}

/* ---------- Encadré « Le saviez-vous ? » ---------- */
.ssi-note {
  position: relative;
  padding-top: 14px;
}

.ssi-note__title::before {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  margin-bottom: 20px;
  background: var(--ssi-red);
  /* Icône Font Awesome Free 6.5.2 « question » (CC BY 4.0) */
  -webkit-mask: url("../images/icons/question.svg") left center / contain no-repeat;
  mask: url("../images/icons/question.svg") left center / contain no-repeat;
}

.ssi .ssi-note__title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.ssi .ssi-note > .ssi-step__text {
  margin-top: 16px;
}

.ssi .ssi-note > .ssi-list {
  margin-top: 20px;
  padding-bottom: 46px;
}

@media (min-width: 768px) {
  .ssi-note {
    padding-top: var(--ssi-pad);
    padding-left: calc(9% + 65px);
  }

  .ssi-panel--flush .ssi-note {
    padding-top: 8px;
  }

  .ssi .ssi-note__title {
    position: relative;
  }

  .ssi-note__title::before {
    position: absolute;
    top: -8px;
    left: -65px;
    width: 50px;
    height: 47px;
    margin: 0;
  }


  .ssi .ssi-note__title {
    font-size: 1.21rem;
  }

  /* La liste de l'encadré repart à 10 % du bord, comme l'original */
  .ssi-note > .ssi-list {
    margin-left: calc(-9% - 65px);
  }
}

/* ---------- Accordéon « Option 1 / Option 2 » (bloc Détails) ---------- */
.ssi .ssi-option {
  border: 1px solid var(--ssi-line);
}

.ssi .ssi-option + .ssi-option {
  margin-top: 10px;
}

.ssi .ssi-option > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 12px;
  color: var(--ssp-navy);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
}

.ssi .ssi-option > summary::-webkit-details-marker {
  display: none;
}

.ssi .ssi-option > summary::before {
  content: "";
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  background: currentColor;
  -webkit-mask: url("../images/icons/plus.svg") center / contain no-repeat;
  mask: url("../images/icons/plus.svg") center / contain no-repeat;
}

.ssi .ssi-option[open] > summary {
  border-bottom: 1px solid var(--ssi-line);
  color: var(--ssi-red);
}

.ssi .ssi-option[open] > summary::before {
  -webkit-mask-image: url("../images/icons/minus.svg");
  mask-image: url("../images/icons/minus.svg");
}

.ssi .ssi-option > summary:hover {
  color: var(--ssi-red);
}

.ssi .ssi-option > summary:focus-visible {
  outline: 3px solid var(--ssp-navy);
  outline-offset: -3px;
}

.ssi .ssi-option > .ssi-option__body {
  margin-top: 0;
  padding: 10px;
}
