/* ---------- EBOOK CONTAINER ---------- */
.ebook-wrapper {
    display: grid;
    grid-template-columns: 20% auto;
    gap: var(--default-col-gap);
    }

/* ---------- TABLE OF CONTENTS ---------- */
.ebook-toc-container {
    font-family: var(--text-font);
    font-size: var(--text-normal);
    line-height: 1.5;
}

.toc ul{
    margin-left: 0 !important;
    margin-bottom: 0 !important;
}

/* Chapter items */
.ebook-toc-container .toc-chapter {
    display: block;
    margin-bottom: var(--half-pad);
    cursor: pointer;
}

/* Links for H2 chapters */
.ebook-toc-container .toc-chapter > a {
    display: block;
    padding: var(--half-pad);
    background: var(--primary-color-light);
    color: var(--link-color);
    font-weight: bold;
    text-decoration: none;
    border-radius: var(--standard-radius);
    transition: background 0.2s ease;
}

.ebook-toc-container .toc-chapter.expanded > a {
    background: var(--primary-color);
    color: var(--bright-color);
}

/* Anchor links inside chapter (H3/H4) */
.ebook-toc-container .toc-anchors {
    display: none;
    margin-top: var(--half-pad);
    padding-left: var(--standard-pad);
    list-style: none;
}

.ebook-toc-container .toc-chapter.expanded .toc-anchors {
    display: block;
}

.ebook-toc-container .toc-anchors li {
    margin-bottom: var(--half-pad);
}

.ebook-toc-container .toc-anchors li a {
    display: block;
    padding: var(--half-pad);
    background: var(--secondary-color);
    color: var(--bright-color);
    font-weight: normal;
    text-decoration: none;
    border-radius: var(--standard-radius);
    font-size: var(--text-small);
    transition: background 0.2s ease;
}

.ebook-toc-container .toc-anchors li a:hover {
    background: var(--secondary-hover-color);
}

/* ---------- EBOOK MAIN CONTENT ---------- */
.ebook-content {
    flex: 1;
    background: var(--bright-color);
    padding: var(--standard-pad);
    border-radius: var(--standard-radius);
    font-family: var(--text-font);
    font-size: var(--text-normal);
    line-height: 1.6;
    color: var(--text-color);
    overflow-x: hidden;
}

/* Headings inside ebook */
.ebook-content h1 {
    font-size: var(--page-content-title);
    font-family: var(--title-font);
    color: var(--primary-color);
}

.ebook-content h2 {
    font-size: var(--page-content-heading-2);
    font-weight: bold;
}

.ebook-content h3 {
    font-size: var(--page-content-heading-3);
    font-weight: bold;
    margin-top: var(--standard-pad);
    margin-bottom: var(--half-pad);
}

.ebook-content h4 {
    font-size: var(--text-normal);
    font-weight: bold;
    margin-top: var(--half-pad);
    margin-bottom: var(--half-pad);
}

/* Links inside ebook content */
.ebook-content a {
    color: var(--link-color);
    text-decoration: underline;
}

.ebook-content a:hover {
    color: var(--green-hover-color);
}

.ebook-nav {
    display: flex;
    justify-content: space-between;
    margin-top: var(--double-pad);
    gap: var(--standard-pad);
}

.ebook-nav a {
    display: block;
    padding: var(--standard-pad);
    background: var(--primary-color-light);
    color: var(--dark-color);
    border-radius: var(--standard-radius);
    text-decoration: none;
    font-size: var(--text-normal);
}

.ebook-nav a:hover {
    color: white;
    background: var(--secondary-hover-color);
}

