/*
SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0
*/

/* Custom CSS overrides for FlashDreams documentation */

/* Hide the "Table of Contents" heading in the primary sidebar. */
.bd-links__title {
    display: none;
}

.video-slot {
    border: 1px dashed var(--nv-color-neutral-500, #6f6f6f);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 12px 0 18px;
    background: var(--nv-color-neutral-100, rgba(127, 127, 127, 0.06));
}

.ai-figure-placeholder {
    border: 1px solid color-mix(in srgb, #2563eb 45%, #cbd5e1);
    border-radius: 16px;
    padding: 22px;
    margin: 18px 0 24px;
    background:
        radial-gradient(circle at 12% 20%, rgba(11, 119, 109, 0.18), transparent 34%),
        linear-gradient(135deg, rgba(11, 119, 109, 0.10), rgba(59, 130, 246, 0.08));
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ai-figure-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.ai-figure-body {
    max-width: 760px;
    color: var(--color-foreground-secondary);
}

.fd-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0 22px;
}

.fd-stat-card {
    border: 1px solid #dce5ea;
    border-radius: 10px;
    padding: 14px;
    background: var(--color-background-primary);
}

.fd-stat-value {
    font-size: 1.55rem;
    line-height: 1.2;
    font-weight: 800;
    color: #2563eb;
}

.fd-stat-label {
    margin-top: 4px;
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--color-foreground-secondary);
}

.fd-highlight-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0 20px;
}

.fd-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.fd-highlight-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.fd-highlight-link:hover {
    text-decoration: none;
}

.fd-highlight-card {
    border: 1px solid #dce5ea;
    border-radius: 10px;
    padding: 15px;
    background: var(--color-background-primary);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.fd-highlight-card:hover {
    border-color: #9db2f5;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

.fd-highlight-title {
    font-weight: 800;
    margin-bottom: 6px;
}

.fd-kpi-value {
    display: inline-block;
    color: #166534;
    background: #dcfce7;
    padding: 1px 8px;
    border-radius: 6px;
}

.fd-kpi-grid .fd-highlight-body {
    white-space: nowrap;
}

.fd-highlight-body {
    color: var(--color-foreground-secondary);
    font-size: 0.92rem;
    line-height: 1.45;
}

.fd-collapsible {
    margin: 10px 0;
    border: 1px solid #dce5ea;
    border-radius: 10px;
    background: var(--color-background-primary);
    overflow: hidden;
}

.fd-collapsible summary {
    cursor: pointer;
    padding: 10px 12px;
    font-weight: 700;
    list-style-position: inside;
}

.fd-collapsible p {
    margin: 0;
    padding: 0 12px 12px;
    color: var(--color-foreground-secondary);
    line-height: 1.45;
}

.fd-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 20px;
}

.fd-pill {
    border: 1px solid #dce5ea;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.86rem;
    color: var(--color-foreground-secondary);
    background: var(--color-background-primary);
}

.fd-subtitle {
    margin: 18px 0 8px;
    font-size: 1.2rem;
    line-height: 1.35;
    font-weight: 700;
}

.benchmark-figure {
    margin: 16px 0 8px;
}

.benchmark-chart-svg {
    display: block;
    width: 100%;
    height: auto;
}

.benchmark-figure-wrap figcaption {
    text-align: left;
    margin-top: 0;
}

.model-footnote {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.2;
    color: var(--color-foreground-secondary);
    font-style: italic;
}

.sidebar-github-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 2px 10px 8px;
}

.sidebar-github-link .github-button {
    max-width: 100%;
}

.sidebar-brand .sidebar-logo {
    max-width: 220px;
}

.mobile-header .brand {
    display: none;
}

.mobile-header .header-center {
    display: none;
}

body.index .content h1 {
    margin-top: 0.2rem;
}

.homepage-logo-wrap {
    margin: 0 0 0.8rem;
    text-align: center;
    display: flex;
    justify-content: center;
}

.homepage-logo-wrap img {
    width: min(560px, 90%);
    height: auto;
}

.fd-promo-video-wrap {
    position: relative;
    width: min(960px, 100%);
    margin: 0.4rem auto 1.6rem;
    overflow: hidden;
    border-radius: 8px;
    background: #05070a;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}

.fd-promo-video-player {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #05070a;
}

.fd-promo-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    padding: 0;
    background: linear-gradient(180deg, rgba(5, 7, 10, 0.1), rgba(5, 7, 10, 0.32));
    cursor: pointer;
    transition: opacity 0.18s ease, background 0.18s ease;
}

.fd-promo-play::before {
    content: "";
    position: absolute;
    width: 78px;
    height: 56px;
    border-radius: 8px;
    background: rgba(5, 7, 10, 0.78);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.fd-promo-play:hover::before,
.fd-promo-play:focus-visible::before {
    background: #76b900;
}

.fd-promo-play:focus-visible {
    outline: 3px solid #76b900;
    outline-offset: -6px;
}

.fd-promo-play-icon {
    position: relative;
    width: 0;
    height: 0;
    margin-left: 6px;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    border-left: 22px solid #ffffff;
}

.fd-promo-video-wrap.is-playing .fd-promo-play {
    opacity: 0;
    pointer-events: none;
}

.model-link-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
    margin: 0 0 12px;
}

.model-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    border-radius: 0.25rem;
    border: 1px solid #4f46e5;
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.model-link-button:hover {
    text-decoration: none;
    background: color-mix(in srgb, #4f46e5 8%, transparent);
}

.model-video-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0 18px;
}

.model-video-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #c9c9c9;
    background: #101214;
}

.model-video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #cfcfcf;
    font-size: 0.95rem;
}

.model-video-player {
    display: block;
    width: 100%;
    height: auto;
    background: #000;
}

.model-video-overlay {
    position: absolute;
    inset: auto 0 0 0;
    background: rgba(0, 0, 0, 0.72);
    color: #f3f3f3;
    padding: 10px 12px;
    font-size: 0.60rem;
    line-height: 1.1;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.model-video-card:hover .model-video-overlay {
    opacity: 1;
}

@media (max-width: 1100px) {
    .fd-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .fd-stat-grid,
    .fd-highlight-grid {
        grid-template-columns: 1fr;
    }

    .model-video-grid {
        grid-template-columns: 1fr;
    }
}

/* -- Image hover-to-zoom (JS-driven overlay) ----------------------------- */

img.zoomable,
.zoomable img,
.zoomable video {
    cursor: zoom-in;
}

.img-zoom-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.img-zoom-overlay.visible {
    opacity: 1;
}

.img-zoom-clone {
    max-width: 72vw;
    max-height: 72vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
                opacity 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    transform: scale(0.92);
    opacity: 0;
}

.img-zoom-overlay.visible .img-zoom-clone {
    transform: scale(1);
    opacity: 1;
}
