/* ===== Viewer 3D <model-viewer> ===== */
model-viewer {
    width: 100%;
    height: 460px;
    background: linear-gradient(160deg, #11151c 0%, #1b2330 100%);
    border-radius: 10px;
    border: 1px solid #2a3340;
    margin: 0.6em 0 0.3em 0;
    --poster-color: transparent;
}
.msx-viewer-hint {
    font-size: 0.82em;
    color: var(--md-default-fg-color--light);
    text-align: center;
    margin: 0 0 1.4em 0;
}
.msx-viewer-hint kbd {
    background: var(--md-code-bg-color);
    border-radius: 4px;
    padding: 0 5px;
}

/* ===== Foto: stile lineare e pulito ===== */
.md-content figure {
    margin: 1.8em auto;
    text-align: center;
}
.md-content figure img {
    max-width: 100%;
    border-radius: 4px;
    border: 1px solid var(--md-default-fg-color--lightest);
}
.md-content figure figcaption {
    margin: 0.6em auto 0;
    max-width: 600px;
    font-size: 0.8em;
    line-height: 1.4;
    font-style: italic;
    color: var(--md-default-fg-color--light);
}

/* ===== Versione sotto il titolo nell'header ===== */
.md-header__topic .msx-version {
    display: block;
    font-size: 0.62rem;
    font-weight: 400;
    opacity: 0.8;
    line-height: 1.2;
    margin-top: 6px;
    letter-spacing: 0.02em;
}

/* Video */
.md-content video {
    width: 100%;
    max-width: 960px;
    display: block;
    margin: 0.6em auto;
    border-radius: 10px;
    border: 1px solid #2a3340;
    background: #000;
}

/* ===== Tabelle in stile SparkFun (intestazione marcata, zebra, compatte) ===== */
.md-typeset table:not([class]) {
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.76rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.md-typeset table:not([class]) th {
    background: var(--md-default-fg-color--lightest);
    color: var(--md-default-fg-color);
    font-weight: 700;
    border-bottom: 2px solid var(--md-accent-fg-color);
    padding: 0.6em 1em;
    white-space: nowrap;
}
.md-typeset table:not([class]) td {
    padding: 0.5em 1em;
    border-top: 1px solid var(--md-default-fg-color--lightest);
}
.md-typeset table:not([class]) tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--md-default-fg-color) 4%, transparent);
}
.md-typeset table:not([class]) tbody tr:hover {
    background: color-mix(in srgb, var(--md-accent-fg-color) 9%, transparent);
    transition: background 0.12s ease;
}
/* prima colonna in evidenza (etichette) */
.md-typeset table:not([class]) td:first-child {
    font-weight: 600;
    color: var(--md-default-fg-color);
}

/* Permalink dei titoli (¶) solo al passaggio del mouse */
.md-typeset .headerlink {
    opacity: 0;
    transition: opacity 0.15s ease;
}
.md-typeset h1:hover .headerlink,
.md-typeset h2:hover .headerlink,
.md-typeset h3:hover .headerlink,
.md-typeset h4:hover .headerlink {
    opacity: 0.6;
}
/* Liste un filo più compatte */
.md-typeset ul li { margin-bottom: 0.25em; }

/* ===== Header: dark slate pulito ===== */
.md-header {
    background-color: #1e2630;
}

/* Logo rimosso dall'header */
.md-header__button.md-logo { display: none !important; }

/* MSX (titolo header) più a sinistra */
.md-header__title { margin-left: 0.5rem !important; }

/* Toglie il titolo ridondante in cima alla sidebar (su desktop è già nell'header) */
@media screen and (min-width: 76.25em) {
    .md-sidebar--primary .md-nav--primary > .md-nav__title {
        display: none;
    }
}
