/* Content — Wiki articles, guide rendering, sidebar */

/* Article layout — two columns */
.article-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* Wiki sidebar */
.wiki-sidebar {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: 4rem;
    position: relative;
    padding: 0.75rem;
    background: rgba(0, 212, 255, 0.015);
    backdrop-filter: blur(2px);
}

.wiki-sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 1px solid rgba(0, 212, 255, 0.1);
    box-shadow:
        inset 10px 10px 0 -8px var(--cyan),
        inset -10px 10px 0 -8px var(--cyan),
        inset 10px -10px 0 -8px var(--cyan),
        inset -10px -10px 0 -8px var(--cyan);
}

.wiki-sidebar h3 {
    display: inline-block;
    background: linear-gradient(135deg, transparent 5px, rgba(0, 212, 255, 0.1) 5px);
    padding: 0.12rem 0.5rem 0.12rem 0.4rem;
    clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
    border-bottom: 1px solid var(--cyan);
    color: var(--cyan);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.wiki-sidebar ul {
    list-style: none;
    padding: 0;
}

.wiki-sidebar li a {
    display: block;
    padding: 0.3rem 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all var(--transition);
}

.wiki-sidebar li.active a {
    color: var(--cyan);
    border-left-color: var(--cyan);
    background: rgba(0, 212, 255, 0.05);
}

.wiki-sidebar li a:hover {
    color: var(--cyan);
}

.sidebar-back {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(0, 212, 255, 0.1);
}

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

/* Article body — rendered markdown */
.article-body {
    flex: 1;
    min-width: 0;
}

.article-body h1 {
    font-size: 1.4rem;
    color: var(--cyan);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
    margin-bottom: 0.15rem;
    padding-bottom: 0;
    border-bottom: none;
}

.article-body h1 + .glow-separator-left,
.article-body h1::after {
    content: '';
    display: block;
    height: 1px;
    background: linear-gradient(90deg, var(--cyan) 30%, transparent);
    box-shadow: 0 0 6px rgba(0, 212, 255, 0.2);
    margin-bottom: 1rem;
    margin-top: 0.15rem;
}

.article-body h2 {
    display: inline-block;
    background: linear-gradient(135deg, transparent 6px, rgba(0, 212, 255, 0.08) 6px);
    padding: 0.2rem 0.8rem 0.2rem 0.7rem;
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
    border-bottom: 1px solid var(--cyan);
    color: var(--cyan);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 2rem;
    margin-bottom: 0.6rem;
}

.article-body h3 {
    font-size: 1.15rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-body p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.article-body ul {
    list-style: none;
    padding-left: 0.5rem;
}

.article-body ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.article-body ul li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    line-height: 1.6;
}

.article-body ul li::before {
    content: '';
    width: 5px;
    height: 5px;
    background: var(--cyan);
    transform: rotate(45deg);
    flex-shrink: 0;
    margin-top: 0.5rem;
}

.article-body ol li {
    margin-bottom: 0.4rem;
    line-height: 1.6;
}

.article-body strong {
    color: var(--cyan);
}

/* Article body tables */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.article-body th {
    background: var(--bg-surface);
    color: var(--cyan);
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--cyan-dim);
    font-weight: 600;
}

.article-body td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--cyan-hairline);
}

.article-body tr:nth-child(even) td {
    background: rgba(26, 26, 46, 0.4);
}

/* Article body blockquotes */
.article-body blockquote {
    background: rgba(0, 212, 255, 0.04);
    border-left: 2px solid var(--cyan);
    border-top: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0;
    padding: 0.6rem 0.8rem;
    margin: 1rem 0;
}

.article-body blockquote p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Article body code blocks */
.article-body pre {
    background: rgba(0, 8, 20, 0.85);
    border-left: 2px solid var(--cyan);
    border-top: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    margin: 0.75rem 0;
}

.article-body pre code {
    background: transparent;
    color: var(--text);
    font-size: 0.85rem;
}

.article-body code {
    color: var(--orange);
    background: rgba(0, 8, 20, 0.5);
    padding: 0.1rem 0.3rem;
    font-size: 0.85rem;
}

/* Article meta (category badge, etc.) */
.article-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Wiki category headers */
.wiki-category-header {
    font-size: 1.3rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--cyan-dim);
}

.wiki-category-header:first-of-type {
    margin-top: 1.5rem;
}

/* Guide steps */
.guide-steps {
    counter-reset: step;
}

.guide-steps .step {
    position: relative;
    padding-left: 3.5rem;
    margin-bottom: 2rem;
    counter-increment: step;
}

.guide-steps .step::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--cyan-dim);
    color: var(--cyan);
    border: 1px solid var(--cyan-glow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

/* Templates section on guide pages */
.templates-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--cyan-dim);
}

/* Responsive — wiki sidebar collapses */
@media (max-width: 768px) {
    .article-layout {
        flex-direction: column;
    }

    .wiki-sidebar {
        width: 100%;
        position: static;
        order: -1;
    }
}
