*,
*::before,
*::after { box-sizing: border-box; }
body, h1, li { margin: 0; padding: 0; }
h2, h3, p, ul { margin-top: 0.5rem; margin-bottom: 0.5rem; }
body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; }

.wrapper { display: flex; }

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: #222;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 20px; 
    z-index: 10;
}

.top-bar h1 {
    font-size: 1.4rem;
}

.top-right {
    margin-left: auto;
    display: flex;
    align-items: right;
}

.small-text {
    font-size: 0.75rem;         
    color: #ccc;
}
.top-bar h1 { font-size: 1.4rem; }

#sidebar {
    width: 250px;
    min-height: 100vh;
    background: #f8f8f8;
    border-right: 1px solid #ddd;
    padding-top: 60px;
    overflow-y: auto;
}
#sidebar .logo {
    width: 100%;
    text-align: center;
    padding: 10px 0;
}
#sidebar .logo img { width: 80px; height: 80px; object-fit: contain; }

.tree ul { list-style: none; padding-left: 20px; }
.tree li > a {
    display: block;
    padding: 8px 12px;
    color: #444;
    text-decoration: none;
    cursor: pointer;
}
.tree li > a:hover { background: #e0e0e0; }

.tree li > a.has-children::after {
    content: '▸';
    float: right;
    transition: transform .2s;
}
.tree li.expanded > a.has-children::after {
    transform: rotate(90deg);
}

/* Leaf‑Links können anders aussehen */
.tree li > a.leaf {
    font-weight: normal;
    color: #444;
}

.tree li ul { display: none; }
.tree li.expanded ul { display: block; }

#content {
    flex: 1;
    padding: 80px 20px 20px 20px;
}

#bg-fade {
    position: fixed;
    inset: 0;
    background: url('/img/oldhand-background.jpg') center/cover no-repeat;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    pointer-events: none;
    z-index: 5;
}
#bg-fade.visible { opacity: 0.8; }

#code-example {
    background-color: #f5f5f5;
    padding: 20px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
}

#code-example h2 {
    margin-top: 0;
    font-size: 1.2em;
    color: #333;
}

#code-example pre {
    background-color: #282c34;
    color: #abb2bf;
    padding: 10px;
    overflow-x: auto;
    border-radius: 5px;
    font-family: monospace;
    font-size: 0.9em;
    white-space: pre-wrap;
}

#code-example code {
    display: block;
}