@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,ital,wght@9..144,0,400;9..144,0,700;9..144,1,400&family=Inter:wght@400;500;600&display=swap');

:root {
    --ink:     #1A2238;
    --paper:   #E8DCC4;
    --red:     #C84B31;
    --surface: #FAF7F2;
    --muted:   #6B6355;
    --border:  #D4C8B0;
    --font-serif: 'Fraunces', Georgia, serif;
    --font-sans:  'Inter', system-ui, sans-serif;
    --container-width: 1200px;
    --transition: all 0.25s ease;
    /* Aliases rétro-compat pour les pages utilisant les anciens tokens */
    --primary:      var(--red);
    --primary-dark: var(--ink);
    --secondary:    var(--paper);
    --bg-light:     var(--paper);
    --white:        var(--surface);
    --text-main:    var(--ink);
    --text-muted:   var(--muted);
}

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

body {
    font-family: var(--font-sans);
    color: var(--ink);
    line-height: 1.7;
    background: var(--paper);
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1rem;
    color: var(--ink);
}
h1 { font-size: 3.2rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.6rem; }

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* === HEADER — masthead encre === */
.main-header {
    background: var(--ink);
    border-bottom: 3px solid var(--red);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
}

.nav-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--paper);
}

.logo-text span {
    color: rgba(232,220,196,0.65);
    font-weight: 400;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--paper);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 22px 16px;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--red);
}

/* Dropdown */
.has-dropdown { position: relative; }

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--ink);
    border-top: 2px solid var(--red);
    min-width: 200px;
    list-style: none;
    display: none;
    z-index: 100;
    padding: 8px 0;
}

.dropdown li a {
    padding: 10px 20px;
    font-size: 0.82rem;
    display: block;
    color: var(--paper);
}

.dropdown li a:hover {
    background: rgba(255,255,255,0.05);
    color: var(--red);
}

.has-dropdown:hover .dropdown { display: block; }

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--paper);
}

/* === BOUTONS === */
.btn {
    display: inline-block;
    padding: 11px 22px;
    font-weight: 600;
    font-size: 0.83rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    text-align: center;
    border-radius: 0;
    transition: var(--transition);
}

.btn-primary {
    background: var(--red);
    color: var(--surface);
}
.btn-primary:hover {
    background: var(--ink);
    color: var(--paper);
}

.btn-outline {
    background: transparent;
    color: var(--paper);
    border: 2px solid var(--paper);
}
.btn-outline:hover {
    background: var(--paper);
    color: var(--ink);
}

.btn-sm { padding: 7px 14px; font-size: 0.78rem; }

/* === UTILS === */
.py-large { padding: 80px 0; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    background: var(--red);
    color: var(--surface);
}

/* === HERO === */
.hero {
    background: var(--ink);
    color: var(--paper);
    padding: 80px 0;
    text-align: center;
    border-bottom: 3px solid var(--red);
}

.hero h1 {
    color: var(--paper);
    max-width: 820px;
    margin: 0 auto 20px;
}

.hero p {
    font-size: 1.2rem;
    color: rgba(232,220,196,0.8);
    max-width: 620px;
    margin: 0 auto 32px;
    font-style: italic;
}

/* === SECTIONS === */
.section-padding { padding: 80px 0; }

.section-title {
    margin-bottom: 48px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid var(--border);
    padding-bottom: 16px;
}

.section-title h2 {
    margin: 0;
}

.section-title a {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.section-title a:hover { color: var(--ink); }

/* === CARD GRID === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: 3px solid var(--border);
    border-radius: 0;
    overflow: hidden;
    transition: border-bottom-color 0.2s;
}

.card:hover {
    border-bottom-color: var(--red);
}

.card-img {
    height: 220px;
    background-size: cover;
    background-position: center;
    background-color: var(--paper);
}

.card-body {
    padding: 20px 24px 24px;
}

.card-tag {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: var(--surface);
    background: var(--red);
    padding: 2px 8px;
    margin-bottom: 10px;
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    line-height: 1.2;
}

.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--red); }

.card p {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.6;
}

/* === CATÉGORIES CARDS === */
.cat-card {
    background: var(--ink);
    color: var(--paper);
    padding: 28px 24px;
    border-left: 3px solid var(--red);
    transition: border-left-width 0.2s;
}
.cat-card:hover {
    border-left-width: 6px;
}
.cat-card .cat-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--red);
    margin-bottom: 8px;
    font-weight: 700;
}
.cat-card h3 {
    color: var(--paper);
    font-size: 1.2rem;
    margin-bottom: 8px;
}
.cat-card p {
    color: rgba(232,220,196,0.7);
    font-size: 0.88rem;
}

/* === QUIZ / OUTILS PAGE === */
.tool-hero {
    background: var(--ink);
    color: var(--paper);
    padding: 60px 0;
    border-bottom: 3px solid var(--red);
}

.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--red);
    padding: 24px 28px;
    margin-bottom: 20px;
}

/* === SCORES / RÉSULTATS === */
.score-bar {
    height: 6px;
    background: var(--border);
    border-radius: 0;
    overflow: hidden;
}
.score-fill {
    height: 100%;
    background: var(--red);
}

/* === CLASSEMENT / TABLEAU === */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.ranking-table th {
    background: var(--ink);
    color: var(--paper);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ranking-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--ink);
}
.ranking-table tr:hover td {
    background: var(--paper);
}

/* === FOOTER === */
.main-footer {
    background: var(--ink);
    color: var(--paper);
    padding: 64px 0 0;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(232,220,196,0.15);
}

.footer-brand p {
    color: rgba(232,220,196,0.65);
    margin: 16px 0;
    max-width: 300px;
    font-size: 0.9rem;
    font-style: italic;
}

.footer-brand .logo {
    font-size: 1.2rem;
}

.footer-links h4, .footer-newsletter h4 {
    color: var(--paper);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(232,220,196,0.2);
}

.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a {
    color: rgba(232,220,196,0.7);
    font-size: 0.9rem;
}
.footer-links a:hover { color: var(--red); }

.footer-bottom {
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(232,220,196,0.4);
    font-size: 0.82rem;
}

.legal-links {
    display: flex;
    gap: 20px;
}
.legal-links a {
    color: rgba(232,220,196,0.4);
    font-size: 0.82rem;
}
.legal-links a:hover { color: var(--red); }

/* === ARTICLE / MAG === */
.mag-header {
    background: var(--ink);
    color: var(--paper);
    padding: 60px 0;
    border-bottom: 3px solid var(--red);
}

.article-meta {
    font-size: 0.8rem;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 12px;
}

.article-body {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 0;
}

.article-body p { margin-bottom: 1.5em; }

.article-body h2 {
    margin-top: 2.5em;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--red);
}

.article-body blockquote {
    border-left: 3px solid var(--red);
    padding-left: 20px;
    margin: 2em 0;
    font-style: italic;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--muted);
}

/* === VILLE / VILLES === */
.ville-hero {
    background: var(--ink);
    color: var(--paper);
    padding: 60px 0;
    border-bottom: 3px solid var(--red);
}

.ville-score {
    display: inline-block;
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 700;
    color: var(--red);
}

/* === COMPARATEUR === */
.comparateur-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 4px solid var(--ink);
    padding: 32px;
}

/* === RESPONSIVE === */
@media (max-width: 1100px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--ink);
        flex-direction: column;
        padding: 8px 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.3);
        border-top: 2px solid var(--red);
    }
    .nav-links.active { display: flex; }
    .has-dropdown .dropdown {
        position: static;
        display: block;
        box-shadow: none;
        padding-left: 20px;
        border-top: none;
    }
    .mobile-menu-toggle { display: block; }
    .mobile-hide { display: none; }

    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
    .card-grid { grid-template-columns: 1fr; }
    .article-body { padding: 32px 0; }
    .hero { padding: 56px 0; }
}
