:root {
    --bg-primary: #1a1b1e;
    --bg-secondary: #252629;
    --bg-hover: #333538;
    --text-primary: #d4d4d4;
    --text-secondary: #a0a0a0;
    --text-muted: #808080;
    --accent: #5b8db8;
    --accent-hover: #78a9ce;
    --border: #3a3b3e;
    --code-bg: #2d2e31;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    line-height: 1.65;
}

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

.sidebar {
    width: 280px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    padding: 2rem 1.25rem;
    background: var(--bg-secondary);
    overflow-y: auto;
    max-height: 100vh;
    position: sticky;
    top: 0;
}

/*
 * Avatar placeholder.
 *
 * Currently renders a generic user silhouette as an inline
 * SVG data URI, so no image file is required. To use a real
 * image:
 *
 *   1. Place the file at /var/www/html/images/avatar.png
 *   2. Replace background-image below with:
 *        background-image: url("/images/avatar.png");
 *      and change background-size to `cover`.
 */

.site-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem auto;
    border-radius: 50%;
    background-color: var(--bg-hover);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b8db8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/><circle cx='12' cy='7' r='4'/></svg>");
    background-size: 55%;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid var(--border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.site-title a {
    color: var(--accent);
    text-decoration: none;
}

.search-form {
    margin-bottom: 1.5rem;
}

.search-form input {
    width: 100%;
    padding: .5rem .75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: .9rem;
}

.search-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section h3 {
    margin: 0 0 .5rem 0;
    padding: 0 .7rem;
    font-size: .85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--accent);
}

.sidebar nav a {
    display: block;
    padding: .4rem .7rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 5px;
}

.sidebar nav a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar nav a.active {
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 600;
}

.content {
    width: 100%;
    max-width: 850px;
    padding: 3rem 2.5rem;
}

.breadcrumbs {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--accent);
    text-decoration: none;
}

.content h1 {
    margin-top: 0;
    font-size: 2.2rem;
    line-height: 1.2;
    color: var(--accent);
}

.content h2 {
    margin-top: 2.5rem;
    color: var(--accent-hover);
}

.content h3 {
    margin-top: 2rem;
}

.content a {
    color: var(--accent);
}

.content code {
    background: var(--code-bg);
    padding: .15rem .35rem;
    border-radius: 3px;
    color: var(--accent-hover);
}

.content pre {
    background: var(--code-bg);
    padding: 1rem;
    overflow-x: auto;
    border-radius: 5px;
    border: 1px solid var(--border);
}

.content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.content blockquote {
    border-left: 4px solid var(--accent);
    margin-left: 0;
    padding-left: 1rem;
    color: var(--text-muted);
}

.content table {
    border-collapse: collapse;
    width: 100%;
}

.content th,
.content td {
    border: 1px solid var(--border);
    padding: .5rem .75rem;
    text-align: left;
}

.content th {
    background: var(--bg-secondary);
    color: var(--accent);
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.search-result {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.search-result h2 {
    margin: 0 0 .5rem 0;
    font-size: 1.3rem;
}

.search-result h2 a {
    color: var(--accent);
    text-decoration: none;
}

.result-section {
    display: inline-block;
    padding: .15rem .5rem;
    margin-bottom: .75rem;
    background: var(--bg-hover);
    border-radius: 3px;
    font-size: .8rem;
    color: var(--text-muted);
}

.search-result p {
    margin: 0;
    color: var(--text-secondary);
}

.no-results {
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-align: center;
}

.site-footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-size: .85rem;
}

.site-footer p {
    margin: 0;
}

@media (max-width: 700px) {
    .layout {
        display: block;
    }

    .sidebar {
        width: 100%;
        max-height: none;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1rem;
    }

    .content {
        padding: 2rem 1.25rem;
    }
}
