/* ============================================================
   Right-side "On This Page" Table of Contents
   Matches the JS SDK reference sidebar pattern.
   ============================================================ */

/* Container for the right TOC */
.toc-right {
    position: fixed;
    top: 70px;
    right: 16px;
    width: 220px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    padding: 12px 0;
    font-size: 13px;
    line-height: 1.5;
    z-index: 10;
    border-left: 1px solid var(--border-color, #e5e7eb);
    padding-left: 16px;
}

/* Hide on smaller screens where there's no room */
@media (max-width: 1400px) {
    .toc-right {
        display: none;
    }
}

/* Make room for the right TOC on wide screens */
@media (min-width: 1401px) {
    #main {
        margin-right: 260px;
    }
}

/* TOC heading */
.toc-right .toc-right__title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--default-font-color, #374151);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

/* TOC section header (Types, Properties, Functions, etc.) */
.toc-right .toc-right__section {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--default-font-color, #6b7280);
    margin-top: 14px;
    margin-bottom: 6px;
}

/* Individual TOC links */
.toc-right a {
    display: block;
    padding: 2px 0;
    color: var(--default-font-color, #4b5563);
    text-decoration: none;
    font-size: 16.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.15s;
}

.toc-right a:hover {
    color: var(--active-tab-border-color, #2563eb);
}

/* Active/highlighted link */
.toc-right a.toc-active {
    color: var(--active-tab-border-color, #2563eb);
    font-weight: 600;
}

/* Dark mode support */
.theme-dark .toc-right {
    border-left-color: #374151;
}

.theme-dark .toc-right .toc-right__title {
    color: #d1d5db;
    border-bottom-color: #374151;
}

.theme-dark .toc-right .toc-right__section {
    color: #9ca3af;
}

.theme-dark .toc-right a {
    color: #9ca3af;
}

.theme-dark .toc-right a:hover,
.theme-dark .toc-right a.toc-active {
    color: #60a5fa;
}

/* Scrollbar styling for the TOC */
.toc-right::-webkit-scrollbar {
    width: 4px;
}

.toc-right::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.theme-dark .toc-right::-webkit-scrollbar-thumb {
    background: #4b5563;
}

/* ============================================================
   Hide Constructors from Dokka output globally
   Dokka wraps constructor sections in [data-togglable="CONSTRUCTOR"]
   ============================================================ */
.tabs-section-body > [data-togglable="CONSTRUCTOR"] {
    display: none !important;
}
/* Also hide the Constructors tab button if it's the only togglable */
button.section-tab[data-togglable="CONSTRUCTOR"] {
    display: none !important;
}

/* Hide platform filter button (single-platform SDK — "androidJvm" tag is unnecessary) */
#filter-section {
    display: none !important;
}

/* Add vertical spacing above code example blocks (between heading/text and code) */
.sample-container {
    margin-top: 12px !important;
}

/* "Code Example:" label — bold paragraph directly above code blocks.
   Dokka renders <b> as <strong>, so target <p class="paragraph"><strong>...</strong></p>.
   Visually separated from preceding text (margin-top) but tight to the code block (margin-bottom). */
.content .paragraph > strong:only-child {
    display: inline-block;
    font-size: 15px;
}

.content .paragraph:has(> strong:only-child) {
    margin-top: 5px !important;
    margin-bottom: 2px !important;
}

.content .paragraph:has(> strong:only-child) + .sample-container {
    margin-top: 2px !important;
}

/* Consistent 15px font size for all code examples across API reference pages */
.sample-container pre,
.sample-container code {
    font-size: 15px !important;
}

/* Add vertical spacing above tables in description content (e.g., error code tables) */
.content table {
    margin-top: 8px !important;
    margin-bottom: 16px !important;
}

/* Hide Dokka footer */
.footer {
    display: none !important;
}
