/**
 * Journal RP — Styles vitrine publique (modernisé)
 * Mode sombre par défaut, toggle clair/sombre
 * Toutes couleurs via variables CSS — ZÉRO valeur en dur
 */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.4s ease, color 0.4s ease;
}

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

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

/* === Animations d'apparition === */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Délais échelonnés */
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.40s; }
.reveal-delay-6 { transition-delay: 0.48s; }

/* Variantes */
.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.visible,
.reveal-right.visible,
.reveal-scale.visible {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* === Alertes === */
.alert {
    padding: 14px 22px;
    margin-bottom: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    background-color: var(--surface-color);
    font-size: 0.9rem;
}

.alert-success { border-left-color: #2e7d32; }
.alert-error { border-left-color: #c62828; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: background-color 0.4s ease;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 24px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.header-brand a {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: opacity 0.2s;
}

.header-brand a:hover {
    opacity: 0.8;
}

.header-logo {
    max-height: 46px;
}

.header-title {
    font-family: var(--font-title);
    font-size: 2rem;
    letter-spacing: -0.02em;
    color: var(--text-color);
    line-height: 1.1;
}

.header-slogan {
    font-family: var(--font-title);
    font-style: italic;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-date {
    font-family: var(--font-title);
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* Toggle thème */
.theme-toggle {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: hidden;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    transform: rotate(15deg);
}

.theme-icon {
    width: 18px;
    height: 18px;
    color: var(--text-color);
    position: absolute;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* En dark mode : afficher soleil, cacher lune */
[data-theme="dark"] .theme-icon--sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}
[data-theme="dark"] .theme-icon--moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

/* En light mode : afficher lune, cacher soleil */
[data-theme="light"] .theme-icon--sun {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}
[data-theme="light"] .theme-icon--moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Bouton admin */
.header-admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 0.73rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.header-admin-btn:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.header-admin-btn svg {
    opacity: 0.7;
}

/* Navigation */
.main-nav {
    background-color: var(--header-bg);
    border-top: 1px solid var(--border-color);
    transition: background-color 0.4s ease;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-inner::-webkit-scrollbar {
    display: none;
}

.nav-link {
    padding: 12px 18px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    position: relative;
    transition: color 0.25s ease;
    color: var(--text-muted);
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* Menu burger mobile */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   CONTENU
   ============================================================ */
.site-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    flex: 1;
    width: 100%;
}

/* ============================================================
   HERO
   ============================================================ */
.hero-section {
    margin-bottom: 56px;
}

.hero-link {
    display: block;
}

.hero-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    min-height: 420px;
    background-color: var(--surface-color);
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.4s ease, transform 0.4s ease;
    box-shadow: var(--card-shadow);
}

.hero-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-4px);
}

.hero-image {
    background-size: cover;
    background-position: center;
    min-height: 300px;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-card:hover .hero-image {
    transform: scale(1.03);
}

.hero-image--placeholder {
    background: linear-gradient(135deg, var(--primary-color), var(--surface-color));
    opacity: 0.2;
}

.hero-content {
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-category {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--primary-color);
    margin-bottom: 14px;
    padding: 4px 12px;
    background-color: rgba(139, 0, 0, 0.08);
    border-radius: 6px;
    width: fit-content;
}

[data-theme="dark"] .hero-category {
    background-color: rgba(139, 0, 0, 0.2);
}

.hero-title {
    font-family: var(--font-title);
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text-color);
}

.hero-excerpt {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.hero-meta {
    display: flex;
    gap: 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.hero-author {
    font-weight: 600;
}

/* ============================================================
   SECTION ABOUT / PRÉSENTATION
   ============================================================ */
.about-section {
    margin-bottom: 56px;
    padding: 56px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.about-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
    margin-bottom: 56px;
}

.about-title {
    font-family: var(--font-title);
    font-size: 2.2rem;
    line-height: 1.15;
    color: var(--text-color);
    margin-bottom: 8px;
}

.about-subtitle {
    font-family: var(--font-title);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--primary-color);
    opacity: 0.85;
}

.about-rule {
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 18px 0 22px;
    border-radius: 3px;
}

.about-text {
    font-size: 0.95rem;
    line-height: 1.85;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.about-stats {
    display: flex;
    gap: 36px;
    margin-bottom: 30px;
    padding: 22px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.about-stat {
    display: flex;
    flex-direction: column;
}

.about-stat-number {
    font-family: var(--font-title);
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.1;
}

.about-stat-label {
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-top: 4px;
}

.about-cta {
    display: inline-block;
    padding: 12px 30px;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.about-cta:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.25);
}

.about-image-wrap {
    position: relative;
}

.about-image {
    width: 100%;
    height: 380px;
    object-fit: cover;
    border-radius: 16px;
}

.about-image-wrap::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--primary-color);
    border-radius: 16px;
    z-index: -1;
    transition: transform 0.3s ease;
}

.about-image-wrap:hover::after {
    transform: translate(-4px, -4px);
}

.about-values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.about-value {
    text-align: center;
    padding: 32px 24px;
    background-color: var(--surface-color);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    transition: all 0.35s ease;
}

.about-value:hover {
    border-color: var(--primary-color);
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-6px);
}

.about-value-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 18px;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.about-value:hover .about-value-icon {
    transform: scale(1.15);
}

.about-value-icon svg {
    width: 100%;
    height: 100%;
}

.about-value-title {
    font-family: var(--font-title);
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.about-value-text {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--text-muted);
}

/* ============================================================
   SECTIONS & GRILLE D'ARTICLES
   ============================================================ */
.section-header {
    margin-bottom: 32px;
}

.section-title {
    font-family: var(--font-title);
    font-size: 1.5rem;
    color: var(--text-color);
}

.section-rule {
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
    margin-top: 8px;
    border-radius: 3px;
}

.section-count {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 6px;
}

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

.article-card {
    background-color: var(--surface-color);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--card-shadow);
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-color);
}

.article-card a {
    display: block;
}

.card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    position: relative;
}

.card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--surface-color) 0%, transparent 40%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.article-card:hover .card-image::after {
    opacity: 0.3;
}

.card-image--placeholder {
    background: linear-gradient(135deg, var(--surface-color), var(--bg-color));
}

.card-body {
    padding: 20px;
}

.card-category {
    display: inline-block;
    font-size: 0.63rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--primary-color);
    margin-bottom: 8px;
    padding: 3px 10px;
    border-radius: 5px;
    background-color: rgba(139, 0, 0, 0.08);
}

[data-theme="dark"] .card-category {
    background-color: rgba(139, 0, 0, 0.2);
}

.card-title {
    font-family: var(--font-title);
    font-size: 1.12rem;
    line-height: 1.3;
    margin-bottom: 8px;
    color: var(--text-color);
    transition: color 0.2s ease;
}

.article-card:hover .card-title {
    color: var(--primary-color);
}

.card-excerpt {
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.73rem;
    color: var(--text-muted);
}

/* ============================================================
   ARTICLE COMPLET
   ============================================================ */
.article-full {
    max-width: 780px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 36px;
    text-align: center;
}

.article-category-link {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--primary-color);
    margin-bottom: 14px;
    padding: 5px 14px;
    border-radius: 6px;
    background-color: rgba(139, 0, 0, 0.08);
    transition: all 0.2s ease;
}

[data-theme="dark"] .article-category-link {
    background-color: rgba(139, 0, 0, 0.2);
}

.article-category-link:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

.article-title {
    font-family: var(--font-title);
    font-size: 2.6rem;
    line-height: 1.15;
    margin-bottom: 18px;
    color: var(--text-color);
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.84rem;
    color: var(--text-muted);
}

.article-author {
    font-weight: 600;
}

.article-cover {
    margin-bottom: 36px;
    border-radius: 14px;
    overflow: hidden;
}

.article-cover img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

.article-content {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.85;
}

.article-content h2 {
    font-family: var(--font-title);
    font-size: 1.6rem;
    margin: 36px 0 14px;
    color: var(--text-color);
}

.article-content h3 {
    font-family: var(--font-title);
    font-size: 1.3rem;
    margin: 28px 0 10px;
    color: var(--text-color);
}

.article-content p {
    margin-bottom: 18px;
}

.article-content blockquote {
    border-left: 3px solid var(--primary-color);
    padding: 14px 24px;
    margin: 28px 0;
    font-style: italic;
    color: var(--text-muted);
    background-color: var(--surface-color);
    border-radius: 0 12px 12px 0;
}

.article-content ul,
.article-content ol {
    margin: 16px 0;
    padding-left: 28px;
}

.article-content li {
    margin-bottom: 6px;
}

.article-content img {
    margin: 28px auto;
    border-radius: 12px;
}

/* === Articles liés === */
.related-section {
    margin-top: 64px;
    padding-top: 44px;
    border-top: 1px solid var(--border-color);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 40px 0;
}

.pagination-link {
    padding: 8px 14px;
    font-size: 0.84rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.25s ease;
    color: var(--text-color);
    background-color: var(--surface-color);
}

.pagination-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.pagination-link.active {
    background-color: var(--primary-color);
    color: var(--bg-color);
    border-color: var(--primary-color);
}

.pagination-dots {
    padding: 8px 6px;
    color: var(--text-muted);
}

/* === Empty state === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    margin-top: auto;
    transition: background-color 0.4s ease;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 52px 24px 28px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-heading {
    font-family: var(--font-title);
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: #fff;
}

.footer-col p {
    font-size: 0.85rem;
    line-height: 1.7;
    opacity: 0.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    font-size: 0.85rem;
    opacity: 0.6;
    transition: all 0.25s ease;
    position: relative;
    padding-left: 0;
}

.footer-links a:hover {
    opacity: 1;
    padding-left: 6px;
    color: var(--primary-color);
}

.footer-contact {
    list-style: none;
    font-size: 0.85rem;
    opacity: 0.6;
}

.footer-contact li {
    margin-bottom: 8px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.4;
}

.footer-disclaimer {
    font-style: italic;
    margin-top: 4px;
    font-size: 0.75rem;
}

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

    .hero-card {
        grid-template-columns: 1fr;
    }

    .hero-image {
        min-height: 250px;
    }

    .hero-content {
        padding: 28px;
    }

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

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .about-inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .about-image {
        height: 280px;
    }

    .about-image-wrap::after {
        display: none;
    }

    .about-values {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 600px) {
    .header-inner {
        padding: 14px 16px 10px;
    }

    .header-title {
        font-size: 1.5rem;
    }

    .header-date,
    .header-admin-btn span {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
        border-top: none;
    }

    .main-nav.open {
        display: block;
    }

    .nav-inner {
        flex-direction: column;
        padding: 8px 16px;
    }

    .nav-link {
        padding: 10px 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-link::after {
        display: none;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

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

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .site-content {
        padding: 24px 16px;
    }

    .about-title {
        font-size: 1.6rem;
    }

    .about-stats {
        flex-direction: column;
        gap: 16px;
    }

    .about-stat {
        flex-direction: row;
        align-items: baseline;
        gap: 8px;
    }

    .hero-card {
        border-radius: 12px;
    }

    .article-card {
        border-radius: 12px;
    }
}
