/* *******************************************************************************
 * Copyright (c) 2026 Contributors to the Eclipse Foundation
 *
 * See the NOTICE file(s) distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Apache License Version 2.0 which is available at
 * https://www.apache.org/licenses/LICENSE-2.0
 *
 * SPDX-License-Identifier: Apache-2.0
 * *****************************************************************************/

/* ---------------------------------------------------------------------------
 * Compact process-area overview tables (used in feature_and_process_status.rst)
 * ---------------------------------------------------------------------------*/

.compact-overview-wrapper {
    overflow-x: auto;
}

.compact-overview-table td:nth-child(1),
.compact-overview-table th:nth-child(1),
.compact-overview-table td:nth-child(5),
.compact-overview-table th:nth-child(5),
.compact-overview-table td:nth-child(6),
.compact-overview-table th:nth-child(6) {
    text-align: center;
    vertical-align: middle;
}

.compact-overview-table {
    width: 100%;
    table-layout: fixed;
    max-width: 100%;
}

.compact-overview-table td {
    width: 33%;
    overflow: hidden;
}

.compact-overview-table td:has(img[id^="needpie-"]) {
    vertical-align: middle;
    text-align: center;
}

/* Override the fixed pixel size sphinx-needs writes into the img attributes */
.small-pie-cell img,
.compact-overview-table td img,
img[id^="needpie-"] {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
}

/* ---------------------------------------------------------------------------
 * Module phase tracker table (also used in feature_and_process_status.rst)
 * ---------------------------------------------------------------------------*/

.module-phase-tracker-table td,
.module-phase-tracker-table th {
    vertical-align: middle;
    white-space: nowrap;
}

.module-phase-tracker-table td:first-child {
    font-weight: 600;
}

/* ---------------------------------------------------------------------------
 * Wide content area: pages that opt in via a `wide-content-page` body class
 * get a full-width article container.
 * ---------------------------------------------------------------------------*/

body.wide-content-page .bd-content .bd-article-container {
    max-width: 100%;
}

/* ---------------------------------------------------------------------------
 * Collapsible right sidebar (page-TOC)
 * ---------------------------------------------------------------------------*/

#right-sidebar-toggle {
    position: absolute;
    top: 0.6rem;
    left: -1.4rem;
    z-index: 100;
    width: 1.4rem;
    height: 1.8rem;
    padding: 0;
    border: 1px solid var(--pst-color-border, #d0d0d0);
    border-right: none;
    border-radius: 4px 0 0 4px;
    background: var(--pst-color-background, #fff);
    color: var(--pst-color-text-muted, #666);
    font-size: 0.75rem;
    line-height: 1.8rem;
    cursor: pointer;
    transition: background 0.15s;
}

#right-sidebar-toggle:hover {
    background: var(--pst-color-surface, #f5f5f5);
}

.bd-sidebar-secondary {
    position: relative;
    transition: width 0.2s ease, min-width 0.2s ease, padding 0.2s ease,
                opacity 0.2s ease;
}

.bd-sidebar-secondary.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow: visible;
    border: none;
}

.bd-sidebar-secondary.collapsed > *:not(#right-sidebar-toggle) {
    opacity: 0;
    pointer-events: none;
}
