/* Wider content row when local TOC is shown (filling space beside capped text) */
@media screen and (min-width: 960px) {
    .wy-body-for-nav .wy-nav-content-wrap .wy-nav-content:has(.openvcad-doc-columns:not(.openvcad-doc-columns--no-toc)) {
        max-width: min(1180px, 96vw);
    }
}

.openvcad-doc-columns {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    width: 100%;
}

@media screen and (min-width: 960px) {
    .openvcad-doc-columns:not(.openvcad-doc-columns--no-toc) {
        flex-direction: row;
        align-items: flex-start;
        gap: 1.75rem;
    }

    .openvcad-doc-main {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 800px;
    }

    .openvcad-localtoc {
        flex: 0 0 220px;
        width: 220px;
        max-width: 220px;
    }

    .openvcad-localtoc-sticky {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        padding-right: 0.25rem;
    }
}

.openvcad-localtoc-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #2980b9;
    margin: 0 0 0.65rem 0;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #e1e4e5;
}

.openvcad-localtoc-nav {
    font-size: 0.82rem;
    line-height: 1.35;
}

.openvcad-localtoc-nav ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.openvcad-localtoc-nav > ul ul {
    padding-left: 1rem;
    margin-top: 0.25rem;
}

.openvcad-localtoc-nav li {
    margin-bottom: 0.35rem;
}

.openvcad-localtoc-nav a {
    color: #404040;
}

.openvcad-localtoc-nav a:hover {
    color: #2980b9;
}

/* Responsive figure rows under code (gradients guide) */
.guide-figure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem 1.25rem;
    margin: 1.25rem 0 2rem 0;
    width: 100%;
}

.guide-figure-cell {
    min-width: 0;
}

.guide-figure-cell img {
    width: 100%;
    height: auto;
    vertical-align: middle;
}

.guide-figure-cell .guide-figure-label {
    font-weight: 600;
    margin: 0 0 0.4rem 0;
    font-size: 0.92rem;
}

.guide-figure-cell > p:not(.guide-figure-label) {
    font-size: 0.88rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.35;
}
