body {
    font-family: Arial, sans-serif;
    background: #111;
    color: #ddd;
    line-height: 1.6;
}

html {
    scroll-behavior: smooth;
}

.content {
    margin: 20px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 40px;
}

h1,
h2,
h3 {
    color: #E8C38C;
}

code {
    background: #222;
    padding: 2px 6px;
    border-radius: 4px;
}

pre {
    background: #222;
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
}

hr {
    border: 1px solid #333;
    margin: 30px 0;
}

/* ===============================
   TABLE OF CONTENTS STYLING
   =============================== */
.table-of-contents {
    position: sticky;
    top: 20px;
    max-width: 800px;
    margin: 40px auto 60px auto;
    background: #2d353e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 25px 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    align-self: start;
    overflow: visible;
    z-index: 40;
}

[id] {
    scroll-margin-top: 20vh;
}

.table-of-contents h2 {
    color: #E8C38C;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.6em;
    letter-spacing: 0.5px;
}

.table-of-contents ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.table-of-contents>ul>li {
    margin: 12px 0;
    padding-left: 10px;
    border-left: 2px solid #cf3756;
    transition: all 0.3s ease;
}

.table-of-contents>ul>li:hover {
    border-left-color: #E8C38C;
    transform: translateX(5px);
}

/* Sub-list (indented items) */
.table-of-contents ul ul {
    margin-top: 6px;
    margin-left: 25px;
    border-left: 1px dashed #333;
    padding-left: 15px;
}

.table-of-contents ul ul li {
    margin: 6px 0;
    padding-left: 8px;
    border-left: none;
}

.table-of-contents a {
    color: #cf3756;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.table-of-contents a:hover {
    color: #E8C38C;
}

/* ===============================
   RESPONSIVE: TABLET / SMALL SCREENS
   =============================== */
@media (max-width: 1100px) {
    .content {
        grid-template-columns: 1fr 1fr;
        gap: 60px;
    }
}

.btn {
    margin: 20px auto;
    width: fit-content;
    border: 1px solid #e6bf8b;
    padding: 7px 15px;
    border-radius: 6px;
    text-decoration: none;
    color: #fff;
    background-color: #cf3756;
    transition: background 0.3s ease;
}

.btn:hover {
    background-color: #cfa46e;
}

/* ===============================
   RESPONSIVE: COMPACT MOBILE LAYOUT
   =============================== */

@media (max-width: 930px) {

    html,
    body {
        overflow-x: hidden;
        font-size: 0.95rem;
    }

    .content {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 0 12px;
    }

    /* --- Compact TOC --- */
    .table-of-contents {
        position: relative;
        top: auto;
        margin: 10px 0 15px 0;
        width: 100%;
        border-radius: 8px;
        padding: 12px 14px;
        background: #1b1f24;
        border: 1px solid #292f35;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
    }

    .table-of-contents h2 {
        font-size: 1rem;
        text-align: left;
        margin-bottom: 6px;
        letter-spacing: 0.4px;
    }

    .table-of-contents ul {
        padding-left: 0;
        margin: 0;
    }

    .table-of-contents>ul>li {
        margin: 6px 0;
        padding-left: 6px;
        border-left: 2px solid #cf3756;
    }

    .table-of-contents ul ul {
        margin-top: 4px;
        margin-left: 12px;
        border-left: 1px dashed #333;
        padding-left: 10px;
    }

    .table-of-contents a {
        display: block;
        color: #cf3756;
        text-decoration: none;
        font-weight: 600;
        font-size: 0.9rem;
        padding: 3px 0;
        line-height: 1.25;
        white-space: normal;
        word-break: break-word;
    }

    .table-of-contents a:hover {
        color: #E8C38C;
    }

    /* --- Compact Documentation Text --- */
    .contentText {
        padding: 0 6px;
    }

    h1 {
        font-size: 1.5rem;
        margin-top: 0.8em;
        margin-bottom: 0.4em;
    }

    h2 {
        font-size: 1.2rem;
        margin-top: 1em;
        margin-bottom: 0.4em;
    }

    h3 {
        font-size: 1.05rem;
        margin-top: 0.8em;
        margin-bottom: 0.3em;
    }

    p,
    li {
        font-size: 0.95rem;
        margin-bottom: 0.6em;
        line-height: 1.5;
    }

    ul,
    ol {
        padding-left: 1.2em;
    }

    pre {
        font-size: 0.85rem;
        padding: 8px;
        margin: 10px 0;
        border-radius: 4px;
    }

    code {
        font-size: 0.9rem;
        padding: 2px 4px;
        border-radius: 3px;
        word-break: break-word;
    }

    hr {
        margin: 20px 0;
    }

    footer {
        font-size: 0.8rem;
        text-align: center;
        padding: 15px 0;
    }
}

/* ===============================
   EXTRA SMALL (Phones < 559px)
   =============================== */
@media (max-width: 559px) {

    html,
    body {
        overflow-x: hidden;
        font-size: 0.9rem;
    }

    .content {
        padding: 0 8px;
        gap: 14px;
    }

    .table-of-contents {
        padding: 10px 12px;
        border-radius: 6px;
        background: #161a1f;
        border: 1px solid #24282d;
    }

    .table-of-contents h2 {
        font-size: 0.95rem;
        margin-bottom: 5px;
    }

    .table-of-contents>ul>li {
        margin: 4px 0;
        padding-left: 5px;
        border-left-width: 1.5px;
    }

    .table-of-contents ul ul {
        margin-left: 10px;
        padding-left: 8px;
    }

    .table-of-contents a {
        font-size: 0.85rem;
        padding: 2px 0;
        line-height: 1.2;
    }

    /* --- Make Content Text Compact --- */
    h1 {
        font-size: 1.3rem;
    }

    h2 {
        font-size: 1.05rem;
    }

    h3 {
        font-size: 0.95rem;
    }

    p,
    li {
        font-size: 0.88rem;
        margin-bottom: 0.5em;
        line-height: 1.45;
    }

    pre,
    code {
        font-size: 0.8rem;
    }

    ul,
    ol {
        padding-left: 1em;
    }

    footer {
        font-size: 0.75rem;
        padding: 10px 0;
    }
}

@media (max-width: 400px) {

    html,
    body {
        overflow-x: hidden;
        font-size: 0.85rem;
    }

    .content {
        padding: 0 6px;
        gap: 12px;
    }

    /* --- Table of Contents --- */
    .table-of-contents {
        padding: 8px 10px;
        border-radius: 6px;
        background: #15191e;
        border: 1px solid #20242a;
    }

    .table-of-contents h2 {
        font-size: 0.9rem;
        text-align: left;
        margin-bottom: 4px;
    }

    .table-of-contents>ul>li {
        margin: 3px 0;
        padding-left: 4px;
        border-left-width: 1px;
    }

    .table-of-contents ul ul {
        margin-top: 3px;
        margin-left: 8px;
        padding-left: 6px;
    }

    .table-of-contents a {
        font-size: 0.8rem;
        padding: 2px 0;
        line-height: 1.15;
        word-break: break-word;
    }

    /* --- Main Text + Headings --- */
    h1 {
        font-size: 1.15rem;
        line-height: 1.3;
        margin-top: 0.7em;
        margin-bottom: 0.3em;
    }

    h2 {
        font-size: 1rem;
        margin-top: 0.8em;
        margin-bottom: 0.3em;
    }

    h3 {
        font-size: 0.9rem;
        margin-top: 0.6em;
        margin-bottom: 0.25em;
    }

    p,
    li {
        font-size: 0.82rem;
        line-height: 1.4;
        margin-bottom: 0.45em;
    }

    ul,
    ol {
        padding-left: 0.9em;
    }

    /* --- Code & Preformatted Text --- */
    pre {
        font-size: 0.75rem;
        padding: 6px 8px;
        margin: 8px 0;
        border-radius: 4px;
        overflow-x: auto;
        white-space: pre;
        scrollbar-width: thin;
    }

    pre::-webkit-scrollbar {
        height: 4px;
    }

    pre::-webkit-scrollbar-thumb {
        background: #333;
        border-radius: 2px;
    }

    code {
        font-size: 0.78rem;
        padding: 1px 3px;
    }

    /* --- Other Small Details --- */
    hr {
        margin: 18px 0;
    }

    footer {
        font-size: 0.7rem;
        padding: 8px 0;
        text-align: center;
    }


}