/* --- VARIABLES DE LA CHARTE RNR S3 --- */
:root {
    /* Couleurs */
    --rnr-white: #ffffff;
    --rnr-black: #000000;
    --rnr-purple: #8e44ad;
    --rnr-gold: #8b5a2b; /* Cuir / Or antique */
    --rnr-bg-light: #fafafd;
    --rnr-gray-dark: #2c3e50;
    
    /* Typographies */
    --font-main: 'TenorSans', sans-serif;
    --font-title: 'Cinzel', serif;
    --font-deco: 'CinzelDecorative', serif;
}

/* --- POLICES --- */
@font-face {
    font-family: 'Cinzel';
    src: url('fonts/Cinzel-Regular.ttf') format('truetype');
}
@font-face {
    font-family: 'CinzelDecorative';
    src: url('fonts/CinzelDecorative-Regular.ttf') format('truetype');
}
@font-face {
    font-family: 'TenorSans';
    src: url('fonts/TenorSans-Regular.ttf') format('truetype');
}

/* --- BASE --- */
/* --- VARIABLES DE BASE (MODE CLAIR) --- */
:root {
    --rnr-white: #ffffff;
    --rnr-black: #000000;
    --rnr-purple: #8e44ad;
    --rnr-gold: #8b5a2b;
    --rnr-bg-light: #fafafd;
    --rnr-gray-dark: #2c3e50;
    --rnr-section-bg: #ffffff;
    --rnr-text: #2c3e50;
}

/* --- OVERRIDE DARK MODE --- */
/* Dans style_main.css */
body.dark-mode {
    --rnr-bg-light: #121212 !important;   
    --rnr-section-bg: #1e1e1e !important; 
    --rnr-text: #e0e0e0 !important;       
    --rnr-white: #1e1e1e !important;      
    --rnr-black: #ffffff !important;      
    
    background-color: var(--rnr-bg-light) !important;
    color: var(--rnr-text) !important;
}

body.dark-mode section {
    background: var(--rnr-section-bg) !important;
    border-color: #333 !important;
}

/* Ajustement des titres de modules en mode sombre */
body.dark-mode .module-title {
    color: var(--rnr-purple); /* Plus vibrant sur fond noir */
}

/* --- HEADER & NAVIGATION --- */
.main-header {
    background: var(--rnr-white);
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    position: sticky;
    top: 0;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-bottom: 2px solid var(--rnr-black);
}

.logo img {
    height: 50px;
    filter: brightness(0); /* Force le logo en noir pur selon la charte */
}

.main-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.menu-link {
    font-family: var(--font-title);
    text-decoration: none;
    color: var(--rnr-black);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.3s;
}

.menu-link:hover {
    color: var(--rnr-purple);
}

/* --- SOUS-MENUS (STYLE PARCHEMIN) --- */
.submenu {
    background-color: #f2e8c9;
    background-image: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.2), rgba(0,0,0,0)), url('img/texture_papier.png');
    border: 2px solid var(--rnr-gold);
    box-shadow: 5px 5px 15px rgba(0,0,0,0.1);
    padding: 15px 0;
    border-radius: 2px;
}

.submenu li a {
    color: #3d2b1f;
    font-family: var(--font-main); /* Plus lisible dans les menus */
    font-weight: 600;
    padding: 8px 25px;
    display: block;
    transition: 0.3s;
}

.submenu li a:hover {
    background: rgba(139, 90, 43, 0.1);
    color: var(--rnr-purple);
    padding-left: 30px;
}

/* --- TITRAGE --- */
h1, h2, h3 {
    font-family: var(--font-title);
    color: var(--rnr-black);
    text-transform: uppercase;
    margin-bottom: 20px;
}

.titre-episode {
    font-family: var(--font-deco);
    color: var(--rnr-purple);
}

/* --- FOOTER --- */
.main-footer {
    background: var(--rnr-black); /* Noir selon la charte */
    color: var(--rnr-white);
    padding: 60px 0 30px 0;
    margin-top: 80px;
    font-family: var(--font-main);
}

.footer-section h4 {
    color: var(--rnr-white);
    font-family: var(--font-title);
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.visites-count {
    font-family: var(--font-deco);
    color: var(--rnr-purple);
    font-size: 0.9em;
}

/* --- UTILITAIRES --- */
.btn-roxxe {
    background: var(--rnr-black);
    color: var(--rnr-white);
    font-family: var(--font-title);
    padding: 12px 25px;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

.btn-roxxe:hover {
    background: var(--rnr-purple);
    transform: translateY(-2px);
}

/* Reset de base pour le menu */
.main-header {
    background: #2c3e50;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    position: sticky;
    top: 0;
    z-index: 9999;
}

.main-menu {
    display: flex; /* Aligne les menus 1 2 3 horizontalement */
    list-style: none; /* Enlève les points */
    margin: 0;
    padding: 0;
}

.menu-item {
    position: relative;
    padding: 0 20px;
}

.menu-link {
    color: #f1c40f;
    text-decoration: none;
    font-weight: bold;
    line-height: 70px; /* Aligne le texte au milieu de la barre */
    display: block;
}

/* --- Le Parchemin --- */
.submenu {
    position: absolute;
    top: 100%; /* Juste en dessous du header */
    left: 50%;
    transform: translateX(-50%) scaleY(0); /* On le compresse */
    transform-origin: top;
    transition: transform 0.4s ease;
    
    background: #fdf5e6;
    background-image: url('https://www.transparenttextures.com/patterns/parchment.png');
    border-left: 2px solid #8b4513;
    border-right: 2px solid #8b4513;
    list-style: none;
    padding: 15px 0;
    margin: 0;
    min-width: 180px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

/* On le déroule au survol */
.menu-item:hover .submenu {
    transform: translateX(-50%) scaleY(1);
}

.submenu li {
    padding: 8px 20px;
    text-align: center;
}

.submenu li a {
    color: #3d2b1f;
    text-decoration: none;
    font-family: serif;
    font-style: italic;
    white-space: nowrap; /* Evite que le texte revienne à la ligne */
}

.submenu li a:hover {
    color: #8e44ad;
}

/* --- FOOTER --- */
.main-footer {
    background: #1a1a1a;
    color: #bdc3c7;
    padding: 40px 0 20px 0;
    margin-top: 50px;
    border-top: 4px solid #8e44ad; /* Rappel de la couleur primaire */
    font-family: 'Segoe UI', sans-serif;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 0 20px;
}

.footer-section h4 {
    color: #f1c40f; /* Or antique */
    text-transform: uppercase;
    margin-bottom: 20px;
    border-bottom: 1px solid #34495e;
    padding-bottom: 10px;
}

.footer-section p {
    line-height: 1.6;
    font-size: 0.9em;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: #8e44ad;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    font-size: 0.8em;
}

.social-icons {
    margin-top: 15px;
    color: #f1c40f;
    font-weight: bold;
}