/* ============================================
   stephane.matthey.fr — CSS complet
   Style editorial Tucker Carlson x Syndicaliste
   ============================================ */

/* ===== Variables ===== */
:root {
    --sm-red: #B91C1C;
    --sm-red-hover: #991B1B;
    --sm-red-light: #FEF2F2;
    --sm-blue: #009EE0;
    --sm-blue-dark: #0080B8;
    --sm-navy: #1E3A5F;
    --sm-dark: #111827;
    --sm-bg: #FAFAF9;
    --sm-white: #FFFFFF;
    --sm-text: #1A1A1A;
    --sm-text-light: #6B7280;
    --sm-text-lighter: #9CA3AF;
    --sm-border: #E5E7EB;
    --sm-border-light: #F3F4F6;
    --sm-font-heading: 'DM Sans', -apple-system, system-ui, sans-serif;
    --sm-font-body: 'DM Sans', -apple-system, system-ui, sans-serif;
    --sm-font-article: 'Source Serif 4', 'Libre Baskerville', Georgia, serif;
    --sm-radius: 8px;
    --sm-radius-lg: 12px;
    --sm-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --sm-shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.05);
    --sm-transition: all 0.2s ease;
}

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

body {
    font-family: var(--sm-font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--sm-text);
    background: var(--sm-bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

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

/* ===== HEADER ===== */
.site-header {
    background: var(--sm-blue);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 72px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.header-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.header-titles {
    display: flex;
    flex-direction: column;
}

.header-name {
    font-family: var(--sm-font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--sm-white);
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.header-tagline {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    display: inline-block;
    padding: 8px 14px;
    color: #D1D5DB;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    transition: var(--sm-transition);
}

.nav-link:hover {
    color: var(--sm-white);
    background: rgba(255,255,255,0.08);
}

.nav-link.active {
    color: var(--sm-white);
    background: var(--sm-red);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--sm-white);
    cursor: pointer;
    padding: 8px;
}

/* ===== MAIN ===== */
.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 60vh;
}

/* ===== HERO ===== */
.hero-section {
    margin: 32px 0;
}

.hero-card {
    position: relative;
    border-radius: var(--sm-radius-lg);
    overflow: hidden;
    background: var(--sm-blue);
}

.hero-card a {
    display: block;
    text-decoration: none;
}

.hero-image {
    width: 100%;
    height: 450px;
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.hero-card:hover .hero-image {
    opacity: 0.5;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 48px 40px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--sm-red);
    color: var(--sm-white);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.hero-date, .hero-reading {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
}

.hero-title {
    font-family: var(--sm-font-heading);
    font-size: 2.75rem;
    font-weight: 900;
    color: var(--sm-white);
    line-height: 1.15;
    margin-bottom: 12px;
}

.hero-excerpt {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.6;
    max-width: 600px;
}

.hero-no-image {
    padding: 60px 40px;
}

.hero-no-image .hero-title {
    color: var(--sm-white);
}

/* ===== GRILLE ARTICLES ===== */
.articles-section {
    margin: 48px 0;
}

.section-title {
    font-family: var(--sm-font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--sm-text);
    margin-bottom: 8px;
}

.section-separator {
    width: 50px;
    height: 3px;
    background: var(--sm-red);
    margin-bottom: 32px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.article-card {
    background: var(--sm-white);
    border-radius: var(--sm-radius-lg);
    overflow: hidden;
    box-shadow: var(--sm-shadow);
    transition: var(--sm-transition);
}

.article-card:hover {
    box-shadow: var(--sm-shadow-lg);
    transform: translateY(-3px);
}

.article-card a {
    display: block;
    text-decoration: none;
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--sm-blue) 0%, var(--sm-blue-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image-placeholder svg {
    color: rgba(255,255,255,0.3);
}

.card-body {
    padding: 20px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.card-date {
    font-size: 0.8rem;
    color: var(--sm-text-light);
}

.card-title {
    font-family: var(--sm-font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--sm-text);
    line-height: 1.35;
    margin-bottom: 8px;
}

.card-excerpt {
    font-size: 0.9rem;
    color: var(--sm-text-light);
    line-height: 1.5;
}

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--sm-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-author {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sm-text);
}

.card-reading {
    font-size: 0.75rem;
    color: var(--sm-text-lighter);
}

/* ===== PAGE ARTICLE ===== */
.article-page {
    max-width: 720px;
    margin: 40px auto;
}

.article-header {
    margin-bottom: 32px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    color: var(--sm-text-light);
}

.article-meta .reading-time::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 3px;
    background: var(--sm-text-lighter);
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 12px;
}

.article-title {
    font-family: var(--sm-font-heading);
    font-size: 2.75rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 20px;
    color: var(--sm-text);
}

.article-separator {
    width: 60px;
    height: 3px;
    background: var(--sm-red);
    margin-bottom: 24px;
}

.article-author-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--sm-blue);
    color: var(--sm-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.author-details {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 700;
    color: var(--sm-text);
    font-size: 0.95rem;
}

.author-role {
    font-size: 0.8rem;
    color: var(--sm-text-light);
}

/* Image mise en avant */
.article-featured-image {
    margin: 0 0 40px 0;
    border-radius: var(--sm-radius-lg);
    overflow: hidden;
}

.article-featured-image img {
    width: 100%;
    height: auto;
}

/* Contenu article — Typographie éditoriale */
.article-content {
    font-family: var(--sm-font-article);
    font-size: 1.125rem;
    line-height: 1.85;
    color: #374151;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h2 {
    font-family: var(--sm-font-heading);
    font-size: 2rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    color: var(--sm-text);
    line-height: 1.25;
}

.article-content h3 {
    font-family: var(--sm-font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 0.75rem;
    color: var(--sm-text);
    line-height: 1.3;
}

.article-content h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 1.5rem 0 0.5rem;
    color: #1F2937;
}

.article-content img {
    border-radius: var(--sm-radius);
    margin: 2rem 0;
}

.article-content a {
    color: var(--sm-red);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-content a:hover {
    color: var(--sm-red-hover);
}

.article-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: var(--sm-red-light);
    border-left: 4px solid var(--sm-red);
    border-radius: 0 var(--sm-radius) var(--sm-radius) 0;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #1F2937;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

.article-content ul, .article-content ol {
    margin: 1rem 0 1.5rem 1.5rem;
}

.article-content ul { list-style-type: disc; }
.article-content ol { list-style-type: decimal; }

.article-content li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.article-content hr {
    border: none;
    height: 2px;
    background: var(--sm-border);
    margin: 2.5rem auto;
    width: 60px;
}

.article-content pre {
    background: var(--sm-dark);
    color: #E5E7EB;
    padding: 1.25rem 1.5rem;
    border-radius: var(--sm-radius);
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 1.5rem 0;
}

.article-content code {
    background: var(--sm-border-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875rem;
}

.article-content pre code {
    background: transparent;
    padding: 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.article-content th, .article-content td {
    padding: 10px 14px;
    border: 1px solid var(--sm-border);
    text-align: left;
}

.article-content th {
    background: var(--sm-border-light);
    font-weight: 600;
}

/* Tags article */
.article-tags {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 2px solid var(--sm-border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Articles suggeres */
.suggested-section {
    margin: 60px auto;
    max-width: 720px;
}

.suggested-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Navigation articles */
.article-nav {
    display: flex;
    justify-content: space-between;
    margin: 48px auto;
    max-width: 720px;
    gap: 16px;
}

.article-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--sm-border-light);
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
    color: var(--sm-text-light);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--sm-transition);
}

.article-nav a:hover {
    background: var(--sm-red);
    color: var(--sm-white);
    border-color: var(--sm-red);
}

/* ===== PAGE CATEGORIE ===== */
.category-page {
    margin: 40px 0;
}

.category-header {
    margin-bottom: 40px;
}

.category-title {
    font-family: var(--sm-font-heading);
    font-size: 2.25rem;
    font-weight: 900;
    margin-bottom: 8px;
}

.category-description {
    color: var(--sm-text-light);
    font-size: 1.05rem;
}

.category-count {
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--sm-text-lighter);
}

/* ===== PAGE 404 ===== */
.page-404 {
    text-align: center;
    padding: 80px 24px;
}

.page-404 h1 {
    font-family: var(--sm-font-heading);
    font-size: 6rem;
    font-weight: 900;
    color: var(--sm-red);
    margin-bottom: 16px;
}

.page-404 p {
    font-size: 1.2rem;
    color: var(--sm-text-light);
    margin-bottom: 32px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--sm-red);
    color: var(--sm-white);
    border-radius: var(--sm-radius);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--sm-transition);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--sm-red-hover);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--sm-border);
    color: var(--sm-text);
}

.btn-outline:hover {
    border-color: var(--sm-red);
    color: var(--sm-red);
    background: transparent;
}

/* ===== FOOTER ===== */
.site-footer {
    background: var(--sm-dark);
    color: rgba(255,255,255,0.5);
    margin-top: 100px;
    padding: 40px 0;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
}

.footer-name {
    font-family: var(--sm-font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    display: block;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.footer-copy {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--sm-text-light);
}

.empty-state h2 {
    font-family: var(--sm-font-heading);
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--sm-text);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 968px) {
    .articles-grid,
    .suggested-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-overlay {
        padding: 32px 24px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        height: 60px;
    }

    .header-nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--sm-blue-dark);
        flex-direction: column;
        padding: 12px 16px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    .header-nav.open {
        display: flex;
    }

    .nav-link {
        padding: 12px 16px;
        font-size: 0.95rem;
        border-radius: var(--sm-radius);
    }

    .header-name {
        font-size: 1.1rem;
        letter-spacing: 1.5px;
    }

    .header-tagline {
        font-size: 0.6rem;
        letter-spacing: 1.5px;
    }

    .nav-toggle {
        display: block;
    }

    .hero-image {
        height: 300px;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-excerpt {
        font-size: 0.95rem;
    }

    .article-title {
        font-size: 2rem;
    }

    .article-content {
        font-size: 1rem;
    }

    .article-content h2 {
        font-size: 1.5rem;
    }

    .article-content h3 {
        font-size: 1.25rem;
    }

    .article-nav {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .articles-grid,
    .suggested-grid {
        grid-template-columns: 1fr;
    }

    .site-main {
        padding: 0 16px;
    }

    .article-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    .article-title {
        font-size: 1.75rem;
    }

    .category-title {
        font-size: 1.75rem;
    }
}

/* ===== ADMIN STYLES ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: var(--sm-blue);
    padding: 24px 0;
    flex-shrink: 0;
}

.admin-sidebar-brand {
    padding: 0 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 16px;
}

.admin-sidebar-brand a {
    color: var(--sm-white);
    font-family: var(--sm-font-heading);
    font-size: 1.1rem;
    font-weight: 700;
}

.admin-sidebar-brand small {
    display: block;
    color: #6B7280;
    font-size: 0.75rem;
    margin-top: 4px;
    font-family: var(--sm-font-body);
}

.admin-nav {
    list-style: none;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #9CA3AF;
    font-size: 0.9rem;
    transition: var(--sm-transition);
}

.admin-nav a:hover {
    color: var(--sm-white);
    background: rgba(255,255,255,0.05);
}

.admin-nav a.active {
    color: var(--sm-white);
    background: var(--sm-red);
}

.admin-nav a svg {
    width: 18px;
    height: 18px;
}

.admin-main {
    flex: 1;
    padding: 32px;
    background: var(--sm-bg);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.admin-title {
    font-family: var(--sm-font-heading);
    font-size: 1.75rem;
    font-weight: 700;
}

/* Admin tables */
.admin-table {
    width: 100%;
    background: var(--sm-white);
    border-radius: var(--sm-radius-lg);
    overflow: hidden;
    box-shadow: var(--sm-shadow);
}

.admin-table thead {
    background: var(--sm-border-light);
}

.admin-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--sm-text-light);
}

.admin-table td {
    padding: 14px 16px;
    border-top: 1px solid var(--sm-border-light);
    font-size: 0.9rem;
}

.admin-table tr:hover {
    background: #FAFAFA;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-published {
    background: #D1FAE5;
    color: #065F46;
}

.status-draft {
    background: #FEF3C7;
    color: #92400E;
}

.admin-actions {
    display: flex;
    gap: 8px;
}

.admin-actions a, .admin-actions button {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--sm-border);
    background: var(--sm-white);
    color: var(--sm-text-light);
    cursor: pointer;
    transition: var(--sm-transition);
}

.admin-actions a:hover, .admin-actions button:hover {
    border-color: var(--sm-red);
    color: var(--sm-red);
}

.admin-actions .btn-delete:hover {
    background: #FEE2E2;
    border-color: var(--sm-red);
    color: var(--sm-red);
}

/* Admin forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sm-text);
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--sm-border);
    border-radius: var(--sm-radius);
    font-size: 0.95rem;
    font-family: var(--sm-font-body);
    background: var(--sm-white);
    transition: var(--sm-transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--sm-red);
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.1);
}

.form-group textarea {
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 400px;
}

/* Editor layout */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.editor-panel {
    background: var(--sm-white);
    border-radius: var(--sm-radius-lg);
    padding: 24px;
    box-shadow: var(--sm-shadow);
}

.editor-panel h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--sm-text-light);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-content {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--sm-text);
}

.preview-content h2 {
    font-family: var(--sm-font-heading);
    font-size: 1.5rem;
    margin: 1.5rem 0 0.75rem;
}

.preview-content blockquote {
    border-left: 3px solid var(--sm-red);
    padding-left: 16px;
    margin: 1rem 0;
    color: var(--sm-text-light);
    font-style: italic;
}

/* Admin login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--sm-bg);
}

.login-card {
    background: var(--sm-white);
    border-radius: var(--sm-radius-lg);
    padding: 48px;
    box-shadow: var(--sm-shadow-lg);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-card h1 {
    font-family: var(--sm-font-heading);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.login-card p {
    color: var(--sm-text-light);
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.login-logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 24px;
}

.login-error {
    background: #FEE2E2;
    color: var(--sm-red);
    padding: 10px 16px;
    border-radius: var(--sm-radius);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

/* Alert messages */
.alert {
    padding: 12px 16px;
    border-radius: var(--sm-radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
}

/* Responsive admin */
@media (max-width: 968px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        display: none;
    }

    .admin-main {
        padding: 16px;
    }
}
