/**
 * Palawyn JDR - Feuille de style principale
 * Thème immersif pour campagne de jeu de rôle
 */

/* ==================== VARIABLES CSS ==================== */
:root {
    /* Palette parchemin */
    --parchment-bg: #f4f1e8;
    --parchment-dark: #e8e3d3;
    --parchment-light: #faf8f3;
    
    /* Encres */
    --ink-dark: #2c2416;
    --ink-medium: #5a4a3a;
    --ink-light: #8a7a6a;
    
    /* Accents métalliques */
    --accent-gold: #d4af37;
    --accent-amber: #c17817;
    --accent-burgundy: #800020;
    --accent-bronze: #cd7f32;
    
    /* Ombres */
    --shadow-soft: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --shadow-strong: rgba(0, 0, 0, 0.25);
    
    /* Typographie */
    --font-title: 'Cinzel', serif;
    --font-body: 'Lora', serif;
    --font-mono: 'Courier New', monospace;
}

/* ==================== BASE & TYPOGRAPHIE ==================== */
body {
    font-family: var(--font-body);
    color: var(--ink-dark);
    background: linear-gradient(135deg, var(--parchment-bg) 0%, var(--parchment-dark) 100%);
    min-height: 100vh;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    font-weight: 600;
    color: var(--ink-dark);
}

/* ==================== NAVIGATION ==================== */
.navbar-rpg {
    background: linear-gradient(135deg, var(--ink-dark) 0%, var(--ink-medium) 100%);
    border-bottom: 3px solid var(--accent-gold);
    box-shadow: 0 4px 12px var(--shadow-soft);
}

.navbar-brand {
    font-family: var(--font-title);
    font-weight: 700;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: translateY(-2px);
}

.navbar-brand img {
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.navbar-brand:hover img {
    transform: scale(1.05) rotate(-2deg);
    filter: drop-shadow(0 4px 8px rgba(212, 175, 55, 0.4));
}

/* ==================== CARTES ==================== */
.card-rpg {
    background: white;
    border: 2px solid var(--parchment-dark);
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--shadow-soft);
    transition: all 0.3s ease;
}

.card-rpg:hover {
    box-shadow: 0 6px 20px var(--shadow-medium);
    transform: translateY(-2px);
}

.card-rpg .card-header {
    background: linear-gradient(135deg, var(--parchment-light) 0%, var(--parchment-bg) 100%);
    border-bottom: 2px solid var(--accent-gold);
    font-family: var(--font-title);
    font-weight: 600;
    color: var(--ink-dark);
}

/* ==================== BOUTONS ==================== */
.btn-rpg {
    font-family: var(--font-title);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.btn-rpg-primary {
    background: linear-gradient(135deg, var(--accent-burgundy) 0%, var(--accent-amber) 100%);
    border: 2px solid var(--accent-gold);
    color: white;
}

.btn-rpg-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-soft);
    color: white;
}

.btn-rpg-secondary {
    background: linear-gradient(135deg, var(--ink-medium) 0%, var(--ink-light) 100%);
    border: 2px solid var(--ink-dark);
    color: white;
}

.btn-rpg-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-soft);
    color: white;
}

/* ==================== BADGES ==================== */
.badge-rpg {
    font-family: var(--font-title);
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.badge-rpg-gold {
    background: var(--accent-gold);
    color: var(--ink-dark);
}

.badge-rpg-burgundy {
    background: var(--accent-burgundy);
    color: white;
}

.badge-rpg-amber {
    background: var(--accent-amber);
    color: white;
}

/* ==================== FORMULAIRES ==================== */
.form-control-rpg {
    border: 2px solid var(--parchment-dark);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

.form-control-rpg:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25);
}

/* ==================== HEADER DOCUMENT ==================== */
.doc-header {
    background: linear-gradient(135deg, #fff 0%, var(--parchment-bg) 100%);
    border: 2px solid var(--accent-gold);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.doc-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-gold) 0%, var(--accent-amber) 50%, var(--accent-gold) 100%);
}

.doc-meta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--ink-medium);
}

.doc-type {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--parchment-dark);
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.doc-title {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 700;
    color: var(--ink-dark);
    margin: 1rem 0;
    line-height: 1.3;
}

.doc-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.doc-tag {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    background: var(--parchment-dark);
    border: 1px solid var(--accent-gold);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--ink-medium);
    transition: all 0.3s ease;
    cursor: pointer;
}

.doc-tag:hover {
    background: var(--accent-gold);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px var(--shadow-soft);
}

/* ==================== MARKDOWN BODY ==================== */
.markdown-body {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-soft);
    line-height: 1.8;
    max-width: 1100px;
    margin: 0 auto;
}

.markdown-body h1 {
    font-family: var(--font-title);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--ink-dark);
    border-bottom: 3px solid var(--accent-gold);
    padding-bottom: 0.75rem;
    margin-bottom: 2rem;
    margin-top: 0;
}

.markdown-body h2 {
    font-family: var(--font-title);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--accent-burgundy);
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--parchment-dark);
}

.markdown-body h3 {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent-amber);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.markdown-body h4 {
    font-family: var(--font-title);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--ink-medium);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.markdown-body p {
    margin-bottom: 1.2rem;
}

.markdown-body strong {
    color: var(--ink-dark);
    font-weight: 600;
}

.markdown-body ul, .markdown-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.markdown-body li {
    margin-bottom: 0.5rem;
}

.markdown-body blockquote {
    background: var(--parchment-bg);
    border-left: 5px solid var(--accent-gold);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--ink-medium);
    box-shadow: 0 2px 8px var(--shadow-soft);
}

.markdown-body blockquote p:last-child {
    margin-bottom: 0;
}

.markdown-body table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-soft);
}

.markdown-body table th {
    background: linear-gradient(135deg, var(--accent-burgundy) 0%, var(--accent-amber) 100%);
    color: white;
    padding: 1rem;
    text-align: left;
    font-family: var(--font-title);
    font-weight: 600;
}

.markdown-body table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--parchment-dark);
    background: white;
}

.markdown-body table tr:nth-child(even) td {
    background: var(--parchment-bg);
}

.markdown-body table tr:last-child td {
    border-bottom: none;
}

.markdown-body code {
    background: var(--parchment-dark);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: var(--font-mono);
    color: var(--accent-burgundy);
}

.markdown-body pre {
    background: var(--ink-dark);
    color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px var(--shadow-soft);
}

.markdown-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.markdown-body a {
    color: var(--accent-burgundy);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-gold);
    transition: all 0.3s ease;
}

.markdown-body a:hover {
    color: var(--accent-amber);
    border-bottom-color: var(--accent-amber);
}

.markdown-body hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--accent-gold) 50%, transparent 100%);
    margin: 3rem 0;
}

/* ==================== LOGIN CARD ==================== */
.login-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 241, 232, 0.95) 100%);
    backdrop-filter: blur(10px);
    border: 3px solid var(--accent-gold);
    border-radius: 15px;
    box-shadow: 0 8px 32px var(--shadow-strong);
}

.login-card img {
    transition: all 0.3s ease;
}

.login-card img:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}

.site-logo {
    font-size: 2.5rem;
    font-weight: bold;
    font-family: var(--font-title);
    background: linear-gradient(135deg, var(--accent-burgundy) 0%, var(--accent-amber) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== LISTE DOCUMENTS ==================== */
.doc-list {
    max-height: 70vh;
    overflow-y: auto;
}

.doc-list::-webkit-scrollbar {
    width: 8px;
}

.doc-list::-webkit-scrollbar-track {
    background: var(--parchment-bg);
}

.doc-list::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 4px;
}

.doc-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-amber);
}

.list-group-item-rpg {
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.list-group-item-rpg:hover {
    background-color: var(--parchment-light);
    border-left-color: var(--accent-gold);
    transform: translateX(4px);
}

/* ==================== SEARCH BOX ==================== */
.search-box-rpg {
    border: 2px solid var(--parchment-dark);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.search-box-rpg:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25);
}

/* ==================== ADMIN SECTIONS ==================== */
.admin-section {
    margin-bottom: 2rem;
}

.admin-section .card-header {
    font-family: var(--font-title);
    font-weight: 600;
}

/* ==================== FIL D'ARIANE (BREADCRUMB) ==================== */
.breadcrumb-nav {
    margin-bottom: 1.5rem;
}

.breadcrumb {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-soft);
    margin-bottom: 0;
    border: 2px solid var(--parchment-dark);
}

.breadcrumb-item {
    font-family: var(--font-body);
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: var(--accent-burgundy);
    text-decoration: none;
    transition: all 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--accent-amber);
}

.breadcrumb-item.active {
    color: var(--ink-medium);
    font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--accent-gold);
    content: "›";
    font-size: 1.2rem;
}

/* ==================== TABLE DES MATIÈRES ==================== */
.table-of-contents {
    background: linear-gradient(135deg, #fff 0%, var(--parchment-bg) 100%);
    border: 2px solid var(--accent-gold);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 12px var(--shadow-soft);
    position: sticky;
    top: 90px;
    z-index: 100;
}

.toc-header {
    font-family: var(--font-title);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--ink-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-gold);
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toc-link {
    display: block;
    color: var(--ink-medium);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.toc-link:hover {
    background: var(--parchment-dark);
    color: var(--accent-burgundy);
    transform: translateX(4px);
}

.toc-level-2 {
    padding-left: 0.75rem;
}

.toc-level-3 {
    padding-left: 1.5rem;
    font-size: 0.85rem;
    color: var(--ink-light);
}

/* ==================== NAVIGATION PRÉCÉDENT/SUIVANT ==================== */
.doc-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 3rem 0;
    padding: 1.5rem 0;
    border-top: 2px solid var(--parchment-dark);
    border-bottom: 2px solid var(--parchment-dark);
}

.doc-navigation .nav-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #fff 0%, var(--parchment-bg) 100%);
    border: 2px solid var(--parchment-dark);
    border-radius: 8px;
    text-decoration: none;
    color: var(--ink-dark);
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.doc-navigation .nav-link:hover {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-soft);
}

.doc-navigation .nav-prev {
    text-align: left;
}

.doc-navigation .nav-next {
    text-align: right;
    justify-content: flex-end;
}

.doc-navigation .nav-link i {
    font-size: 1.5rem;
    color: var(--accent-gold);
}

.doc-navigation .nav-link span {
    line-height: 1.4;
}

.doc-navigation .nav-link small {
    display: block;
    font-size: 0.85rem;
    color: var(--ink-medium);
    font-style: italic;
}

.doc-navigation .nav-disabled {
    flex: 1;
    visibility: hidden;
}

/* ==================== BOUTON RETOUR EN HAUT ==================== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-burgundy) 0%, var(--accent-amber) 100%);
    border: 2px solid var(--accent-gold);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px var(--shadow-medium);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px var(--shadow-strong);
}

/* ==================== BARRE DE PROGRESSION DE LECTURE ==================== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-gold) 0%, var(--accent-amber) 100%);
    z-index: 10000;
    transition: width 0.2s ease;
    box-shadow: 0 2px 4px var(--shadow-soft);
}

/* ==================== VUE GRILLE DES DOCUMENTS ==================== */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

.doc-card {
    background: white;
    border: 2px solid var(--parchment-dark);
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px var(--shadow-soft);
}

.doc-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-4px);
    box-shadow: 0 6px 16px var(--shadow-medium);
}

.doc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.doc-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.doc-card-title {
    font-family: var(--font-title);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--ink-dark);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.doc-card-excerpt {
    font-size: 0.9rem;
    color: var(--ink-medium);
    line-height: 1.5;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==================== BOUTONS FAVORIS ==================== */
.btn-favorite {
    background: none;
    border: none;
    color: var(--ink-light);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.25rem 0.5rem;
}

.btn-favorite:hover {
    color: var(--accent-gold);
    transform: scale(1.1);
}

.btn-favorite.active {
    color: var(--accent-gold);
}

.btn-favorite.active:hover {
    color: var(--accent-amber);
}

/* ==================== FILTRES ET CONTROLS ==================== */
.btn-group .btn-check:checked + .btn {
    background: var(--accent-burgundy);
    border-color: var(--accent-burgundy);
    color: white;
}

.btn-outline-primary {
    border-color: var(--parchment-dark);
    color: var(--ink-dark);
}

.btn-outline-primary:hover {
    background: var(--parchment-bg);
    border-color: var(--accent-gold);
    color: var(--ink-dark);
}

#clearSearch {
    border-left: none;
}

/* ==================== RESPONSIVE ==================== */
/* Ajustement de la largeur du conteneur document */
.container-doc {
    max-width: 1200px !important;
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
    
    .markdown-body {
        padding: 1.5rem;
        max-width: 100%;
    }
    
    .container-doc {
        max-width: 100% !important;
    }
    
    .doc-title {
        font-size: 1.5rem;
    }
    
    .markdown-body h1 {
        font-size: 2rem;
    }
    
    .markdown-body h2 {
        font-size: 1.5rem;
    }
    
    .doc-header {
        padding: 1rem;
    }
    
    .btn-rpg {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
    
    /* Logo navbar mobile */
    .navbar-brand img {
        height: 32px !important;
        margin-right: 8px !important;
    }
    
    .navbar-brand {
        font-size: 0.95rem;
    }
    
    /* Bannière login mobile */
    .login-card img {
        max-height: 200px;
        object-fit: cover;
        object-position: center;
    }
    
    /* Table des matières mobile */
    .table-of-contents {
        position: relative;
        top: 0;
    }
    
    /* Navigation précédent/suivant mobile */
    .doc-navigation {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .doc-navigation .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .doc-navigation .nav-link i {
        font-size: 1.2rem;
    }
    
    .doc-navigation .nav-disabled {
        display: none;
    }
    
    /* Bouton retour en haut mobile */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    /* Vue grille mobile */
    .doc-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    /* Fil d'Ariane mobile */
    .breadcrumb {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .breadcrumb-item {
        font-size: 0.85rem;
    }
    
    /* Filtres mobile */
    .d-flex.flex-wrap.gap-2 {
        gap: 0.5rem !important;
    }
    
    .btn-group-sm .btn {
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
    }
    
    .form-select-sm {
        font-size: 0.85rem;
    }
}

/* ==================== UTILITAIRES ==================== */
.text-parchment {
    color: var(--ink-medium);
}

.bg-parchment {
    background-color: var(--parchment-bg);
}

.bg-parchment-dark {
    background-color: var(--parchment-dark);
}

.border-gold {
    border-color: var(--accent-gold) !important;
}

.text-gold {
    color: var(--accent-gold);
}

.text-burgundy {
    color: var(--accent-burgundy);
}

.shadow-rpg {
    box-shadow: 0 4px 16px var(--shadow-soft);
}

.shadow-rpg-lg {
    box-shadow: 0 8px 32px var(--shadow-medium);
}

/* ==================== LIENS WIKI-STYLE ==================== */
.wiki-link {
    color: var(--accent-burgundy);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-gold);
    transition: all 0.3s ease;
    font-weight: 500;
}

.wiki-link:hover {
    color: var(--accent-amber);
    border-bottom-color: var(--accent-amber);
    border-bottom-style: solid;
}

.wiki-link-broken {
    color: var(--ink-light);
    text-decoration: line-through;
    cursor: help;
    font-style: italic;
}

/* ==================== SECTIONS MJ (CAVIARDÉES) ==================== */

/* Pour les JOUEURS : Effet feutre noir main levée par mot */
.mj-censored {
    padding: 1rem 0;
    margin: 1.5rem 0;
    line-height: 2;
    
    /* Empêcher la sélection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none;
}

/* IMPORTANT : Pas de message "CLASSIFIÉ" pour les joueurs */
.mj-censored::before {
    content: none !important;
}

/* Style des paragraphes et titres */
.mj-censored p,
.mj-censored h2,
.mj-censored h3,
.mj-censored h4,
.mj-censored li {
    margin: 0.5rem 0;
    line-height: 2.2;
}

/* Chaque mot caviardé individuellement */
.word-redacted {
    /*display: inline-block;*/
    background: #000;
    color: rgba(50, 50, 50, 0.3); /* Texte très sombre, presque invisible */
    padding: 3px 6px;
    margin: 0 2px;
    position: relative;
    
    /* Effet feutre main levée avec légère rotation */
    transform: rotate(-0.5deg);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    
    /* Transition douce */
    transition: none;
}

/* Variations aléatoires pour effet main levée naturel */
.word-redacted:nth-child(2n) {
    transform: rotate(0.6deg);
    padding: 3px 7px;
}

.word-redacted:nth-child(3n) {
    transform: rotate(-0.8deg);
    padding: 4px 6px;
}

.word-redacted:nth-child(4n) {
    transform: rotate(0.4deg);
    padding: 3px 5px;
}

.word-redacted:nth-child(5n) {
    transform: rotate(-0.6deg);
    padding: 4px 7px;
}

.word-redacted:nth-child(7n) {
    transform: rotate(0.7deg);
    padding: 3px 6px;
}

.word-redacted:nth-child(11n) {
    transform: rotate(-0.4deg);
    padding: 4px 5px;
}

/* Variations d'épaisseur pour effet naturel */
.word-redacted:nth-child(2n+1) {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.word-redacted:nth-child(3n+1) {
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.4);
}

/* ==================== SECTIONS MJ - VUE MJ ==================== */

/* Pour le MJ : Style clair et professionnel avec avertissement */
body.role-mj .mj-censored {
    /* Style clair et professionnel pour le MJ */
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #000;
    padding: 1.5rem;
    border-left: 5px solid #dc3545;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
    clip-path: none;
    pointer-events: auto;
    user-select: text;
    filter: none;
    margin: 2rem 0;
}

/* Message clair pour le MJ */
body.role-mj .mj-censored::before {
    content: "🔒 SECTION MJ UNIQUEMENT - CONFIDENTIEL";
    display: block;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff;
    padding: 0.75rem 1rem;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    font-weight: bold;
    text-align: center;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-family: var(--font-title);
}

/* Contenu normal et lisible pour le MJ */
body.role-mj .mj-censored * {
    color: #000 !important;
    text-shadow: none;
    opacity: 1;
    user-select: text;
}

body.role-mj .mj-censored h2,
body.role-mj .mj-censored h3,
body.role-mj .mj-censored h4 {
    color: #721c24 !important;
    margin-top: 1rem;
}

/* Bordure subtile pour les sous-sections MJ */
body.role-mj .mj-censored h3 {
    border-bottom: 2px solid #dc3545;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* Style pour les listes dans sections MJ */
body.role-mj .mj-censored ul,
body.role-mj .mj-censored ol {
    margin-left: 1.5rem;
}

body.role-mj .mj-censored li {
    margin-bottom: 0.5rem;
}

/* Style pour les paragraphes dans sections MJ */
body.role-mj .mj-censored p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Style pour le texte en gras dans sections MJ */
body.role-mj .mj-censored strong {
    color: #721c24 !important;
    font-weight: 700;
}

/* Style pour les blockquotes dans sections MJ */
body.role-mj .mj-censored blockquote {
    border-left: 4px solid #dc3545;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #856404 !important;
}

/* ==================== PAGES D'ACCÈS REFUSÉ ==================== */

/* Page d'accès refusé pour les joueurs */
.access-denied-card {
    background: linear-gradient(135deg, #faf8f3 0%, #f4f1e8 100%);
    border: 3px solid #d4af37;
    border-radius: 15px;
    padding: 3rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.access-denied-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #d4af37 0%, #c17817 50%, #d4af37 100%);
}

.seal-icon {
    font-size: 4rem;
    color: #800020;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.seal-text {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.3rem;
    color: #800020;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.roleplay-message {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: #2c2416;
    line-height: 1.8;
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(212, 175, 55, 0.1);
    border-left: 4px solid #d4af37;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn-back {
    background: linear-gradient(135deg, #800020 0%, #c17817 100%);
    border: 2px solid #d4af37;
    color: white;
    font-family: var(--font-title);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: white;
}

.btn-archives {
    background: linear-gradient(135deg, #2c2416 0%, #5a4a3a 100%);
    border: 2px solid #8a7a6a;
    color: white;
    font-family: var(--font-title);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-archives:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: white;
}

/* Navbar pour pages d'accès refusé */
.navbar-access-denied {
    background: linear-gradient(135deg, #2c2416 0%, #5a4a3a 100%);
    border-bottom: 3px solid #d4af37;
}

/* Card pour document offline (MJ) */
.card-offline {
    background: white;
    border: 2px solid #ffc107;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.card-offline .card-header {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-bottom: 2px solid #ffc107;
    color: #333;
}

/* ==================== TOC SIDEBAR SLIDE-IN ==================== */

/* Overlay semi-transparent */
.toc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.toc-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar TOC */
.toc-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    background: white;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    z-index: 999;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.toc-sidebar.active {
    left: 0;
}

/* Header de la sidebar */
.toc-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--parchment-light) 0%, var(--parchment-bg) 100%);
    border-bottom: 2px solid var(--accent-gold);
    flex-shrink: 0;
}

.toc-sidebar-title {
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc-close-btn {
    background: none;
    border: none;
    color: var(--ink-medium);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.toc-close-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-burgundy);
    transform: rotate(90deg);
}

/* Contenu de la sidebar */
.toc-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.toc-sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.toc-sidebar-content::-webkit-scrollbar-track {
    background: var(--parchment-bg);
}

.toc-sidebar-content::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 3px;
}

.toc-sidebar-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-amber);
}

/* Table des matières dans la sidebar */
.toc-sidebar .table-of-contents {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
    position: static;
}

.toc-sidebar .toc-header {
    display: none; /* Déjà dans le header de la sidebar */
}

.toc-sidebar .toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.toc-sidebar .toc-link {
    display: block;
    color: var(--ink-medium);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    line-height: 1.4;
    border-left: 3px solid transparent;
    margin-bottom: 0.25rem;
}

.toc-sidebar .toc-link:hover {
    background: var(--parchment-light);
    color: var(--accent-burgundy);
    border-left-color: var(--accent-gold);
    transform: translateX(4px);
}

.toc-sidebar .toc-link.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15) 0%, transparent 100%);
    color: var(--accent-burgundy);
    font-weight: 600;
    border-left-color: var(--accent-gold);
}

.toc-sidebar .toc-level-2 {
    padding-left: 1rem;
    font-weight: 500;
}

.toc-sidebar .toc-level-3 {
    padding-left: 2rem;
    font-size: 0.9rem;
    color: var(--ink-light);
}

/* Responsive */
@media (max-width: 768px) {
    .toc-sidebar {
        width: 85%;
        max-width: 320px;
        left: -100%;
    }
    
    .toc-sidebar.active {
        left: 0;
    }
    
    .toc-sidebar-header {
        padding: 1.25rem;
    }
    
    .toc-sidebar-content {
        padding: 1.25rem;
    }
}

/* ==================== DIAGRAMMES MERMAID ==================== */

.mermaid {
    display: flex;
    justify-content: center;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border: 2px solid var(--accent-gold);
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--shadow-soft);
    max-width: 100%;
    overflow-x: auto;
}

.mermaid svg {
    max-width: 100%;
    height: auto;
}

/* Style responsive mobile */
@media (max-width: 768px) {
    .mermaid {
        padding: 1rem;
        margin: 1.5rem 0;
    }
}

/* ==================== PORTRAITS DE PERSONNAGES ==================== */

/* Conteneur principal du portrait */
.character-portrait-container {
    float: right;
    margin: 0 0 2rem 2rem;
    max-width: 320px;
    width: 100%;
}

/* Cadre du portrait avec style parchemin/doré */
.character-portrait {
    position: relative;
    background: linear-gradient(135deg, #faf8f3 0%, #f4f1e8 100%);
    border: 8px solid #8b7355;
    border-radius: 4px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Effet de cadre doré intérieur */
.character-portrait::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #d4af37;
    pointer-events: none;
    z-index: 1;
    box-shadow: inset 0 0 8px rgba(212, 175, 55, 0.3);
}

/* Image du portrait */
.character-portrait img {
    width: 100%;
    height: auto;
    display: block;
    border: none;
    position: relative;
    z-index: 0;
}

/* Placeholder pour portrait non disponible */
.character-portrait-placeholder {
    background: linear-gradient(135deg, #f4f1e8 0%, #e8e3d3 100%);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8b7355;
    font-family: var(--font-title);
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 0;
}

/* Icône du placeholder */
.character-portrait-placeholder .placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

/* Texte du placeholder */
.character-portrait-placeholder .placeholder-text {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.7;
    line-height: 1.4;
}

/* Sous-texte du placeholder */
.character-portrait-placeholder .placeholder-subtext {
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 0.5rem;
    opacity: 0.5;
    font-family: var(--font-body);
}

/* Légende du portrait */
.character-portrait-caption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--ink-medium);
    margin-top: 0.75rem;
    font-style: italic;
    font-family: var(--font-body);
}

/* Responsive - Portrait en haut sur mobile */
@media (max-width: 768px) {
    .character-portrait-container {
        float: none;
        margin: 0 auto 2rem;
        max-width: 100%;
    }
    
    .character-portrait {
        max-width: 100%;
    }
    
    .character-portrait-placeholder {
        min-height: 300px;
    }
    
    .character-portrait-placeholder .placeholder-icon {
        font-size: 2.5rem;
    }
    
    .character-portrait-placeholder .placeholder-text {
        font-size: 1rem;
    }
}

/* Hover effect sur le portrait */
.character-portrait:hover {
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}
