/* ==========================================================================
   bio.css — Styles dédiés aux pages Biographie
   ========================================================================== */

/* Base */
* { box-sizing: border-box; }
html, body { width: 100%; }

/* Décalage sous la navbar fixed-top (position actuelle conservée) */
body{
  padding-top: 95px !important;
}

@media (max-width: 576px){
  body{
    padding-top: 112px !important;
  }
}

/* ==========================================================================
   Zone BIO
   ========================================================================== */

.container.bio{
  max-width: 980px;
  margin: 0 auto;
  padding: 1.25rem 0.9rem;
  margin-top: 0 !important;
  overflow-x: clip;
}
@supports not (overflow: clip) {
  .container.bio { overflow-x: hidden; }
}

@media (max-width: 576px){
  .container.bio{
    padding: 1rem 0.75rem;
  }
}

/* Neutralisation des styles globaux gênants */
.container.bio,
.container.bio *{
  white-space: normal !important;
  max-width: 100%;
  min-width: 0;
}

/* ==========================================================================
   TITRE PRINCIPAL (un peu plus petit)
   ========================================================================== */

.container.bio .custom-h1{
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;

  position: relative;
  z-index: 2;

  font-family: 'Handlee', cursive;

  /* Taille réduite */
  font-size: clamp(1.4rem, 4.8vw, 2rem);

  line-height: 1.15;
  margin: 0 0 0.6rem 0;

  color: #dc3545 !important;
}

/* ==========================================================================
   SOUS-TITRES
   ========================================================================== */

.container.bio h5{
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.05rem, 3.8vw, 1.25rem);
  line-height: 1.2;
  margin: 1.2rem 0 0.35rem 0;
}

/* 1er sous-titre remonté fortement (≈ -20 % supplémentaires) */
.container.bio .paragraph1{
  margin-top: 0.3rem !important;
}

/* Couleurs individuelles */
.container.bio .paragraph1 { color: #dc3545 !important; }
.container.bio .paragraph2 { color: #fd7e14 !important; }
.container.bio .paragraph3 { color: #ffc107 !important; }
.container.bio .paragraph4 { color: #28a745 !important; }
.container.bio .paragraph5 { color: #20c997 !important; }
.container.bio .paragraph6 { color: #17a2b8 !important; }
.container.bio .paragraph7 { color: #007bff !important; }
.container.bio .paragraph8 { color: #6f42c1 !important; }

/* ==========================================================================
   TEXTE
   ========================================================================== */

.container.bio p{
  font-family: 'Nunito', sans-serif;
  font-size: clamp(0.98rem, 3.6vw, 1.1rem);
  line-height: 1.7;
  margin: 0 0 0.25rem 0;

  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;

  color: #212529;
}

/* Liens */
.container.bio a{
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

/* ==========================================================================
   Infobulles
   ========================================================================== */

.infobulle{
  display: inline;
  max-width: 100%;
}

/* Base commune : verrou anti-"texte vertical" + anti coupure lettre-à-lettre */
.container.bio .infobulle::before,
.container.bio .infobulle::after{
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;

  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  hyphens: auto;

  /* on neutralise toute largeur héritée */
  width: auto !important;
  min-width: 0 !important;
}

/* iPhone / petits écrans : on conserve le réglage qui fonctionne chez vous */
@media (max-width: 767px){
  .container.bio .infobulle::before,
  .container.bio .infobulle::after{
    max-width: min(320px, 92vw) !important;

    overflow-wrap: break-word !important;
    word-break: normal !important;

    width: auto !important;
    min-width: 0 !important;
  }
}

/* Tablette + ordi : cadre au plus près du texte */
@media (min-width: 768px){
  .container.bio .infobulle::before,
  .container.bio .infobulle::after{
    /* "shrink-to-fit" au contenu */
    display: inline-block !important;
    inline-size: max-content !important;

    /* mais on évite une bulle géante si le texte est long */
    max-inline-size: 520px !important;

    /* pas de min-width sur desktop => cadre colle au texte */
    min-width: 0 !important;

    /* si ça dépasse, on casse proprement (sans colonne) */
    overflow-wrap: break-word !important;
  }
}

/* Fallback si max-content/inline-size ne sont pas supportés */
@supports not (inline-size: max-content){
  @media (min-width: 768px){
    .container.bio .infobulle::before,
    .container.bio .infobulle::after{
      width: max-content !important;
      max-width: 520px !important;
      min-width: 0 !important;
      display: inline-block !important;
      overflow-wrap: break-word !important;
    }
  }
}

/* ==========================================================================
   Médias
   ========================================================================== */

img, svg, video, iframe, embed, object{
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   Numéros des paragraphes — pastilles colorées (CSS only)
   Objectif :
   - entourer le numéro par la couleur du titre du paragraphe
   - numéro en blanc
   Hypothèse (comme dans votre HTML) :
   - chaque paragraphe commence par <strong>1.</strong>, <strong>2.</strong>, etc.
   - chaque <p> suit immédiatement le <h5 class="paragraphX">
   ========================================================================== */

/* Style commun : transformer le <strong> initial en pastille */
.container.bio h5 + p > strong:first-child{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 1.9em;
  height: 1.9em;
  padding: 0 0.2em;

  border-radius: 999px;
  margin-right: 0.55rem;
  transform: translateY(-0.08em);

  font-weight: 800;
  line-height: 1;

  background: var(--num-color, #212529);
  border: 2px solid var(--num-color, #212529);
  color: #fff;

  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* Mobile : un peu plus compact */
@media (max-width: 576px){
  .container.bio h5 + p > strong:first-child{
    min-width: 1.75em;
    height: 1.75em;
    margin-right: 0.5rem;
    border-width: 2px;
  }
}

/* Couleur de la pastille = couleur du sous-titre */
.container.bio h5.paragraph1 + p > strong:first-child{ --num-color: #dc3545; }
.container.bio h5.paragraph2 + p > strong:first-child{ --num-color: #fd7e14; }
.container.bio h5.paragraph3 + p > strong:first-child{ --num-color: #ffc107; }
.container.bio h5.paragraph4 + p > strong:first-child{ --num-color: #28a745; }
.container.bio h5.paragraph5 + p > strong:first-child{ --num-color: #20c997; }
.container.bio h5.paragraph6 + p > strong:first-child{ --num-color: #17a2b8; }
.container.bio h5.paragraph7 + p > strong:first-child{ --num-color: #007bff; }
.container.bio h5.paragraph8 + p > strong:first-child{ --num-color: #6f42c1; }
