/*
 * Sidebar overrides – TOC and Tags widgets.
 * Loaded globally so rules use !important where the theme's single.css
 * would otherwise win (it loads later via the template head block).
 */

/* ─── Scrollbar removal ───────────────────────────────────────── */
#single aside.toc,
#single aside.tags {
    max-height: none !important;
    overflow: visible !important;
    scrollbar-width: none; /* Firefox */
}

#single aside.toc::-webkit-scrollbar,
#single aside.tags::-webkit-scrollbar,
#single .sticky-sidebar::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* ─── TOC – remove the double-box from enhanced-reading.css ──── */
#single aside.toc #TableOfContents {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

#single aside.toc #TableOfContents::before {
    display: none !important;
}

/* ─── TOC links – readable in both light and dark mode ──────── */
/*
 * enhanced-reading.css sets hover to bg=var(--primary-color) + color=white.
 * In dark themes --primary-color is often white/light → white-on-white = invisible.
 * Replace with a left-border accent approach that always contrasts.
 */
#single aside.toc #TableOfContents a {
    display: block;
    padding: 4px 8px 4px 10px;
    border-radius: 4px;
    color: var(--text-color) !important;
    text-decoration: none !important;
    background: transparent !important;
    border-left: 2px solid transparent;
    transition: border-color 0.18s ease, color 0.18s ease, padding-left 0.18s ease;
    transform: none !important;
    line-height: 1.4;
}

#single aside.toc #TableOfContents a:hover,
#single aside.toc #TableOfContents a:focus {
    color: var(--primary-color) !important;
    background: transparent !important;
    border-left-color: var(--primary-color) !important;
    padding-left: 14px !important;
    transform: none !important;
}

/* Nested items get a bit less padding */
#single aside.toc #TableOfContents ul ul a,
#single aside.toc #TableOfContents ol ol a {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    font-size: 0.9em !important;
    opacity: 0.85;
}

/* ─── Tags – compact flex pills ─────────────────────────────── */
#single aside.tags {
    padding-bottom: 0.9rem !important;
}

#single aside.tags ul.tags-ul {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.35rem !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

#single aside.tags ul.tags-ul li {
    margin: 0 !important;
    display: inline-flex !important;
}

#single aside.tags ul.tags-ul li a {
    font-size: 0.78rem !important;
    padding: 3px 10px !important;
    border-radius: 20px !important;
    white-space: nowrap !important;
    line-height: 1.6 !important;
}
