/* ─── Variables & Reset ─────────────────────────────── */
:root {
    --rouge: #E6003E;
    --vert: #C6D002;
    --blanc: #FFFFFF;
    --noir: #1A1A2E;
    --gris-clair: #F4F5F7;
    --gris: #6C757D;
    --rouge-fonce: #B8002F;
    --vert-fonce: #9BA600;
}

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

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--gris-clair);
    color: var(--noir);
    line-height: 1.6;
}

a { color: var(--rouge); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--rouge-fonce); }

/* ─── Navbar ───────────────────────────────────────── */
.navbar {
    background: var(--noir);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--blanc);
    font-weight: 700;
    font-size: 1.2rem;
}

.navbar-brand img {
    height: 45px;
    width: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--rouge);
}

.navbar-brand span.accent { color: var(--rouge); }

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

.nav-links a {
    color: var(--blanc);
    padding: 0 1.2rem;
    height: 70px;
    display: flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
    border-bottom: 3px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(230,0,62,0.1);
    color: var(--rouge);
    border-bottom-color: var(--rouge);
}

.nav-links .btn-nav {
    background: var(--rouge);
    color: var(--blanc) !important;
    border-radius: 25px;
    padding: 8px 24px;
    height: auto;
    margin-left: 1rem;
    border-bottom: none;
    font-weight: 600;
}

.nav-links .btn-nav:hover {
    background: var(--rouge-fonce);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--blanc);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--noir);
        flex-direction: column;
        padding: 1rem 0;
    }
    .nav-links.open { display: flex; }
    .nav-links a {
        height: auto;
        padding: 1rem 2rem;
        border-bottom: none;
    }
    .nav-links .btn-nav { margin: 0.5rem 2rem; text-align: center; }
}

/* ─── Hero ─────────────────────────────────────────── */
.hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--noir) 0%, #16213E 50%, #0F3460 100%);
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(230,0,62,0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(198,208,2,0.10) 0%, transparent 40%);
}

.hero-portrait {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--rouge);
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    flex-shrink: 0;
}

.hero-compact {
    min-height: 0;
    padding: 3rem 2rem;
}

.hero-row {
    position: relative;
    z-index: 2;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.hero-text { text-align: left; }

.hero-text h1 {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--blanc);
    margin-bottom: 0.4rem;
    letter-spacing: -1px;
}
.hero-text h1 span { color: var(--rouge); }

.hero-text .hero-tagline {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.85);
    margin: 0;
    max-width: none;
}

.section-tight { padding-top: 2.5rem; padding-bottom: 4rem; }

@media (max-width: 768px) {
    .hero-portrait { width: 110px; height: 110px; }
    .hero-row { flex-direction: column; gap: 1rem; text-align: center; }
    .hero-text { text-align: center; }
    .hero-text h1 { font-size: 2rem; }
    .hero-compact { padding: 2rem 1rem; }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--blanc);
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.hero-content h1 span { color: var(--rouge); }

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--vert);
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero-tagline {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ─── Buttons ──────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: var(--rouge);
    color: var(--blanc);
}
.btn-primary:hover {
    background: var(--rouge-fonce);
    color: var(--blanc);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(230,0,62,0.4);
}

.btn-outline {
    background: transparent;
    color: var(--blanc);
    border: 2px solid var(--vert);
}
.btn-outline:hover {
    background: var(--vert);
    color: var(--noir);
    transform: translateY(-2px);
}

.btn-vert {
    background: var(--vert);
    color: var(--noir);
}
.btn-vert:hover {
    background: var(--vert-fonce);
    transform: translateY(-2px);
    color: var(--noir);
}

.btn-sm {
    padding: 8px 20px;
    font-size: 0.9rem;
}

/* Admin shared header. Compact strip — title only; tabs handle nav. */
.admin-hero {
    background: linear-gradient(135deg, var(--noir), #16213E);
    padding: 1rem 2rem;
    color: white;
}
.admin-hero-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    flex-wrap: wrap;
}
.admin-hero h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
}
.admin-hero p {
    color: rgba(255,255,255,0.65);
    font-size: 0.85rem;
    margin: 0;
}

/* One canonical content width across every /admin/* page so switching
   tabs never shifts the layout horizontally. */
.admin-shell {
    max-width: 1000px;
    padding-top: 2rem;
    padding-bottom: 3rem;
}
.admin-content {
    width: 100%;
    margin: 0 auto;
}

@media (max-width: 540px) {
    .admin-hero { padding: 0.8rem 1rem; }
    .admin-hero h1 { font-size: 1.05rem; }
    .admin-shell { padding-top: 1.2rem; }
}

/* Admin tab strip — keeps active/inactive tabs the same size so the row
   doesn't shift when you switch pages. .btn-outline carries a 2px border,
   so we give every tab in the strip an equivalent transparent border. */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.admin-tabs .btn {
    border: 2px solid transparent;
}
.admin-tabs .btn-outline {
    border-color: #e0e0e0;
    color: var(--noir);
    background: transparent;
}
.admin-tabs .btn-outline:hover {
    background: var(--gris-clair);
    color: var(--noir);
    transform: none;
}

/* ─── Sections ─────────────────────────────────────── */
.section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--noir);
    margin-bottom: 0.5rem;
}

.section-title h2 span { color: var(--rouge); }

.section-title p {
    color: var(--gris);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.section-title .bar {
    width: 60px;
    height: 4px;
    background: var(--rouge);
    margin: 1rem auto;
    border-radius: 2px;
}

/* ─── Tiles (article cards) ────────────────────────── */
.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.theme-tile {
    background: var(--blanc);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: var(--noir);
    display: block;
}

.theme-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    border-color: var(--rouge);
    color: var(--noir);
}

.theme-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--rouge), var(--vert));
}

.theme-tile .tile-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(230,0,62,0.1), rgba(198,208,2,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--rouge);
    margin-bottom: 1rem;
}

.theme-tile .tile-numero {
    position: absolute;
    top: 1.2rem;
    right: 1.5rem;
    font-size: 2.5rem;
    font-weight: 800;
    color: rgba(0,0,0,0.05);
}

.theme-tile h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.theme-tile p {
    color: var(--gris);
    font-size: 0.95rem;
}

.theme-tile .tile-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--rouge);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* ─── Article body (rendered HTML from WYSIWYG) ─────── */
.article-body {
    max-width: 760px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    background: var(--blanc);
    color: var(--noir);
    font-size: 1.08rem;
    line-height: 1.75;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
    font-weight: 800;
    margin: 2rem 0 0.8rem;
    line-height: 1.3;
}
.article-body h1 { font-size: 2rem; }
.article-body h2 { font-size: 1.6rem; color: var(--noir); }
.article-body h3 { font-size: 1.3rem; }
.article-body h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--rouge);
    margin-top: 0.4rem;
    border-radius: 2px;
}

.article-body p { margin: 0 0 1.1rem; }
.article-body a { color: var(--rouge); text-decoration: underline; }
.article-body a:hover { color: var(--rouge-fonce); }

.article-body ul,
.article-body ol {
    margin: 0 0 1.2rem 1.5rem;
}
.article-body li { margin-bottom: 0.4rem; }

.article-body blockquote {
    border-left: 4px solid var(--rouge);
    background: var(--gris-clair);
    padding: 1rem 1.2rem;
    margin: 1.5rem 0;
    color: var(--noir);
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

.article-body pre,
.article-body code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    background: var(--gris-clair);
    border-radius: 6px;
}
.article-body code { padding: 2px 6px; font-size: 0.95em; }
.article-body pre {
    padding: 1rem 1.2rem;
    overflow-x: auto;
    margin: 1.2rem 0;
    background: var(--noir);
    color: #f6f8fa;
}
.article-body pre code { background: transparent; color: inherit; padding: 0; }

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1.2rem 0;
    display: block;
}

.article-body hr {
    border: 0;
    height: 1px;
    background: #e6e6e6;
    margin: 2rem 0;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2rem 0;
}
.article-body th,
.article-body td {
    padding: 0.6rem 0.9rem;
    border: 1px solid #e6e6e6;
    text-align: left;
}
.article-body th { background: var(--gris-clair); font-weight: 600; }

/* ─── Forms ────────────────────────────────────────── */
.form-container {
    max-width: 550px;
    margin: 3rem auto;
    padding: 2.5rem;
    background: var(--blanc);
    border-radius: 16px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.08);
}

.form-container h2 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.form-container .form-sub {
    text-align: center;
    color: var(--gris);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: var(--noir);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--rouge);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-container .btn { width: 100%; justify-content: center; margin-top: 0.5rem; }

/* ─── Alerts ───────────────────────────────────────── */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success { background: rgba(198,208,2,0.15); color: var(--vert-fonce); border: 1px solid var(--vert); }
.alert-danger  { background: rgba(230,0,62,0.1);   color: var(--rouge);      border: 1px solid var(--rouge); }
.alert-info,
.alert-warning { background: rgba(108,117,125,0.1); color: var(--gris);      border: 1px solid var(--gris); }

/* ─── Footer ───────────────────────────────────────── */
.footer {
    background: var(--noir);
    color: rgba(255,255,255,0.6);
    padding: 3rem 2rem;
    text-align: center;
}

.footer .footer-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--blanc);
    margin-bottom: 0.5rem;
}

.footer .footer-brand span { color: var(--rouge); }

.footer p { font-size: 0.85rem; margin: 0.3rem 0; }

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a { color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.footer-links a:hover { color: var(--blanc); }

/* ─── Newsletter block ─────────────────────────────── */
.newsletter-block {
    background: linear-gradient(135deg, var(--rouge), var(--rouge-fonce));
    color: var(--blanc);
    padding: 1.75rem 1.5rem;
    text-align: center;
}

.newsletter-inner {
    max-width: 720px;
    margin: 0 auto;
}

.newsletter-icon { display: none; }

.newsletter-block h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    color: var(--blanc);
}

.newsletter-block > .newsletter-inner > p {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 0.8rem;
}

.newsletter-form {
    display: grid;
    gap: 0.4rem;
    text-align: left;
    margin: 0 auto;
}

.newsletter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

.newsletter-form input {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    background: rgba(255,255,255,0.95);
    color: var(--noir);
    outline: 2px solid transparent;
    transition: outline-color 0.2s;
}

.newsletter-form input:focus { outline-color: var(--vert); }

.newsletter-form input::placeholder { color: rgba(0,0,0,0.45); }

.newsletter-form button[type=submit] {
    justify-self: center;
    background: var(--noir);
    color: var(--blanc);
    margin-top: 0.2rem;
    padding: 8px 22px;
    font-size: 0.9rem;
}

.newsletter-form button[type=submit]:hover {
    background: var(--blanc);
    color: var(--noir);
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.newsletter-fineprint {
    margin-top: 0.5rem;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.7);
}

@media (max-width: 540px) {
    .newsletter-row { grid-template-columns: 1fr; }
    .newsletter-block { padding: 1.5rem 1rem; }
}

/* ─── Reactions ────────────────────────────────────── */
.article-reactions {
    max-width: 760px;
    margin: 2.5rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid #e6e6e6;
}

.reactions-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    background: var(--blanc);
    cursor: pointer;
    font-size: 1.1rem;
    font-family: inherit;
    transition: all 0.15s;
}

.reaction-btn:hover {
    border-color: var(--rouge);
    background: rgba(230,0,62,0.05);
}

.reaction-btn.active {
    border-color: var(--rouge);
    background: rgba(230,0,62,0.1);
}

.reaction-btn .count {
    font-size: 0.8rem;
    color: var(--gris);
    font-weight: 600;
    min-width: 8px;
}
.reaction-btn.active .count { color: var(--rouge); }
.reaction-btn:disabled { opacity: 0.6; cursor: wait; }

/* ─── Comments ─────────────────────────────────────── */
.comments-section {
    background: var(--gris-clair);
    padding: 3rem 1.5rem;
}

.comments-inner {
    max-width: 760px;
    margin: 0 auto;
}

.comments-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--noir);
}

.comment-form-heading {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--noir);
    margin: 2.5rem 0 0.8rem;
}

.comment-form {
    background: var(--blanc);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: grid;
    gap: 0.6rem;
}

.comment-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s;
}

.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--rouge); }

.comment-form textarea { resize: vertical; min-height: 100px; }

.comment-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.3rem;
}

.comment-form-actions small {
    color: var(--gris);
    font-size: 0.8rem;
    flex: 1;
    min-width: 200px;
}

.comments-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.8rem;
}

.comment-item {
    background: var(--blanc);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}

.comment-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rouge), var(--rouge-fonce));
    color: var(--blanc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.comment-body { flex: 1; min-width: 0; }

.comment-meta {
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.comment-meta strong { color: var(--noir); }
.comment-meta span { color: var(--gris); margin-left: 0.4rem; }

.comment-text {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--noir);
    word-wrap: break-word;
}

.comments-empty {
    text-align: center;
    color: var(--gris);
    padding: 1.5rem 0;
}

@media (max-width: 540px) {
    .comment-row { grid-template-columns: 1fr; }
}

/* ─── Back link ────────────────────────────────────── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--blanc);
    opacity: 0.7;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.back-link:hover { opacity: 1; color: var(--blanc); }

/* ─── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
    .hero-content h1 { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1rem; }
    .section { padding: 3rem 1rem; }
    .form-row { grid-template-columns: 1fr; }
    .article-body { padding: 2rem 1rem; }
    .article-body h1 { font-size: 1.6rem; }
    .article-body h2 { font-size: 1.3rem; }
}
