/**
 * Home v2 — Hero-Slider (Produkt-Animation + Deutscher Notartag), heller Auftritt.
 *
 * Markup: template-parts/home-v2/hero.php, Steuerung: assets/js/hero-slider.js.
 * Reines CSS, keine Schriften/Bibliotheken von fremden Servern. Zeitschema der
 * Produkt-Animation: 5 Bilder x 5 s = 25 s je Durchlauf (--o wird mit 1,3 gedehnt) (--p = Bildnummer,
 * --o = Versatz innerhalb des Bildes). Die Animationen haengen an `.is-active`,
 * damit sie bei jedem Folienwechsel von vorn beginnen und unsichtbare Folien nicht rechnen.
 * Die Beispieldaten (Muster GmbH, Anna Beispiel, 2.150,00 EUR) sind erfunden.
 *
 * Hell: Die Variablen aus home-v2.css (--hv2-*) werden nur im Hero umgedreht,
 * damit Eyebrow, Titel, Untertitel und Buttons ohne Sonderregeln mitziehen.
 */

/* ============================================================
   Helle Farbwelt des Heros
   ============================================================ */
.hv2s {
    --hv2s-dur: 25s;
    --hv2-text: #0b1b33;
    --hv2-text-muted: #3f526c;
    --hv2-text-subtle: #5d6f87;
    --hv2-accent: #1565c0;
    --hv2-accent-strong: #2196f3;
    --hv2-accent-soft: rgba(33, 150, 243, 0.2);
    --hv2-accent-glow: rgba(33, 150, 243, 0.35);
    --hv2-glass-bg: rgba(255, 255, 255, 0.78);
    --hv2-glass-border: rgba(11, 27, 51, 0.1);
    --hv2s-card: rgba(255, 255, 255, 0.92);
    --hv2s-tint: rgba(33, 150, 243, 0.07);
    background: linear-gradient(165deg, #fbfdff 0%, #eef6fe 48%, #dcecfb 100%);
}

.hv2s .home-v2-hero-overlay {
    background:
        radial-gradient(ellipse at 85% 10%, rgba(255, 226, 170, 0.45) 0%, transparent 50%),
        radial-gradient(ellipse at 10% 90%, rgba(33, 150, 243, 0.14) 0%, transparent 55%);
}

.hv2s .home-v2-hero-orb {
    opacity: 0.7;
}

.hv2s .home-v2-hero-orb-1 { background: rgba(71, 178, 228, 0.34); }
.hv2s .home-v2-hero-orb-2 { background: rgba(255, 205, 120, 0.4); }
.hv2s .home-v2-hero-orb-3 { background: rgba(33, 150, 243, 0.16); }

.hv2s .home-v2-hero-title {
    text-shadow: none;
}

.hv2s .home-v2-hero-eyebrow {
    background: rgba(33, 150, 243, 0.08);
    border-color: rgba(33, 150, 243, 0.25);
}

.hv2s .home-v2-hero-scroll-hint {
    border-color: rgba(11, 27, 51, 0.3);
}

.hv2s .home-v2-hero-scroll-hint span {
    background: rgba(11, 27, 51, 0.55);
}

/* ============================================================
   Kopfzeile über dem hellen Hero: dunkle Schrift, solange nicht gescrollt
   (nach dem Scrollen und bei offenem Handy-Menü bleibt sie hell auf dunklem Grund)
   ============================================================ */
body.home .nv-header:not(.is-scrolled):not(.is-mobile-open) .nv-header__sitename,
body.home .nv-header:not(.is-scrolled):not(.is-mobile-open) .nv-header__nav a {
    color: #0b1b33;
}

body.home .nv-header:not(.is-scrolled):not(.is-mobile-open) .nv-header__nav a:hover,
body.home .nv-header:not(.is-scrolled):not(.is-mobile-open) .nv-header__nav a[aria-current],
body.home .nv-header:not(.is-scrolled):not(.is-mobile-open) .nv-header__nav .current-menu-item > a {
    color: #1565c0;
}

body.home .nv-header:not(.is-scrolled):not(.is-mobile-open) .nv-header__toggle {
    color: #0b1b33;
    border-color: rgba(11, 27, 51, 0.25);
}

/* ============================================================
   Folien-Gerüst: alle Folien übereinander, die aktive blendet ein
   ============================================================ */
.hv2s-slides {
    display: grid;
    width: 100%;
}

.hv2s-slide {
    grid-area: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s ease, visibility 0.7s ease;
}

.hv2s-slide.is-active {
    opacity: 1;
    visibility: visible;
}

.hv2s .home-v2-hero-content {
    width: 100%;
    padding: 140px 12px 150px;
}

.hv2s-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 56px;
    align-items: center;
}

.hv2s-text {
    text-align: left;
}

.hv2s .home-v2-hero-title {
    font-size: clamp(34px, 4.4vw, 60px);
}

.hv2s .home-v2-hero-subtitle {
    margin: 0 0 40px;
    max-width: 560px;
}

.hv2s .home-v2-hero-ctas {
    justify-content: flex-start;
}

.hv2s .home-v2-hero-eyebrow i {
    margin-right: 6px;
}

.hv2s-visual {
    min-width: 0;
}

/* ============================================================
   Slide 1: Produkt-Szene
   ============================================================ */
.hv2s-scene {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
}

.hv2s-win {
    background: var(--hv2s-card);
    border: 1px solid var(--hv2-glass-border);
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(33, 99, 170, 0.18), 0 4px 14px rgba(11, 27, 51, 0.06);
    overflow: hidden;
}

.hv2s-win-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 16px;
    border-bottom: 1px solid var(--hv2-glass-border);
    background: rgba(11, 27, 51, 0.03);
}

.hv2s-win-bar i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(11, 27, 51, 0.16);
}

.hv2s-win-bar i:nth-child(1) { background: #ff6b6b; }
.hv2s-win-bar i:nth-child(2) { background: #ffc857; }
.hv2s-win-bar i:nth-child(3) { background: #5dd39e; }

.hv2s-win-bar span {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--hv2-text-subtle);
}

.hv2s-panels {
    position: relative;
    height: 272px;
}

.hv2s-panel {
    position: absolute;
    inset: 0;
    padding: 22px 24px;
    opacity: 0;
}

.hv2s-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--hv2-accent);
}

.hv2s-title {
    margin: 14px 0 10px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--hv2-text);
}

.hv2s-fields {
    margin-top: 6px;
}

.hv2s-field {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 9px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--hv2s-tint);
    font-size: 14px;
}

.hv2s-field span {
    flex: 0 0 82px;
    font-size: 12px;
    color: var(--hv2-text-subtle);
}

.hv2s-field b {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: var(--hv2-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hv2s-field--wide b {
    white-space: normal;
    overflow: visible;
}

.hv2s-field em {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    padding: 4px;
    border-radius: 50%;
    background: var(--hv2-accent-strong);
    color: #fff;
}

.hv2s-field em svg,
.hv2s-chip svg {
    display: block;
    width: 100%;
    height: 100%;
}

.hv2s-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 6px;
}

.hv2s-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    border: 1px solid var(--hv2-accent-soft);
    border-radius: 999px;
    background: rgba(33, 150, 243, 0.09);
    font-size: 14px;
    font-weight: 600;
    color: var(--hv2-text);
}

.hv2s-chip svg {
    width: 14px;
    height: 14px;
    color: var(--hv2-accent);
}

.hv2s-note {
    margin-top: 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--hv2-accent);
}

/* Word Add-in: Papier mit befüllten Platzhaltern */
.hv2s-doc {
    margin-top: 12px;
    padding: 0 0 14px;
    border: 1px solid var(--hv2-glass-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(11, 27, 51, 0.06);
    overflow: hidden;
}

.hv2s-doc-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--hv2-glass-border);
    background: #f3f7fc;
    font-size: 12px;
    font-weight: 600;
    color: var(--hv2-text-muted);
}

.hv2s-doc-w {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: #2b579a;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
}

.hv2s-doc-h {
    padding: 14px 16px 0;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--hv2-text);
}

.hv2s-doc-p {
    margin: 8px 0 0;
    padding: 0 16px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 14px;
    line-height: 1.85;
    color: var(--hv2-text);
}

.hv2s-ph {
    display: inline-block;
    padding: 0 6px;
    border-radius: 4px;
    background: rgba(33, 150, 243, 0.16);
    font-weight: 700;
    color: #0d47a1;
}

.hv2s-sum {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 12px 0 0;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(33, 150, 243, 0.1);
}

.hv2s-sum span {
    font-size: 13px;
    font-weight: 600;
    color: var(--hv2-text-muted);
}

.hv2s-sum b {
    font-family: 'Poppins', 'Open Sans', system-ui, sans-serif;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--hv2-text);
}

.hv2s-in {
    opacity: 0;
}

.hv2s-steps {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.hv2s-steps span {
    padding: 6px 13px;
    border: 1px solid var(--hv2-glass-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--hv2-text-subtle);
}

/* Animation nur auf der aktiven Folie (startet bei jedem Wechsel neu) */
.hv2s-slide.is-active .hv2s-panel {
    animation: hv2s-panel var(--hv2s-dur) linear infinite;
    animation-delay: calc(var(--p) * 5s);
}

.hv2s-slide.is-active .hv2s-in {
    animation: hv2s-in var(--hv2s-dur) ease-out infinite;
    animation-delay: calc(var(--p) * 5s + var(--o, 0s) * 1.3);
}

.hv2s-slide.is-active .hv2s-steps span {
    animation: hv2s-step var(--hv2s-dur) linear infinite;
    animation-delay: calc(var(--p) * 5s);
}

/* Bild i sichtbar von i*5 s bis i*5+5 s (= 20 % der 25 s) */
@keyframes hv2s-panel {
    0%   { opacity: 0; transform: translateY(8px); }
    2.4% { opacity: 1; transform: translateY(0); }
    17.6% { opacity: 1; transform: translateY(0); }
    20%  { opacity: 0; transform: translateY(-6px); }
    100% { opacity: 0; transform: translateY(-6px); }
}

@keyframes hv2s-in {
    0%   { opacity: 0; transform: translateY(10px); }
    2.4% { opacity: 1; transform: translateY(0); }
    17.6% { opacity: 1; transform: translateY(0); }
    19%  { opacity: 0; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(0); }
}

@keyframes hv2s-step {
    0%   { color: #fff; border-color: var(--hv2-accent-strong); background: var(--hv2-accent-strong); }
    19%  { color: #fff; border-color: var(--hv2-accent-strong); background: var(--hv2-accent-strong); }
    21%  { color: var(--hv2-text-subtle); border-color: var(--hv2-glass-border); background: rgba(255, 255, 255, 0.6); }
    100% { color: var(--hv2-text-subtle); border-color: var(--hv2-glass-border); background: rgba(255, 255, 255, 0.6); }
}

/* ============================================================
   Slide 2: Notartag
   ============================================================ */
.hv2s-date {
    position: relative;
    width: min(360px, 100%);
    margin: 0 auto;
    padding: 44px 32px 40px;
    text-align: center;
    border: 1px solid var(--hv2-glass-border);
    border-radius: 28px;
    background: linear-gradient(160deg, #ffffff 0%, #eaf4fe 100%);
    box-shadow: 0 28px 70px rgba(33, 99, 170, 0.2), 0 4px 14px rgba(11, 27, 51, 0.06);
}

.hv2s-date-ring {
    position: absolute;
    inset: -14px;
    border: 1px solid rgba(33, 150, 243, 0.3);
    border-radius: 38px;
    pointer-events: none;
}

.hv2s-date > i {
    display: block;
    margin-bottom: 14px;
    font-size: 40px;
    line-height: 1;
    color: var(--hv2-accent-strong);
}

.hv2s-date-days {
    font-family: 'Poppins', 'Open Sans', system-ui, sans-serif;
    font-size: clamp(48px, 7vw, 72px);
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
    color: var(--hv2-text);
}

.hv2s-date-month {
    margin-top: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--hv2-text-muted);
}

.hv2s-date-place {
    display: inline-block;
    margin-top: 22px;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(33, 150, 243, 0.12);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--hv2-accent);
}

.hv2s-slide.is-active .hv2s-date-ring {
    animation: hv2s-pulse 3.2s ease-in-out infinite;
}

@keyframes hv2s-pulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50%      { transform: scale(1.035); opacity: 0.3; }
}

/* ============================================================
   Bedienelemente
   ============================================================ */
.hv2s-controls {
    position: absolute;
    left: 50%;
    bottom: 116px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
    transform: translateX(-50%);
}

.hv2s-dots {
    display: flex;
    align-items: center;
}

.hv2s-dot {
    box-sizing: content-box;
    position: relative;
    width: 14px;
    height: 14px;
    padding: 0;
    border: 15px solid transparent;
    border-radius: 999px;
    background: rgba(11, 27, 51, 0.22);
    background-clip: padding-box;
    cursor: pointer;
    overflow: hidden;
    transition: width 0.3s ease, background-color 0.2s ease;
}

.hv2s-dot:hover {
    background-color: rgba(11, 27, 51, 0.4);
}

.hv2s-dot.is-active {
    width: 40px;
    background-color: rgba(11, 27, 51, 0.14);
}

.hv2s-dot.is-active::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--hv2-accent-strong);
    transform: scaleX(1);
    transform-origin: left center;
}

.hv2s.is-playing .hv2s-dot.is-active::after {
    animation: hv2s-fill var(--hv2s-slide-dur, 25s) linear forwards;
}

.hv2s.is-held .hv2s-dot.is-active::after {
    animation-play-state: paused;
}

@keyframes hv2s-fill {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

.hv2s-pause {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--hv2-glass-border);
    border-radius: 50%;
    background: var(--hv2-glass-bg);
    color: var(--hv2-text);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(11, 27, 51, 0.08);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.hv2s-pause:hover {
    background: #fff;
    border-color: var(--hv2-accent-soft);
}

.hv2s-ico-pause {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 14px;
    transform: translate(-50%, -50%);
    border-left: 4px solid currentColor;
    border-right: 4px solid currentColor;
    box-sizing: border-box;
}

.hv2s-pause.is-paused .hv2s-ico-pause {
    width: 0;
    height: 0;
    margin-left: 2px;
    border-left: 12px solid currentColor;
    border-right: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
}

.hv2s-pause:focus-visible,
.hv2s-dot:focus-visible {
    outline: 2px solid var(--hv2-accent);
    outline-offset: 2px;
}

/* ============================================================
   Bewegung reduzieren: Szene steht im Endzustand, der Slider wechselt
   weiter (Pause-Knopf stoppt ihn)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .hv2s-slide {
        transition: none;
    }
    .hv2s-slide.is-active .hv2s-panel,
    .hv2s-slide.is-active .hv2s-in,
    .hv2s-slide.is-active .hv2s-steps span,
    .hv2s-slide.is-active .hv2s-date-ring,
    .hv2s.is-playing .hv2s-dot.is-active::after {
        animation: none;
    }
    .hv2s-panel:first-child,
    .hv2s-panel:first-child .hv2s-in {
        opacity: 1;
    }
    .hv2s-steps span:first-child {
        color: #fff;
        border-color: var(--hv2-accent-strong);
        background: var(--hv2-accent-strong);
    }
    .hv2s.is-playing .hv2s-dot.is-active::after {
        transform: scaleX(1);
    }
}

/* ============================================================
   Schmale Bildschirme: eine Spalte, Text zuerst
   ============================================================ */
@media (max-width: 991px) {
    .hv2s .home-v2-hero-content {
        padding: 110px 12px 130px;
    }
    .hv2s-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }
    .hv2s-text {
        text-align: center;
    }
    .hv2s .home-v2-hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    .hv2s .home-v2-hero-ctas {
        justify-content: center;
    }
    .hv2s-controls {
        bottom: 36px;
    }
}

@media (max-width: 480px) {
    .hv2s-panels {
        height: 300px;
    }
    .hv2s-panel {
        padding: 18px;
    }
    .hv2s-field span {
        flex-basis: 70px;
    }
    .hv2s-steps span {
        padding: 5px 10px;
        letter-spacing: 1px;
    }
}
