* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

a {
    color: inherit;
}


html {
    scroll-behavior: smooth;
}

html {
    overscroll-behavior-y: none;
}

body {
    margin: 0;
    font-family: 'Noto Sans', sans-serif;   
    /* line-height: 1.6; */
    font-size: 16px;
    max-width: 100%;
    font-weight: 400;
    color: #333;
}

.page {
    max-width: 900px;
    margin: 0 auto;
    padding: 50px;
    display: flex;
    gap: 50px;
    width: 100%;
}

article {
    flex: 1;
    min-width: 0;
}

.h1-main-title {
    margin-bottom: 20px;
    margin-top: 20px !important;
}

.logo-container {
    margin-bottom: 20px;
    line-height: 50px;

}

/* =========================
           TOC
           ========================= */

.toc-container {
    width: 200px;
    flex-shrink: 0;

    position: sticky;
    top: 0px;
    align-self: flex-start;
    font-size: 0.9rem;
    /* min-width: 200px; */
    flex-basis: calc((95vw - 800px) /2);
    padding-top: 50px;
}

.toc-inner {
    border-left: 1px solid #ddd;

}

.toc ul {
    list-style: none;
    margin: 0;
    padding-left: 0;

}

.toc ul ul a {
    padding-left: 25px;
}

.toc li {
    margin: 2px 0;
}

.toc a {
    display: block;

    padding: 0 10px;

    border-left: 2px solid transparent;

    color: #222;
    text-decoration: none;

    transition:
        color 0.15s,
        border-color 0.15s;
}

.toc a:hover {
    color: #000;
}

/* Active heading */
.toc a.active {
    color: #2563eb;
    border-left-color: #2563eb;
}


/* =========================
           Markdown
           ========================= */

article a {
    color: #2563eb;
}

.broken-link {
    color: #888;
}

pre {
    overflow-x: auto;
    padding: 15px;
    background: #f5f5f5;
}

code {
    font-family: monospace;
}

img {
    max-width: 100%;
}




/* Header */

.site-header {
    background: #ecf0f1;
    font-family: "Raleway", sans-serif;

}

.site-header .container {
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 10px 15px;
}

.logo {
    font-size: 1.7rem;
    font-weight: 700;
    text-decoration: none;
    color: #2563eb;
    font-family: 'Raleway', sans-serif;
}

.site-title {
    color: #666;
    font-size: 1rem;
}


/* Main */




/* Footer */

.site-footer {
    background: #ecf0f1;
    border-top: 1px solid #d5dadd;
    color: #777;
    font-size: 0.85rem;
}

.site-footer .container {
    min-height: 60px;
    display: flex;
    align-items: center;
}


/* Mobile */
@media (max-width: 1000px) {
    .toc {
        display: none
    }
}

@media (max-width: 600px) {
    .container {
        width: min(100% - 24px, 1200px);
    }

    .site-header .container {
        min-height: 60px;
    }
}


/* =========================================================
   Knowledge layout
   ========================================================= */

.site-header {
    background: #ecf0f1;
    font-family: "Raleway", sans-serif;

}

.site-header .container {
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 10px 15px;
}

.logo {
    font-size: 1.7rem;
    font-weight: 700;
    text-decoration: none;
    color: #2563eb;
    font-family: 'Raleway', sans-serif;
}

.site-title {
    color: #666;
    font-size: 1rem;
}

/* =========================================================
   File sidebar
   ========================================================= */

main {
    display: flex;
}

.page {
    flex: 1;
}


.file-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100dvh;
  overflow-y: auto;
  border-right: 1px solid #ddd;
  padding-left: 80px;
  padding-right: 20px;
  padding-top: 50px;
  padding-left: 20px;
  flex-basis: calc((95vw - 800px) / 2);
  background: #ecf0f1;
  font-size: 14px;
}

.file-sidebar-inner {
    padding: 12px 8px 24px;
}

.sidebar-title {
    display: flex;
    align-items: center;
    padding: 0 10px;
    margin-bottom: 8px;
    color: #858b95;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}


/* Remove browser defaults */
.file-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-tree ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Folder and note rows */
.file-tree li {
    margin: 0;
    padding: 0;
}

.file-tree summary,
.file-tree a {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 29px;
    padding: 4px 8px;
    border-radius: 5px;
    color: #555c66;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: background-color 0.12s ease;
}

.file-tree summary {
    list-style: none;
    user-select: none;
}

.file-tree summary::-webkit-details-marker {
    display: none;
}

/* Hover */
.file-tree summary:hover,
.file-tree a:hover {
    background: #e9ebee;
    color: #24292f;
}

/* Folder chevron */
.tree-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 14px;
    height: 16px;
    color: #858b95;
    transition: transform 0.15s ease;
}

.tree-folder details[open] > summary .tree-chevron {
    transform: rotate(90deg);
}

/* Icons */
.tree-icon {
    flex-shrink: 0;
    color: #858b95;
}

.folder-svg {
    color: #8a9099;
}

.note-svg {
    color: #9298a2;
}

/* Labels */
.tree-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Folder children indentation */
.tree-folder > details > ul {
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid #e1e4e8;
}

/* Note links */
.tree-note a {
    width: 100%;
}

/* Active note */
.file-tree a.active {
    background: #e1e7f0;
    color: #2459a9;
    font-weight: 600;
}

.file-tree a.active .note-svg {
    color: #3973c6;
}

/* Keep the active note visible */
.file-tree a.active:hover {
    background: #d9e2ef;
}

/* Scrollbar */
.file-sidebar::-webkit-scrollbar {
    width: 6px;
}

.file-sidebar::-webkit-scrollbar-thumb {
    background: #d0d4da;
    border-radius: 4px;
}

.file-sidebar::-webkit-scrollbar-thumb:hover {
    background: #b7bdc6;
}

.sidebar-toggle {
    position: fixed;
    top: 85px;
    left: 12px;
    z-index: 1000;

    width: 32px;
    height: 32px;

    padding: 0;

    border: 1px solid #d5dadd;
    background: #ecf0f1;

    color: #555;
    font-size: 16px;

    cursor: pointer;
}


.sidebar-toggle:hover {
    background: #e2e6e7;
}


/* Sidebar hidden */

.knowledge-layout.sidebar-hidden {
    grid-template-columns: minmax(0, 1fr) 240px;
}

.knowledge-layout.sidebar-hidden .file-sidebar {
    display: none;
}


/* When sidebar is visible, button sits over it */

.knowledge-layout:not(.sidebar-hidden) .sidebar-toggle {
    left: 250px;
}



.overlay {
    display: none;
}

.overlay.visible {
    display: none;
}

/* Mobile */

@media (max-width: 1300px) {
    .toc-container {
        display: none;

    }

    .file-sidebar {
        flex-basis: calc(100vw - 840px)
    }
}

@media (max-width: 1250px) {
    .page {
        padding: 50px 20px;
    }
}

.mobile-header {
    display: none;
}

@media (max-width: 1100px) {
    .mobile-header {
        display: flex;
        position: fixed;

        top: 0;
        left: 0;
        right: 0;

        height: 52px;

        align-items: center;

        padding: 0 14px;

        background: #ecf0f1;
        border-bottom: 1px solid #ddd;

        z-index: 900;
    }

    .menu-button {
        display: flex;

        width: 34px;
        height: 34px;

        padding: 7px 6px;

        flex-direction: column;
        justify-content: space-between;

        background: #fff;
        border: 1px solid #ccc;

        cursor: pointer;
    }

    .menu-button span {
        display: block;

        width: 100%;
        height: 2px;

        background: #222;
    }

    .menu-button:hover {
        background: #f5f5f5;
    }
}

@media (max-width: 1100px) {
    .file-sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.1s;
        width: 75%;
        z-index: 2;
        overflow-y: scroll;
        top: 0;
        /* height: 100lvh; */
        height: 100%;   
    
    }

    .sidebar-visible {
        transform: translateX(0%);
    }

    .overlay {
        background-color: #444;
        opacity: 0.5;
        position: fixed;
        top: 0;
        bottom: 0;
        right: 0;
        left: 0;
        display: none;
        /* height: 100lvh; */
        z-index: 1;
        height: 100%;
    }

    .overlay.visible {
        display: block;
    }
    .page {
        margin-top: 20px;
    }
}

.sidebar-hidden.file-sidebar {
    display: none;
}