/* --- 1. GÉNÉRAL ET STRUCTURE --- */

/* Correction footer collé en bas (utilisant flexbox sur le body) */
html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f6f8;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh; 
}

/* --- 2. EN-TÊTE ET NAVIGATION --- */
header {
    background-color: #2c3e50;
    color: white;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    margin-bottom: 5px;
    font-size: 2.5em;
    letter-spacing: 1px;
}

header p {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.9;
}

/* Navigation */
nav {
    background-color: #e0e4e8;
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

nav a {
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

nav a:hover,
nav a.active {
    background-color: #d0d4d8;
}

/* --- 3. SECTIONS DE CONTENU --- */
.section {
    background-color: #ffffff;
    margin: 30px auto;
    padding: 40px;
    max-width: 1100px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    flex: 1;
}

.section h2 {
    color: #2c3e50;
    border-bottom: 2px solid #1abc9c;
    padding-bottom: 10px;
    margin-top: 0;
    font-size: 1.8em;
    text-align: left;
}

/* --- 4. LISTES (GÉNÉRALES) --- */
.section ul {
    list-style-type: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.section li {
    background-color: #ecf0f1;
    padding: 10px 15px;
    border-radius: 4px;
    border-left: 5px solid #3498db;
    transition: background-color 0.2s;
}

.section li:hover {
    background-color: #dde1e5;
}

.section li strong {
    color: #2c3e50;
}

@media (min-width: 768px) {
    .section ul {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* --- 5. LIENS (GÉNÉRAUX) --- */
a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Email */
.email-link {
    color: #2c3e50;
    text-decoration: none;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    background-color: #e0e4e8;
    transition: background-color 0.3s ease;
}
.email-link:hover {
    background-color: #d0d4d8;
}

/* --- 6. PIED DE PAGE --- */
footer {
    text-align: center;
    padding: 20px;
    background-color: #2c3e50;
    color: white;
    margin-top: auto;
}

footer a {
    color: #1abc9c;
    margin: 0 15px;
}

footer a:hover {
    color: white;
    text-decoration: none;
}

/* --- 7. STYLES SPÉCIFIQUES (Projets/Galerie) --- */
.project {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}
.gallery img {
    width: 45%;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.project-link {
    display: inline-block;
    margin-top: 10px;
    margin-right: 10px;
    padding: 8px 14px;
    background-color: #3498db;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}
.project-link:hover {
    background-color: #2980b9;
}

/* ------------------------------------------------------------------ */
/* --- 8. Codes Sources - NOUVEAU STYLE (Vert Élégant) - FINALISÉ --- */
/* ------------------------------------------------------------------ */

/* La grille principale */
.code-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 30px; 
    padding: 10px 0;
}

/* Le bloc individuel (la "carte") */
.code-block-group {
    background: #ffffff; 
    /* Padding ajusté pour un fond plus fin (25px haut/côtés, 15px bas) */
    padding: 25px 25px 15px; 
    border-radius: 12px;
    border: 1px solid #e0e4e8; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.code-block-group:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: #1abc9c; 
}

/* Titre du bloc de code */
.code-block-group h4 {
    font-size: 1.15em;
    color: #2c3e50; 
    /* Marge réduite pour coller aux boutons */
    margin-bottom: 10px; 
    line-height: 1.4;
    border-left: 3px solid #1abc9c; 
    padding-left: 12px;
    font-weight: 600;
}

/* Conteneur des boutons de téléchargement */
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px; 
    margin-top: auto; 
    /* Padding supérieur supprimé pour coller au titre */
    padding-top: 0; 
}

/* Style des boutons/liens de téléchargement */
.code-download {
    background: #1abc9c; /* VERT PRINCIPAL */
    color: #ffffff;
    padding: 8px 14px; 
    border-radius: 6px; 
    font-weight: 500;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.2s ease;
    display: inline-flex; 
    align-items: center;
    font-size: 0.9em;
}

/* Hover du bouton */
.code-download:hover {
    background: #16a085; /* VERT AU SURVOL */
    transform: translateY(-1px);
    text-decoration: none; 
}

/* Fix pour l'élément div vide dans le HTML */
.button-row div {
    display: none; 
}
