/* Définition des couleurs à partir de votre logo */
:root {
    --color-noir: #000000;
    /* Rouge Bordeau/Marron pour l'accentuation */
    --color-accent: #800000; 
    /* Gris foncé pour les cartes et les fonds secondaires */
    --color-gray-dark: #333333; 
    --color-text-light: #F0F0F0;
    --color-text-primary: #FFFFFF;
}

/* Réinitialisation de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: sans-serif; /* Vous pouvez choisir une police plus stylée ici */
    background-color: var(--color-noir);
    color: var(--color-text-primary);
    line-height: 1.6;
}

/* Liens génériques */
a {
    color: var(--color-accent);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ======================= EN-TÊTE ======================= */
.main-header {
    background-color: var(--color-accent);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 40px; /* Ajustez la taille de votre logo */
    vertical-align: middle;
}

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav ul li a {
    color: var(--color-text-primary);
    padding: 10px 15px;
    display: block;
    font-weight: bold;
    transition: background-color 0.3s;
}

.main-nav ul li a:hover {
    background-color: var(--color-noir);
    text-decoration: none;
}

/* ======================= ZONE HÉRO ======================= */
.hero-section {
    background-color: var(--color-noir);
    text-align: center;
    padding: 100px 5%;
    /* Utilise l'accent comme bordure basse pour séparer visuellement */
    border-bottom: 5px solid var(--color-accent); 
}

.hero-section h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: var(--color-text-light);
}

.hero-section p {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: var(--color-gray-dark);
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 5px;
    text-transform: uppercase;
    font-weight: bold;
    margin: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-text-primary);
    border: 2px solid var(--color-accent);
}

.btn-primary:hover {
    background-color: var(--color-noir);
    border-color: var(--color-text-light);
}

.btn-secondary {
    background-color: var(--color-gray-dark);
    color: var(--color-text-primary);
    border: 2px solid var(--color-gray-dark);
}

.btn-secondary:hover {
    background-color: var(--color-noir);
    border-color: var(--color-accent);
}

/* ======================= CONTENU PRINCIPAL (MAIN) ======================= */
.main-content {
    padding: 40px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

h2 {
    color: var(--color-accent);
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8em;
}

hr {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0), var(--color-accent), rgba(255, 255, 255, 0));
    margin: 40px 0;
}

/* Style de la carte du dernier article */
.post-card {
    display: flex;
    background-color: var(--color-gray-dark);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
    border-left: 5px solid var(--color-accent);
}

.post-image {
    width: 30%;
    height: auto;
    object-fit: cover;
}

.post-info {
    width: 70%;
    padding: 20px;
}

.post-info h3 {
    color: var(--color-text-primary);
    margin-bottom: 10px;
}

.post-info .post-excerpt {
    color: var(--color-text-light);
    margin-bottom: 15px;
}

.post-info .read-more {
    font-weight: bold;
    color: var(--color-accent);
}

/* Grille de projets */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.project-item {
    background-color: var(--color-gray-dark);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--color-accent);
    transition: transform 0.3s, background-color 0.3s;
}
.project-item:hover {
    transform: translateY(-5px);
    background-color: #444444; /* Un gris légèrement plus clair au survol */
}

.project-item h3 {
    color: var(--color-text-primary);
    margin-bottom: 10px;
}

.project-item p {
    color: var(--color-text-light);
    margin-bottom: 15px;
}

.project-link {
    font-weight: bold;
    color: var(--color-accent);
}


/* ======================= PIED DE PAGE ======================= */
.main-footer {
    background-color: var(--color-accent);
    color: var(--color-text-primary);
    text-align: center;
    padding: 20px 0;
    font-size: 0.9em;
}

.main-footer p {
    margin-bottom: 10px;
}

.social-links a {
    color: var(--color-text-primary);
    margin: 0 10px;
    font-size: 1.2em; /* Pour les icônes (si vous les utilisez) */
}

.social-links a:hover {
    color: var(--color-noir);
}


/* ======================= PAGE BLOG (DEUX COLONNES) ======================= */
.blog-container {
    display: flex;
    gap: 30px;
    padding: 40px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.articles-list {
    flex: 3; /* Prend 60-70% de la largeur */
}

.sidebar {
    flex: 1; /* Prend 30-40% de la largeur */
    background-color: var(--color-gray-dark);
    padding: 20px;
    border-radius: 8px;
    height: fit-content; /* S'adapte au contenu */
}

.articles-list h1 {
    font-size: 2em;
    color: var(--color-text-primary);
    text-align: left;
    margin-bottom: 20px;
}

/* Style de tri */
.sort-options {
    margin-bottom: 20px;
    color: var(--color-text-light);
}
.sort-options select {
    padding: 8px;
    border-radius: 4px;
    background-color: var(--color-gray-dark);
    color: var(--color-text-primary);
    border: 1px solid var(--color-accent);
}

/* Carte d'Extrait d'Article (similaire à la carte de la page d'accueil) */
.article-summary-card {
    display: flex;
    background-color: var(--color-gray-dark);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    transition: box-shadow 0.3s;
}

.article-summary-card:hover {
    box-shadow: 0 0 15px rgba(128, 0, 0, 0.5); /* Ombre légère en rouge bordeau au survol */
}

.summary-image {
    width: 200px; /* Taille fixe pour la vignette */
    height: auto;
    object-fit: cover;
}

.summary-content {
    padding: 15px;
}

.summary-content h2 a {
    color: var(--color-text-primary);
    font-size: 1.3em;
    text-decoration: none;
    transition: color 0.3s;
}

.summary-content h2 a:hover {
    color: var(--color-accent);
}

.metadata {
    font-size: 0.85em;
    color: #AAAAAA;
    margin-bottom: 10px;
}

.excerpt {
    color: var(--color-text-light);
    margin-bottom: 15px;
}

.read-more-link {
    color: var(--color-accent);
    font-weight: bold;
}

/* Style de la Sidebar (Widgets) */
.widget {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px dotted var(--color-accent);
}

.widget h3 {
    color: var(--color-accent);
    margin-bottom: 15px;
    font-size: 1.2em;
}

.widget input[type="text"], .widget input[type="email"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--color-accent);
    border-radius: 4px;
    background-color: var(--color-noir);
    color: var(--color-text-primary);
}

.widget ul {
    list-style: none;
}

.widget ul li a {
    display: block;
    padding: 5px 0;
    color: var(--color-text-light);
}

.widget ul li a:hover {
    color: var(--color-accent);
    text-decoration: none;
}

/* Pagination */
.pagination {
    text-align: center;
    margin-top: 30px;
}
.pagination a {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    background-color: var(--color-gray-dark);
    color: var(--color-text-primary);
    border-radius: 4px;
    transition: background-color 0.3s;
}
.pagination a.active, .pagination a:hover {
    background-color: var(--color-accent);
    text-decoration: none;
}



/* ======================= PAGE ARTICLE UNIQUE ======================= */
.single-post-container {
    display: flex;
    gap: 30px;
    padding: 40px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.post-article {
    flex: 3; /* Prend environ 70% de la largeur */
    background-color: var(--color-gray-dark);
    padding: 30px;
    border-radius: 8px;
    color: var(--color-text-light);
}

.sidebar-post {
    flex: 1; /* Prend environ 30% de la largeur */
    background-color: var(--color-gray-dark);
    padding: 20px;
    border-radius: 8px;
    height: fit-content;
}

.post-header {
    text-align: center;
    margin-bottom: 30px;
}

.post-header h1 {
    font-size: 2.2em;
    color: var(--color-text-primary);
    margin-bottom: 10px;
    line-height: 1.2;
}

.post-meta {
    font-size: 0.9em;
    color: #AAAAAA;
    margin-bottom: 20px;
}
.post-meta .author {
    font-weight: bold;
    color: var(--color-accent);
}
.post-meta a {
    color: var(--color-accent);
}

.share-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.share-buttons span {
    color: var(--color-text-light);
    font-weight: bold;
}
.share-buttons a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background-color: var(--color-noir);
    color: var(--color-text-primary);
    border-radius: 50%;
    font-size: 0.9em;
    transition: background-color 0.3s;
}
.share-buttons a:hover {
    background-color: var(--color-accent);
}

.featured-image {
    width: 100%;
    height: auto;
    max-height: 400px; /* Limite la hauteur de l'image principale */
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 30px;
}

.post-content h2 {
    color: var(--color-accent);
    font-size: 1.8em;
    margin-top: 30px;
    margin-bottom: 15px;
    text-align: left; /* Réinitialiser le centrage global */
}

.post-content h3 {
    color: var(--color-text-primary);
    font-size: 1.4em;
    margin-top: 25px;
    margin-bottom: 10px;
}

.post-content p {
    margin-bottom: 1em;
    color: var(--color-text-light);
}

.post-content ul, .post-content ol {
    margin-bottom: 1em;
    margin-left: 20px;
    color: var(--color-text-light);
}
.post-content ul li, .post-content ol li {
    margin-bottom: 0.5em;
}

/* Style pour les blocs de code */
.post-content pre {
    background-color: var(--color-noir);
    color: #00FF00; /* Vert fluo classique pour le code */
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto; /* Permet le défilement horizontal si le code est trop long */
    margin-bottom: 1em;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.post-content code {
    color: #00FF00;
}

/* Commentaires */
.comments-section {
    margin-top: 50px;
    border-top: 1px dotted var(--color-accent);
    padding-top: 30px;
}

.comments-section h2 {
    text-align: left;
    color: var(--color-accent);
    margin-bottom: 25px;
}

.comment-form input, .comment-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--color-accent);
    border-radius: 4px;
    background-color: var(--color-noir);
    color: var(--color-text-primary);
}

.comment-form textarea {
    resize: vertical;
}

.comment-list h3 {
    color: var(--color-text-primary);
    margin-top: 30px;
    margin-bottom: 20px;
}

.comment-item {
    background-color: var(--color-noir);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 3px solid var(--color-accent);
}

.comment-author {
    font-weight: bold;
    color: var(--color-accent);
    margin-bottom: 5px;
}
.comment-date {
    font-size: 0.8em;
    color: #AAAAAA;
    margin-bottom: 10px;
}
.comment-text {
    color: var(--color-text-light);
}

/* Navigation Article Précédent/Suivant */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px dotted var(--color-accent);
}

.post-navigation a {
    color: var(--color-accent);
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s;
}
.post-navigation a:hover {
    color: var(--color-text-primary);
}

/* Styles pour la sidebar de l'article (réutilise les styles de .sidebar .widget) */
.sidebar-post .widget {
    background-color: var(--color-noir); /* Un peu plus sombre que le corps de l'article */
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid var(--color-accent);
}
.sidebar-post .widget h3 {
    color: var(--color-accent);
    font-size: 1.1em;
    margin-bottom: 15px;
}
.sidebar-post .widget ul {
    list-style: none;
}
.sidebar-post .widget ul li a {
    color: var(--color-text-light);
    display: block;
    padding: 5px 0;
}
.sidebar-post .widget ul li a:hover {
    color: var(--color-accent);
}

/* ======================= PAGE API & OUTILS ======================= */
.api-tools-container {
    padding: 40px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.intro-section {
    text-align: center;
    margin-bottom: 40px;
}
.intro-section h1 {
    color: var(--color-text-primary);
    margin-bottom: 15px;
    font-size: 2em;
}
.intro-section p {
    color: var(--color-text-light);
    max-width: 800px;
    margin: 0 auto;
}

/* Filtres */
.tool-filters {
    text-align: center;
    margin-bottom: 30px;
}

.filter-btn {
    display: inline-block;
    padding: 8px 15px;
    margin: 5px;
    background-color: var(--color-gray-dark);
    color: var(--color-text-light);
    border: 1px solid var(--color-gray-dark);
    border-radius: 20px;
    transition: background-color 0.3s, color 0.3s;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--color-accent);
    color: var(--color-text-primary);
    text-decoration: none;
}

/* Grille et Cartes d'Outils */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.tool-card {
    background-color: var(--color-gray-dark);
    padding: 25px;
    border-radius: 8px;
    border-top: 5px solid var(--color-accent);
    transition: transform 0.3s;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.tool-header h2 {
    color: var(--color-accent);
    font-size: 1.5em;
    margin: 0;
    text-align: left;
}

/* Badge Statut */
.tool-badge {
    font-size: 0.8em;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    color: var(--color-text-primary);
    background-color: var(--color-noir);
    border: 1px solid var(--color-accent);
}

.tool-description {
    color: var(--color-text-light);
    margin-bottom: 20px;
}

/* Exemple de code (réutilise le style pre/code de l'article) */
.endpoint-example {
    margin-bottom: 20px;
}
.endpoint-example p {
    font-weight: bold;
    color: var(--color-text-primary);
    margin-bottom: 5px;
}

.endpoint-example pre {
    background-color: var(--color-noir);
    color: #00FF00;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
}

/* Actions */
.tool-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.github-link {
    color: var(--color-text-light);
    font-weight: bold;
    transition: color 0.3s;
}
.github-link:hover {
    color: var(--color-accent);
}

/* Assurez-vous que le bouton utilise le style du bouton primaire défini dans le CSS précédent */

/* ======================= PAGE PROJETS ======================= */
.projects-container {
    padding: 40px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Réutilise les styles de .intro-section et .tool-filters de la page API */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: var(--color-gray-dark);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.3s;
    border: 1px solid var(--color-gray-dark);
}

.project-card:hover {
    box-shadow: 0 5px 15px rgba(128, 0, 0, 0.5);
    transform: translateY(-5px);
}

.project-image {
    width: 100%;
    height: 200px; /* Hauteur fixe pour l'uniformité du portfolio */
    object-fit: cover;
    border-bottom: 3px solid var(--color-accent);
}

.project-content {
    padding: 20px;
}

.project-content h2 {
    color: var(--color-accent);
    font-size: 1.4em;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: left;
}

.project-description {
    color: var(--color-text-light);
    margin-bottom: 15px;
}

/* Stack technologique (Tags) */
.tech-stack {
    margin-bottom: 20px;
    min-height: 40px; /* Assure un peu d'espace si les tags sont longs */
}

.tech-tag {
    display: inline-block;
    background-color: var(--color-noir);
    color: var(--color-text-primary);
    font-size: 0.8em;
    padding: 5px 10px;
    margin: 3px 5px 3px 0;
    border-radius: 20px;
    border: 1px solid var(--color-accent);
    white-space: nowrap; /* Empêche la coupure des tags */
}

.project-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

/* Le style des liens .btn-primary et .github-link est réutilisé */

/* ======================= PAGE À PROPOS ======================= */
.about-container {
    padding: 40px 5%;
    max-width: 900px; /* Max-width plus petit pour un contenu plus concentré */
    margin: 0 auto;
}

.profile-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--color-accent);
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%; /* Image ronde */
    object-fit: cover;
    margin-bottom: 20px;
    border: 4px solid var(--color-accent);
    box-shadow: 0 0 10px rgba(128, 0, 0, 0.7);
}

.profile-header h1 {
    color: var(--color-text-primary);
    font-size: 2.5em;
    margin-bottom: 10px;
}

.slogan {
    color: var(--color-accent);
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 20px;
}

.social-connect a {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    background-color: var(--color-noir);
    color: var(--color-text-light);
    border: 1px solid var(--color-accent);
    border-radius: 5px;
    transition: background-color 0.3s;
}
.social-connect a:hover {
    background-color: var(--color-accent);
    color: var(--color-text-primary);
    text-decoration: none;
}

/* Contenu de la page */
.about-content h2 {
    color: var(--color-accent);
    font-size: 1.8em;
    margin-top: 40px;
    margin-bottom: 20px;
}

.about-content p {
    color: var(--color-text-light);
    margin-bottom: 15px;
    line-height: 1.7;
}

/* Badges de technologie pour la page À Propos (variante) */
.tech-badges-list {
    margin-top: 20px;
    margin-bottom: 40px;
}

.about-tech-tag {
    display: inline-block;
    background-color: var(--color-gray-dark);
    color: var(--color-text-primary);
    font-size: 0.9em;
    padding: 8px 15px;
    margin: 5px 10px 5px 0;
    border-radius: 5px;
    font-weight: bold;
    border-left: 3px solid var(--color-accent);
}

/* CTA de contact en bas */
.contact-cta {
    text-align: center;
    background-color: var(--color-gray-dark);
    padding: 30px;
    border-radius: 8px;
    margin-top: 50px;
    border: 1px solid var(--color-accent);
}

.contact-cta p {
    color: var(--color-text-primary);
    font-size: 1.1em;
    margin-bottom: 20px;
}


/* ======================= PAGE CONTACT ======================= */
.contact-container {
    padding: 40px 5%;
    max-width: 700px; /* Formulaire très centré */
    margin: 0 auto;
}

.contact-card {
    background-color: var(--color-gray-dark);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border-top: 5px solid var(--color-accent);
}

.contact-card h1 {
    text-align: center;
    color: var(--color-text-primary);
    font-size: 2em;
    margin-bottom: 10px;
}

.intro-text {
    text-align: center;
    color: var(--color-text-light);
    margin-bottom: 30px;
}

.contact-form {
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--color-text-primary);
    font-weight: bold;
    margin-bottom: 8px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-accent);
    border-radius: 4px;
    background-color: var(--color-noir);
    color: var(--color-text-light);
    font-size: 1em;
}

.contact-form textarea {
    resize: vertical;
}

.form-submit-btn {
    width: 100%;
    /* Utilise le style de .btn-primary */
    font-size: 1.1em;
}

.alternative-contact {
    text-align: center;
    padding-top: 20px;
    border-top: 1px dotted var(--color-accent);
}

.alternative-contact h2 {
    color: var(--color-accent);
    font-size: 1.4em;
    margin-bottom: 20px;
}

.alternative-contact .social-connect a {
    /* Réutilise le style social-connect de la page À Propos */
    font-size: 1em;
    padding: 10px 18px;
}

.note {
    color: #AAAAAA;
    font-size: 0.9em;
    margin-top: 15px;
}