:root {
    --ink: #0a0a0a;
    --paper: #ffffff;
    --paper-alt: #f6f5f3;
    --line: rgba(10, 10, 10, 0.14);
    --line-strong: #0a0a0a;
    --muted: #6b6b6b;
    --accent: #e04659;
    --accent-ink: #ffffff;
    --danger: #b3261e;
    --success: #1c7a4c;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Jost", "Century Gothic", "Futura", -apple-system, sans-serif;
    background: var(--paper-alt);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

h1 { font-size: 1.9rem; margin: 0 0 0.3rem; }
h2 { font-size: 1.25rem; margin: 0 0 1rem; }

a { color: var(--ink); }

/* ---------- Masthead ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 2rem;
    background: var(--paper);
    border-bottom: 3px solid var(--line-strong);
}

.brand {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-decoration: none;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 1.6rem;
}

.topnav a {
    color: var(--ink);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.topnav a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.user-email {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
}

.container-wide { max-width: 1600px; }

.auth-card {
    max-width: 380px;
    margin: 5rem auto;
    background: var(--paper);
    border: 1px solid var(--line);
    border-top: 3px solid var(--accent);
    padding: 2.5rem 2.25rem;
}

.field { margin-bottom: 1.1rem; }
.field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.4rem;
}
.field input, .field select, .field textarea {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.95rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--ink);
}
.field-error { color: var(--danger); font-size: 0.78rem; margin: 0.3rem 0 0; }

button, .btn {
    display: inline-block;
    background: var(--ink);
    color: #fff;
    border: 1px solid var(--ink);
    padding: 0.6rem 1.1rem;
    border-radius: 0;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
button:hover, .btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-secondary:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-danger { background: var(--paper); color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.flashes { list-style: none; padding: 0; margin: 0 0 1.75rem; }
.flash {
    padding: 0.65rem 1rem;
    border-radius: 0;
    margin-bottom: 0.5rem;
    font-size: 0.88rem;
    background: var(--paper);
    border-left: 3px solid var(--ink);
    color: var(--ink);
}
.flash-error { border-left-color: var(--danger); color: var(--danger); }
.flash-success { border-left-color: var(--success); color: var(--success); }

table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); }
th, td { text-align: left; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
th {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--paper);
    border-bottom: 2px solid var(--line-strong);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--paper-alt); }

.card { background: var(--paper); border: 1px solid var(--line); padding: 1.5rem 1.6rem; margin-bottom: 1.5rem; }
.card h2 {
    padding-bottom: 0.7rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--line);
}
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 0;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid currentColor;
}
.badge-success { color: var(--success); background: rgba(28, 122, 76, 0.08); }
.badge-danger { color: var(--danger); background: rgba(179, 38, 30, 0.08); }
.badge-muted { color: var(--muted); background: rgba(10, 10, 10, 0.04); }

/* ---------- Favoris ---------- */

.favorite-star {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1;
    padding: 0.1rem 0.3rem;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
}
.favorite-star:hover { background: transparent; color: var(--accent); border: none; }
.favorite-star.is-favorite { color: var(--accent); }

/* ---------- Onglets (favoris) ---------- */

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.tab {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}
.tab:hover { border-color: var(--ink); }
.tab.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs-hint { color: var(--muted); font-size: 0.82rem; margin: -0.25rem 0 1.25rem; }

/* ---------- Filtres / recherche ---------- */

.filters-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1.25rem;
}
.filters-row .field { margin-bottom: 0; flex: 1 1 200px; }
.filters-row button { flex: 0 0 auto; }

/* ---------- Deux colonnes (IA vs. tout) ---------- */

.news-columns {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    align-items: start;
    gap: 2.5rem;
}

.news-col-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.05rem;
    padding-bottom: 0.6rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--line-strong);
}
.news-col-tag {
    font-family: "Jost", sans-serif;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--accent-ink);
    background: var(--accent);
    padding: 0.12rem 0.4rem;
}
.news-col-empty { color: var(--muted); font-size: 0.85rem; }

.news-col-relevant {
    position: sticky;
    top: 1.5rem;
}

@media (max-width: 860px) {
    .news-columns { grid-template-columns: 1fr; }
    .news-col-relevant { position: static; }
}

/* ---------- Colonne "Les plus pertinents" ---------- */

.relevant-list { display: flex; flex-direction: column; gap: 0.9rem; }
.relevant-card {
    display: flex;
    gap: 0.75rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    padding: 0.75rem 0.9rem;
}
.relevant-thumb { flex: 0 0 64px; }
.relevant-thumb img { width: 64px; height: 64px; object-fit: cover; display: block; }
.relevant-body { flex: 1 1 auto; min-width: 0; }
.relevant-body .article-meta { justify-content: space-between; margin-bottom: 0.3rem; }
.relevant-body h3 { margin: 0; font-size: 0.92rem; line-height: 1.3; }
.relevant-body h3 a { text-decoration: none; }
.relevant-body h3 a:hover { color: var(--accent); }
.badge-relevance { color: var(--accent); border-color: var(--accent); background: rgba(224, 70, 89, 0.08); }

/* ---------- Liste d'articles ---------- */

.article-list { display: flex; flex-direction: column; gap: 1rem; }
.article-card {
    display: flex;
    gap: 1.1rem;
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 1.25rem 1.4rem;
}
.article-thumb { flex: 0 0 140px; }
.article-thumb img { width: 140px; height: 100px; object-fit: cover; display: block; }
.article-body { flex: 1 1 auto; min-width: 0; }
.article-meta {
    display: flex;
    gap: 0.75rem;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}
.article-body h3 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.article-body h3 a { text-decoration: none; }
.article-body h3 a:hover { color: var(--accent); }
.article-summary { color: var(--ink); font-size: 0.9rem; margin: 0; }

/* ---------- Pagination ---------- */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
}
.pagination a { text-decoration: none; }
.pagination a:hover { color: var(--accent); }
.pagination-status { color: var(--muted); }
