@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Rubik:wght@300;400;500;600;700&display=swap');

:root {
    --gold: #FFD700;
    --gold-dim: rgba(255,215,0,.15);
    --bg: #0d0d12;
    --bg-sidebar: #08080d;
    --bg-card: rgba(255,255,255,.03);
    --border: rgba(255,255,255,.07);
    --border-gold: rgba(255,215,0,.2);
    --text: rgba(255,255,255,.88);
    --text-muted: rgba(255,255,255,.4);
    --text-gold: #FFD700;
    --radius: 12px;
}

/* ─── RESET & BASE ─────────────────────────────────────────────────────────── */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Rubik', sans-serif;
    font-weight: 400;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: color .2s ease, opacity .2s ease;
}

a:hover {
    color: #fff;
    opacity: 1;
}

/* ─── LAYOUT ────────────────────────────────────────────────────────────────── */

.wiki-wrap {
    display: flex;
    min-height: 100vh;
}

.wiki-sidebar {
    width: 280px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,215,0,.2) transparent;
}

.wiki-sidebar::-webkit-scrollbar {
    width: 4px;
}

.wiki-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.wiki-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,215,0,.2);
    border-radius: 4px;
}

.wiki-main {
    margin-left: 280px;
    flex: 1;
    min-height: 100vh;
}

.wiki-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 48px 40px 80px;
}

/* ─── SIDEBAR LOGO ──────────────────────────────────────────────────────────── */

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 24px 20px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    gap: 2px;
    transition: background .2s ease;
}

.sidebar-logo:hover {
    background: var(--gold-dim);
    color: inherit;
}

.sidebar-logo-name {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--gold);
    letter-spacing: .04em;
    line-height: 1.2;
}

.sidebar-logo-sub {
    font-family: 'Rubik', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .12em;
}

/* ─── SIDEBAR SEARCH ────────────────────────────────────────────────────────── */

.sidebar-search {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-search-input {
    width: 100%;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px 8px 36px;
    color: var(--text);
    font-family: 'Rubik', sans-serif;
    font-size: 13px;
    outline: none;
    transition: border-color .2s ease, background .2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.3)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 11px center;
}

.sidebar-search-input::placeholder {
    color: var(--text-muted);
}

.sidebar-search-input:focus {
    border-color: var(--border-gold);
    background-color: rgba(255,215,0,.04);
}

/* ─── SIDEBAR NAV ───────────────────────────────────────────────────────────── */

.sidebar-nav {
    flex: 1;
    padding: 12px 0 20px;
}

.nav-category {
    padding: 14px 20px 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-muted);
    -webkit-user-select: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 20px 7px 24px;
    font-size: 13.5px;
    font-weight: 400;
    color: rgba(255,255,255,.65);
    border-left: 2px solid transparent;
    transition: color .18s ease, border-color .18s ease, background .18s ease, padding-left .18s ease;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255,255,255,.03);
    border-left-color: rgba(255,215,0,.35);
    padding-left: 26px;
}

.nav-link.active {
    color: var(--gold);
    border-left-color: var(--gold);
    background: var(--gold-dim);
    font-weight: 500;
    padding-left: 26px;
}

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

.nav-link i {
    font-size: 13px;
    opacity: .7;
    flex-shrink: 0;
}

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

/* ─── SIDEBAR FOOTER ────────────────────────────────────────────────────────── */

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.sidebar-back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color .2s ease;
}

.sidebar-back-link:hover {
    color: var(--gold);
}

.sidebar-back-link i {
    font-size: 14px;
}

/* ─── MOBILE TOGGLE ─────────────────────────────────────────────────────────── */

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gold);
    font-size: 18px;
}

/* ─── BREADCRUMB ────────────────────────────────────────────────────────────── */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color .2s ease;
}

.breadcrumb a:hover {
    color: var(--gold);
}

.breadcrumb-sep {
    color: rgba(255,255,255,.2);
    font-size: 10px;
}

.breadcrumb-current {
    color: var(--text);
    font-weight: 500;
}

/* ─── ARTICLE HEADER ────────────────────────────────────────────────────────── */

.article-header {
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.article-header h1 {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 32px;
    line-height: 1.25;
    color: #fff;
    margin-bottom: 14px;
    letter-spacing: .01em;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.article-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .04em;
    background: var(--gold-dim);
    color: var(--gold);
    border: 1px solid var(--border-gold);
    transition: background .2s ease;
}

.article-tag:hover {
    background: rgba(255,215,0,.25);
    color: var(--gold);
    text-decoration: none;
}

.article-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

/* ─── ARTICLE BODY ──────────────────────────────────────────────────────────── */

.article-body {
    line-height: 1.8;
}

.article-body h2 {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin: 40px 0 14px;
    padding-left: 16px;
    border-left: 3px solid var(--gold);
    line-height: 1.3;
    letter-spacing: .01em;
}

.article-body h2:first-child {
    margin-top: 0;
}

.article-body h3 {
    font-family: 'Cinzel', serif;
    font-size: 17px;
    font-weight: 600;
    color: rgba(255,255,255,.9);
    margin: 28px 0 10px;
    letter-spacing: .01em;
}

.article-body p {
    margin-bottom: 16px;
    color: var(--text);
}

.article-body ul,
.article-body ol {
    margin: 12px 0 20px 20px;
    color: var(--text);
}

.article-body ul li,
.article-body ol li {
    margin-bottom: 6px;
    padding-left: 4px;
}

.article-body ul li::marker {
    color: var(--gold);
}

.article-body ol li::marker {
    color: var(--gold);
    font-weight: 600;
}

.article-body strong {
    font-weight: 600;
    color: #fff;
}

.article-body em {
    color: rgba(255,255,255,.75);
}

.article-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

/* ─── BLOCKQUOTE ────────────────────────────────────────────────────────────── */

.article-body blockquote {
    margin: 20px 0;
    padding: 14px 20px;
    border-left: 3px solid var(--gold);
    background: rgba(255,215,0,.06);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: rgba(255,255,255,.7);
    font-size: 14.5px;
}

.article-body blockquote p {
    margin-bottom: 0;
    color: inherit;
}

/* ─── CODE ──────────────────────────────────────────────────────────────────── */

.article-body code {
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 13px;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--border);
    color: #f0c070;
    padding: 2px 7px;
    border-radius: 5px;
}

.article-body pre {
    background: rgba(0,0,0,.4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    overflow-x: auto;
    margin: 20px 0;
}

.article-body pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 13.5px;
    color: var(--text);
    border-radius: 0;
}

/* ─── INFO BOX ──────────────────────────────────────────────────────────────── */

.info-box {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: rgba(255,215,0,.06);
    border: 1px solid var(--border-gold);
    border-left: 4px solid var(--gold);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 22px 0;
    font-size: 14px;
    color: rgba(255,255,255,.8);
    line-height: 1.65;
}

.info-box::before {
    content: '\f431';
    font-family: "bootstrap-icons";
    font-style: normal;
    color: var(--gold);
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.info-box p {
    margin: 0;
    color: inherit;
}

/* ─── WARN BOX ──────────────────────────────────────────────────────────────── */

.warn-box {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: rgba(255,140,0,.07);
    border: 1px solid rgba(255,140,0,.3);
    border-left: 4px solid #FF8C00;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 22px 0;
    font-size: 14px;
    color: rgba(255,255,255,.8);
    line-height: 1.65;
}

.warn-box::before {
    content: '\f33b';
    font-family: "bootstrap-icons";
    font-style: normal;
    color: #FF8C00;
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.warn-box p {
    margin: 0;
    color: inherit;
}

/* ─── FEEDBACK SECTION ──────────────────────────────────────────────────────── */

.feedback-section {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--border-gold);
}

.feedback-section h3 {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.feedback-section > p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 22px;
}

#feedback-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 560px;
}

#feedback-form input[type="email"],
#feedback-form textarea {
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 16px;
    color: var(--text);
    font-family: 'Rubik', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color .2s ease, background .2s ease;
    resize: vertical;
}

#feedback-form input[type="email"]::placeholder,
#feedback-form textarea::placeholder {
    color: var(--text-muted);
}

#feedback-form input[type="email"]:focus,
#feedback-form textarea:focus {
    border-color: var(--border-gold);
    background: rgba(255,215,0,.04);
}

#feedback-form textarea {
    min-height: 110px;
}

#feedback-form button[type="submit"] {
    align-self: flex-start;
    background: linear-gradient(135deg, #FFD700, #e6a800);
    color: #0d0d12;
    border: none;
    border-radius: 10px;
    padding: 10px 28px;
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: opacity .2s ease, transform .15s ease, box-shadow .2s ease;
    box-shadow: 0 4px 20px rgba(255,215,0,.15);
    letter-spacing: .03em;
}

#feedback-form button[type="submit"]:hover {
    opacity: .9;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(255,215,0,.25);
}

#feedback-form button[type="submit"]:active {
    transform: translateY(0);
}

#fb-result {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
}

#fb-result.success {
    background: rgba(50,200,100,.08);
    border: 1px solid rgba(50,200,100,.25);
    color: #5ddb8e;
}

#fb-result.error {
    background: rgba(255,80,80,.08);
    border: 1px solid rgba(255,80,80,.25);
    color: #f07070;
}

/* ─── HOMEPAGE ──────────────────────────────────────────────────────────────── */

.page-hero {
    margin-bottom: 48px;
}

.page-hero h1 {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 38px;
    line-height: 1.2;
    color: #fff;
    margin-bottom: 10px;
    letter-spacing: .02em;
}

.page-hero h1 span {
    color: var(--gold);
}

.page-hero .hero-sub {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 520px;
    line-height: 1.65;
}

.doc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.doc-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color .22s ease, background .22s ease, transform .2s ease, box-shadow .22s ease;
    position: relative;
    overflow: hidden;
}

.doc-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--gold-dim) 0%, transparent 60%);
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}

.doc-card:hover {
    border-color: var(--border-gold);
    background: rgba(255,255,255,.05);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
    color: inherit;
}

.doc-card:hover::before {
    opacity: 1;
}

.doc-card-category {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: .8;
}

.doc-card-title {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    line-height: 1.35;
    letter-spacing: .01em;
}

.doc-card-excerpt {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.6;
    flex: 1;
}

.doc-card-arrow {
    margin-top: 6px;
    font-size: 13px;
    color: var(--gold);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .2s ease, transform .2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.doc-card:hover .doc-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ─── SECTION DIVIDER ───────────────────────────────────────────────────────── */

.section-intro {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.section-intro p {
    color: var(--text-muted);
    font-size: 14.5px;
    max-width: 600px;
    line-height: 1.7;
}

/* ─── SCROLLBAR ─────────────────────────────────────────────────────────────── */

body::-webkit-scrollbar {
    width: 6px;
}

body::-webkit-scrollbar-track {
    background: var(--bg);
}

body::-webkit-scrollbar-thumb {
    background: rgba(255,215,0,.15);
    border-radius: 4px;
}

body::-webkit-scrollbar-thumb:hover {
    background: rgba(255,215,0,.3);
}

/* ─── RESPONSIVE ────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .doc-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
    }

    .wiki-sidebar {
        transform: translateX(-100%);
        transition: transform .28s cubic-bezier(.4,0,.2,1);
        box-shadow: none;
    }

    .wiki-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 32px rgba(0,0,0,.6);
    }

    .wiki-main {
        margin-left: 0;
    }

    .wiki-content {
        padding: 64px 20px 60px;
    }

    .page-hero h1 {
        font-size: 26px;
    }

    .article-header h1 {
        font-size: 24px;
    }

    .article-body h2 {
        font-size: 19px;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.55);
        z-index: 99;
    }

    .sidebar-overlay.visible {
        display: block;
    }
}

@media (max-width: 480px) {
    .wiki-content {
        padding: 64px 16px 48px;
    }

    .article-meta {
        flex-wrap: wrap;
        gap: 6px;
    }

    .article-date {
        margin-left: 0;
        width: 100%;
    }
}
