/* ══════════════════════════════════════════════════════════════
   Tutorial pages — shared styles (supplements ../style.css)
   ══════════════════════════════════════════════════════════════ */

/* ── Floating left-margin nav ────────────────────────────── */
.sidebar {
    float: left;
    width: var(--nav-width, 180px);
    margin-left: calc(-1 * var(--nav-width, 180px) - 40px);
    position: sticky;
    top: 2rem;
}
.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}
.sidebar-title a {
    color: var(--fg);
    text-decoration: none;
    background: none;
}
.sidebar-title a:hover { color: var(--accent); }
.sidebar-subtitle {
    font-size: 0.8rem;
    color: var(--fg-dim);
    font-style: italic;
    margin-bottom: 1.2rem;
}
.sidebar-subtitle a {
    color: var(--fg-dim);
    text-decoration: none;
    background: none;
}
.sidebar-subtitle a:hover { color: var(--accent); }
.sidebar nav ul {
    list-style: none;
    padding: 0;
}
.sidebar nav li {
    margin-bottom: 0.15rem;
}
.sidebar nav a {
    font-size: 0.82rem;
    color: var(--fg-dim);
    text-decoration: none;
    background: none;
    display: block;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    line-height: 1.4;
}
.sidebar nav a:hover {
    color: var(--accent);
    background: var(--code-bg);
}
.sidebar nav a.active {
    color: var(--accent);
    font-weight: 600;
    background: var(--code-bg);
}
.sidebar nav .nav-label {
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--fg-dim);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.6rem 0.5rem 0.2rem;
}

/* ── Prev/Next nav ──────────────────────────────────────── */
.tutorial-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
    font-size: 0.95rem;
}
.tutorial-nav a {
    background: none;
}
.tutorial-nav .prev::before { content: '\2190\00a0'; }
.tutorial-nav .next::after { content: '\00a0\2192'; }

/* ── Responsive: collapse sidebar on narrow screens ─────── */
@media (max-width: 1100px) {
    .sidebar {
        float: none;
        margin-left: 0;
        width: auto;
        position: static;
        margin-bottom: 2rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--rule);
    }
    .sidebar nav ul { display: flex; flex-wrap: wrap; gap: 0.2rem 0.8rem; }
    .sidebar nav .nav-label { padding-top: 0.3rem; }
}
@media (max-width: 700px) {
    .query-pair { flex-direction: column; }
}
