/* =====================================================================
   FEUILLE DE STYLE : portfolio + pages projets
   Même contenu pour projet.css et portfolio.css.

   CHOISIR UN THÈME : un seul bloc de variables doit être actif.
   Pour désactiver un bloc, entoure-le d'un commentaire CSS ; pour
   l'activer, retire le commentaire qui l'entoure.
   ===================================================================== */


/* THÈME 1 : CLAIR SOBRE (désactivé)
:root {
    --bg: #ffffff;
    --text: #222222;
    --title: #111111;
    --muted: #666666;
    --card: #f5f6f8;
    --border: #e3e5e8;
    --accent: #2563eb;
}
*/
/* =====================================================================
   PAGE D'ACCUEIL : Grille de projets responsive (PC & Mobile)
   ===================================================================== */
.projets {
    display: grid;
    /* 2 colonnes sur PC, passe automatiquement à 1 colonne sur téléphone */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0 2.5rem;
}

.projet {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    text-decoration: none;
    color: var(--title);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.projet:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    border-color: var(--accent);
}

.projet-titre {
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 0.8rem;
    min-height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.projet img {
    display: block;
    width: 100%;
    height: 200px;
    /* "contain" affiche le graphique en entier sans le couper (contrairement à "cover") */
    object-fit: contain;
    background: #ffffff; /* Fond blanc propre pour bien lire tes graphiques R/Python */
    border-radius: 8px;
    padding: 0.4rem;
    box-sizing: border-box;
}
/* THÈME 2 : SOMBRE (actif) */
:root {
    --bg: #14161a;
    --text: #e6e8eb;
    --title: #ffffff;
    --muted: #9aa0a6;
    --card: #1e2127;
    --border: #2c3038;
    --accent: #60a5fa;
}

/* THÈME 3 : CHALEUREUX (désactivé)
:root {
    --bg: #faf7f2;
    --text: #2b2b2b;
    --title: #1c1c1c;
    --muted: #6b665c;
    --card: #ffffff;
    --border: #e7dfd0;
    --accent: #0f766e;
}
*/


/* =====================================================================
   BASE
   ===================================================================== */
body {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--accent);
}


/* =====================================================================
   TITRES
   ===================================================================== */
h1 {
    text-align: center;
    color: var(--title);
    font-size: 2rem;
    margin: 2rem 0 1.5rem;
}

h1::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    margin: 0.6rem auto 0;
    background: var(--accent);
    border-radius: 2px;
}

h2 {
    text-align: left;
    color: var(--title);
    font-size: 1.5rem;
    margin: 2.5rem 0 1rem;
    padding-left: 0.75rem;
    border-left: 4px solid var(--accent);
}


/* =====================================================================
   IMAGE D'INTRODUCTION : grande, centrée, en haut d'une page projet
   Usage : <img src="..." class="image-intro">
   ===================================================================== */
img.image-intro {
    display: block;
    width: 100%;
    max-width: 900px;
    height: auto;
    margin: 1.5rem auto 3rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}


/* =====================================================================
   TABLEAUX
   ===================================================================== */
table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 1rem;
    border: none;
    margin: 0 auto;
}

td {
    border: none;
    vertical-align: middle;
}

.titre,
#titre {
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--title);
}


/* =====================================================================
   PAGES PROJETS : texte en carte, images à côté
   ===================================================================== */
.texte,
#texte {
    padding: 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
}

.superposees {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#image img,
#projets_images img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}


/* =====================================================================
   PAGE D'ACCUEIL : vignettes cliquables
   ===================================================================== */
td a img {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

td a img:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}


/* =====================================================================
   MOBILE
   ===================================================================== */
@media (max-width: 700px) {
    body {
        padding: 1rem;
    }

    table,
    tbody,
    tr,
    td {
        display: block;
        width: 100%;
    }

    table {
        border-spacing: 0;
    }

    td {
        margin-bottom: 1rem;
    }
}
