:root {
    --sidebar-width: 260px;
    --header-height: 58px;
    --banner-height: 56px;
    --total-header: calc(var(--header-height) + var(--banner-height));
    --brand-primary: #0d6efd;
}

body {
    min-height: 100vh;
    background-color: #f8f9fa;
}

/* ── Header ── */
.site-header {
    height: var(--header-height);
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.site-header h1 {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: .02em;
}

/* ── Global Banner ── */
.global-banner {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: var(--banner-height);
    z-index: 1025;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

/* ── Sidebar ── */
@media (min-width: 768px) {
    .sidebar {
        position: fixed;
        top: var(--total-header);
        left: 0;
        width: var(--sidebar-width);
        bottom: 0;
        background: #fff;
        border-right: 1px solid #dee2e6;
        overflow-y: auto;
        padding: 1.25rem 0;
        z-index: 1020;
    }
}

.sidebar .nav-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6c757d;
    padding: .25rem 1.25rem .5rem;
}

.sidebar .nav-link {
    color: #343a40;
    padding: .5rem 1.25rem;
    font-size: .9rem;
    border-left: 3px solid transparent;
    transition: background .15s, border-color .15s;
}

.sidebar .nav-link:hover {
    background: #f0f4ff;
    color: var(--brand-primary);
}

.sidebar .nav-link.active {
    background: #e8f0fe;
    color: var(--brand-primary);
    border-left-color: var(--brand-primary);
    font-weight: 600;
}

.sidebar .nav-link i {
    margin-right: .45rem;
    opacity: .7;
}

/* ── Main content ── */
.main-content {
    margin-top: var(--total-header);
    padding: 2rem 2.5rem;
    min-height: calc(100vh - var(--total-header));
}

@media (min-width: 768px) {
    .main-content {
        margin-left: var(--sidebar-width);
    }
}

.content-card {
    background: #fff;
    border-radius: .5rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
    padding: 2rem 2.25rem;
    max-width: 860px;
}

@media (max-width: 767.98px) {
    .main-content {
        padding: 1.5rem 1rem;
    }

    .content-card {
        padding: 1.5rem 1.25rem;
    }
}

/* ── Page content for non-sidebar pages ── */
.page-content {
    margin-top: var(--total-header);
    padding: 2rem 1rem;
    min-height: calc(100vh - var(--total-header));
}

/* ── Markdown content typography ── */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    font-weight: 700;
}

.markdown-body h1 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.markdown-body h2 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
}

.markdown-body h3 {
    font-size: 1.05rem;
    margin-top: 1.25rem;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 1.25rem;
}

.markdown-body blockquote {
    border-left: 4px solid #0d6efd;
    padding-left: 1rem;
    color: #555;
    font-style: italic;
}

/* ── Password modal overlay ── */
.modal-backdrop.show {
    opacity: .7;
}

/* Lesson pages layout */
.accordion-button.header-completed {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
}

.accordion-button.header-completed::after {
    margin-left: 0.75rem !important;
}

.lesson-carousel-image {
    height: 350px;
    object-fit: contain;
    width: 100%;
}

/* ── Skip to Content Link ── */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--brand-primary);
    color: white;
    padding: 10px 15px;
    z-index: 9999;
    font-weight: bold;
    text-decoration: none;
    transition: top 0.2s ease-in-out;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #fff;
    outline-offset: -3px;
}

