@charset "utf8";
@import "commun.css";

:root {
    --epaisseur-traits: 10px;
}

/* Selection dans les articles */
::selection {
    background-color: var(--couleur);
    color: white;
}

nav {
    display: flex;
    justify-content: space-around;
    align-items: center;

    background-color: var(--coul-nav);
    color: white;

    box-shadow: var(--ombre);

    font-size: var(--step-1);

    /* Pour que le sous menu s'affiche au dessus du contenu de la page (vive les contextes d'empilement) */
    position: fixed;
    top: 0;

    width: 100%;

    z-index: 2;
}

/* Le boutton hamburger, pour deplier le menu sur mobile */
#hamburger {
    display: none;
}

.haut > label {
    display: none;
    fill: white;
}

/* Logo */
nav .bitimpact {
    font-size: var(--step-3);
}

/* Les éléments de base */
a:not([class]) {
    text-decoration: none;
    color: var(--couleur);
}

a:not([class]):visited {
    color: var(--couleur);
}

a:not([class]):active {
    color: var(--couleur2);
}

a:not([class]):hover {
    text-decoration: underline;
}

q::before {
    content: "« ";
}

q::after {
    content: " »";
}

/* ----------- Le menu... ---------------*/
nav > ol {
    display: flex;
    /* gap: 1.5em; */

    padding: 0;
    margin: 0;
    list-style-type: none;
}

/* Les conteneurs des éléments du menu */
nav > ol > li {
    display: flex;
    align-items: center;

    position: relative;
}

/* Les textes des éléments du menu */
nav > ol > li > a {
    color: white !important;
    text-decoration: none !important;

    padding: 1em;
}

/* Animation slash sur les éléments du menu TODO */
.barre {
    position: absolute;

    visibility: hidden;
    
    width: 0;
    height: 2px;

    margin-top: 2em;

    background-color: white;

    transition: all 1s var(--cb-bz);
}

nav ol li:nth-child(3) div {
    margin-left: 2.6em;
}

nav ol li:nth-child(2) div {
    margin-left: 2.3em;
}

nav ol li:nth-child(1) div {
    margin-left: 2.2em;
}

nav > ol > li:hover .barre {
    visibility: visible;
    width: 5.5em;
}

/* Effet sur le texte des éléments du menu */
nav > ol > li:hover > a {
    background-color: var(--coul-nav-hover);
}

/* Les séparateurs entres les elements du menu */
nav > ol > li:not(:last-child)::after {
    content: "";

    width: 2px;
    height: 60%;

    background-color: white;
}

/* Sous menu */
nav > ol ol {
    position: absolute;

    top: 100%;
    right: 0;

    padding: 0;
    list-style-type: none;

    width: max-content;
    max-width: 320px;

    background-color: white;
    color: black;
    box-shadow: var(--ombre);

    visibility: hidden;

    transition-property: visibility, transform, opacity;
    transition: 0.4s ease-in-out;
    transform: translateY(50%);
    opacity: 0;

    z-index: 999;
}

/* Pour afficher le sous menu */
nav > ol > li:hover ol {
    visibility: visible;

    transform: translateY(0);
    opacity: 1;
}

/* Conteneurs des élements du sous menu */
nav > ol ol > li {
    /* text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden; */

    transition: background-color 1s var(--cb-bz);
}

/* Contenu du sous menu */
nav ol ol > li > a {
    display: block;
    padding: 1em;

    color: black !important;
    text-decoration: none !important;
}

/* Effet sur les éléments du sous menu */
nav > ol ol > li:hover {
    background-color: rgb(216, 216, 216);
}

/* Responsivité du menu et sous-menu */
@media screen and (max-width: 683px) {
    nav {
        width: 100%;

        flex-direction: column;
    }

    /* Le conteneur du titre et du hamburger */
    .haut {
        display: flex;
        align-items: center;
        justify-content: space-around;

        width: 100%;
    }

    /* Le hamburger */
    .haut > label {
        display: inline;
        padding: 0.5em 1em;
    }

    .haut > label:hover {
        background-color: var(--coul-nav-hover);
    }

    /* La checkbox en coulisses */
    #hamburger:checked ~ ol {
        display: block;
    }

    /* menu */
    nav > ol {
        display: none;

        flex-direction: column;

        width: 100%;
    }

    /* Cont. des elements du menu */
    nav > ol > li {
        flex-direction: column;
    }

    /* Sous menu */
    nav > ol ol {
        display: none;
        position: static;

        width: 100%;
        max-width: none;
        transform: none;
    }

    nav > ol > li:hover ol {
        display: block;
    }

    /* Effet slash */
    nav .barre {
        margin-top: 2.4em;
    }

    nav ol li:nth-child(3) div {
        margin-left: 1.5em;
    }
    
    nav ol li:nth-child(2) div {
        margin-left: 2em;
    }
    
    nav ol li:nth-child(1) div {
        margin-left: 1.2em;
    }

    /* On en profite pour aussi faire l'intro */
    header > p {
        max-width: 100% !important;

        margin: 0 !important;
    }
}

/* L'image de fond */
/* Explication:
*    Sur mobile, il y a un bug qui fait en sorte que l'image de fond du body "saute".
*    Pour résoudre ce problème, j'ai tiré la solution de cet article:
*                                   https://css-tricks.com/the-fixed-background-attachment-hack
*/
.fond {
    position: fixed;

    height: 100vh;
    width: 100vw;

    background-image: var(--img-fond);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Le conteneur de la page */
.page {
    position: absolute;

    left: 50%;
    transform: translateX(-50%);

    width: 80%;
    max-width: 1333px;
    margin-top: 150px;

    box-shadow:
        rgba(17, 17, 26, 0.1) 0px 4px 16px,
        rgba(17, 17, 26, 0.1) 0px 8px 24px,
        rgba(17, 17, 26, 0.1) 0px 16px 56px;
}

@media screen and (max-width: 1000px) {
    .page {
        max-width: none;
        width: 95%;
    }
}

.page p {
    margin: 0 1.5em;

    line-height: 1.6;
}

/* Ajout d'un espace entre les paragraphes */
.page p:not(:last-of-type) {
    margin-bottom: 1em;
}

header {
    background-color: var(--coul-header);

    padding: 1em 1.5em;
    padding-bottom: 3em;
}

/* Le petit paragraphe d'introduction */
header > p {
    display: inline-block;
    padding: 1em;
    background-color: white;

    max-width: 70%;

    border-color: var(--couleur);
    border-width: var(--epaisseur-traits);
    border-left-style: solid;
}

h1 {
    font-size: var(--step-5);
}

/* Le mot en couleur */
h1 > span {
    color: var(--couleur);
}

h2 {
    font-size: var(--step-4);
}

/* Le premier sous-titre de l'article */
main section:first-child > h2:first-child {
    margin-top: 0;
}

/* Le petit trait en dessous des sous-titres */
h2::after {
    content: "";
    display: block;

    width: 50px;
    height: var(--epaisseur-traits);
    margin-top: 5px;
    margin-left: 5px;;

    background-color: var(--couleur);
}

main {
    background-color: white;

    padding: 1.5em;
    padding-top: 3em;
}

/* Le séparateur à la fin de l'article */
hr {
    margin: 2em auto;
    width: 80%;
    background-color: var(--couleur);
}

/* Le conteneur des boutons pour passer d'une page a l'autre */
.navig-pages {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;

    gap: 1em;
    padding: 0 1em;
    margin-bottom: 2em;
}

/* Les bouttons pour passer d'une page a l'autre */
.navig-pages a {
    text-decoration: none;
    text-align: center;

    padding: 1em;

    border: 5px solid var(--couleur);
    box-shadow: 0 0 2px rgba(17, 17, 26, 0.1);

    color: white;
    background-color: var(--couleur);
    background-image: linear-gradient(90deg, var(--couleur) 51%, white 50%);
    background-size: 200% 100%;
    transition: all 1s var(--cb-bz);
}

.navig-pages span {
    position: relative;
}

.navig-pages .avant ::before,
.navig-pages .apres ::after {
    font-weight: bold;

    position: absolute;
    top: 0;

    opacity: 0;
    transition: all 1s var(--cb-bz);
}

.navig-pages .avant:hover ::before,
.navig-pages .apres:hover ::after {
    opacity: 1;
}

/* Le boutton pour aller à la page précedente */
.navig-pages .avant ::before {
    content: "«";
    left: -1.1em;
}

.navig-pages .avant:hover {
    color: black;
    background-position: 100%;

    padding-left: 1.5em;
    padding-right: 0.5em;
}

/* L'autre boutton */
.navig-pages .apres ::after {
    content: "»";
    right: -1.1em;
}

.navig-pages .apres:hover {
    color: black;
    background-position: -98%;

    padding-right: 1.5em;
    padding-left: 0.5em;
}

/* Gestion des images d'article */
figure img {
    filter: drop-shadow(0 0 14px grey);
}

figure figcaption {
    margin-top: 1em;
    color: rgba(0, 0, 0, 0.877);
    text-align: center;
    font-size: var(--step--1);
}

.droite img, .gauche img {
    max-width: 300px;
    height: auto;
}

.droite {
    float: right;
}

.gauche {
    float: left;
}

.grande {
    max-width: 750px;

    margin: 2em auto;
}

.grande img {
    width: 100%;
    height: auto;
}

@media screen and (max-width: 725px) {
    .droite, .gauche {
        float: none;

        margin: 2em auto;
    }

    .droite img, .gauche img {
        display: block;
    
        width: 100%;
        height: auto;

        margin: 1em auto;
    }
}
