/* ============================================================
   ENTERPRISE AI ENGINEERING HANDBOOK
   Reader Experience
   ============================================================ */

/* Main page background */
.md-main {
    background: #f8fafc;
}

/* ============================================================
   CONTENT READING SURFACE
   ============================================================ */

.md-content {
    background: #ffffff;
}

.md-content__inner {
    padding-top: 1.5rem;
}


/* ============================================================
   PAGE HEADINGS
   ============================================================ */

.md-content h1 {
    font-size: 2.45rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;

    margin-top: 0.75rem;
    margin-bottom: 1.25rem;
}

/* ============================================================
   PART / CHAPTER INTRODUCTION
   ============================================================ */

.md-content blockquote {
    margin: 1rem 0 1.75rem;

    padding: 0.25rem 0 0.25rem 1rem;

    border-left: 3px solid
        var(--md-primary-fg-color);

    color: #6b7280;

    font-size: 1rem;

    line-height: 1.75;
}

/* ============================================================
   BODY TEXT
   ============================================================ */

.md-content p {
    line-height: 1.75;
}

.md-content li {
    line-height: 1.65;
}

/* ============================================================
   READING WIDTH
   ============================================================ */

.md-content__inner {
    max-width: 1000px;
}

.md-content img {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   LEFT SIDEBAR
   ============================================================ */

.md-sidebar--primary {
    border-right: 1px solid #e5e7eb;
}

.md-sidebar--primary .md-sidebar__scrollwrap {
    scrollbar-width: thin;
}

.md-sidebar--primary .md-nav__link {
    line-height: 1.45;
}

/* Active navigation item */

.md-sidebar--primary
.md-nav__link--active {
    font-weight: 700;
}

.md-sidebar--primary
.md-nav__item--active > .md-nav__link {
    border-radius: 4px;
}

/* ============================================================
   TABLE OF CONTENTS
   ============================================================ */

.md-sidebar--secondary {
    font-size: 0.85rem;
}

.md-sidebar--secondary .md-nav__title {
    font-size: 0.75rem;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.05em;
}

/* ============================================================
   HANDBOOK IMAGES
   ============================================================ */

.md-content img {
    border-radius: 10px;
}

.md-content img {
    box-shadow:
        0 4px 18px rgba(0, 0, 0, 0.08);
}


/* ============================================================
   DARK MODE
   ============================================================ */

[data-md-color-scheme="slate"] .md-main {
    background: #111827;
}

[data-md-color-scheme="slate"] .md-content {
    background: #111827;
}

/* ============================================================
   DARK MODE
   ============================================================ */

[data-md-color-scheme="slate"] .md-main {
    background: #111827;
}

[data-md-color-scheme="slate"] .md-content {
    background: #111827;
}

[data-md-color-scheme="slate"] .md-content {
    color: #d1d5db;
}

[data-md-color-scheme="slate"]
.md-content blockquote {
    color: #b8c0cc;

    border-left-color:
        var(--md-primary-fg-color);
}

[data-md-color-scheme="slate"]
.md-sidebar--primary {
    border-right-color: #263244;
}

[data-md-color-scheme="slate"]
.md-sidebar--primary .md-nav__link {
    color: #cbd5e1;
}

[data-md-color-scheme="slate"]
.md-sidebar--primary
.md-nav__link--active {
    color: #60a5fa;
}


[data-md-color-scheme="slate"]
.md-sidebar--secondary
.md-nav__link {
    color: #cbd5e1;
}

[data-md-color-scheme="slate"]
.md-sidebar--secondary
.md-nav__link--active {
    color: #60a5fa;
}

/* ============================================================
   ACTIVE TOP NAVIGATION TAB
   ============================================================ */

.md-tabs__item--active .md-tabs__link {
    font-weight: 700;
    position: relative;
}

.md-tabs__item--active .md-tabs__link::before {
    content: "";

    position: absolute;

    left: 0.5rem;
    right: 0.5rem;
    bottom: 0;

    height: 2px;

    background: currentColor;

    border-radius: 2px;
}

/* ============================================================
   COLLAPSED READING MODE
   ============================================================ */

@media screen and (min-width: 60em) {

    body.sidebar-collapsed
    .md-content__inner {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

}


/* ============================================================
   CHAPTER OUTLINE
   ============================================================ */

.md-sidebar--secondary .md-nav__title {
    font-size: 0 !important;
}

.md-sidebar--secondary .md-nav__title::after {
    content: "CHAPTER OUTLINE";

    display: block;

    font-size: 0.78rem;
    font-weight: 700;

    letter-spacing: 0.06em;
    text-transform: uppercase;

    color: #57606a;
}

[data-md-color-scheme="slate"]
.md-sidebar--secondary .md-nav__title::after {
    color: #c9d1d9;
}

/* ============================================================
   OUTLINE PANEL
   ============================================================ */

.md-sidebar--secondary .md-sidebar__inner {
    padding: 0.25rem 0.75rem 1rem;
}


.md-sidebar--secondary .md-nav {
    border-left: 2px solid #e5e7eb;
    padding-left: 0.75rem;
}

/* ============================================================
   OUTLINE LINKS
   ============================================================ */

.md-sidebar--secondary .md-nav__link {
    font-size: 0.86rem;

    line-height: 1.4;

    padding: 0.28rem 0.45rem;

    margin: 0.05rem 0;

    border-radius: 6px;

    color: #24292f;
}

.md-sidebar--secondary .md-nav__link {
    white-space: normal;
    overflow-wrap: break-word;
}


/* ============================================================
   ACTIVE OUTLINE ITEM
   ============================================================ */

.md-sidebar--secondary
.md-nav__link--active {
    background: #f0f2f4;

    color: #0969da;

    font-weight: 600;
}

[data-md-color-scheme="slate"]
.md-sidebar--secondary
.md-nav__link--active {
    background: #30363d;

    color: #58a6ff;

    font-weight: 600;
}

/* ============================================================
   NESTED OUTLINE ITEMS
   ============================================================ */

.md-sidebar--secondary
.md-nav .md-nav {
    margin-left: 0.65rem;
    padding-left: 0.65rem;
}

.md-sidebar--secondary
.md-nav .md-nav .md-nav__link {
    font-size: 0.82rem;

    color: #57606a;

    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
}

[data-md-color-scheme="slate"]
.md-sidebar--secondary
.md-nav .md-nav .md-nav__link {
    color: #8b949e;
}

/* ============================================================
   OUTLINE SCROLLBAR
   ============================================================ */

.md-sidebar--secondary
.md-sidebar__scrollwrap {
    scrollbar-width: thin;
    scrollbar-color: #c1c7cd transparent;
}

[data-md-color-scheme="slate"]
.md-sidebar--secondary
.md-sidebar__scrollwrap {
    scrollbar-color: #484f58 transparent;
}

@media screen and (min-width: 76.25em) {

    .md-sidebar--secondary {
        width: 16rem;
    }

    .md-sidebar--secondary
    .md-sidebar__scrollwrap {
        width: 16rem;
    }

}

@media screen and (min-width: 60em) {

    .md-sidebar--secondary
    .md-sidebar__inner {
        padding-top: 0.35rem;
    }

}

/* ============================================================
   DARK MODE — GITHUB-INSPIRED OUTLINE
   ============================================================ */

[data-md-color-scheme="slate"]
.md-sidebar--secondary .md-nav {
    border-left-color: #30363d;
}

[data-md-color-scheme="slate"]
.md-sidebar--secondary .md-nav__link {
    color: #c9d1d9;
}

[data-md-color-scheme="slate"]
.md-sidebar--secondary
.md-nav .md-nav .md-nav__link {
    color: #8b949e;
}

[data-md-color-scheme="slate"]
.md-sidebar--secondary
.md-nav__link:hover {
    color: #f0f6fc;
    background: #21262d;
}

[data-md-color-scheme="slate"]
.md-sidebar--secondary
.md-nav__link--active {
    color: #58a6ff;
    background: #30363d;
}


/* ============================================================
   ACTIVE NAVIGATION HIGHLIGHT
   ------------------------------------------------------------
   Visual only — does not change navigation behaviour
   ============================================================ */

/* LEFT SIDEBAR — active page */
.md-sidebar--primary .md-nav__link--active {
    background: #eef3f8;
    color: #0969da;
    font-weight: 600;
    border-radius: 6px;
}


/* LEFT SIDEBAR — hover */
.md-sidebar--primary .md-nav__link:hover {
    background: #f6f8fa;
    border-radius: 6px;
}


/* RIGHT OUTLINE — active heading */

.md-sidebar--secondary .md-nav__link--active {
    background: #eef3f8;
    color: #0969da;
    font-weight: 600;
    border-radius: 6px;
}


/* RIGHT OUTLINE — hover */
.md-sidebar--secondary .md-nav__link:hover {
    background: #f6f8fa;
    border-radius: 6px;
}


/* ============================================================
   DARK MODE
   ============================================================ */

/* LEFT SIDEBAR */
[data-md-color-scheme="slate"]
.md-sidebar--primary .md-nav__link--active {
    background: #30363d;
    color: #58a6ff;
}


/* LEFT SIDEBAR — hover */
[data-md-color-scheme="slate"]
.md-sidebar--primary .md-nav__link:hover {
    background: #21262d;
}


/* RIGHT OUTLINE */
[data-md-color-scheme="slate"]
.md-sidebar--secondary .md-nav__link--active {
    background: #21262d;
    color: #58a6ff;
}


/* RIGHT OUTLINE — hover */
[data-md-color-scheme="slate"]
.md-sidebar--secondary .md-nav__link:hover {
    background: #30363d;
}
