/* MCUXpresso SDK overrides for mcux_book_theme.
 *
 * The theme injects its own mcux_book_theme.css AFTER html_css_files
 * (see layout.html), so we need higher specificity than the theme's
 * single-class !important rules. Using `html .bd-...` raises specificity
 * to beat `.bd-...` regardless of load order.
 *
 * Restores narrower sidebars so wide tables (e.g. DSC driver index)
 * do not overlap the secondary sidebar.
 */

/* ── Sidebar widths ─────────────────────────────────────────────────────── */

html .bd-sidebar-primary {
    flex: 0 0 272px !important;
    min-width: 272px !important;
    max-width: 272px !important;
}

html .bd-sidebar-secondary {
    flex: 0 0 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
}

html .bd-article-container {
    gap: 1rem !important;
}

html .bd-content {
    padding-right: 1rem !important;
}

/* SDK-specific audio FW spec table styling */
.audio_FW_spec_table,
.audio_FW_spec_table th,
.audio_FW_spec_table td {
    text-align: center;
    border: 1px solid gray;
    border-collapse: collapse;
}

.audio_FW_spec_table th,
.audio_FW_spec_table td {
    padding-left: 0.5em;
    padding-right: 0.5em;
}

.audio_FW_spec_table th {
    background-color: #3ECAFB !important;
    color: white;
}

.audio_FW_spec_table_supported {
    background-color: #00A700 !important;
    color: black;
}

.audio_FW_spec_table_modification {
    background-color: #69CA00 !important;
    color: black;
}

.audio_FW_spec_table_limited {
    background-color: #F9B500 !important;
    color: black;
}

/* ── Styles below are contributed upstream to mcux-docs-theme.
 * Remove once mcux_book_theme package is updated in requirements.txt.
 * Tracked in: feature/MCUX-89949-generic-css-additions
 * ─────────────────────────────────────────────────────────────────────────── */

/* Table row hover colour — NXP yellow accent */
html[data-theme="dark"] {
    --pst-color-table-row-hover-bg: rgba(249, 181, 0, 0.4);
}

html[data-theme="light"] {
    --pst-color-table-row-hover-bg: rgba(249, 181, 0, 0.6);
}

/* Footer branch/revision chip */
.footer-branch-rev {
    font-size: 0.85rem;
    color: var(--pst-color-text-muted);
    margin-top: 0.35rem;
}

.footer-branch-rev code {
    background: var(--pst-color-surface);
    padding: 0.075rem 0.25rem;
    border-radius: 4px;
}

/* Extended print layout */
@media print {
    .bd-sidebar-primary,
    .bd-sidebar-secondary {
        display: none !important;
    }

    .bd-main {
        margin: 0 !important;
        max-width: none !important;
    }

    .bd-content {
        max-width: none !important;
        padding: 0 !important;
    }

    #pst-back-to-top,
    #searchbox,
    #print-main-content,
    #jb-print-docs-body { display: none !important; }

    body { font-size: 12pt !important; }
    h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
    pre, blockquote { page-break-inside: avoid; }
    img { max-width: 100% !important; height: auto !important; }
}
