/* PR change highlighting -- amber theme (HTML only)
 *
 * Mirrors the board-selector styling but uses amber (#d4920b) instead
 * of blue (#4a90c4) so the two are visually distinct.
 *
 * Active-state rules use :not(.pr-highlight-off) so that toggling off
 * simply removes the rule match and lets the RTD theme's native
 * styles take over cleanly.
 */

/* ---- In-page: class added to <section> elements ---- */

section.pr-changed:not(.pr-highlight-off),
div.pr-changed:not(.pr-highlight-off) {
    border-left: 4px solid #d4920b;
    background: #fef9ed;
    padding: 12px 12px 4px 16px;
    margin: 16px 0;
    border-radius: 0 4px 4px 0;
    position: relative;
}

section.pr-changed:not(.pr-highlight-off)::before,
div.pr-changed:not(.pr-highlight-off)::before {
    content: "Changed in this PR";
    display: block;
    background: #d4920b;
    color: #fff;
    padding: 4px 10px;
    margin: -12px -12px 12px -16px;
    border-radius: 0 4px 0 0;
    font-size: 0.82em;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ---- Old content (base version) injected by extract_base_sections ---- */

.pr-old-content {
    border-left: 4px solid #5c3d2e;
    background: #f5efe8;
    padding: 12px 12px 4px 16px;
    margin: 16px 0;
    border-radius: 0 4px 4px 0;
    position: relative;
}

.pr-old-content::before {
    content: "Base version";
    display: block;
    background: #5c3d2e;
    color: #fff;
    padding: 4px 10px;
    margin: -12px -12px 12px -16px;
    border-radius: 0 4px 0 0;
    font-size: 0.82em;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.pr-old-placeholder {
    color: #5c3d2e;
    font-style: italic;
}

/* ---- Sidebar ToC: direct-match entries (always highlighted) ---- */

.wy-menu-vertical li.pr-changed-toc:not(.pr-highlight-off) > a {
    color: #f0b429 !important;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #d4920b;
    background: #3b2e1a;
    border-radius: 2px;
}

/* Override RTD expanded-section backgrounds */

.wy-menu-vertical li.current li.pr-changed-toc:not(.pr-highlight-off) > a,
.wy-menu-vertical li.toctree-l2.current li.pr-changed-toc:not(.pr-highlight-off) > a,
.wy-menu-vertical li.toctree-l3.current li.pr-changed-toc:not(.pr-highlight-off) > a {
    color: #f0b429 !important;
    background: #3b2e1a !important;
}

/* ---- Sidebar ToC: ancestor entries (highlighted only when
       collapsed, i.e. not .current and not a direct match) ---- */

.wy-menu-vertical li.pr-changed-toc-ancestor:not(.current):not(.pr-changed-toc):not(.pr-highlight-off) > a {
    color: #f0b429 !important;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #d4920b;
    background: #3b2e1a;
    border-radius: 2px;
}

/* ---- Main-content ToC (index page toctree): direct matches only ---- */

.toctree-wrapper li.pr-changed-toc:not(.pr-highlight-off) > a,
.toctree-wrapper a.pr-changed-toc:not(.pr-highlight-off) {
    color: #b37a00;
    font-weight: 600;
    border-left: 3px solid #d4920b;
    padding-left: 6px;
}

/* ---- Sidebar toggle widget (button group) ---- */

.pr-changes-toggle {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 8px 10px;
    margin: 8px 12px;
    text-align: left;
}
.pr-changes-heading {
    display: block;
    font-weight: bold;
    font-size: 0.85em;
    color: #fff;
    margin-bottom: 6px;
}
.pr-changes-btn-group {
    display: flex;
    gap: 0;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.pr-changes-btn {
    flex: 1;
    padding: 4px 0;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
    font-size: 0.82em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.pr-changes-btn:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}
.pr-changes-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}
.pr-changes-btn.pr-changes-btn-active {
    background: #d4920b;
    color: #fff;
}
