/* ==========================================================================
   Jordan Nicol — Réalisations : carte projet et visuel
   Fichier : css/projets.css

   Partagé par toutes les pages qui affichent des réalisations : section
   « Réalisations » de l'accueil, puis page Réalisations et page projet.

   1. Visuel [jn_projet_visuel] (HTML : template-parts/projets/visuel.php)
      Avec captures ou page factice (sections 1 à 5), ou scène dessinée de la
      maquette (section 8, template-parts/projets/scenes/*.php).
      .jn-pv ..................... fond en dégradé (couleurs du projet)
      ├── .jn-pv__navigateur ..... fenêtre de navigateur + capture ordinateur
      ├── .jn-pv__telephone ...... téléphone + capture mobile
      └── .jn-pv__pastille (x2) .. pastilles flottantes
   2. Carte projet (conteneur Elementor en lien <a>, classe jn-projet)
      ├── .jn-projet__visuel ..... widget Code court [jn_projet_visuel …]
      └── .jn-projet__meta ....... numéro, titre H3, type | flèche (Icône)

   Le visuel est dessiné dans le repère de la maquette (carte de 576 x 300 px)
   et dimensionné en unités cqw (1 cqw = 1 % de la largeur du visuel) :
   tout garde ses proportions, de l'ordinateur au mobile, sans JavaScript.

   Sommaire
   1. Visuel : cadre et fond
   2. Visuel : navigateur
   3. Visuel : téléphone
   4. Visuel : pastilles
   5. Visuel : disposition « droite » (navigateur à droite)
   6. Carte projet : textes, flèche, survol
   7. Responsive et accessibilité
   8. Scènes dessinées de la maquette
   ========================================================================== */


/* 1. Visuel : cadre et fond
   --------------------------------------------------------------------------
   Couleurs du projet transmises par le shortcode (--jn-pv-c1 / --jn-pv-c2).
   container-type : les dimensions des enfants (cqw) suivent la largeur. */
.jn-pv {
    position: relative;
    container-type: inline-size;
    aspect-ratio: 576 / 300;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 22px;
    background: radial-gradient(90% 90% at var(--jn-pv-fond, 20% 0%), var(--jn-pv-c1) 0%, var(--jn-pv-c2) 55%, #0B1B3A 100%);
}

/* Image de capture : remplit son écran, cadrée sur le haut de la page */
.jn-pv__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}


/* 2. Visuel : navigateur
   -------------------------------------------------------------------------- */
.jn-pv__navigateur {
    position: absolute;
    top: 7.6cqw;
    left: 7.5cqw;
    display: flex;
    flex-direction: column;
    width: 63.3cqw;
    height: 39.2cqw;
    overflow: hidden;
    border-radius: 1.2cqw;
    background: #FFFFFF;
    box-shadow: 0 3.3cqw 6.7cqw rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
    transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.jn-pv__barre {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.6cqw;
    height: 3cqw;
    padding: 0 1.2cqw;
    background: #F1EDE4;
}

.jn-pv__point {
    width: 0.85cqw;
    height: 0.85cqw;
    border-radius: 99px;
    background: #E3DDD0;
}

.jn-pv__url {
    display: flex;
    flex-grow: 1;
    align-items: center;
    max-width: 28cqw;
    height: 1.85cqw;
    margin-left: 1.3cqw;
    padding: 0 0.85cqw;
    overflow: hidden;
    border-radius: 0.5cqw;
    background: #FFFFFF;
    font-family: "Poppins", sans-serif;
    font-size: 1.15cqw;
    line-height: 1;
    white-space: nowrap;
    color: #5E6678;
}

.jn-pv__ecran {
    position: relative;
    flex-grow: 1;
    overflow: hidden;
    background: #FFFFFF;
}

/* Page factice (tant qu'aucune capture n'est ajoutée) : en-tête, bandeau
   aux couleurs du projet, rangée de cartes. */
.jn-pv__factice {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.jn-pv__f-entete {
    flex-shrink: 0;
    height: 3.8cqw;
    border-bottom: 1px solid #EFEAE0;
}

.jn-pv__f-bandeau {
    display: flex;
    flex-direction: column;
    gap: 1cqw;
    height: 17.5cqw;
    padding: 3.3cqw 2.7cqw;
    background: linear-gradient(120deg, var(--jn-pv-c2) 0%, var(--jn-pv-c1) 100%);
}

.jn-pv__f-bandeau span {
    width: 46%;
    height: 1.7cqw;
    border-radius: 0.3cqw;
    background: rgba(255, 255, 255, 0.9);
}

.jn-pv__f-bandeau span + span {
    width: 32%;
}

.jn-pv__f-cartes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.3cqw;
    padding: 2cqw 2.7cqw;
}

.jn-pv__f-cartes span {
    height: 8cqw;
    border: 1px solid #EFEAE0;
    border-radius: 1cqw;
}


/* 3. Visuel : téléphone
   --------------------------------------------------------------------------
   Le conteneur se soulève au survol (section 6) ; le cadre intérieur
   flotte en continu (ordinateur uniquement, section 7). */
.jn-pv__telephone {
    position: absolute;
    top: 10.9cqw;
    right: 12.5cqw;
    transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.jn-pv__tel {
    width: 17.5cqw;
    height: 35cqw;
    padding: 0.75cqw;
    border-radius: 2.7cqw;
    background: #0A0F1C;
    box-shadow: 0 2.5cqw 5cqw rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(233, 199, 123, 0.25);
    animation: jn-flottement 3.6s cubic-bezier(0.37, 0, 0.63, 1) -1s infinite alternate;
    will-change: transform;
}

.jn-pv__tel-ecran {
    position: relative;
    height: 100%;
    overflow: hidden;
    border-radius: 2cqw;
    background: #FAF8F3;
}

.jn-pv__encoche {
    position: absolute;
    top: 0.65cqw;
    left: 50%;
    width: 5.8cqw;
    height: 1.5cqw;
    border-radius: 99px;
    background: #0A0F1C;
    transform: translateX(-50%);
}

/* Écran factice du téléphone */
.jn-pv__factice--mobile {
    gap: 1cqw;
    padding: 3.6cqw 1.2cqw 1.2cqw;
}

.jn-pv__factice--mobile .jn-pv__f-bandeau {
    height: 12cqw;
    padding: 1.5cqw;
    border-radius: 0.8cqw;
}

.jn-pv__factice--mobile .jn-pv__f-bandeau span {
    width: 70%;
    height: 1.2cqw;
}

.jn-pv__factice--mobile .jn-pv__f-cartes {
    grid-template-columns: 1fr;
    padding: 0;
}

.jn-pv__factice--mobile .jn-pv__f-cartes span {
    height: 9cqw;
}


/* 4. Visuel : pastilles
   --------------------------------------------------------------------------
   Taille de texte lisible quelle que soit la largeur (entre 10 et 12 px). */
.jn-pv__pastille {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.75em 1.1em;
    border: 1px solid rgba(233, 199, 123, 0.3);
    border-radius: 12px;
    background: rgba(11, 27, 58, 0.88);
    box-shadow: 0 1.7cqw 3.3cqw rgba(0, 0, 0, 0.35);
    font-family: "Poppins", sans-serif;
    font-size: clamp(10px, 2.1cqw, 12px);
    line-height: 1.2;
    white-space: nowrap;
    color: #FAF8F3;
    animation: jn-flottement 3s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
    will-change: transform;
}

/* Puce dorée devant le texte */
.jn-pv__pastille::before {
    content: "";
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 99px;
    background: #E3C07A;
}

/* Disposition « gauche » : 1re en bas à gauche, 2e en haut à droite */
.jn-pv__pastille--1 {
    bottom: 5.5cqw;
    left: 5cqw;
}

.jn-pv__pastille--2 {
    top: 5.9cqw;
    right: 5.8cqw;
    animation-duration: 3.8s;
    animation-delay: -1.6s;
}


/* 5. Visuel : disposition « droite » (navigateur à droite, téléphone à
   gauche ; 1re pastille en bas, 2e en haut à droite comme en « gauche »)
   -------------------------------------------------------------------------- */
.jn-pv--droite .jn-pv__navigateur {
    top: 6.7cqw;
    right: 7.5cqw;
    left: auto;
    width: 65cqw;
}

.jn-pv--droite .jn-pv__telephone {
    top: 11.7cqw;
    right: auto;
    left: 10cqw;
}

.jn-pv--droite .jn-pv__pastille--1 {
    bottom: 6.2cqw;
    left: 30cqw;
}


/* 6. Carte projet : textes, flèche, survol
   --------------------------------------------------------------------------
   La carte entière est un lien (conteneur Elementor, balise <a>).
   Au survol : le navigateur et le téléphone se soulèvent, la flèche se
   remplit d'or. Animations en transform (fluides). */
.e-con.jn-projet {
    color: inherit;
    text-decoration: none;
}

/* Hauteur du visuel calculée depuis la largeur de la carte (576 x 300).
   La carte devient un « conteneur » (container-type) : 100cqw = sa largeur.
   Nécessaire pour le carrousel mobile, où aspect-ratio seul donnait une
   hauteur nulle (les textes passaient par-dessus le visuel). */
.e-con.jn-projet {
    container-type: inline-size;
}

.elementor-widget.jn-projet__visuel {
    flex-shrink: 0;
    height: calc(100cqw * 300 / 576);
}

.jn-projet:hover .jn-pv__navigateur {
    transform: translate3d(0, -1cqw, 0);
}

.jn-projet:hover .jn-pv__telephone {
    transform: translate3d(0, -1.6cqw, 0);
}

/* Flèche : widget Icône « Encadré » rond. Bordure dorée translucide
   (sélecteur renforcé : Elementor colore la bordure avec l'icône). */
.e-con.jn-projet .elementor-widget.jn-projet__fleche.elementor-view-framed .elementor-icon {
    border-color: rgba(233, 199, 123, 0.45);
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.jn-projet__fleche .elementor-icon svg {
    fill: none;
    stroke: currentColor;
    transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.e-con.jn-projet:hover .elementor-widget.jn-projet__fleche.elementor-view-framed .elementor-icon {
    border-color: #E3C07A;
    background-color: #E3C07A;
    color: #0B1B3A;
}

.jn-projet:hover .jn-projet__fleche .elementor-icon svg {
    transform: translateX(3px);
}

/* Focus clavier visible sur la carte */
.e-con.jn-projet:focus-visible {
    outline: 2px solid #E3C07A;
    outline-offset: 6px;
    border-radius: 22px;
}


/* 7. Responsive et accessibilité
   -------------------------------------------------------------------------- */

/* Tablette et mobile : pas de flottement continu (affichage plus léger). */
@media (max-width: 1024px) {
    .jn-pv__tel,
    .jn-pv__pastille {
        animation: none;
    }
}

@media (max-width: 767px) {
    .jn-pv {
        border-radius: 18px;
    }

    /* Une seule pastille sur petit écran : la 2e chargerait trop le visuel */
    .jn-pv__pastille--2 {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jn-pv__tel,
    .jn-pv__pastille {
        animation: none;
    }

    .jn-pv__navigateur,
    .jn-pv__telephone,
    .jn-projet__fleche .elementor-icon svg {
        transition: none;
    }
}


/* 8. Scènes dessinées de la maquette
   --------------------------------------------------------------------------
   [jn_projet_visuel scene="…"] : illustration de la maquette dessinée dans
   un repère de 1 200 x 580 px (comme la maquette), réduite à la largeur
   de la carte par --jn-pv-echelle (calculée par js/projets.js ; 0,48 sans
   JavaScript, soit la carte de 576 px de la maquette).
   La scène commence 10 px sous le haut de la carte (1,74 % de sa largeur). */
.jn-pv__scene {
    position: absolute;
    top: 1.74cqw;
    left: 0;
    width: 1200px;
    height: 580px;
    transform: scale(var(--jn-pv-echelle, 0.48));
    transform-origin: 0 0;
    pointer-events: none;
}

/* Survol de la carte : navigateur, téléphone et fiches se soulèvent.
   Propriété translate (et non transform) : les fiches inclinées de la
   scène Conesa gardent leur rotation. */
.jn-pv__lift {
    transition: translate 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.jn-projet:hover .jn-pv__lift {
    translate: 0 -14px;
}

/* Flottement continu (téléphone, pastilles), rythmes décalés */
.jn-pv__flotte {
    animation: jn-flottement 3s cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
    will-change: transform;
}

.jn-pv__flotte--lent {
    animation-duration: 3.8s;
    animation-delay: -1.6s;
}

/* Tablette et mobile : pas de flottement (affichage plus léger) */
@media (max-width: 1024px) {
    .jn-pv__flotte {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jn-pv__flotte {
        animation: none;
    }

    .jn-pv__lift {
        transition: none;
    }
}


/* 9. Carte projet : pastilles des technologies
   --------------------------------------------------------------------------
   Liste <ul class="jn-technos"> produite par [jn_projet_technos]
   (inc/realisations.php), dans la carte « Carte réalisation » (modèle de
   boucle) et sur la page projet. */
.jn-technos {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.jn-technos__item {
    margin: 0;
    padding: 6px 12px;
    border: 1px solid rgba(233, 199, 123, 0.3);
    border-radius: 99px;
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    line-height: 1.2;
    color: #FAF8F3;
}

@media (max-width: 767px) {
    .jn-technos {
        gap: 5px;
    }

    .jn-technos__item {
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* 10. Encart « Un projet en tête ? » (page Réalisations et pages projet)
   --------------------------------------------------------------------------
   Courbes dorées (mêmes tracés que la section Contact) derrière le texte. */
.e-con.jn-cta-projet {
    isolation: isolate;
}

.elementor-widget.jn-cta-projet__courbes {
    position: absolute;
    top: -80px;
    left: 0;
    z-index: -1;
    width: 1200px;
    margin: 0;
    opacity: 0.5;
    pointer-events: none;
}

.jn-cta-projet__courbes svg {
    display: block;
    width: 100%;
    height: auto;
}