/* ==========================================================================
   ARANGÛR - LE CODEX & WIKI OFFICIEL (STYLE MODERNE & RESPONSIVE)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Spectral:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #0a0d14;
    --bg-darker: #05070a;
    --bg-card: rgba(16, 21, 31, 0.95);
    --bg-card-hover: rgba(24, 32, 48, 0.98);
    --gold: #d4af37;
    --gold-light: #f3e5ab;
    --gold-dim: rgba(212, 175, 55, 0.25);
    --gold-border: rgba(212, 175, 55, 0.35);
    --crimson: #8b0000;
    --crimson-light: #b22222;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --sidebar-width: 300px;
    --header-height: 70px;
}

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

body {
    background: var(--bg-dark) url('../style/roi_mort.png') no-repeat center top fixed;
    background-size: cover;
    color: var(--text-main);
    font-family: 'Spectral', Georgia, serif;
    font-size: 16px;
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 10%, rgba(10, 13, 20, 0.82) 0%, rgba(5, 7, 10, 0.96) 80%);
    z-index: -1;
}

/* --------------------------------------------------------------------------
   HEADER NAVIGATION
   -------------------------------------------------------------------------- */
.wiki-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: rgba(8, 11, 16, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--gold-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.wiki-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--gold);
}

.wiki-brand h1 {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.wiki-brand .wiki-badge {
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--gold);
    color: var(--gold-light);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wiki-header-search {
    flex: 1;
    max-width: 480px;
    margin: 0 20px;
    position: relative;
}

.wiki-header-search input {
    width: 100%;
    padding: 9px 16px 9px 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 30px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: all 0.25s ease;
}

.wiki-header-search input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

.wiki-header-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold);
    font-size: 0.95rem;
}

.wiki-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wiki-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
}

.wiki-btn-gold {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(212, 175, 55, 0.05));
    border: 1px solid var(--gold);
    color: var(--gold);
}

.wiki-btn-gold:hover {
    background: var(--gold);
    color: #000;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.wiki-btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
}

.wiki-btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.wiki-btn-sgmj {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.4), rgba(212, 175, 55, 0.2));
    border: 1px solid var(--gold);
    color: var(--gold-light);
    font-weight: bold;
}

.wiki-btn-sgmj:hover {
    background: var(--crimson);
    color: #fff;
    box-shadow: 0 0 15px rgba(139, 0, 0, 0.6);
}

/* --------------------------------------------------------------------------
   LAYOUT CONTAINER (SIDEBAR + MAIN CONTENT)
   -------------------------------------------------------------------------- */
.wiki-layout {
    display: flex;
    max-width: 1500px;
    margin: 0 auto;
    min-height: calc(100vh - var(--header-height));
}

/* --------------------------------------------------------------------------
   SIDEBAR NAVIGATION
   -------------------------------------------------------------------------- */
.wiki-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: rgba(10, 14, 22, 0.85);
    backdrop-filter: blur(8px);
    border-right: 1px solid var(--gold-border);
    padding: 24px 16px;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-border) transparent;
}

.wiki-sidebar::-webkit-scrollbar {
    width: 5px;
}
.wiki-sidebar::-webkit-scrollbar-thumb {
    background: var(--gold-border);
    border-radius: 4px;
}

.wiki-nav-category {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 10px 6px 10px;
    margin-top: 14px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
}

.wiki-nav-category:first-of-type {
    margin-top: 0;
}

.wiki-nav-list {
    list-style: none;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wiki-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-family: 'Spectral', serif;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.wiki-nav-link i {
    width: 18px;
    text-align: center;
    color: var(--gold-dim);
    transition: color 0.2s;
}

.wiki-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    border-left-color: var(--gold);
}

.wiki-nav-link:hover i {
    color: var(--gold);
}

.wiki-nav-link.active {
    color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
    border-left-color: var(--gold);
    font-weight: 600;
}

.wiki-nav-link.active i {
    color: var(--gold);
}

.wiki-nav-count {
    margin-left: auto;
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 10px;
    color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   MAIN ARTICLE CONTENT
   -------------------------------------------------------------------------- */
.wiki-main {
    flex: 1;
    padding: 35px 45px 60px 45px;
    min-width: 0;
}

.wiki-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
}

.wiki-breadcrumbs a {
    color: var(--gold);
    text-decoration: none;
}
.wiki-breadcrumbs a:hover {
    text-decoration: underline;
}

.wiki-article-header {
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 20px;
    margin-bottom: 30px;
    position: relative;
}

.wiki-article-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: var(--gold);
    margin-bottom: 8px;
    line-height: 1.2;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.wiki-article-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    font-style: italic;
}

.wiki-article-meta {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.82rem;
    color: var(--text-dim);
    font-family: 'Inter', sans-serif;
}

/* Article Body Typography */
.wiki-article-body h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    color: var(--gold);
    margin-top: 40px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.wiki-article-body h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    color: var(--gold-light);
    margin-top: 30px;
    margin-bottom: 12px;
}

.wiki-article-body h4 {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    color: var(--gold);
    margin-top: 20px;
    margin-bottom: 8px;
}

.wiki-article-body p {
    margin-bottom: 1.25rem;
    color: #cbd5e1;
    font-size: 1.05rem;
    line-height: 1.8;
}

.wiki-article-body ul, .wiki-article-body ol {
    margin: 15px 0 25px 25px;
    color: #cbd5e1;
}

.wiki-article-body li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.wiki-article-body strong {
    color: #fff;
}

.text-gold {
    color: var(--gold) !important;
}

/* --------------------------------------------------------------------------
   COMPONENTS: CARDS, BOXES, TABLES, GRIDS
   -------------------------------------------------------------------------- */
.wiki-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.wiki-card {
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.wiki-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.wiki-card strong {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 8px;
}

.wiki-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.6;
}

.wiki-card-tile {
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.wiki-card-img-wrap {
    height: 280px;
    overflow: hidden;
    background: radial-gradient(circle at center, rgba(30, 35, 45, 0.9) 0%, rgba(10, 12, 16, 0.98) 100%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
    position: relative;
}

.wiki-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    transition: transform 0.4s ease;
    display: block;
}

.wiki-card:hover .wiki-card-img-wrap img {
    transform: scale(1.05);
}

.wiki-card-content {
    padding: 18px 20px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wiki-highlight-box {
    background: rgba(212, 175, 55, 0.06);
    border-left: 4px solid var(--gold);
    border-radius: 0 8px 8px 0;
    padding: 20px 24px;
    margin: 25px 0;
}

.wiki-highlight-box h4 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* CONFIDENTIAL MJ SECRET BOX */
.wiki-mj-secret {
    background: linear-gradient(135deg, rgba(35, 10, 10, 0.92), rgba(15, 8, 12, 0.95));
    border: 1px solid rgba(220, 38, 38, 0.6);
    border-left: 5px solid #dc2626;
    border-radius: 8px;
    padding: 24px;
    margin: 35px 0;
    box-shadow: 0 5px 25px rgba(185, 28, 28, 0.2);
    position: relative;
}

.wiki-mj-secret-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: #dc2626;
    color: #fff;
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    font-weight: bold;
    padding: 3px 12px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.wiki-mj-secret h4 {
    color: #fca5a5;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wiki-mj-secret p {
    color: #fecaca;
    font-size: 0.98rem;
}

/* WIKI TABLES */
.wiki-table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    overflow: hidden;
}

.wiki-table th, .wiki-table td {
    padding: 12px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.wiki-table th {
    background: rgba(212, 175, 55, 0.12);
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wiki-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* STAT PILLS & BADGES */
.wiki-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.25);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--gold-light);
    margin: 3px 4px 3px 0;
}

.wiki-skill-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 4px 11px;
    border-radius: 16px;
    font-size: 0.82rem;
    color: #fef08a;
    margin: 3px 4px 3px 0;
    transition: all 0.2s ease;
}

.wiki-skill-pill:hover {
    background: rgba(212, 175, 55, 0.18);
    border-color: var(--gold);
    color: #fff;
}

.wiki-weapon-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 0.8rem;
    color: #e2e8f0;
    margin: 2px 3px;
}

.wiki-armor-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.4);
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 0.8rem;
    color: #93c5fd;
    margin: 2px 3px;
}

.wiki-trait-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 4px 11px;
    border-radius: 16px;
    font-size: 0.82rem;
    color: #6ee7b7;
    margin: 3px 4px 3px 0;
}

.wiki-spell-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.4);
    padding: 4px 11px;
    border-radius: 16px;
    font-size: 0.82rem;
    color: #d8b4fe;
    margin: 3px 4px 3px 0;
    text-decoration: none;
}
.wiki-spell-pill:hover {
    background: rgba(168, 85, 247, 0.25);
    color: #fff;
}

.wiki-attr-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 35px 0 15px 0;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--gold);
    border-radius: 0 6px 6px 0;
}
.wiki-attr-header h3 {
    margin: 0;
    font-family: 'Cinzel', serif;
    font-size: 1.25rem;
    color: var(--gold-light);
}

/* ACTION LIST */
.wiki-action-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.wiki-action-list li {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-bottom: 8px;
    transition: background 0.2s;
}

.wiki-action-list li:hover {
    background: rgba(255, 255, 255, 0.04);
}

.wiki-action-list strong {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* --------------------------------------------------------------------------
   FILTERS TOOLBAR (SPELLS, STATES, PLACES)
   -------------------------------------------------------------------------- */
.wiki-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 25px 0;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: 8px;
}

.wiki-filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.wiki-filter-btn:hover, .wiki-filter-btn.active {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   MODAL SGMJ EDITOR
   -------------------------------------------------------------------------- */
.wiki-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

.wiki-modal-box {
    background: var(--bg-darker);
    border: 2px solid var(--gold);
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
    padding: 30px;
    color: var(--text-main);
    position: relative;
}

.wiki-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gold-border);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.wiki-modal-header h3 {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    margin: 0;
    font-size: 1.4rem;
}

.wiki-modal-close {
    background: transparent;
    border: none;
    color: var(--gold);
    font-size: 1.5rem;
    cursor: pointer;
}

.wiki-form-group {
    margin-bottom: 20px;
}

.wiki-form-group label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--gold-light);
    margin-bottom: 6px;
}

.wiki-form-control {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px;
    color: #fff;
    font-family: 'Spectral', serif;
    font-size: 1rem;
}

.wiki-form-control:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.08);
}

textarea.wiki-form-control {
    min-height: 180px;
    resize: vertical;
}

/* --------------------------------------------------------------------------
   RESPONSIVE DESIGN (MOBILE & TABLET)
   -------------------------------------------------------------------------- */
.wiki-mobile-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
}

@media (max-width: 992px) {
    .wiki-mobile-toggle {
        display: block;
    }
    .wiki-sidebar {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        bottom: 0;
        z-index: 5000;
        transition: left 0.3s ease;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.8);
    }
    .wiki-sidebar.open {
        left: 0;
    }
    .wiki-main {
        padding: 25px 20px;
    }
    .wiki-header-search {
        display: none; /* Accessible in mobile drawer */
    }
}
