/* Article images: subtle frame so dark screenshots don't bleed into the dark theme */
.e-content img {
    display: block;
    margin-inline: auto;
    border: 1px solid var(--divider-color);
    border-radius: 8px;
}

/* Fixed sidebar table of contents (wide screens only) */
.sidebar-toc {
    display: none;
}

@media (min-width: 1400px) {
    .sidebar-toc {
        display: block;
        position: fixed;
        top: 7rem;
        left: 2rem;
        width: 15rem;
        max-height: 75vh;
        overflow-y: auto;
        padding-left: 0.9rem;
        border-left: 2px solid var(--divider-color);
        font-size: 0.85rem;
        line-height: 1.45;
    }

    .sidebar-toc-title {
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        font-size: 0.72rem;
        opacity: 0.7;
        margin-bottom: 0.6rem;
    }

    .sidebar-toc ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .sidebar-toc li {
        margin: 0.15rem 0;
    }

    .sidebar-toc li.toc-h3 {
        padding-left: 0.9rem;
    }

    .sidebar-toc a {
        text-decoration: none;
        color: var(--text-color);
        opacity: 0.7;
        transition: opacity 0.15s, color 0.15s;
    }

    .sidebar-toc a:hover {
        opacity: 1;
        background-color: transparent;
        color: var(--primary-color);
    }

    /* Neutralise tabi's global link-hover highlight (green block + padding pseudo) */
    .sidebar-toc a:hover::before,
    .sidebar-toc a:hover::after {
        content: none !important;
        background: none !important;
    }

    .sidebar-toc a.active {
        opacity: 1;
        color: var(--primary-color);
        font-weight: 600;
    }
}

/* Lightbox overlay for article images */
.img-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.85);
    cursor: zoom-out;
}

.img-lightbox img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border: none;
    border-radius: 4px;
}

/* Round avatar */
#banner-home-img {
    border-radius: 50% !important;
    object-position: center top;
}

/* More breathing room below hero */
#banner-container-home {
    margin-block-end: 2.5rem !important;
}

/* Tighten image container slightly */
#image-container-home {
    max-width: 9rem !important;
}
