:root {
    /* Thème clair par défaut */
    --bg-body: #f4f4f5;
    --bg-container: #fdfdfd;
    --text-main: #1a1a1a;
    --text-muted: #555555;
    --accent-red: #8b0000;
    --link-hover: #b30000;
    --border-color: #cccccc;
    --bg-code: #f0f0f0;
    --bg-tag: #e8e8e8;
    --bg-encart: #fdf8f8;
    --bg-title-frama: #8b0000;
    --text-title-frama: #ffffff;
    --bg-title-blog: #1a1a1a;
    --text-title-blog: #ffffff;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Thème sombre */
        --bg-body: #121212;
        --bg-container: #1e1e1e;
        --text-main: #e4e4e4;
        --text-muted: #a0a0a0;
        --accent-red: #e55353;
        --link-hover: #ff7777;
        --border-color: #444444;
        --bg-code: #2a2a2a;
        --bg-tag: #2d2d2d;
        --bg-encart: #2a1f1f;
        --bg-title-frama: #e55353;
        --text-title-frama: #121212;
        --bg-title-blog: #e4e4e4;
        --text-title-blog: #121212;
    }
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-body);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 18px;
    color: var(--text-main);
    line-height: 1.7;
}


h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--bg-container);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0 2.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

main {
    flex: 1;
    padding: 2.5rem 0;
}

.site-header {
    padding: 2rem 0 1rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.site-title {
    font-size: 1.5rem;
    font-weight: bold;
    display: inline-flex;
    border-radius: 4px;
    overflow: hidden;
}

.title-frama {
    background-color: var(--bg-title-frama);
    color: var(--text-title-frama);
    padding: 0.1rem 0.5rem;
}

.title-blog {
    background-color: var(--bg-title-blog);
    color: var(--text-title-blog);
    padding: 0.1rem 0.5rem;
}

.site-nav a {
    margin-left: 1rem;
}

.site-footer {
    padding: 1.5rem 0 2.5rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.post-list {
    list-style-type: none;
    padding: 0;
}

.post-item {
    margin-bottom: 3rem;
}

.post-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.6rem;
    line-height: 1.3;
}

.post-meta {
    font-family: monospace;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.post-description {
    margin: 0.75rem 0 0 0;
    color: var(--text-main);
}
.post-description p {
    margin: 0;
}

a { 
    color: var(--accent-red); 
    text-decoration: none; 
}

a:hover { 
    color: var(--link-hover);
    text-decoration: underline; 
}

img { 
    max-width: 100%; 
    height: auto; 
}

pre, code { 
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
}

pre { 
    background-color: var(--bg-code); 
    padding: 1rem; 
    overflow-x: auto; 
    border: 1px solid var(--border-color); 
    border-radius: 4px;
}

code {
    background-color: var(--bg-code);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

/* Citations */
blockquote {
    margin: 2rem 0;
    padding: 0.5rem 1.5rem;
    border-left: 4px solid var(--accent-red);
    background-color: var(--bg-body);
    color: var(--text-muted);
    font-style: italic;
}

blockquote p:first-child { margin-top: 0; }
blockquote p:last-child { margin-bottom: 0; }

/* Tableaux */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: bold;
    color: var(--text-main);
    border-bottom: 2px solid var(--border-color);
}

.toc {
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 4px;
}

.toc ul { 
    padding-left: 1.5rem; 
    margin: 0;
}

.post-tags {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--border-color);
    font-size: 0.9rem;
}

.tag {
    display: inline-block;
    background-color: var(--bg-tag);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    margin-right: 0.5rem;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.tag:hover {
    background-color: var(--border-color);
    text-decoration: none;
}

.footnote {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footnote hr {
    display: none;
}

.footnote ol {
    padding-left: 1.5rem;
}

.footnote-ref {
    text-decoration: none;
    padding: 0 0.1rem;
}

figure {
    margin: 2.5rem 0;
    padding: 0;
    text-align: center;
}

figure img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

figcaption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.encart {
    background-color: var(--bg-encart);
    border-left: 4px solid var(--accent-red);
    margin: 1.2rem 0;
    padding-top: 0.2rem;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 1rem;
    border-radius: 0 4px 4px 0;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-red);
}

.encart-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--accent-red);
    margin-bottom: 0.85rem;
}

.encart-content p:first-child { margin-top: 0; }
.encart-content p:last-child { margin-bottom: 0; }

@media (max-width: 600px) {
    .container { padding: 0 1.25rem; }
    .site-header { flex-direction: column; align-items: flex-start; }
    .site-nav { margin-top: 1rem; }
    .site-nav a { margin-left: 0; margin-right: 1.25rem; }
    body { font-size: 16px; }
}
