/* L2JMobius Wiki - shared stylesheet (l2wiki-style left-sidebar layout) */

:root {
    --gold: #E8C547;
    --gold-bright: #F5D76E;
    --gold-deep: #C9A227;
    --ink: #0F0B14;
    --ink-soft: #1A1322;
    --panel: rgba(28, 22, 38, 0.72);
    --panel-strong: rgba(20, 15, 28, 0.88);
    --border: rgba(232, 197, 71, 0.28);
    --text: #ECE6D8;
    --text-dim: #B5AEA0;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Source Sans Pro', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text);
    background: var(--ink);
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
}
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: url('../images/background.jpg') no-repeat center center;
    background-size: cover;
    transform: scale(1.05) translateZ(0);
    animation: slowZoom 30s ease-in-out infinite alternate;
}
.bg-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at top, rgba(232, 197, 71, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(120, 40, 160, 0.15) 0%, transparent 60%),
        linear-gradient(180deg, rgba(15, 11, 20, 0.55) 0%, rgba(15, 11, 20, 0.85) 60%, rgba(15, 11, 20, 0.95) 100%);
}
@keyframes slowZoom {
    from { transform: scale(1.05) translateY(0); }
    to { transform: scale(1.12) translateY(-2%); }
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }

nav.topnav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(180deg, rgba(15, 11, 20, 0.96) 0%, rgba(15, 11, 20, 0.92) 100%);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: center;
    padding: 0;
}
nav.topnav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
}
nav.topnav ul li a {
    display: inline-block;
    padding: 18px 22px;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.95em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text);
    position: relative;
    transition: color 0.25s ease;
}
nav.topnav ul li a::after {
    content: '';
    position: absolute;
    left: 22px; right: 22px; bottom: 12px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}
nav.topnav ul li a:hover { color: var(--gold-bright); }
nav.topnav ul li a:hover::after { transform: scaleX(1); }
nav.topnav ul li a.active { color: var(--gold); }
nav.topnav ul li a.active::after { transform: scaleX(1); }
nav.topnav ul li a.cta {
    color: var(--ink);
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
    margin: 8px 12px;
    border-radius: 4px;
    padding: 10px 22px;
    box-shadow: 0 4px 14px rgba(232, 197, 71, 0.25);
}
nav.topnav ul li a.cta:hover {
    color: var(--ink);
    background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 100%);
    box-shadow: 0 6px 20px rgba(232, 197, 71, 0.4);
}
nav.topnav ul li a.cta::after { display: none; }

/* ===== Wiki two-column layout ===== */
.wiki-wrap {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    align-items: start;
    min-height: calc(100vh - 60px);
    max-width: 1500px;
    margin: 0 auto;
}

.side-toggle {
    display: none;
    width: 100%;
    padding: 14px 18px;
    background: rgba(15, 11, 20, 0.92);
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-size: 0.85em;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    text-align: left;
    cursor: pointer;
}
.side-toggle::before {
    content: '\2630';
    margin-right: 12px;
    font-size: 1.1em;
}

.wiki-side {
    position: sticky;
    top: 60px;
    padding: 30px 22px 50px;
    border-right: 1px solid var(--border);
    background: rgba(15, 11, 20, 0.62);
    backdrop-filter: blur(6px);
    height: calc(100vh - 60px);
    overflow-y: auto;
}
.wiki-side::-webkit-scrollbar { width: 6px; }
.wiki-side::-webkit-scrollbar-track { background: transparent; }
.wiki-side::-webkit-scrollbar-thumb {
    background: rgba(232, 197, 71, 0.2);
    border-radius: 3px;
}
.wiki-side::-webkit-scrollbar-thumb:hover { background: rgba(232, 197, 71, 0.35); }

.side-brand {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 0.95em;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    text-align: center;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
    text-shadow: 0 0 16px rgba(232, 197, 71, 0.25);
}
.side-group { margin-bottom: 24px; }
.side-group h4 {
    font-family: 'Cinzel', serif;
    font-size: 0.7em;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--gold);
    margin: 0 0 8px 10px;
    opacity: 0.85;
}
.side-group ul { list-style: none; margin: 0; padding: 0; }
.side-group li { margin: 0; }
.side-group li a {
    display: block;
    padding: 7px 12px 7px 14px;
    color: var(--text-dim);
    font-size: 0.94em;
    line-height: 1.35;
    border-left: 2px solid transparent;
    border-radius: 0 4px 4px 0;
    transition: all 0.2s ease;
}
.side-group li a:hover {
    color: var(--gold-bright);
    background: rgba(232, 197, 71, 0.05);
    border-left-color: var(--gold-deep);
}
.side-group li a.on {
    color: var(--gold);
    background: rgba(232, 197, 71, 0.10);
    border-left-color: var(--gold);
    font-weight: 600;
}

.wiki-main {
    padding: 50px 50px 80px;
    min-width: 0;
}
.wiki-page-head {
    border-bottom: 1px solid var(--border);
    padding-bottom: 26px;
    margin-bottom: 36px;
}
.wiki-page-head .page-eyebrow {
    font-family: 'Cinzel', serif;
    font-size: 0.78em;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.85;
    margin-bottom: 12px;
}
.wiki-page-head h1 {
    font-family: 'Cinzel', serif;
    font-weight: 800;
    font-size: clamp(1.8em, 3.6vw, 2.6em);
    color: var(--gold);
    margin: 0 0 14px;
    text-shadow: 2px 3px 0 rgba(0, 0, 0, 0.7);
    letter-spacing: 0.02em;
}
.wiki-page-head p.lead {
    font-family: 'Philosopher', serif;
    font-style: italic;
    font-size: 1.15em;
    color: var(--text);
    margin: 0 0 6px;
    line-height: 1.55;
    max-width: 760px;
}
.wiki-page-head p.sub {
    color: var(--text-dim);
    font-size: 1em;
    margin: 0;
    line-height: 1.65;
    max-width: 760px;
}

.wiki-page-body { max-width: 920px; }

.prose { color: var(--text-dim); line-height: 1.78; font-size: 1.02em; }
.prose p { margin: 0 0 16px; }
.prose strong { color: var(--text); }
.prose em { color: var(--text); font-style: italic; }
.prose h2 {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 1.5em;
    letter-spacing: 0.04em;
    margin: 40px 0 16px;
    text-shadow: 1px 2px 0 rgba(0, 0, 0, 0.6);
    scroll-margin-top: 80px;
}
.prose h3 {
    font-family: 'Cinzel', serif;
    color: var(--gold-bright);
    font-size: 1.25em;
    letter-spacing: 0.04em;
    margin: 32px 0 12px;
    text-shadow: 1px 2px 0 rgba(0, 0, 0, 0.6);
    scroll-margin-top: 80px;
}
.prose h4 {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 1em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 26px 0 10px;
}
.prose ul, .prose ol { padding-left: 22px; margin: 12px 0 20px; }
.prose li { margin-bottom: 8px; line-height: 1.7; }
.prose li::marker { color: var(--gold); }
.prose a { border-bottom: 1px dotted rgba(232, 197, 71, 0.5); padding-bottom: 1px; }
.prose a:hover { border-bottom-color: var(--gold-bright); }
.prose code, .step code, code.kbd {
    font-family: 'Source Code Pro', monospace;
    background: rgba(232, 197, 71, 0.08);
    border: 1px solid var(--border);
    padding: 2px 7px;
    border-radius: 3px;
    color: var(--gold-bright);
    font-size: 0.92em;
}

.divider {
    width: 80px;
    height: 1px;
    margin: 24px 0 26px;
    background: linear-gradient(90deg, var(--gold), transparent);
}

pre.whiteboard {
    font-family: 'Source Code Pro', 'Consolas', 'Menlo', monospace;
    background: rgba(10, 7, 14, 0.92);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    border-radius: 6px;
    padding: 20px 22px;
    color: var(--text);
    line-height: 1.5;
    font-size: 0.84em;
    overflow-x: auto;
    box-shadow:
        inset 0 0 30px rgba(0, 0, 0, 0.45),
        0 8px 24px rgba(0, 0, 0, 0.35);
    white-space: pre;
    margin: 18px 0 26px;
}

.callout {
    background: var(--panel);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    border-radius: 6px;
    padding: 18px 22px;
    margin: 22px 0;
    color: var(--text-dim);
    line-height: 1.7;
}
.callout strong { color: var(--gold-bright); }
.callout p { margin: 0 0 10px; }
.callout p:last-child { margin: 0; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 18px 0 26px; }
.feature-grid.two { grid-template-columns: repeat(2, 1fr); }
.card {
    background: rgba(28, 22, 38, 0.92);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px 22px;
    position: relative;
    overflow: hidden;
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0;
    transition: opacity 0.35s ease;
}
.card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}
.card:hover::before { opacity: 1; }
.card h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.05em;
    color: var(--gold-bright);
    margin: 0 0 10px;
    letter-spacing: 0.04em;
}
.card p { font-size: 0.94em; color: var(--text-dim); line-height: 1.65; margin: 0; }
.card .card-num {
    display: inline-block;
    font-family: 'Cinzel', serif;
    font-size: 0.74em;
    letter-spacing: 0.18em;
    color: var(--gold);
    margin-bottom: 6px;
}

.timeline {
    position: relative;
    padding-left: 28px;
    border-left: 1px solid var(--border);
    margin: 24px 0 12px;
}
.timeline-item { position: relative; margin-bottom: 26px; padding-left: 6px; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -36px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
    border: 2px solid var(--ink);
    box-shadow: 0 0 0 1px var(--border), 0 0 12px rgba(232, 197, 71, 0.3);
}
.timeline-date {
    font-family: 'Cinzel', serif;
    font-size: 0.78em;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 4px;
    display: block;
}
.timeline-title {
    font-family: 'Philosopher', serif;
    font-size: 1.08em;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.timeline-body { color: var(--text-dim); line-height: 1.65; font-size: 0.98em; }

.step-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 18px 0 26px; }
.step {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
    position: relative;
}
.step-num {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: var(--gold);
    font-size: 0.78em;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.step h4 {
    font-family: 'Philosopher', serif;
    color: var(--text);
    font-size: 1.15em;
    margin: 0 0 10px;
}
.step p, .step li { color: var(--text-dim); line-height: 1.7; font-size: 0.97em; }
.step ul, .step ol { padding-left: 20px; margin: 8px 0; }
.step li::marker { color: var(--gold); }

.license-badges { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    background: rgba(232, 197, 71, 0.08);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 0.76em;
    letter-spacing: 0.15em;
    color: var(--gold);
}

footer {
    background: linear-gradient(180deg, rgba(15, 11, 20, 0.85), rgba(8, 6, 12, 0.95));
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    text-align: center;
    padding: 40px 20px 30px;
    font-size: 0.92em;
}
footer .foot-brand {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    font-size: 1.15em;
    letter-spacing: 0.3em;
    margin-bottom: 14px;
}
footer p { margin: 6px 0; line-height: 1.7; }

.page-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 50px 0 10px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}
.page-nav a {
    display: block;
    padding: 16px 20px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    transition: all 0.25s ease;
}
.page-nav a:hover {
    border-color: var(--gold);
    background: rgba(232, 197, 71, 0.06);
    transform: translateY(-2px);
}
.page-nav .nav-dir {
    font-family: 'Cinzel', serif;
    font-size: 0.7em;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 6px;
}
.page-nav .nav-title {
    font-family: 'Philosopher', serif;
    font-size: 1.05em;
    color: var(--text);
}
.page-nav a:hover .nav-title { color: var(--gold-bright); }
.page-nav .nav-next { text-align: right; }
.page-nav .nav-empty { visibility: hidden; }

@media (max-width: 980px) {
    .wiki-wrap { grid-template-columns: 1fr; }
    .side-toggle { display: block; }
    .wiki-side {
        position: static;
        height: auto;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 22px 18px;
        display: none;
    }
    .wiki-side.open { display: block; }
    .wiki-main { padding: 30px 20px 60px; }
    .feature-grid, .feature-grid.two { grid-template-columns: 1fr; }
    pre.whiteboard { font-size: 0.78em; }
    .page-nav { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    nav.topnav ul li a { padding: 14px 14px; font-size: 0.82em; }
    nav.topnav ul li a.cta { margin: 6px 8px; padding: 10px 16px; }
    pre.whiteboard { font-size: 0.72em; padding: 14px 14px; }
    .wiki-main { padding: 24px 14px 50px; }
    .wiki-page-head h1 { font-size: 1.5em; }
}

/* Search - sidebar input */
.side-search {
    margin: 0 6px 22px;
}
.side-search input[type="search"] {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(232, 197, 71, 0.25);
    border-radius: 4px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.88em;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.side-search input[type="search"]:focus {
    border-color: var(--gold);
    background: rgba(232, 197, 71, 0.06);
}
.side-search input[type="search"]::placeholder {
    color: var(--text-dim);
    opacity: 0.6;
}

/* Search - page form */
.page-search {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}
.page-search input[type="search"] {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(232, 197, 71, 0.3);
    border-radius: 4px;
    color: var(--text);
    font-family: inherit;
    font-size: 1em;
    outline: none;
}
.page-search input[type="search"]:focus {
    border-color: var(--gold);
    background: rgba(232, 197, 71, 0.06);
}
.page-search button {
    padding: 10px 22px;
    background: var(--gold);
    color: var(--ink);
    border: none;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-size: 0.85em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease;
}
.page-search button:hover {
    background: var(--gold-bright);
}

/* Search - results */
.search-summary {
    color: var(--text-dim);
    font-size: 0.92em;
    margin-bottom: 18px;
}
.search-results {
    list-style: none;
    margin: 0;
    padding: 0;
}
.search-results li {
    padding: 14px 0;
    border-bottom: 1px solid rgba(232, 197, 71, 0.10);
}
.search-results li:last-child {
    border-bottom: none;
}
a.search-hit {
    font-family: 'Cinzel', serif;
    font-size: 1.05em;
    color: var(--gold);
    text-decoration: none;
    margin-right: 10px;
}
a.search-hit:hover {
    color: var(--gold-bright);
    text-decoration: underline;
}
.search-file {
    color: var(--text-dim);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82em;
    opacity: 0.65;
}
.search-snippet {
    color: var(--text);
    margin: 6px 0 0;
    font-size: 0.94em;
    line-height: 1.55;
}
.search-snippet mark {
    background: rgba(232, 197, 71, 0.22);
    color: var(--gold-bright);
    padding: 0 2px;
    border-radius: 2px;
}
