/* =========================================================
   Blog BMW M5 E60 - Feuille de style principale
   Projet BTS CIEL 2 - Toutes les pages utilisent ce fichier
   ========================================================= */

/* ---------- 1. Remise a zero et reglages de base ---------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* les bordures et le padding sont compris dans la largeur */
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #141414;
    color: #e8e8e8;
    line-height: 1.6;
}

/* Le conteneur centre le contenu et l'empeche d'etre trop large sur grand ecran */
.conteneur {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: #5aa0ff;
}

img {
    max-width: 100%; /* aucune image ne depasse de son conteneur : utile pour le responsive */
    display: block;
}

h1, h2, h3 {
    margin-bottom: 15px;
    line-height: 1.2;
}

p {
    margin-bottom: 15px;
}

/* ---------- 2. En-tete et barre de navigation ---------- */

header {
    background-color: #0d0d0d;
    border-bottom: 3px solid #1c69d4; /* bleu BMW M */
    position: sticky; /* la barre reste visible quand on descend dans la page */
    top: 0;
    z-index: 10;
}

.barre {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.logo {
    color: #ffffff;
    font-size: 22px;
    font-weight: bold;
    text-decoration: none;
}

.logo span {
    color: #e2001a; /* rouge M */
}

/* La liste des liens du menu */
.menu {
    list-style: none;
    display: flex;
}

.menu li {
    margin-left: 20px;
}

.menu a {
    color: #e8e8e8;
    text-decoration: none;
    padding-bottom: 4px;
}

.menu a:hover {
    color: #ffffff;
    border-bottom: 2px solid #e2001a;
}

/* Le lien de la page en cours est mis en evidence */
.menu a.actif {
    color: #ffffff;
    border-bottom: 2px solid #1c69d4;
}

/* Le bouton de changement de langue */
.langue {
    border: 1px solid #555555;
    padding: 4px 10px;
    border-radius: 3px;
}

/* Le bouton burger : cache sur ordinateur, affiche sur mobile */
.burger {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 26px;
    cursor: pointer;
}

/* ---------- 3. Banniere et effet parallax ---------- */

.banniere {
    background-image: url(../img/banniere.jpg);
    background-size: cover;
    background-position: center;
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Un voile sombre pour que le texte reste lisible par dessus la photo */
.banniere-texte {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 30px;
}

.banniere-texte h1 {
    font-size: 40px;
    color: #ffffff;
}

/* L'effet parallax : le fond reste fixe pendant que la page defile.
   Tout l'effet tient dans la ligne background-attachment: fixed. */
.parallax {
    background-image: url(../img/fond-parallax.jpg);
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.parallax-texte {
    background-color: rgba(0, 0, 0, 0.55);
    padding: 25px 35px;
}

.parallax-texte h2 {
    font-size: 30px;
    color: #ffffff;
    margin-bottom: 5px;
}

/* ---------- 4. Sections et cartes ---------- */

section {
    padding: 50px 0;
}

.titre-section {
    text-align: center;
    font-size: 28px;
    margin-bottom: 30px;
}

/* Le trait rouge sous les titres de section */
.titre-section::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background-color: #e2001a;
    margin: 10px auto 0 auto;
}

/* Les cartes sont rangees cote a cote grace a flex-wrap,
   et passent automatiquement a la ligne si la place manque */
.cartes {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.carte {
    background-color: #1e1e1e;
    border: 1px solid #2c2c2c;
    border-radius: 5px;
    padding: 20px;
    flex: 1 1 280px; /* largeur minimale de 280px, sinon la carte s'etire */
}

.carte h3 {
    color: #ffffff;
}

/* ---------- 5. Articles ---------- */

article {
    background-color: #1a1a1a;
    border-left: 4px solid #1c69d4;
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 0 5px 5px 0;
}

article h2 {
    color: #ffffff;
}

.chapo {
    color: #b0b0b0;
    font-style: italic;
}

.date {
    color: #808080;
    font-size: 14px;
}

/* ---------- 6. Carrousel ---------- */

.carrousel {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

/* Toutes les images du carrousel sont cachees par defaut.
   Le JavaScript affiche uniquement celle qui est active. */
.diapo {
    display: none;
}

.diapo img {
    width: 100%;
    border-radius: 5px;
}

.legende {
    text-align: center;
    padding: 10px;
    color: #b0b0b0;
}

/* Les fleches precedent et suivant */
.fleche {
    position: absolute;
    top: 40%;
    background-color: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    border: none;
    font-size: 26px;
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 3px;
}

.fleche:hover {
    background-color: #e2001a;
}

.precedent {
    left: 10px;
}

.suivant {
    right: 10px;
}

.compteur {
    text-align: center;
    color: #808080;
    font-size: 14px;
}

/* ---------- 7. Video ---------- */

.video {
    max-width: 800px;
    margin: 0 auto;
}

.video video {
    width: 100%;
    border-radius: 5px;
}

/* ---------- 8. Formulaires ---------- */

.formulaire {
    max-width: 550px;
    margin: 0 auto;
    background-color: #1e1e1e;
    border: 1px solid #2c2c2c;
    border-radius: 5px;
    padding: 25px;
}

.champ {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #cccccc;
}

input, textarea, select {
    width: 100%;
    padding: 10px;
    background-color: #2a2a2a;
    border: 1px solid #444444;
    border-radius: 3px;
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #1c69d4;
}

textarea {
    height: 130px;
    resize: vertical;
}

.bouton {
    background-color: #1c69d4;
    color: #ffffff;
    border: none;
    padding: 12px 25px;
    font-size: 15px;
    border-radius: 3px;
    cursor: pointer;
}

.bouton:hover {
    background-color: #1550a8;
}

.bouton-gris {
    background-color: #444444;
}

.bouton-gris:hover {
    background-color: #333333;
}

/* Le petit encadre de connexion de la page d'accueil */
.connexion {
    max-width: 380px;
    margin: 0 auto;
    background-color: #1e1e1e;
    border: 1px solid #2c2c2c;
    border-radius: 5px;
    padding: 25px;
}

.note {
    font-size: 13px;
    color: #808080;
    text-align: center;
    margin-top: 15px;
}

/* ---------- 9. Tableau de caracteristiques ---------- */

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    border: 1px solid #333333;
    padding: 10px;
    text-align: left;
}

th {
    background-color: #1c69d4;
    color: #ffffff;
}

tr:nth-child(even) {
    background-color: #1a1a1a; /* une ligne sur deux est grisee */
}

/* ---------- 10. Pied de page ---------- */

footer {
    background-color: #0d0d0d;
    border-top: 3px solid #e2001a;
    text-align: center;
    padding: 25px 20px;
    color: #909090;
    font-size: 14px;
}

/* =========================================================
   11. RESPONSIVE
   Les media queries adaptent l'affichage a la taille d'ecran
   ========================================================= */

/* --- Tablette : jusqu'a 900px de large --- */
@media screen and (max-width: 900px) {

    .banniere {
        height: 320px;
    }

    .banniere-texte h1 {
        font-size: 30px;
    }

    .titre-section {
        font-size: 24px;
    }
}

/* --- Smartphone : jusqu'a 600px de large --- */
@media screen and (max-width: 600px) {

    /* Le bouton burger apparait */
    .burger {
        display: block;
    }

    /* Le menu se cache et passe en colonne sous l'en-tete */
    .menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #0d0d0d;
        padding: 10px 20px 20px 20px;
    }

    /* Classe ajoutee par le JavaScript quand on clique sur le burger */
    .menu.ouvert {
        display: flex;
    }

    .menu li {
        margin: 0;
        padding: 10px 0;
        border-bottom: 1px solid #222222;
    }

    .barre {
        flex-wrap: wrap;
    }

    .banniere {
        height: 250px;
    }

    .banniere-texte {
        padding: 20px;
    }

    .banniere-texte h1 {
        font-size: 22px;
    }

    /* Sur telephone, background-attachment: fixed est mal gere par
       les navigateurs mobiles : on repasse donc en defilement normal */
    .parallax {
        background-attachment: scroll;
        height: 280px;
    }

    .fleche {
        font-size: 20px;
        padding: 8px 12px;
    }

    article {
        padding: 18px;
    }

    /* Le tableau devient defilant plutot que de deformer la page */
    table {
        font-size: 14px;
    }
}
