/* Le conteneur de la section extensible */
.section-template-flex .expander {
  position: relative; /* ancre interne du bouton */
}

/* Contenu ouvert : réserve un espace pour le bouton */
.section-template-flex .expander[open] .expander-content {
  position: relative;
  padding-bottom: 64px;
}

/* Bouton Lire plus / Réduire : ANCRÉ DANS LE BLOC (pas dans la fenêtre) */
.section-template-flex .expander[open] .expander-cta {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  background-color: #8B0000;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: background-color .2s ease, transform .15s ease;
}

.section-template-flex .expander[open] .expander-cta:hover {
  background-color: #a80000;
  transform: translateY(-1px);
}

/* Mobile : plus compact */
@media (max-width: 600px) {
  .section-template-flex .expander[open] .expander-content { padding-bottom: 56px; }
  .section-template-flex .expander[open] .expander-cta {
    right: 12px;
    bottom: 12px;
    padding: 9px 16px;
    border-radius: 7px;
    font-size: 14px;
  }
}

/* Images : coins non arrondis */
.section-template-flex .block-carousel-standard-v1 img,
.section-template-flex .block-carousel-universal-v1 img,
.section-template-flex .block-carousel-universal-v1-2per-row img,
.section-template-flex .swiper-slide img {
  border-radius: 0 !important;
}

/* Mobile: tout à gauche inside section-template-flex */
@media (max-width: 768px) {
  .section-template-flex .stf-inner { 
    text-align: left !important;
  }
  .section-template-flex .section-title,
  .section-template-flex .teaser,
  .section-template-flex .expander-summary,
  .section-template-flex .expander-content p,
  .section-template-flex .carousel-block-title,
  .section-template-flex .carousel-block-subtitle {
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: auto !important;
  }
}

/* === Ajustements globaux (version qui cible VRAIMENT le template) === */
.section-template-flex { padding-top: 60px; padding-bottom: 40px; }

.section-template-flex .section-title {
  margin-bottom: 10px;
  line-height: 1.3;
}

.section-template-flex .teaser {
  font-size: 1.05em;
  opacity: 0.9;
  margin-bottom: 15px;
}

.section-template-flex .section-intro p {
  margin-bottom: 1.2em;
  line-height: 1.9;
  font-size: 1rem;
}

.section-template-flex .expander-cta {
  background: #8B0000;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 8px 14px;
  color: #fff;
  font-size: .95em;
}

/* Japonais : micro-ajustements */
html[lang="ja"] .section-template-flex .section-title,
html[lang="ja"] .section-template-flex .teaser {
  letter-spacing: 0.02em;
}
html[lang="ja"] .section-template-flex .section-intro p {
  line-height: 2;
  word-break: keep-all;
}
/* ==== HOTFIX: forcer l’ancrage du bouton au bloc, et réserver l’espace ==== */
.section-template-flex .expander { position: relative !important; }

.section-template-flex .expander[open] .expander-content {
  position: relative !important;
  padding-bottom: 64px !important;   /* espace pour le bouton */
}

.section-template-flex .expander[open] .expander-cta {
  position: absolute !important;     /* écrase tout "fixed" résiduel */
  right: 16px !important;
  bottom: 16px !important;
  z-index: 3 !important;
}

/* Mobile un peu plus compact */
@media (max-width: 600px) {
  .section-template-flex .expander[open] .expander-content { padding-bottom: 56px !important; }
  .section-template-flex .expander[open] .expander-cta {
    right: 12px !important; bottom: 12px !important;
  }
}

/* Harmoniser l’alignement mobile (contre tout centrage précédent) */
@media (max-width: 768px) {
  .section-template-flex .stf-inner,
  .section-template-flex .section-title,
  .section-template-flex .teaser,
  .section-template-flex .expander-summary,
  .section-template-flex .expander-content p,
  .section-template-flex .carousel-block-title,
  .section-template-flex .carousel-block-subtitle {
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: auto !important;
  }
}
