/* ==========================================================================
   Player dei video tutorial (Components/TutorialVideo.razor + js/tutorial-video.js).
   Stile V2: cornice 16:9 con raggio e ombra calda come .v2-frame / .v2-media, un solo
   accento rosso sul bottone play. Solo token var(--v2-*), proprieta' logiche (RTL ok).
   Versione nel link: TutorialVideo.CssHref (aumentarla a ogni modifica).
   ========================================================================== */

.tv {
    margin: 0;
    min-width: 0;
}

.tv-stage {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--v2-r-media);
    background: var(--v2-fg);
    box-shadow:
        0 40px 80px -36px rgb(var(--v2-shadow-rgb) / 0.4),
        0 0 0 1px rgb(var(--v2-shadow-rgb) / 0.08);
    isolation: isolate;
}
.tv-compact .tv-stage {
    border-radius: var(--v2-r-md);
    box-shadow:
        0 24px 48px -28px rgb(var(--v2-shadow-rgb) / 0.4),
        0 0 0 1px rgb(var(--v2-shadow-rgb) / 0.08);
}

/* poster cliccabile: copre tutto lo stage finche' il video non parte */
.tv-poster {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--v2-canvas);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.tv-poster > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* velatura solo in basso, per la leggibilita' del badge della durata */
.tv-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, color-mix(in srgb, var(--v2-fg) 38%, transparent) 0%, transparent 38%);
    pointer-events: none;
}
.tv-poster:focus-visible {
    outline: 3px solid var(--v2-accent);
    outline-offset: -3px;
}

.tv-play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--v2-surface);
    color: var(--v2-accent);
    box-shadow: var(--v2-shadow-xl), 0 0 0 8px color-mix(in srgb, var(--v2-surface) 30%, transparent);
    transform: translate(-50%, -50%);
}
/* il triangolo resta verso destra anche in RTL (come i comandi dei player): solo centratura ottica */
.tv-play > svg {
    width: 32px;
    height: 32px;
    margin-left: 4px;
}
.tv-compact .tv-play {
    width: 60px;
    height: 60px;
    box-shadow: var(--v2-shadow-lg), 0 0 0 6px color-mix(in srgb, var(--v2-surface) 30%, transparent);
}
.tv-compact .tv-play > svg {
    width: 24px;
    height: 24px;
    margin-left: 3px;
}

.tv-badge {
    position: absolute;
    inset-block-end: 14px;
    inset-inline-end: 14px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: var(--v2-r-pill);
    background: color-mix(in srgb, var(--v2-fg) 72%, transparent);
    color: var(--v2-surface);
    font-size: var(--v2-xs);
    line-height: var(--v2-xs-lh);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.tv-compact .tv-badge {
    inset-block-end: 10px;
    inset-inline-end: 10px;
}

/* il video (creato al clic dal <template>, oppure dal <noscript> senza JS) */
.tv-video {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    background: var(--v2-fg);
    object-fit: contain;
}
.tv.is-playing .tv-poster {
    display: none;
}

/* "Attiva l'audio" (classe comune .v2-vid-unmute, css/site-v2.css) piu' piccolo nelle griglie */
.tv-compact .v2-vid-unmute {
    inset-block-start: 10px;
    inset-inline-start: 10px;
    padding: 8px 12px;
    font-size: 13px;
}

/* nota sotto il player sulle pagine non it/en: video inglese con sottotitoli */
.tv-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    color: var(--v2-fg-muted);
    font-size: var(--v2-small);
    line-height: var(--v2-small-lh);
    text-align: center;
}
.tv-note > svg {
    flex: none;
    color: var(--v2-fg-subtle);
}
.tv-compact .tv-note {
    justify-content: flex-start;
    margin-top: 10px;
    font-size: var(--v2-xs);
    line-height: var(--v2-xs-lh);
    text-align: start;
}

/* movimento solo se l'utente non chiede di ridurlo */
@media (prefers-reduced-motion: no-preference) {
    .tv-poster > img {
        transition: transform 1.2s var(--v2-ease-out);
    }
    .tv-play {
        transition: transform 0.45s var(--v2-ease-spring), box-shadow 0.45s var(--v2-ease-out);
    }
    .tv-poster:hover > img,
    .tv-poster:focus-visible > img {
        transform: scale(1.03);
    }
    .tv-poster:hover .tv-play,
    .tv-poster:focus-visible .tv-play {
        transform: translate(-50%, -50%) scale(1.08);
    }
    .tv-poster:active .tv-play {
        transform: translate(-50%, -50%) scale(0.96);
    }
}

@media (max-width: 479px) {
    .tv-stage {
        border-radius: var(--v2-r-md);
    }
    .tv-play {
        width: 64px;
        height: 64px;
    }
    .tv-play > svg {
        width: 26px;
        height: 26px;
        margin-left: 3px;
    }
    .tv-badge {
        inset-block-end: 10px;
        inset-inline-end: 10px;
    }
}

/* ------------------------------------------------------------------ pagina /video-tutorial */
.vt2-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: calc(var(--v2-grid-gap) * 1.5) var(--v2-grid-gap);
}
.vt2-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}
.vt2-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.vt2-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}
.vt2-card-head .v2-card-title {
    margin: 0;
}
.vt2-card .v2-card-foot {
    margin-top: auto;
    padding-top: 6px;
}
.vt2-empty {
    align-items: center;
    text-align: center;
}

/* sezione "Video tutorial" sulle pagine funzionalita' */
.vt2-player {
    max-width: 1080px;
    margin-inline: auto;
}
.vt2-section .v2-link-row {
    margin-top: 32px;
}

/* banda nel centro assistenza */
.vt2-band {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px 28px;
}
.vt2-band .v2-h3 {
    margin: 0;
}
.vt2-band p {
    margin: 6px 0 0;
}
@media (max-width: 767px) {
    .vt2-band {
        grid-template-columns: 1fr;
        justify-items: start;
    }
}
