/* ============================================================
   🏠 GENERAL STYLES
   ============================================================ */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================================
   📌 HEADER
   ============================================================ */
header {
    background: #222;
    color: white;
    padding: 20px;
    text-align: center;
}

/* ============================================================
   📌 FOOTER (Toujours collé en bas)
   ============================================================ */
footer {
    background: #222;
    color: white;
    text-align: center;
    padding: 10px;
    margin-top: auto;
}

/* ============================================================
   📌 MAIN LAYOUT
   ============================================================ */
.main-container {
    display: flex;
    flex: 1;
    justify-content: space-between;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* ============================================================
   📌 SECTION PRINCIPALE (Blog)
   ============================================================ */
.content-container {
    flex: 3;
    padding: 20px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Liste des entrées de blog */
ul.blog-list {
    list-style: none;
    padding: 0;
}

ul.blog-list li {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #ddd;
    transition: background 0.3s;
}

ul.blog-list li:hover {
    background: #f5f5f5;
}

/* Style de la date */
.blog-date {
    font-weight: bold;
    color: #555;
    font-size: 0.9em;
    margin-right: 10px;
    padding: 5px 10px;
    background: #eee;
    border-radius: 5px;
    min-width: 90px;
    text-align: center;
}

/* Style du lien */
.blog-link {
    color: #007BFF;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.blog-link:hover {
    color: #0056b3;
}

/* Suppression de l’underscore par défaut */
.blog-link:focus,
.blog-link:active {
    text-decoration: none;
}

/* ============================================================
   📌 SIDEBAR (MOZAÏQUE DE PROJETS)
   ============================================================ */
.sidebar {
    flex: 1;
    background: #fff;
    padding: 20px;
    margin-left: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.sidebar h2 {
    text-align: center;
}

/* ============================================================
   📌 MOSAÏQUE DE PROJETS (Toujours sur 3 colonnes)
   ============================================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Toujours 3 colonnes */
    gap: 10px;
    justify-items: center;
    padding-top: 10px;
}

/* Conteneur d'un projet */
.project {
    position: relative;
    width: 100%;
    max-width: 300px;
}

/* Image du projet */
.project img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

/* Effet hover sur l'image */
.project:hover img {
    transform: scale(1.05);
}

/* Overlay avec titre */
.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 1em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Afficher overlay au hover */
.project:hover .overlay {
    opacity: 1;
}

/* ============================================================
   📌 LIENS
   ============================================================ */
a {
    color: #007BFF;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================================
   📌 PAGINATION STYLES
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.pagination-button {
    background: #007BFF;
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 5px;
    margin: 0 5px;
    transition: background 0.3s;
}

.pagination-button:disabled {
    background: #ccc;
    cursor: default;
}

.pagination-button:hover:not(:disabled) {
    background: #0056b3;
}

#page-info {
    font-size: 1.2em;
    margin: 0 10px;
}


/* ============================================================
   📌 ARTICLE PAGE STYLES
   ============================================================ */
.article-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.article-container h1 {
    font-size: 2.2em;
    color: #222;
    text-align: center;
    margin-bottom: 20px;
}

.article-container h2 {
    font-size: 1.8em;
    margin-top: 30px;
    color: #333;
    border-bottom: 2px solid #007BFF;
    padding-bottom: 5px;
}

.article-container h3 {
    font-size: 1.5em;
    margin-top: 20px;
    color: #444;
}

.article-container p {
    font-size: 1.1em;
    line-height: 1.8;
    color: #444;
    margin-bottom: 15px;
}

/* Citations et notes */
.article-container blockquote {
    background: #f5f5f5;
    border-left: 5px solid #007BFF;
    margin: 20px 0;
    padding: 15px;
    font-style: italic;
    color: #555;
}

/* Navigation retour */
.back-button {
    display: inline-block;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #007BFF;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.back-button:hover {
    background: #0056b3;
}

/* Tables */
.article-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 1em;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.article-container table thead tr {
    background-color: #007BFF;
    color: white;
    text-align: left;
    font-weight: bold;
}

.article-container table th,
.article-container table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
}

.article-container table tbody tr:nth-child(even) {
    background-color: #f3f3f3;
}

/* Code blocks */
.article-container pre {
    background: #282c34;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 0.9em;
}

.article-container code {
    font-family: "Courier New", Courier, monospace;
    background: #f4f4f4;
    padding: 2px 4px;
    border-radius: 4px;
    color: #d63384;
}

/* Images */
.article-container img {
    max-width: 100%;
    display: block;
    margin: 20px auto;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}


/* ============================================================
   📌 RESPONSIVE DESIGN
   ============================================================ */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    .sidebar {
        margin-left: 0;
        margin-top: 20px;
    }
    .projects-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 colonnes sur mobile */
    }

    .article-container {
        padding: 15px;
        margin: 20px;
    }
    .article-container h1 {
        font-size: 1.8em;
    }
    .article-container h2 {
        font-size: 1.5em;
    }
}

