/* Copyright (c) 2026, pinkfish
 *
 * Licensed under the BSD 2-Clause License. See the LICENSE file in the project
 * root for the full license text.
 * SPDX-License-Identifier: BSD-2-Clause
 *
 * Styling for the ``.. stl::`` viewers (docs/_ext/stl_viewer.py, docs/_static/stl_viewer.js).
 * Colours come from the theme's palette variables so the viewers follow the light/dark toggle
 * instead of sitting on a fixed near-white panel. */

.stl-viewer {
    position: relative;
    width: 100%;
    height: 360px;
    border: 1px solid var(--md-default-fg-color--lightest, #ddd);
    border-radius: 4px;
    background: var(--md-code-bg-color, #f7f7f9);
    /* Without this a mis-sized drawing buffer would spill over the surrounding text. */
    overflow: hidden;
    touch-action: none;
}

.stl-viewer canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

.stl-viewer-status {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1em;
    text-align: center;
    font-size: 0.8em;
    opacity: 0.7;
}

.stl-viewer-error {
    color: #a00;
    opacity: 1;
}

/* Hide autodoc field-list headers (Parameters, Returns, Return type) from the
   right-hand sidebar TOC so only real objects – functions, classes, methods,
   properties – are shown.  The `‑parameters` / `‑returns` / `‑return‑type`
   id suffixes are generated by Sphinx autodoc for every documented callable. */
.md-nav--secondary a[href$="-parameters"] { display: none; }
.md-nav--secondary a[href$="-returns"] { display: none; }
.md-nav--secondary a[href$="-return-type"] { display: none; }
