/* ============================================================
   CE "Produktvideos" (fux_videocenter, Etappe Produktvideos 2026-10-15)
   nach Prototyp _prototypes/produktvideos/variante-d.html (assets/
   videos.css: Datenschutz-Hinweis, Eyebrow, Videokarte, Video-Lightbox;
   Praefix pv- -> vc-). Filter-Sidebar, Suchfeld, mobiles Modal und
   Leerzustand: products.css (gemeinsame Filter-Sidebar).

   Kontraste (WCAG 1.4.3 / 1.4.11), aus dem Prototyp nachgerechnet:
   - Sekundaertext #6e6e73 auf #f5f5f7 / #fff . . . .  4,66 / 5,07:1
   - Eyebrow/Links #0066cc auf #f5f5f7 / #fff . . . .  5,11 / 5,57:1
   - Play-Badge #fff auf #0066cc . . . . . . . . . . . 5,57:1
   - Lightbox-Text #f5f5f7 auf #1d1d1f . . . . . . . . ca. 15:1
   - Lightbox-Fokus #fff auf #1d1d1f . . . . . . . . . ca. 17:1
   ============================================================ */

/* Inhaltsbereich wie .category-main/.downloadcenter (Prototyp .pv-content):
   48 px unter dem Seitenkopf, 80 px vor dem CTA-Band (das seit 2026-10-19
   direkt anschliesst, Rahmen-Layout). Im Relaunch-Rahmen seit 2026-10-30
   oben und unten der Standardabstand (Regel unten). */
.videocenter {
    padding: var(--space-lg) 0 var(--space-xl);
    background: var(--white);
}

/* Standardabstand des Inhaltsbereichs (User-Vorgabe 2026-10-30): im
   Relaunch-Rahmen steht das Center als Abschnitt am Rand der Inhaltshuelle,
   die dort auf ihren Abstand verzichtet (relaunch-frame.css, Abschnitt
   "Inhaltsbereich"). Der Rand-Innenabstand ist deshalb der Standard
   (48 px, unter 769 px 32 px) statt --space-lg/--space-xl. */
body.fux-relaunch .videocenter:first-child {
    padding-top: var(--fux-content-gap, var(--space-lg));
}

body.fux-relaunch .videocenter:last-child {
    padding-bottom: var(--fux-content-gap, var(--space-lg));
}

/* ---------- Inline-Link ---------- */
.vc-inline-link {
    color: var(--hsgm-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.vc-inline-link:hover {
    color: var(--hsgm-blue-dark);
}

/* ---------- Eyebrow (wie Produktkarten: GRUPPE · UNTERTYP) ---------- */
.vc-eyebrow {
    margin: 0 0 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--hsgm-blue);
    /* lange Komposita (STYROPORSCHNEIDEGERÄTE) bei 320 px umbrechen (1.4.10) */
    hyphens: auto;
    overflow-wrap: break-word;
}

/* ---------- Videokarte ---------- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.video-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--gray-quaternary);
    border: 1px solid var(--gray-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-base);
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--hsgm-blue-light);
}

/* Fokus der gestreckten Ausloeser-Verknuepfung sichtbar an der ganzen Karte */
.video-card:has(.video-trigger:focus-visible) {
    outline: 3px solid var(--hsgm-blue);
    outline-offset: 3px;
}

.video-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--gray-primary);
    overflow: hidden;
}

.video-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-card:hover .video-card-media img {
    transform: scale(1.03);
}

/* Produktfoto statt Videostandbild: freigestellt, nicht beschneiden */
.video-card-media img.is-product-photo {
    object-fit: contain;
    background: var(--white);
    padding: 0.5rem;
}

/* Eigenes Play-Badge: einheitliche Affordanz, auch bei Bildern ohne
   eingebranntes YouTube-Symbol (Produktfoto-Platzhalter) */
.play-badge {
    position: absolute;
    left: 0.75rem;
    bottom: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.75rem 0.3125rem 0.5rem;
    border-radius: 999px;
    background: var(--hsgm-blue);
    color: var(--white);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.play-badge svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.video-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 1.25rem 1.25rem 1.25rem;
}

.video-card-title,
.video-dialog-title {
    hyphens: auto;
    overflow-wrap: break-word;
}

.video-card-title {
    margin: 0 0 0.375rem;
    font-size: 1.1875rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-primary);
}

.video-card-text {
    margin: 0 0 1rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--gray-secondary);
}

/* Gestreckter Ausloeser: die ganze Karte ist Klickflaeche */
.video-trigger {
    color: inherit;
    text-decoration: none;
}

.video-trigger::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    cursor: pointer;
}

.video-trigger:focus-visible,
body.fux-relaunch .video-trigger:focus-visible {
    outline: none; /* Rahmen traegt die Karte (:has oben) */
}

.product-link {
    position: relative;
    z-index: 2; /* ueber dem gestreckten Ausloeser */
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 44px;
    margin-top: auto;
    color: var(--hsgm-blue);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
}

.product-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.product-link:focus-visible,
body.fux-relaunch .product-link:focus-visible {
    outline: 3px solid var(--hsgm-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

.product-link svg {
    width: 16px;
    height: 16px;
}

/* Ziel eines Ankers (#video-<slug>, Weiterleitung der alten Einzelseiten):
   aktiver CI-Zustand wie .product-card.is-current (Rahmen --hsgm-blue +
   1px-Ring), damit man die Karte nach dem Sprung findet. YouTube laedt
   trotzdem erst nach Klick. */
.video-grid > li:target .video-card,
.video-grid > li.is-target .video-card {
    border-color: var(--hsgm-blue);
    box-shadow: 0 0 0 1px var(--hsgm-blue);
}

.video-grid > li {
    scroll-margin-top: calc(var(--fux-sticky-offset, 72px) + 1.5rem);
}

/* ---------- Video-Lightbox (natives <dialog>) ---------- */
.video-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 4.5rem 5rem 2rem;
    border: 0;
    box-sizing: border-box;
    background: #1d1d1f; /* PV-G-05: am Dialog selbst, nicht nur ::backdrop */
    color: var(--white);
    overflow: auto;
}

.video-dialog[open] {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.video-dialog::backdrop {
    background: #1d1d1f; /* deckend (PV-G-05): Text liegt ueber der Seite, kein Durchscheinen */
}

.video-dialog-inner {
    width: 100%;
    max-width: min(1100px, calc((100dvh - 22rem) * 16 / 9));
    min-width: min(100%, 560px);
    margin: auto 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.video-dialog-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 1rem;
}

.video-dialog-eyebrow {
    margin: 0 0 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #a1c9f4; /* auf #1d1d1f ca. 10:1 */
}

.video-dialog-title {
    margin: 0;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--white);
}

.video-dialog-counter {
    margin: 0;
    font-size: var(--font-size-small);
    color: #f5f5f7;
    white-space: nowrap;
}

.video-dialog-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.video-dialog-player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-dialog-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    color: #f5f5f7;
    font-size: var(--font-size-small);
}

.video-dialog-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
}

.video-dialog-subtitle {
    margin: 0;
    color: #f5f5f7;
    font-size: 1rem;
}

.video-dialog a {
    color: var(--white);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.video-dialog-product {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 44px;
    font-weight: 600;
    white-space: nowrap;
}

.video-dialog-product svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.video-dialog-notes {
    display: grid;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: var(--font-size-small);
    color: #f5f5f7;
}

.video-dialog-notes p {
    margin: 0;
}

.video-dialog-transcript summary {
    cursor: pointer;
    min-height: 24px;
    font-weight: 600;
}

.video-dialog-transcript p {
    margin-top: 0.5rem;
}

.video-dialog-close,
.video-dialog-prev,
.video-dialog-next {
    position: fixed;
    z-index: 2;
    width: 3rem;
    height: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    background: rgba(29, 29, 31, 0.6);
    color: var(--white);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.video-dialog-close svg,
.video-dialog-prev svg,
.video-dialog-next svg {
    width: 24px;
    height: 24px;
}

.video-dialog-close {
    top: 1rem;
    right: 1rem;
}

.video-dialog-prev,
.video-dialog-next {
    top: 50%;
    transform: translateY(-50%);
}

.video-dialog-prev {
    left: 1rem;
}

.video-dialog-next {
    right: 1rem;
}

.video-dialog-close:hover,
.video-dialog-prev:hover,
.video-dialog-next:hover {
    background: var(--hsgm-blue);
    border-color: var(--hsgm-blue);
}

/* Weisser Fokusrahmen: Blau hat auf dem Backdrop nur 2,4:1 (wie LB-02) */
.video-dialog-close:focus-visible,
.video-dialog-prev:focus-visible,
.video-dialog-next:focus-visible,
.video-dialog a:focus-visible,
.video-dialog summary:focus-visible,
body.fux-relaunch .video-dialog-close:focus-visible,
body.fux-relaunch .video-dialog-prev:focus-visible,
body.fux-relaunch .video-dialog-next:focus-visible,
body.fux-relaunch .video-dialog a:focus-visible,
body.fux-relaunch .video-dialog summary:focus-visible {
    outline: 3px solid var(--white);
    outline-offset: 2px;
    border-radius: 4px;
}

body.fux-relaunch .video-dialog-close:focus-visible,
body.fux-relaunch .video-dialog-prev:focus-visible,
body.fux-relaunch .video-dialog-next:focus-visible {
    border-radius: 50%;
}

@media (max-width: 767.98px) {
    .video-dialog {
        padding: 4.5rem 0.75rem 5rem;
    }

    .video-dialog-inner {
        min-width: 0;
        max-width: 100%;
    }

    .video-dialog-prev,
    .video-dialog-next {
        top: auto;
        bottom: 1rem;
        transform: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .video-dialog[open] {
        animation: vc-fade 0.2s ease-out;
    }

    .video-dialog-inner.is-entering-next {
        animation: vc-in-next 0.25s ease-out;
    }

    .video-dialog-inner.is-entering-prev {
        animation: vc-in-prev 0.25s ease-out;
    }
}

@keyframes vc-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes vc-in-next {
    from { opacity: 0; transform: translateX(2rem); }
    to { opacity: 1; transform: none; }
}

@keyframes vc-in-prev {
    from { opacity: 0; transform: translateX(-2rem); }
    to { opacity: 1; transform: none; }
}

/* Hintergrund-Scroll sperren, solange der Dialog offen ist */
html.vc-dialog-open {
    overflow: hidden;
}

/* Dialog: Textfassung-Ueberschrift und Tastatur-Hinweis (PV-G-02) */
.video-dialog-transcript-title {
    margin: 0.5rem 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
}

.video-dialog-keyhint {
    color: #d2d2d7; /* auf #1d1d1f ca. 12:1 */
}

/* Lightbox: Blaettern-Buttons. Breit und hoch genug: fix am Rand (wie die
   Bild-Lightbox, Pager per display:contents). Schmal ODER niedrig (PV-G-04,
   A11y-Review M-2): im Fluss unter dem Inhalt, nichts ueberdeckt Text oder
   Player. Aus dem Prototyp videos.css uebernommen. */
.video-dialog-pager {
    display: contents;
}

.video-dialog-pager[hidden] {
    display: none !important;
}

@media (max-width: 767.98px), (max-height: 30em) {
    .video-dialog {
        padding-bottom: 1.5rem;
    }

    .video-dialog-pager {
        display: flex;
        justify-content: center;
        gap: 1rem;
        width: 100%;
        padding-top: 1rem;
    }

    .video-dialog-prev,
    .video-dialog-next {
        position: static;
        transform: none;
    }

    /* der fixe Schliessen-Button ueberdeckt sonst den Anfang der Eyebrow */
    .video-dialog-head {
        padding-right: 3.5rem;
    }
}

@media (max-height: 30em) {
    .video-dialog {
        padding-top: 4rem;
    }

    /* Player darf schrumpfen, Inhalt bleibt scrollbar (Reflow 1.4.10) */
    .video-dialog-inner {
        max-width: min(100%, 36rem);
        min-width: 0;
    }
}

/* Platzhalter ohne Einwilligung (Cookiebot "Marketing", User 2026-10-15):
   steht statt des Players in der 16:9-Flaeche */
.video-dialog-consent {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* safe: bei Ueberlauf (Text-Spacing) bleibt der Anfang erreichbar (A11y N-3) */
    justify-content: safe center;
    gap: 1rem;
    padding: 1.5rem;
    overflow: auto;
    text-align: center;
    color: #f5f5f7;
    font-size: var(--font-size-small);
    line-height: 1.5;
}

.video-dialog-consent p {
    max-width: 34rem;
    margin: 0;
}

.video-dialog-consent-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.5rem;
    align-items: center;
}

.video-dialog-consent button {
    min-height: 2.75rem;
    padding: 0.625rem 1.25rem;
    border: 0;
    border-radius: 2rem;
    background: var(--hsgm-blue);
    color: var(--white);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.video-dialog-consent button:hover {
    background: var(--hsgm-blue-dark);
}

.video-dialog-consent button:focus-visible,
body.fux-relaunch .video-dialog-consent button:focus-visible {
    outline: 3px solid var(--white);
    outline-offset: 2px;
}

@media (max-height: 30em), (max-width: 479.98px) {
    /* wenig Flaeche: Platzhalter waechst mit dem Inhalt statt zu ueberlaufen */
    .video-dialog-player:has(.video-dialog-consent) {
        aspect-ratio: auto;
    }

    .video-dialog-consent {
        position: static;
    }
}

@media (forced-colors: active) {
    .video-dialog-consent button {
        border: 1px solid ButtonText;
    }
}

/* Kontaktlink im Leerzustand im CI-Stil (A11y A-5) */
.videocenter .filter-empty a {
    color: var(--hsgm-blue);
    text-underline-offset: 3px;
}

/* ---------- Bewegung, Kontrastmodus ---------- */
@media (prefers-reduced-motion: reduce) {
    .video-card,
    .video-card-media img {
        transition: none;
    }

    .video-card:hover {
        transform: none;
    }

    .video-card:hover .video-card-media img {
        transform: none;
    }
}

@media (forced-colors: active) {
    .video-card,
    .play-badge {
        border: 1px solid CanvasText;
    }

    .video-grid > li:target .video-card,
    .video-grid > li.is-target .video-card {
        outline: 3px solid Highlight;
    }
}
