/* -------------------------------------------------------------------------- */
/* VARIABLES                                 */
/* -------------------------------------------------------------------------- */

:root {
    --bg-color: #FFFFFF;
    --text-color: #333333;
    --link-color: #D93636; /* Un rouge sobre */
    --link-hover-color: #A92A2A; /* Un rouge plus foncé pour le survol */
    --border-color: #EAEAEA;
    --code-bg-color: #F5F5F5;
    --pre-bg-color: #2d2d2d; /* Fond sombre pour les blocs de code */
    --pre-text-color: #f8f8f2;
    
    --info-color: #2E7AFB;
    --warning-color: #FFB800;
    --alert-color: #F44336;

    --font-body: 'Inter', sans-serif;
    --font-headings: 'Lora', serif;

    --container-width: 800px;
}

/* -------------------------------------------------------------------------- */
/* RESET                                   */
/* -------------------------------------------------------------------------- */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%; /* 16px par défaut */
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* -------------------------------------------------------------------------- */
/* LAYOUT & HEADER                             */
/* -------------------------------------------------------------------------- */

.container {
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding: 1rem 1.5rem 3rem;
}

.site-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: calc(var(--container-width) + 3rem); /* container + padding */
    margin: 0 auto;
}

.logo-link {
    display: flex;
    align-items: center;
}

.site-title {
    font-family: var(--font-headings);
    font-size: 1.25rem;
    font-weight: 700;
}

.site-title a {
    text-decoration: none;
    color: var(--text-color);
}

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex; /* Pour s'assurer que le SVG est bien aligné */
    color: var(--text-color);
}

.main-nav {
    display: none; /* Caché par défaut */
    width: 100%;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.main-nav.is-open {
    display: block; /* Affiché par JavaScript */
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.main-nav a {
    font-size: 1.1rem;
}

/* -------------------------------------------------------------------------- */
/* TYPOGRAPHIE                                */
/* -------------------------------------------------------------------------- */

p, li, blockquote {
    margin-bottom: 1.25rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headings);
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out, text-shadow 0.2s ease-in-out;
}

a:hover, a:focus {
    color: var(--link-hover-color);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

/* -------------------------------------------------------------------------- */
/* ÉLÉMENTS SPÉCIFIQUES                           */
/* -------------------------------------------------------------------------- */

hr {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 3rem 0;
}

/* Code en ligne */
code {
    background-color: var(--code-bg-color);
    color: var(--text-color);
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    border-radius: 6px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* Bloc de code */
pre {
    background-color: var(--pre-bg-color);
    color: var(--pre-text-color);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* Citation */
blockquote {
    border-left: 4px solid var(--link-color);
    padding-left: 1.5rem;
    margin-left: 0;
    margin-right: 0;
    font-style: italic;
    color: #666;
}

blockquote p {
    margin-bottom: 0.5rem;
}

blockquote footer {
    font-style: normal;
    font-size: 0.9rem;
    color: #888;
}

/* Paragraphes spéciaux */
.info, .warning, .alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-left-width: 5px;
    border-left-style: solid;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.info { border-color: var(--info-color); }
.warning { border-color: var(--warning-color); }
.alert { border-color: var(--alert-color); }

/* -------------------------------------------------------------------------- */
/* CONTENU                                   */
/* -------------------------------------------------------------------------- */

/* Liste d'articles sur la page d'accueil */
.post-list .list-title {
    text-align: center;
    margin-top: 0;
    margin-bottom: 3rem;
}

.post-preview {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
}

.post-preview:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.post-title {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.post-title a {
    color: var(--text-color);
    text-decoration: none;
}
.post-title a:hover {
    color: var(--link-color);
    text-decoration: none;
}

.post-meta {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1rem;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    font-weight: bold;
}

/* Contenu d'un article */
.article-content .article-header {
    text-align: center;
    margin-bottom: 3rem;
}

.article-content .article-header h1 {
    margin-top: 0;
}

/* -------------------------------------------------------------------------- */
/* FOOTER                                   */
/* -------------------------------------------------------------------------- */

.site-footer-bottom {
    text-align: center;
    padding: 2rem 1.5rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: #888;
}

.site-footer-bottom .container {
    padding: 0;
}

/* -------------------------------------------------------------------------- */
/* RESPONSIVE                                 */
/* -------------------------------------------------------------------------- */

@media (min-width: 768px) {
    html {
        font-size: 112.5%; /* 18px */
    }

    .container {
        padding: 2rem 2rem 4rem;
    }
    
    h1 { font-size: 3rem; }
    h2 { font-size: 2.25rem; }
}
