/* TODO: intégrer le contenu de reset.css directement ici pour la mise en prod */
@import url(reset.css);

:root {
    --page-spacing-x: 20px;
    --page-max-width: 1300px;
    --clr-blue-ultralight: hsl(194, 87%, 96%);
}



/**
 * Media queries pour les breakpoints de ce template
 * =================================================
 * 
 * - Mobile :
 *      - pas de media query (mobile first)
 *      - 600px (pour la longueur des titres et du texte en général)
 * 
 * - Tablettes :
 *      - 768px (portrait)
 *      - 1024px (paysage)
 * 
 * - Ordinateur :
 *      - 1280px (passage la version du header pour ordinateur)
 *      - 1550px et 1900px si nécessaire
 */

@media (min-width: 1024px) {
    :root {
        --page-spacing-x: 40px;
    }
}



/**
 * =============================================================================
 * Style de base
 * =============================================================================
 */

html {
    /* Ajoute un espace en haut des ancres ciblées */
    scroll-padding-top: 150px;
}

body {
    /**
     * "Raleway NoDigit" utilise la police Raleway, sans les chiffres (voir déclaration @font-face dans <head>)
     * "Segoe UI" est donc utilisée par défaut pour les caractères digitaux.
     */
    font-family: 'Raleway NoDigit', 'Segoe UI', Geneva, Verdana, sans-serif;
    font-optical-sizing: auto;
}

main {
    font-size: 18px;
    overflow-x: hidden;
    /*
    overflow-x: hidden;
    Cette déclaration évite l'affichage d'une scrollbar horizontale sur les écrans 16" (et moins),
    dûe aux blocs animés par mon script ClassInView (app.js) qui ne sont a encore dans la vue du navigateur
    */
}


/**
 * h1/h2
 * 
 * - Effet visuel (gradient) : utiliser au moins un <span>
 * - Utiliser deux <span> pour séparer un titre long en deux parties
 * 
        <hn>
        <span>Titre</span>
        <span>exemple de texte complémentaire pour un titre un peu long</span>
        </hn>
 * 
 * Pour un alignement à gauche (souvent pour les h2), utiliser les classes .container et .container__title
 * qui réduit la taille du texte du deuxième <span>
 */
h1, h2 {
    color: transparent;
    background-image: linear-gradient(to right, #11baec, #005ba8);
    background-clip: text;
}

h1 {
    width: fit-content;
}

h3 {
    display: flex;
    gap: 10px;
    margin-top: 40px;
    font-size: 1.6em;
    color: #005ba8;
}
h3:before {
    flex-shrink: 0;
    content: '';
    display: block;
    margin-top: 9px;
    width: 30px;
    height: 30px;
    background-color: #005ba8;
    transform: skew(0, -18deg);
}

h4 {
    margin-top: 40px;
    font-size: 1.4em;
    font-weight: 600;
}

@media (min-width: 600px) {

    h3 {
        font-size: 1.8em;
    }

    h4 {
        font-size: 1.6em;
    }
}

p {
    margin: 20px 0;
}

figure {
    margin: 30px 0;
}

figcaption {
    margin-top: 3px;
    font-size: 0.8em;
    color: grey;
}


/** Liens */
a {
    color: #005ba8;
}


/**
 * Bouton d'action
 */
button {
    display: flex;
    align-items: center;
    padding: 6px 15px;
    height: 50px;
    line-height: 34px;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    background-color: #005ba8;
    background-image: linear-gradient(to bottom right, #11baec, #005ba8);
    background-repeat: no-repeat;
    border: none;
    border-radius: 6px;
    transition: all 150ms ease-in-out;
    image-rendering: crisp-edges;
    transform-origin: center;
}

button:hover {
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.15) inset;
    filter: brightness(120%);
}

button:hover > * {
    filter: blur(0.6px);
}

button span {
    display: inline-block;  /* Pour permettre au texte de ne pas être affecté */
    transform: none; /* Aucun effet de transformation sur le texte */
}

button i.fa {
    color: inherit;
}

button span {
    margin-left: 10px;
    padding-left: 10px;
    border-left: rgba(255,255,255, 0.7) solid 1px;
}



/**
 * =============================================================================
 * Layout
 * =============================================================================
 */


.container {
    margin: auto;
    padding: 60px 0;
}

.container--view-title {
    background-image: url(/public/img/bg-repeat-x-huile.webp);
    background-repeat: no-repeat;
    background-position-y: 70%;
    background-size: 160%;
}

.container--view-title h1 {
    margin-left: calc(-1 * var(--page-spacing-x)); /* marge négative */
    padding: 10px 20px;
    font-size: 1.8em;
    /* font-weight: 300; */
    font-weight: 600;
    line-height: 1.2;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0 12px 12px 0;
}

.container--deco-grafic-lines {
    background: url(/public/img/background-grafica-lines.svg) bottom center no-repeat;
    background-size: 140%;

}

.container__content {
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--page-spacing-x);
    max-width: var(--page-max-width);
}

.container__content--page-width {
    max-width: 1600px;
    padding-left: 20px;
    padding-right: 20px;
}

@media (min-width: 1280px) {

    .container {
        padding-top: 90px;
        padding-bottom: 120px;
    }

    .container--view-title {
        background-image: linear-gradient(to top, transparent 70%, black), url(/public/img/bg-repeat-x-huile.webp);
        background-position-x: 90%;
        background-repeat: no-repeat, repeat-x;
        background-size: contain;
    }

    .container--view-title h1 {
        /* margin-top: 180px; */
        margin-top: 160px;
        margin-left: 0;
        padding: 20px 40px;
        font-size: 2.8em;
        /* font-size: 2.5em; */
        /* background: rgba(0, 0, 0, 0.35); */
        border-radius: 12px;
    }

    .container--deco-grafic-lines {
        background-position-x: left;
        background-size: 1200px 85px;
    }

    .container__content--page-width {
        padding: 0;
    }
}

/**
 * Titre dont la couleur par défaut du texte est un dégradé (1 <span> requis minimum)
 * Voir commentaire de h1/h2 pour les détails.
 */
.container__title {
    margin: 0 auto 40px;
    max-width: calc(var(--page-max-width) - var(--page-spacing-x) * 2);
    font-size: 8vw;
    line-height: 1.2;
}

/* Couleur de texte pour une section (un conteneur) avec un background foncé */
.container__title--light {
    background-image: linear-gradient(to right, white 20%, #11baec);
}

.container__title span {
    display: block;
    width: fit-content;
    background: inherit;
}

.container__title span + span {
    font-size: 0.5em;
}

@media (min-width: 600px) {
    .container__title {
        font-size: 2.7em;
    }
}

@media (min-width: 1280px) {
    .container__title {
        font-size: 3.5em;
    }
}


/**
 * Sous-titre (généralement pour h3)
 */

.container__subtitle {
    margin: 40px auto 20px;
    font-size: 1.6em;
}

.container__subtitle--margin-top-2x {
    margin-top: 80px;
}


/**
 * Séparateur de conteneur
 */

.container-divider-image {
    margin: 20px auto 40px;
    padding-left: var(--page-spacing-x);
    padding-right: var(--page-spacing-x);
}

@media (min-width: 1280px) {
    .container-divider-image {
        margin-top: 0;
        margin-bottom: 160px;
    }
}




/**
 * =============================================================================
 * Utilitaires
 * TODO: Move classes utilitaires à la fin du fichier
 * =============================================================================
 */

.u-no-margin-top {
    margin-top: 0;
}

.u-padding-top {
    padding-top: 20px;
}

.u-padding-bottom {
    padding-bottom: 20px;
}

.u-image-center {
    margin-left: auto;
    margin-right: auto;
}

.u-corp-name {
    font-weight: 500;
}

.u-list {
    padding-left: 50px;
    list-style: disc;
}

.u-text-white {
    color: white;
}

.u-text-red {
    font-weight: 600;
    color: #aa1618;
}

/** Background de couleur */
.u-bg-light {
    background-color: #f4f5f7;
}

.u-bg-blue {
    background-color: #005ba8;
}



/**
 * Grille de base
 */

.u-grid {
    display: grid;
    gap: 40px;
}

@media (min-width: 960px) {
    .u-grid {
        grid-template-columns: auto auto;
    }

    .u-grid--1-1 {
        grid-template-columns: 1fr 1fr;
    }

    .u-grid--2-1 {
        grid-template-columns: 2fr 1fr;
    }
}

@media (min-width: 1280px) {
    .u-grid {
        gap: 80px;
    }
}



/**
 * Grille de liste de cartes
 */
.u-grid-cards {
    display: grid;
    gap: 20px;
    margin: 0 auto;
    width: fit-content;
}

@media (min-width: 768px) {
    .u-grid-cards {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1280px) {
    .u-grid-cards {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 40px;
    }
}


/**
 * =============================================================================
 * Composants UI
 * =============================================================================
 */

/**
 * Lien textuel (classique)
 * ========================
 */

.link-text,
.link-pdf {
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1px;
    text-underline-offset: 7px;
}

.link-pdf {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

.link-text:hover,
.link-pdf:hover {
    text-decoration-style: solid;
}

.link-text i.fa {
    margin-inline: 5px;
}

.link-pdf::before {
    content: '\f1c1';
    font-family: 'Font Awesome 6 Free';
    font-size: 1.3em;
    color: #b30a00;
}

.link-pdf--large-icon::before {
    font-size: 1.8em;
}



/**
 * Lien stylisé comme un bouton
 * ============================
 */

/**
 * Lien stylisé comme un bouton carré bleu
 */

.btn-block {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 15px 20px;
    font-weight: 600;
    color: white;
    background-color: #11baec;
}

@media (min-width: 1280px) {
    .btn-block {
    width: 210px;
    height: 210px;
    }
}


/**
 * Carte de la grille produits
 */

.card-product,
.card-product a  {
    display: flex;
    flex-direction: column;
}

.card-product  {
    max-width: 350px;
    color: white;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.card-product a {
    flex: 1;
    color: inherit;
}

.card-product h2 {
    display: flex;
    align-items: center;
    flex-grow: 1;
    padding: 10px 20px 10px 40px;
    color: inherit;
    min-height: 101px;
    background-color: #11baec;
    background-clip: padding-box;
}

.card-product a div {
    overflow: hidden;
}

.card-product img {
    aspect-ratio: 1 / 1;
    width: 100%;
    object-fit: cover;
    transition: transform 2s linear;
}

.card-product:hover img {
    transform: scale(1.1);
}


/**
 * Liste des news
 */

.news {
    min-height: 500px;
} 
.news ul {
    columns: 2;
} 
.news li:first-child a {
    margin-top: 0;
} 



/**
 * Effet commun au survol de la souris pour CTA carré et carte de liste
 * NB : le CTA des news a son propre effet
 */

.btn-block,
.card-product {
    transition: box-shadow 200ms, transform 200ms;
}

.btn-block:hover,
.card-product:hover {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
}


/**
 * Bouton de liste avec flèche à droite 
 */
.btn-list {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0;
    padding: 15px 20px;
    font-weight: 600;
    line-height: 1;
    color: white;
    background-color: #11baec;
    transition: all 200ms ease-in-out;
}

.btn-list:hover {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.btn-list::after {
    display: block;
    font-family: 'Font Awesome 6 Free';
    content: '\f061';
    font-size: 1.5rem;
    line-height: 1;
    transition: inherit;
}

.btn-list:hover,
.btn-list:hover::after {
    transform: translate3d(8px, 0, 0);
}



/**
 * Flèche d'angle
 * ==============
 * Ajoute une flèche d'angle (sur les CTA ou carte)
 * Anime le flèche au survol de la souris
 */

.has-corner-arrow {
    position: relative;
}

.has-corner-arrow::after {
    content: '\f062';
    position: absolute;
    top: 5px;
    right: 10px;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.8rem;
    line-height: 1;
    color: inherit;
    transform: rotate(45deg);
    pointer-events: none;
}

@media (min-width: 1280px) {
    .has-corner-arrow::after {
        font-size: 2.8rem;
        transition: transform 200ms;
    }

    .has-corner-arrow:hover::after {
        animation: hoverCornerArrowEffect 500ms forwards;
        animation-delay: 200ms;
    }
}

@keyframes hoverCornerArrowEffect {
    0% {
        transform: rotate(45deg) scale(1) translate3d(0, 30px, 0);
    }

    50% {
        transform: rotate(45deg) scale(1.8) translate3d(0, 20px, 0);
        opacity: 0.5;
    }

    100% {
        transform: rotate(45deg) scale(1.5) translate3d(0, 10px, 0);
    }
}



/**
 * Liste des pays avec carte mondial en background
 */

.countries-with-bg-word-map p {
    font-weight: 600;
}

.countries-with-bg-word-map ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-top: 60%;
    font-size: 1.5em;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    background: url(/public/img/iph-worldwide-map@1180.webp) top no-repeat;
    background-size: contain;
}

.countries-with-bg-word-map__etc {
    display: flex;
    align-items: end;
    gap: 4px;
    padding-bottom: 4px;
    width: fit-content;
    font-size: 0.4em;
}

@media (min-width: 1280px) {
    .countries-with-bg-word-map {
        background-image: url(/public/img/iph-worldwide-map@1180.png); /* support anciens navigateur */
        background-image: image-set(url(/public/img/iph-worldwide-map@1180.webp) 1x,
                url(/public/img/iph-worldwide-map@1770.webp) 1.5x,
                url(/public/img/iph-worldwide-map@2360.webp) 2x);
        background-position: center;
        background-repeat: no-repeat;
        background-size: 77%;
    }

    .countries-with-bg-word-map p {
        max-width: 480px;
    }

    .countries-with-bg-word-map ul {
        flex-direction: column;
        margin-top: 40px;
        padding-top: 0;
        background: none;
    }
}



/**
 * =============================================================================
 * Animations des éléments qui entrent et sortent du viewport
 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 * NB: Ces classes fonctionnent avec mon script ClassInView 
 * =============================================================================
 */

@media (min-width: 1280px) {

    /**
     * État initial
     * (avant que l'élément ne soit visible)
     */
    .js .scroll-effect {
        opacity: 0;
        transition: transform 600ms ease;
    }

    /**
     * État initial par direction
     */
    .js .scroll-effect--slide-up {
        transform: translateY(60px); /* Départ en bas */
    }

    .js .scroll-effect--slide-left {
        transform: translateX(-60px); /* Départ à gauche */
    }

    .js .scroll-effect--slide-right {
        transform: translateX(60px); /* Départ à droite */
    }

    /**
     * État final commun
     * (classe temporaire gérée par ClassInView)
     */
    .js .scroll-effect--civ {
        opacity: 1;
        transform: translate(0); /* Retour à la position naturelle */
    }


    /**
     * Effets personnalisés pour carte du monde
     */
    .js .scroll-effect--bg-worldwide-map {
        opacity: 1;
        background-size: 77%;
        background-position-y: bottom;
        transition-property: background-size, background-position-y;
        transition-duration: 1200ms;
    }

    .js .scroll-effect--bg-worldwide-map--civ {
        background-size: 1180px auto;
        background-position-y: center;
    }
}



/**
 * Button back top of page
 */
.nav-to-top {
    display: block;
    position: fixed;
    bottom: 30px;
    right: 30px;
}

.nav-to-top::before {
    display: none;
}

.nav-to-top i.fa {
    transition: color 150ms ease;
}

.nav-to-top i:hover {
    color: #11baec;
}