/* =========================================================
   4SACS — Feuille de style principale
   Dédupliquée et organisée
========================================================= */

/* === RESET === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === VARIABLES === */
:root {
    --font-body: "Source Serif 4", Georgia, serif;
    --font-sans: "Inter", system-ui, sans-serif;
    --bg: #fcf9f4;
    --text: #2b2b2b;
    --muted: #7b7b7b;
    --accent: #2c7a7b;
    --accent-light: #52b2b6;
    --link-hover: #205b5d;
    --max-width: 860px;
    --radius: 6px;
}

/* === STRUCTURE GÉNÉRALE === */
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.7;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.2rem 4rem;
}

/* === LIENS === */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* === TITRES === */
h1, h2, h3 {
    font-family: var(--font-sans);
    font-weight: 600;
    line-height: 1.3;
    color: var(--accent);
    margin-top: 1.2em;
    margin-bottom: 0.6em;
}

h1 {
    font-size: 2rem;
    border-bottom: 2px solid var(--accent-light);
    padding-bottom: 0.3em;
}

h2 {
    font-size: 1.3rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.1rem;
}

.home-footer, footer {
    visibility: hidden;
}

/* === ARTICLES === */
article {
    margin-bottom: 3rem;
}

/* === HEADERS UNIFIÉS === */
.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-bottom: 2.5rem;
}

.article-header .meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.article-header .cat,
.article-header .cat a {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    font-size: 1.2em;
}

.article-header .date {
    font-size: 0.95em;
    color: var(--muted);
}

.article-header h1 {
    font-family: var(--font-sans);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0;
    border-bottom: none;
}

.article-header .sep {
    opacity: 0.5;
    margin-right: 0.3em;
}

/* === CONTENU === */
.article-layout {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.content {
    flex: 3;
    line-height: 2;
}

.content img {
    width: 100%;
    border-radius: var(--radius);
    display: block;
    margin: 0 0 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* === ASIDE (MENU / GÉO) === */
aside.side {
    flex: 1;
    font-size: 0.95rem;
    color: var(--muted);
    background: linear-gradient(to top, var(--bg) 0%, #ede8df 100%);
    border-radius: var(--radius);
    align-self: flex-start;
    padding: 1.5rem;
}

.menu-jour h3 {
    font-family: var(--font-sans);
    color: var(--accent);
    font-weight: 600;
    margin: 0 0 0.5em 0;
}

.menu-jour ul {
    list-style: none;
    padding-left: 0;
}

.menu-jour ul li {
    margin: 0;
    padding: 0;
}

.geo {
    display: inline-block;
    margin-top: 0.8rem;
    font-family: monospace;
    font-size: 0.9rem;
    background: #f1ede7;
    color: var(--muted);
    padding: 0.4em 0.8em;
    border-radius: var(--radius);
}

/* === NAVIGATION ENTRE ARTICLES === */
.post-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    font-family: var(--font-sans);
}

.post-nav a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.post-nav a:hover {
    color: var(--accent-light);
}

/* blocs vides pour garder l'équilibre */
.post-nav .prev-empty,
.post-nav .next-empty {
    visibility: hidden;
    flex: 1;
}

/* === LISTES (index, catégories, tags) === */
ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

li {
    border-bottom: 1px dotted #ddd;
    padding: 0.5em 0;
}

li:last-child {
    border-bottom: none;
}

li a {
    font-weight: 500;
    color: var(--text);
}

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

li em {
    color: var(--muted);
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

/* === TAGS === */
.tag {
    margin-right: 0.4em;
}

.tag a {
    font-size: 0.9rem;
    font-family: var(--font-sans);
    color: var(--accent);
    opacity: 0.9;
}

.tag a:hover {
    color: var(--accent-light);
}

/* === NUAGE DE TAGS === */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    line-height: 1.6;
    margin-top: 1.5rem;
}

.tag-cloud {
    text-decoration: none;
    color: var(--accent);
    font-weight: 500;
    font-size: 1rem;
}

.tag-cloud:hover {
    color: var(--accent-light);
}

.count {
    color: var(--muted);
    font-size: 0.85em;
    margin-left: 0.2em;
}

/* === FOOTER === */
footer {
    margin-top: 2rem;
}

footer p {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

footer a {
    color: var(--accent);
    font-weight: 500;
}

footer a:hover {
    color: var(--accent-light);
}

body.home {
    padding-top: 2rem;
}

.home-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.5em;
    margin-bottom: 2.5rem;
}

.home-header .meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.home-header .site-name {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--accent);
    font-size: 1.2rem;
}

.home-header .subtitle {
    font-size: 0.95rem;
    color: var(--muted);
    font-style: italic;
    margin-top: 0.2rem;
}

.home-header .logo {
    width: 100px;
    height: auto;
    opacity: 0.9;
}

/* Liste des catégories */
.category-list {
    margin: 0 auto;
    text-align: left;
}

.category-list li {
    border-bottom: 1px dotted #ddd;
    padding: 0.6rem 0;
}

.category-list li a {
    font-weight: 600;
    color: var(--accent);
}

.category-list li a:hover {
    color: var(--link-hover);
}

.category-list em {
    color: var(--muted);
    font-size: 0.9rem;
    margin-left: 0.4em;
}

/* === MAP === */
.category-map {
    height: 400px;
    margin-top: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.8rem 2rem;
        font-size: 0.9rem;
        line-height: 1.6;
    }

    h1 {
        font-size: 1.4rem;
        line-height: 1.2;
        padding-bottom: 0.2em;
    }

    h2 {
        font-size: 1.1rem;
        margin-top: 1.5rem;
    }

    h3 {
        font-size: 1rem;
    }

    .article-layout {
        flex-direction: column;
        gap: 1rem;
    }

    .content {
        order: 1;
        width: 100%;
        line-height: 1.7;
        font-size: 0.9rem;
    }

    aside.side {
        order: 2;
        width: 100%;
        flex: none;
        margin-top: 1rem;
        margin-bottom: 1rem;
        padding: 1rem;
        font-size: 0.85rem;
    }

    [id^="leaflet-map-"] {
        width: 100% !important;
        height: 300px;
        margin-top: 1rem;
    }

    /* Ajustements pour le header sur mobile */
    .article-header {
        align-items: flex-start;
        gap: 0.8em;
        margin-bottom: 1.5rem;
    }

    .article-header h1 {
        font-size: 1.3rem;
        margin-top: 0.5em;
        line-height: 1.2;
    }

    .article-header .cat,
    .article-header .cat a {
        font-size: 1rem;
    }

    .article-header .date {
        font-size: 0.85rem;
    }

    .article-header .sep {
        margin-right: 0.2em;
    }

    /* Navigation entre articles */
    .post-nav {
        gap: 0.5rem;
        text-align: center;
        font-size: 0.85rem;
    }

    .post-nav a {
        font-size: 0.85rem;
    }

    /* Listes */
    li {
        padding: 0.4em 0;
        font-size: 0.9rem;
    }

    li em {
        font-size: 0.8rem;
        margin-left: 0.3em;
    }

    /* Tags */
    .tag a {
        font-size: 0.8rem;
    }

    .tags-cloud {
        gap: 0.4rem 0.8rem;
    }

    .tag-cloud {
        font-size: 0.9rem;
    }

    .count {
        font-size: 0.75em;
    }

    /* Footer */
    footer {
        margin-top: 1.5rem;
    }

    footer p {
        font-size: 0.8rem;
    }

    /* Page d'accueil */
    .home-header {
        margin-bottom: 1.5rem;
    }

    .home-header .site-name {
        font-size: 1rem;
    }

    .home-header .subtitle {
        font-size: 0.85rem;
    }

    .home-header .logo {
        width: 80px;
    }

    .category-list li {
        padding: 0.5rem 0;
    }

    .category-list em {
        font-size: 0.8rem;
    }
}

/* Pour les très petits écrans */
@media (max-width: 480px) {
    body {
        padding: 0.8rem 0.6rem 1.5rem;
        font-size: 0.85rem;
    }

    h1 {
        font-size: 1.2rem;
    }

    .article-header h1 {
        font-size: 1.1rem;
    }

    .content {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    .content img {
        margin: 0 0 1rem 0;
    }

    aside.side {
        padding: 0.8rem;
        font-size: 0.8rem;
    }

    .menu-jour h3 {
        font-size: 0.9rem;
    }

    .geo {
        font-size: 0.8rem;
        padding: 0.3em 0.6em;
    }


}
