/* ============================================================
   Eventbuch Handbook Styles
   ============================================================ */

/* --- Wrapper --- */
.eb-handbook {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    margin-bottom: 2rem;
}

/* --- Header Bar --- */
.eb-handbook__header {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #fff;
    padding: 0;
}
.eb-handbook__header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
}
.eb-handbook__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.eb-handbook__title:hover {
    color: #e2e8f0 !important;
    text-decoration: none !important;
}
.eb-handbook__title i {
    font-size: 1.15rem;
    opacity: 0.85;
}

/* --- Mobile sidebar toggle (hidden on desktop) --- */
.eb-handbook__sidebar-toggle {
    display: none;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
}
.eb-handbook__sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}
.eb-handbook__sidebar-toggle--active {
    background: rgba(255, 255, 255, 0.25);
}

/* --- Breadcrumb --- */
.eb-handbook__breadcrumb {
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.55rem 1.25rem;
    font-size: 0.82rem;
}
.eb-handbook__breadcrumb ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}
.eb-handbook__breadcrumb li {
    display: flex;
    align-items: center;
    color: #718096;
}
.eb-handbook__breadcrumb li + li::before {
    content: "/";
    margin: 0 0.45rem;
    color: #cbd5e0;
    font-size: 0.78rem;
}
.eb-handbook__breadcrumb a {
    color: #4a5568;
    text-decoration: none;
    transition: color 0.15s ease;
}
.eb-handbook__breadcrumb a:hover {
    color: var(--eb-primary, #3182ce);
    text-decoration: underline;
}
.eb-handbook__breadcrumb-current {
    color: #2d3748;
    font-weight: 600;
}

/* --- Root Page --- */
.eb-handbook__root {
    padding: 1.5rem 1.5rem 1.75rem;
}
.eb-handbook__intro {
    margin-bottom: 1.5rem;
    line-height: 1.65;
}

/* --- Layout (Sidebar + Content) --- */
.eb-handbook__layout {
    display: flex;
    min-height: 400px;
}

/* --- Sidebar --- */
.eb-handbook__sidebar {
    width: 280px;
    min-width: 280px;
    border-right: 1px solid #e2e8f0;
    background: #f9fafb;
}
.eb-handbook__sidebar-inner {
    position: sticky;
    top: 10px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 0.75rem 0;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
}
.eb-handbook__sidebar-inner::-webkit-scrollbar {
    width: 5px;
}
.eb-handbook__sidebar-inner::-webkit-scrollbar-track {
    background: transparent;
}
.eb-handbook__sidebar-inner::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

/* --- Main Content --- */
.eb-handbook__main {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 1.75rem 1.75rem;
}
.eb-handbook__content {
    min-height: 120px;
    line-height: 1.55;
}
.eb-handbook__content .eb-heading-standard {
    margin-top: 1.3em;
    margin-bottom: 0.2em;
}
.eb-handbook__content .eb-heading-standard__title {
    margin-bottom: 1.25em;
    padding-bottom: 0.35em;
}
.eb-handbook__content .eb-heading-standard:first-child {
    margin-top: 0 !important;
}

/* Neutralize theme section/container styles inside handbook content */
.eb-handbook__content section {
    padding: 0 !important;
    border-bottom: none !important;
    background: none !important;
    background-attachment: initial !important;
    background-size: initial !important;
    position: static !important;
}
.eb-handbook__content section:after,
.eb-handbook__content section:before {
    display: none !important;
}
.eb-handbook__content section > .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
}
/* Hide stray <br> between heading and content */
.eb-handbook__content > .eb-heading-standard + br {
    display: none !important;
}
.eb-handbook__content > br:first-child {
    display: none !important;
}

/* Intro area (root page) same treatment */
.eb-handbook__intro section {
    padding: 0 !important;
    border-bottom: none !important;
    background: none !important;
    position: static !important;
}
.eb-handbook__intro section > .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
}

/* --- TOC Styles (shared) --- */
.handbook-toc ul {
    padding-left: 0;
    list-style: none;
    margin-bottom: 0;
}
.handbook-toc li {
    margin: 0;
    padding: 0;
}
.handbook-toc a {
    display: block;
    padding: 5px 12px;
    border-radius: 0;
    text-decoration: none !important;
    color: #4a5568;
    font-size: 0.88rem;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    line-height: 1.4;
}
.handbook-toc a:hover {
    background: #edf2f7;
    color: #2d3748;
    border-left-color: #cbd5e0;
    text-decoration: none !important;
}
.handbook-toc a.active {
    font-weight: 600;
    color: var(--eb-primary, #3182ce);
    background: rgba(49, 130, 206, 0.06);
    border-left-color: var(--eb-primary, #3182ce);
}
.handbook-toc-number {
    font-variant-numeric: tabular-nums;
    margin-right: 5px;
    opacity: 0.65;
    font-size: 0.82em;
}
.handbook-toc-level-1 > li > a { font-weight: 500; }
.handbook-toc-level-2 a { padding-left: 24px; font-size: 0.86rem; }
.handbook-toc-level-3 a { padding-left: 38px; font-size: 0.84rem; }
.handbook-toc-level-4 a { padding-left: 52px; font-size: 0.82rem; }
.handbook-toc-level-5 a { padding-left: 66px; font-size: 0.82rem; }

/* TOC article entries (leaf page children) */
.handbook-toc-article a {
    font-size: 0.84rem;
    color: #718096;
}
.handbook-toc-article a.active {
    color: var(--eb-primary, #3182ce);
}

/* Root TOC (wider, more spacious) */
.handbook-toc--root {
    max-width: 700px;
}
.handbook-toc--root a {
    padding: 7px 12px;
    font-size: 0.92rem;
}

/* --- Nav Buttons --- */
.eb-handbook__nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}
.eb-handbook__nav-buttons > div,
.eb-handbook__nav-buttons > span {
    flex: 1;
}

/* ============================================================
   Responsive: Mobile
   ============================================================ */
@media (max-width: 991px) {
    .eb-handbook__sidebar-toggle {
        display: flex;
    }

    .eb-handbook__layout {
        flex-direction: column;
    }

    .eb-handbook__sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        display: none;
    }
    .eb-handbook__sidebar--open {
        display: block;
    }

    .eb-handbook__sidebar-inner {
        position: static;
        max-height: 50vh;
        overflow-y: auto;
        padding: 0.5rem 0;
    }

    .eb-handbook__main {
        padding: 1.25rem 1rem 1.5rem;
    }

    .eb-handbook__breadcrumb {
        padding: 0.45rem 1rem;
        font-size: 0.78rem;
    }

    .eb-handbook__nav-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 576px) {
    .eb-handbook__header-inner {
        padding: 0.6rem 0.85rem;
    }
    .eb-handbook__title {
        font-size: 0.95rem;
    }
    .eb-handbook__toggle-label {
        display: none;
    }
    .eb-handbook__root {
        padding: 1rem;
    }
}
