/*
 * SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
 *
 * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
 * property and proprietary rights in and to this material, related
 * documentation and any modifications thereto. Any use, reproduction,
 * disclosure or distribution of this material and related documentation
 * without an express license agreement from NVIDIA CORPORATION or
 * its affiliates is strictly prohibited.
 */

/* header-like rubrics */
p.rubric.rubric-h1,
p.rubric.rubric-h2,
p.rubric.rubric-h3,
p.rubric.rubric-h4,
p.rubric.rubric-h5,
p.rubric.rubric-h6 {
    font-family: var(--pst-font-family-heading);
    font-weight: var(--pst-font-weight-heading);
    color: var(--pst-color-heading);
    line-height: 1.15;
    margin: 2.75rem 0 1.05rem;
    border-bottom: none;
}

p.rubric.rubric-h1 {
    font-size: var(--pst-font-size-h1);
}

p.rubric.rubric-h2 {
    font-size: var(--pst-font-size-h2);
}

p.rubric.rubric-h3 {
    font-size: var(--pst-font-size-h3);
}

p.rubric.rubric-h4 {
    font-size: var(--pst-font-size-h4);
}

p.rubric.rubric-h5 {
    font-size: var(--pst-font-size-h5);
}

p.rubric.rubric-h6 {
    font-size: var(--pst-font-size-h6);
}

/* optional table with no stripes */
.table-no-stripes tbody tr:nth-child(odd) {
    background-color: var(--pst-color-table-row-zebra-high-bg);
}

/* optional table right align first column */
.table-right-align-first-column tr td:first-child {
    text-align: right;
}

/* provide a compact table style */
.table-compact {
    font-size: 0.75em;
}

.table-compact caption {
    font-size: initial;
}

/* text transformations */
.text-rotate-90 {
    writing-mode: vertical-rl;
}

.text-rotate-270 {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

/* hide main scrollbar when modal is open */
html:has(body.modal-open) {
    overflow: hidden;
}

/* avoid disappearing sidebars when opening a modal */
body.modal-open {
    overflow: revert !important;
}

/* hide the back-to-top button when modal is open */
body.modal-open #pst-back-to-top {
    display: none !important;
}

/* ensure we can position the expand button relative to the table */
.pst-scrollable-table-container {
    position: relative;
}

/* fix colors of modal content */
.modal {
    --bs-modal-bg: var(--pst-color-background);
    --bs-modal-header-border-color: var(--pst-color-border);
}

/* right align close button in modal header */
.modal-header {
    flex-direction: row-reverse;
}

/* Learning-page headings and figure captions */
.bd-article #small-training-datasets-amplify-boundary-sensitivity > h1,
.bd-article #effective-resolution-s-impact-on-prediction-accuracy > h1,
.bd-article #training-data-bias-shapes-prediction-bias > h1,
.bd-article #prefer-event-based-video-chunking > h1 {
    font-size: 1.75rem;
}

.bd-article #small-training-datasets-amplify-boundary-sensitivity h2,
.bd-article #effective-resolution-s-impact-on-prediction-accuracy h2,
.bd-article #training-data-bias-shapes-prediction-bias h2,
.bd-article #prefer-event-based-video-chunking h2 {
    font-size: 1.5rem;
}

.bd-article .learning-page-figure figcaption,
.bd-article .learning-page-figure figcaption .caption-number,
.bd-article .learning-page-figure figcaption .caption-text {
    color: var(--pst-color-text-base);
}

.bd-article .learning-page-figure figcaption .caption-number {
    font-weight: 700;
}

.bd-article .learning-page-figure figcaption strong {
    color: var(--pst-color-heading);
    font-weight: 700;
}

/* Vertical breathing room between block images/figures and adjacent text */
.bd-article img.align-center,
.bd-article img.align-left,
.bd-article img.align-right,
.bd-article figure {
    margin-top: 1.75rem;
    margin-bottom: 1.75rem;
}

/* Index page: h2 section below the document title; h3 subsection smaller but bold. */
.bd-article #what-the-playbooks-provide > h2 {
    font-size: var(--pst-font-size-h2);
    font-weight: var(--pst-font-weight-heading);
}

.bd-article #playbook-includes > h3 {
    font-size: var(--pst-font-size-h4);
    font-weight: var(--pst-font-weight-heading);
}

/* Keep the index hero full-width while reducing its vertical footprint. */
@media (min-width: 768px) {
    .bd-article img.index-hero {
        aspect-ratio: 7 / 3;
        object-fit: fill;
        width: 100%;
    }
}

/* Performance page data tables: green header, zebra body, optional totals row. */
:root {
    --si-perf-table-header-bg: #1f6f4a;
    --si-perf-table-zebra-bg: #eef3f0;
}

html[data-theme="dark"] {
    --si-perf-table-header-bg: #14563a;
    --si-perf-table-zebra-bg: rgba(118, 185, 0, 0.07);
}

.bd-article table.perf-table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 6px;
    overflow: hidden;
    width: 100%;
    font-size: 0.85rem;
}

.bd-article table.perf-table > caption {
    caption-side: top;
    text-align: left;
    padding: 0 0 0.5rem;
    color: var(--pst-color-heading);
    font-size: 1rem;
    font-weight: var(--pst-font-weight-heading);
}

.bd-article table.perf-table thead th {
    background-color: var(--si-perf-table-header-bg);
    color: #ffffff;
    font-weight: 700;
    border-bottom: none;
    vertical-align: bottom;
}

.bd-article table.perf-table th,
.bd-article table.perf-table td {
    padding: 0.4rem 0.65rem;
}

.bd-article table.perf-table tbody td {
    white-space: nowrap;
}

.bd-article table.perf-table tbody tr:nth-child(odd) {
    background-color: var(--pst-color-background);
}

.bd-article table.perf-table tbody tr:nth-child(even) {
    background-color: var(--si-perf-table-zebra-bg);
}

/* These tables fit the content width, so suppress the horizontal scrollbar.
   Narrow viewports keep the theme's scrolling behavior. */
@media (min-width: 992px) {
    .bd-article .pst-scrollable-table-container:has(> table.perf-table) {
        overflow-x: visible;
    }
}

/* Use more horizontal space for diagrams and other wide content. */
@media (min-width: 1200px) {
    .bd-page-width {
        max-width: 130rem;
    }

    .bd-main .bd-content .bd-article-container {
        max-width: 100rem;
    }
}
