/* * FICHIER CSS RÉORGANISÉ
 * Fichier : assets/css/jp-hero.css
 * Rôle : Bandeaux héro et contenus d’introduction.
 *
 * Organisation :
 * 1. Styles de base du module
 * 2. États et interactions
 * 3. Adaptations responsives, dans l’ordre du fichier d’origine
 *
 * Maintenance : l’ordre des règles est conservé afin de respecter la cascade CSS.
 * Les doublons strictement identiques dans un même bloc ont été supprimés. */

/* *
 * jp-hero.css
 * Rôle : Bandeau principal (hero).
 *
 * Organisation du fichier :
 * 1. Variables et fondations éventuelles
 * 2. Structure principale du composant
 * 3. États, variantes et interactions
 * 4. Adaptations responsives
 *
 * Les doublons strictement identiques ont été supprimés. Les surcharges
 * volontaires et les fallbacks compatibles ont été conservés pour ne pas
 * modifier le rendu ou le comportement existant. */

/* ==========================================================
   JP HERO — Bandeau haut de page
   Fichier nettoyé, indenté et commenté
   ========================================================== */

/* =========================================================
   HERO : bandeau haut de page
   ========================================================= */

/* ---------------------------------------------------------
   Réglages rapides du Hero
   Modifier ces variables suffit généralement pour ajuster
   toute la mise en page du Hero.
   --------------------------------------------------------- */

/* ==========================================================================
   Bandeau principal
   ========================================================================== */

.jp-hero {
    /* Dimensions générales */
    --jp-hero-height: 412px;
    --jp-hero-padding-y: 20px;
    --jp-hero-padding-x: 7%;
    --jp-hero-radius: 42px;
    /* Décalage du contenu principal */
    --jp-hero-main-top: 5mm;
    /* Espacement entre les badges et le titre */
    --jp-title-margin-top: 6mm;
    /* Décalage de la ligne Type + Surtitre */
    --jp-hero-badges-left: 3cm;
    --jp-hero-badges-top: 2mm;
    /* Position de la phrase manuscrite */
    --jp-script-top: 38px;
    --jp-script-left: 600px;
    --jp-script-right: 330px;
    /* -----------------------------------------------------
       Bloc Hero
       ----------------------------------------------------- */
    position: relative;
    height: var(--jp-hero-height);
    min-height: var(--jp-hero-height);
    padding: var(--jp-hero-padding-y) var(--jp-hero-padding-x);
    color: #fff;
    background: linear-gradient(135deg, #0d2448, #18345d, #244a7d);
    border-bottom-left-radius: var(--jp-hero-radius);
    border-bottom-right-radius: var(--jp-hero-radius);
    overflow: hidden;
    width: 100%;
    max-width: none;
}

/* ---------------------------------------------------------
   Contenu principal du Hero
   --------------------------------------------------------- */

.jp-hero-main {
    max-width: 780px;
    position: relative;
    z-index: 2;
    top: var(--jp-hero-main-top);
}

/* ---------------------------------------------------------
   Image de fond
   --------------------------------------------------------- */

.jp-hero-bg-img {
    position: absolute;
    left: 0;
    top: -2%;
    width: 100%;
    height: 104%;
    object-fit: cover;
    object-position: center center;
    z-index: 0;
}

/* Bandeau bleu foncé à gauche + léger dégradé vers l'image */

.jp-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
    90deg,
    rgba(8, 23, 47, 0.92) 0%,
    rgba(8, 23, 47, 0.86) 33%,
    rgba(8, 23, 47, 0.55) 45%,
    rgba(8, 23, 47, 0.18) 58%,
    rgba(8, 23, 47, 0.04) 100%
  );
    z-index: 1;
    pointer-events: none;
}

/* ---------------------------------------------------------
   Ligne contenant le type et le surtitre
   --------------------------------------------------------- */

.jp-hero-badges {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 6px;
    flex-wrap: nowrap;
    position: relative;
    left: var(--jp-hero-badges-left);
    top: var(--jp-hero-badges-top);
}

/* ---------------------------------------------------------
   Badge du type de formation
   --------------------------------------------------------- */

.jp-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--jp-main);
    color: #fff;
    font-weight: 900;
    text-transform: uppercase;
    font-size: clamp(20px, 1.3vw, 28px);
    line-height: 1;
    padding: 6px 18px;
    border-radius: 8px;
    white-space: nowrap;
}

/* ---------------------------------------------------------
   Surtitre
   --------------------------------------------------------- */

.jp-hero-surtitre {
    display: inline-flex;
    align-items: center;
    padding: 14px 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
    white-space: nowrap;
    position: relative;
    top: -5px;
}

/* ---------------------------------------------------------
   Titre principal
   --------------------------------------------------------- */

.jp-hero h1 {
    font-family: "Poppins", "Montserrat", sans-serif;
    font-size: clamp(34px, 2.4vw, 48px);
    line-height: 1.02;
    font-weight: 500;
    letter-spacing: -0.012em;
    color: #fff;
    margin: var(--jp-title-margin-top) 0 1mm;
    opacity: 0;
    transform: scale(0.82);
    transform-origin: left center;
    animation: jp-title-zoom 0.9s cubic-bezier(0.2, 0.9, 0.25, 1.2) forwards;
}

/* ---------------------------------------------------------
   Nom complet de la formation
   --------------------------------------------------------- */

.jp-subtitle {
    font-size: clamp(18px, 1.1vw, 21px);
    font-weight: 100;
    line-height: 1.18;
    max-width: 700px;
    color: #fff;
    margin: 8px 0 18px;
    padding: 0;
    opacity: 0;
    transform: scale(0.82);
    transform-origin: left center;
    animation: jp-subtitle-zoom 0.9s cubic-bezier(0.2, 0.9, 0.25, 1.2) 0.25s
    forwards;
}

/* ---------------------------------------------------------
   Description éventuelle
   --------------------------------------------------------- */

.jp-desc {
    font-size: 13px;
    line-height: 1.4;
    max-width: 700px;
    margin-top: 12px;
    margin-bottom: 18px;
}

/* ---------------------------------------------------------
   Phrase manuscrite
   --------------------------------------------------------- */

.jp-script {
    position: absolute;
    top: var(--jp-script-top);
    left: var(--jp-script-left);
    right: var(--jp-script-right);
    width: var(--jp-script-width, auto);
    max-width: var(--jp-script-max-width, none);
    transform: var(--jp-script-transform, none);
    text-align: var(--jp-script-align, center);
    font-family: "Caveat", cursive;
    font-size: var(--jp-script-size-desktop, clamp(42px, 3vw, 56px));
    font-weight: 500;
    font-style: normal;
    line-height: var(--jp-script-line-height, 0.95);
    letter-spacing: 0;
    color: #fff;
    text-shadow: var(--jp-script-shadow, 0 2px 5px rgba(0, 0, 0, 0.18));
    z-index: 4;
    pointer-events: none;
    white-space: normal;
    overflow: visible;
}

.jp-script span {
    transition: opacity 0.12s ease;
}

/* ---------------------------------------------------------
   Cartouche d'informations
   --------------------------------------------------------- */

.jp-hero-side {
    position: absolute;
    top: 0;
    right: 24px;
    width: 260px;
    max-width: calc(100% - 48px);
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    padding: 8px 12px;
    border-radius: 14px;
    box-sizing: border-box;
}

.jp-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.jp-info-icon, .jp-info-icon svg {
    width: 28px;
    height: 28px;
}

.jp-info-icon {
    color: var(--jp-main);
}

.jp-info-icon svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.jp-info-text {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.15;
    color: #fff;
}

/* ---------------------------------------------------------
   Animations
   --------------------------------------------------------- */

@keyframes jp-title-zoom {
    from {
      opacity: 0;
      transform: scale(0.82);
  }
    to {
      opacity: 1;
      transform: scale(1);
  }
}

@keyframes jp-subtitle-zoom {
    from {
      opacity: 0;
      transform: scale(0.82);
  }
    to {
      opacity: 1;
      transform: scale(1);
  }
}

/* ---------------------------------------------------------
   Adaptations écran intermédiaire
   --------------------------------------------------------- */

/* ==========================================================================
   Adaptation responsive : (max-width: 1300px)
   ========================================================================== */

@media (max-width: 1300px) {
    .jp-hero {
      --jp-script-left: 43%;
      --jp-script-right: 4%;
      --jp-script-top: 25px;
  }
    .jp-script {
      font-size: var(--jp-script-size-medium, clamp(40px, 3.4vw, 52px));
  }
}

/* ---------------------------------------------------------
   Adaptations tablette
   --------------------------------------------------------- */

/* ==========================================================================
   Adaptation responsive : (max-width: 1100px)
   ========================================================================== */

@media (max-width: 1100px) {
    .jp-hero {
      --jp-script-left: 38%;
      --jp-script-right: 4%;
      --jp-script-top: 28px;
  }
    .jp-script {
      font-size: var(--jp-script-size-tablet, clamp(38px, 4.2vw, 48px));
  }
}

/* =========================================================
   JP HERO v2.1 — options universelles
   Ces règles ajoutent des variables sans casser les pages Formation.
   ========================================================= */

.jp-hero {
    --jp-hero-overlay-left: rgba(8, 23, 47, 0.92);
    --jp-hero-overlay-mid: rgba(8, 23, 47, 0.55);
    --jp-hero-overlay-end: rgba(8, 23, 47, 0.04);
}

.jp-hero::after {
    background: linear-gradient(
    90deg,
    var(--jp-hero-overlay-left) 0%,
    color-mix(in srgb, var(--jp-hero-overlay-left) 92%, transparent) 33%,
    var(--jp-hero-overlay-mid) 45%,
    rgba(8, 23, 47, 0.18) 58%,
    var(--jp-hero-overlay-end) 100%
  );
}

.jp-hero-bg-dark {
    background: linear-gradient(135deg, #0d2448, #18345d, #244a7d);
}

.jp-hero-bg-color {
    background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--jp-main, #e95b22) 82%, #10233f),
    color-mix(in srgb, var(--jp-main, #e95b22) 48%, #10233f)
  );
}

.jp-hero-bg-light {
    background: linear-gradient(135deg, #ffffff, #eef8fb);
    color: var(--jp-dark, #10233f);
}

.jp-hero-bg-light::after {
    background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.96),
    rgba(255, 255, 255, 0.78),
    rgba(255, 255, 255, 0.22)
  );
}

.jp-hero-bg-light h1, .jp-hero-bg-light .jp-subtitle, .jp-hero-bg-light .jp-script, .jp-hero-bg-light .jp-hero-surtitre {
    color: var(--jp-dark, #10233f);
}

.jp-hero-bg-none::after {
    display: none;
}

/* =========================================================
   PALETTE ADMINISTRABLE DU VOILE DU HERO
   ========================================================= */

.jp-hero {
    background-color: var(--jp-hero-gradient-color, #08172f);
}

.jp-hero::after {
    background: linear-gradient(
    90deg,
    var(--jp-hero-overlay-start, rgba(8, 23, 47, .96)) 0%,
    var(--jp-hero-overlay-strong, rgba(8, 23, 47, .90)) 18%,
    var(--jp-hero-overlay-mid, rgba(8, 23, 47, .60)) 27%,
    var(--jp-hero-overlay-soft, rgba(8, 23, 47, .22)) 38%,
    var(--jp-hero-overlay-end, rgba(8, 23, 47, 0)) 50%
  );
}

.jp-hero-gradient-none, .jp-hero-gradient-none::after, .jp-hero-bg-none::after {
    background: transparent;
}

.jp-hero-gradient-none::after, .jp-hero-bg-none::after {
    display: none;
}

.jp-hero-gradient-none {
    background-color: transparent !important;
    background-image: none !important;
}

/* =========================================================
   APPARENCE ADMINISTRABLE DU HERO — Framework JP 4.1
   ========================================================= */

/* ==========================================================================
   Adaptation responsive : (min-width: 901px)
   ========================================================================== */

@media (min-width: 901px) {
    .jp-hero.jp-hero-text-center .jp-hero-main {
      max-width: min(760px, 62%);
      margin-inline: auto;
      text-align: center;
  }
    .jp-hero.jp-hero-text-center .jp-hero-badges, .jp-hero.jp-hero-text-center .jp-buttons, .jp-hero.jp-hero-text-center .jp-statuses {
      justify-content: center;
  }
    .jp-hero.jp-hero-text-center .jp-hero-badges {
      left: 0;
  }
    .jp-hero.jp-hero-text-center h1, .jp-hero.jp-hero-text-center .jp-subtitle, .jp-hero.jp-hero-text-center .jp-desc {
      margin-inline: auto;
  }
    .jp-hero.jp-hero-text-right .jp-hero-main {
      max-width: min(720px, 55%);
      margin-left: auto;
      text-align: right;
  }
    .jp-hero.jp-hero-text-right .jp-hero-badges, .jp-hero.jp-hero-text-right .jp-buttons, .jp-hero.jp-hero-text-right .jp-statuses {
      justify-content: flex-end;
  }
    .jp-hero.jp-hero-text-right .jp-hero-badges {
      left: 0;
  }
    .jp-hero.jp-hero-text-right h1, .jp-hero.jp-hero-text-right .jp-subtitle, .jp-hero.jp-hero-text-right .jp-desc {
      margin-left: auto;
  }
    .jp-hero.jp-hero-script-top-left {
      --jp-script-left: 7%;
      --jp-script-right: 48%;
      --jp-script-top: 28px;
  }
    .jp-hero.jp-hero-script-top-center {
      --jp-script-left: 34%;
      --jp-script-right: 20%;
      --jp-script-top: 28px;
  }
    .jp-hero.jp-hero-script-top-right {
      --jp-script-left: 52%;
      --jp-script-right: 5%;
      --jp-script-top: 28px;
  }
    .jp-hero.jp-hero-script-over-title .jp-script {
      top: 86px;
      left: 28%;
      right: auto;
      width: max-content;
      max-width: 58%;
      text-align: left;
      transform: rotate(-1deg);
  }
}

/* ==========================================================
   Description du Hero en Caveat — Framework JP 11.3.6
   Formations, contenus et page « En construction »
   ========================================================== */

/* ==========================================================================
   Fondations et règles globales
   ========================================================================== */

body.single-formation .jp-hero .jp-desc, body.single-contenu .jp-hero .jp-desc, body.jp-construction-view .jp-hero .jp-desc {
    font-family: "Caveat", cursive;
    font-size: clamp(15px, 1.05vw, 21px);
    font-weight: 500;
    line-height: 1.18;
    letter-spacing: 0;
    max-width: 760px;
    margin-top: 14px;
    margin-bottom: 22px;
}

body.single-formation .jp-hero .jp-desc p, body.single-contenu .jp-hero .jp-desc p, body.jp-construction-view .jp-hero .jp-desc p {
    margin: 0;
    font: inherit;
    line-height: inherit;
}

/* ==========================================================================
   Adaptation responsive : (max-width: 900px)
   ========================================================================== */

@media (max-width: 900px) {
    body.single-formation .jp-hero .jp-desc, body.single-contenu .jp-hero .jp-desc, body.jp-construction-view .jp-hero .jp-desc {
      font-size: clamp(12px, 4vw, 18px);
      line-height: 1.2;
      max-width: 100%;
      margin-top: 12px;
      margin-bottom: 18px;
  }
}


/* ==========================================================
   BOUTONS DU HERO — ICÔNES MONOCHROMES SANS FOND
   ========================================================== */

/*
 * Les icônes sont utilisées comme masques SVG et non comme images <img>.
 * Elles prennent ainsi automatiquement la couleur voulue, sans carré blanc.
 */
.jp-hero .jp-buttons .jp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.jp-hero .jp-buttons .jp-btn .jp-btn-icon {
    display: inline-block;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;

    color: inherit;
    background-color: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

.jp-hero .jp-buttons .jp-btn > span:not(.jp-btn-icon) {
    display: inline-block;
}

@media (max-width: 600px) {
    .jp-hero .jp-buttons .jp-btn .jp-btn-icon {
        width: 18px;
        height: 18px;
    }
}

/* ==========================================================
   FORMATIONS V52 — SÉQUENCE MANUSCRITE DU HERO
   slogan -> phrase manuscrite -> description manuscrite
   ========================================================== */

/*
 * La phrase .jp-script est vide dans le HTML et sera remplie caractère
 * par caractère par jp-formation.js. La description, elle, contient déjà
 * son texte dans le HTML : on la masque donc avant le démarrage du script
 * pour éviter qu'elle apparaisse brièvement en entier.
 */
body.single-formation .jp-hero
.jp-desc[data-jp-formation-description="1"] {
    visibility: hidden;
}

/* Le conteneur redevient visible dès qu'il est préparé pour l'écriture. */
body.single-formation .jp-hero
.jp-desc[data-jp-formation-description="1"].jp-formation-description-ready {
    visibility: visible;
}

/* Chaque caractère reste invisible jusqu'à son tour. */
body.single-formation .jp-hero
.jp-script > span[data-jp-formation-char="1"],
body.single-formation .jp-hero
.jp-desc[data-jp-formation-description="1"]
span[data-jp-formation-char="1"] {
    opacity: 0;
    visibility: hidden;
    transition: opacity 45ms linear;
}

body.single-formation .jp-hero
.jp-script > span[data-jp-formation-char="1"].is-visible,
body.single-formation .jp-hero
.jp-desc[data-jp-formation-description="1"]
span[data-jp-formation-char="1"].is-visible {
    opacity: 1;
    visibility: visible;
}

