/* ---------------------- */
/*     STYLES GENERAUX    */
/* ---------------------- */

body {
    font-family: Arial, sans-serif;
    margin: 40px;
    background-color: #f7f7f7;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
}

h2 {
    margin-top: 0;
}

h1.titre, h2.titre {
    text-align: center;
    color: red;
    text-decoration: underline;
}

p {
    line-height: 1.5;
}

code {
    background: #eee;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.95em;
}

pre {
    background: #eee;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
}

.small {
    font-size: 0.9em;
    color: #555;
}


/* ---------------------- */
/*  TABLEAUX (HTML & CSS) */
/* ---------------------- */

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    margin-bottom: 30px;
}

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

th {
    background: #e6e6e6;
}

/* Exemples CSS */
.exemple-boite {
    border: 1px solid #999;
    padding: 8px;
    margin: 4px 0;
    text-align: center;
}

.exemple-boite-backgrounds {
    border: 1px solid #999;
    padding: 8px;
    margin: 4px 0;
    text-align: center;
    text-shadow: black 1px 1px;
}

#titre-special{
    color: darkred;
    font-size: 26px;
}

.texte-bleu{
    color: blue;
}

.encadre{
    border:solid 3px black;
}


/* Couleurs et images de fond */
.fond-couleur {
    background-color: lightblue;
}

.fond-image {
    background-image: url('smiley.png');
    color: white;
}

.fond-image-cover {
    background-image: url('smiley.png');
    background-size: cover;
    background-repeat: no-repeat;
    color: white;
}

.fond-image-contain {
    background-image: url('smiley.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* ---------------------- */
/*   BLOCS D'EXEMPLE      */
/* ---------------------- */

.exemple {
    border: 1px solid #888;
    padding: 10px;
    margin: 10px 0;
    background: white;
}

/* ---------------------- */
/*     MENU PRINCIPAL     */
/* ---------------------- */

.menu-container {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* grille 2 colonnes */
    gap: 25px;
}


.menu-item {
    background: white;
    border: 2px solid #ccc;
    border-radius: 12px;
    padding: 25px;
    transition: 0.2s;
    text-align: center; /* centre TOUT ce qui est dans la carte */

}

.menu-item:hover {
    border-color: #4A90E2;
    background: #eef6ff;
}

.menu-title {
    font-size: 1.6em;
    margin-bottom: 10px;
    color:red;
}

.menu-description {
    font-size: 1.1em;
    margin-bottom: 15px;
}

.menu-button {
    display: inline-block;
    padding: 20px;
    font-size: 1.2em;
    background: #4A90E2;
    color: black;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s;

}

.menu-button:hover {
    background: #3575b8;
    color:white;
}

/* Boutons de la page de menu principale (grille 2x2) */
.menu-container .menu-button {
    display: inline-block;   /* plus en plein écran */
    width: auto;             /* s'adapte au texte */
    margin: 0 auto;          /* centre le bouton */
    text-align: center;      /* centre le texte dedans */
}


/* ---------------------- */
/*   MENU LATERAL (id/class & flexbox) */
/* ---------------------- */

.page-layout {
    display: flex;
    gap: 20px;
}

.menu {
    width: 240px;
    border: 1px solid #bbb;
    background: #fff;
    padding: 10px;
    border-radius: 5px;
    height: fit-content;
}

.menu h3,
.menu h2 {
    text-align: center;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.menu-button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    margin-bottom: 5px;
    border: 1px solid #ccc;
    background: #f2f2f2;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95em;
}

.menu-button:hover {
    background: #e6e6e6;
}

.menu-button.active {
    background: #d0e4ff;
    border-color: #4a90e2;
    font-weight: bold;
}

/* ---------------------- */
/*   CONTENU DES SECTIONS */
/* ---------------------- */


.section, .section-flex {
    display: none;
    background: white;
    border: 1px solid #bbb;
    padding: 20px;
    border-radius: 5px;
}

.section.active,
.section-flex.active {
    display: block;
}

/* Centrer les sections uniquement dans la page vocabulaire et css */
.vocabulaire-page .section, .css-page .section {
    margin-left: auto;
    margin-right: auto;
    max-width: 800px; /* largeur confortable */
}
/* Mise en page spécifique pour la page vocabulaire */
.vocabulaire-page .page-layout, .css-page .page-layout {
    display: block; /* on enlève le flex ici */
}

/* On centre le bloc de contenu */
.vocabulaire-page .content, .css-page .content {
    max-width: 900px;   /* largeur du "cadre" */
    margin: 0 auto;     /* centre horizontalement */
}


/* ---------------------- */
/*   FLEXBOX DEMO         */
/* ---------------------- */

.flex-demo {
    display: flex;
    gap: 10px;
    border: 1px solid #aaa;
    padding: 10px;
    background: #fff;
    margin-top: 10px;
}

.flex-item {
    background: lightblue;
    border: 1px solid #666;
    padding: 10px;
    text-align: center;
    flex: 0 0 60px;
}

.demo-center {
    justify-content: center;
}

.demo-space-between {
    justify-content: space-between;
}

.demo-column {
    flex-direction: column;
}

.demo-align-center {
    align-items: center;
    height: 120px;
}

.demo-wrap {
    flex-wrap: wrap;
}

.flex-grow-demo .flex-item:nth-child(2) {
    flex-grow: 1;
}


/* Amélioration de visibilité pour marges / padding */
.exemple-marge {
    background: #fff6d1; /* jaune très pâle, visible mais discret */
    border: 2px solid #b8860b;
    padding: 10px;
}

.exemple-marge-container {
    background: #f0f0f0;
    padding: 12px;
    border: 1px dashed #aaa;
    margin:10px;
}

.exemple-padding{
    background: #fff6d1; /* jaune très pâle, visible mais discret */
    border: 2px solid #b8860b;
    margin: 10px;
}



/* Bouton RETOUR AU MENU */
.back-button {
    display: inline-block;
    margin-bottom: 25px;
    padding: 10px 18px;
    background: #dcdcdc;
    color: black;
    text-decoration: none;
    font-size: 1.1em;
    border-radius: 6px;
    border: 1px solid #bbb;
    transition: 0.2s;
}

.back-button:hover {
    background: #c0c0c0;
    border-color: #999;
}


/* ---------------------- */
/*   ANIMATIONS SIMPLES   */
/* ---------------------- */

/* Texte qui clignote (opacity) */
@keyframes clignote {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.2;
    }
    100% {
        opacity: 1;
    }
}

.anim-clignote {
    animation: clignote 1s infinite;
}

/* Petit mouvement gauche-droite */
@keyframes bouge {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(15px);
    }
}

.anim-bouge {
    animation: bouge 1s infinite alternate;
}
