/* ─── Fonts ────────────────────────────────────────────── */
@font-face {
    font-family: "FC Bayern Sans";
    src: url("../fonts/FCBayernSans.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "FC Bayern Sans";
    src: url("../fonts/FCBayernSans-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ─── Hero section ─────────────────────────────────────── */
.hero-video {
    display: grid;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    background-color: transparent;
    grid-template-areas: "video";
    position: relative;
}

/* ─── Video frame ──────────────────────────────────────── */
.hero-video__frame {
    grid-area: video;
    overflow: hidden;
    display: block;
    position: relative;
}

/* gradient overlay for text readability */
.hero-video__frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0,0,0,0.55) 0%,
        rgba(0,0,0,0.20) 50%,
        rgba(0,0,0,0.05) 100%
    );
    pointer-events: none;
}

/* ─── Video / fallback image ────────────────────────────── */
.hero-video__bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ─── Overlay (title + description) ────────────────────── */
/* Оверлей розтягнутий на всю площу hero, а положення тексту в ньому задають
   змінні --hero-justify (вертикаль) / --hero-align (горизонталь). Їх підставляє
   інлайн-стилем Customizer → «Hero-секція (відео)». Поки нічого не вибрано —
   працюють дефолти: десктоп — зверху зліва, мобільний — по центру. */
.hero-video__overlay {
    grid-area: video;
    display: flex;
    flex-direction: column;
    justify-content: var(--hero-justify, flex-start);
    align-items: var(--hero-align, flex-start);
    padding: 3% 3% 0;
    color: #fff;
    z-index: 2;
    /* оверлей перекриває весь кадр — клики пропускаємо крізь нього */
    pointer-events: none;
    /* parallax: JS оновлює змінні при скролі; вони резолвляться і всередині
       keyframes, тому fill-mode анімації появи їх не перекриває.
       --hero-dx / --hero-dy — ручний зсув із Customizer. */
    transform: translate3d(var(--hero-dx, 0px), calc(var(--hero-dy, 0px) + var(--hero-parallax, 0px)), 0);
    opacity: var(--hero-parallax-fade, 1);
    will-change: transform, opacity;
    animation: overlayFadeIn 0.9s ease both;
}

.hero-video__content {
    max-width: 48%;
    text-align: var(--hero-text-align, left);
    pointer-events: auto;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
        transform: translate3d(var(--hero-dx, 0px), calc(var(--hero-dy, 0px) + var(--hero-parallax, 0px) + 14px), 0);
    }
    to {
        opacity: var(--hero-parallax-fade, 1);
        transform: translate3d(var(--hero-dx, 0px), calc(var(--hero-dy, 0px) + var(--hero-parallax, 0px)), 0);
    }
}

/* ─── Heading ───────────────────────────────────────────── */
.hero-video__title {
    font-family: "FC Bayern Sans", sans-serif;
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 4rem);
    margin: 0 0 0.4em;
    line-height: 1.1;
    text-transform: uppercase;
    color: #fff;
    -webkit-text-stroke: 1.5px #fff;
    paint-order: stroke fill;
    animation: strokeReveal 1.2s 0.3s ease forwards;
}

@keyframes strokeReveal {
    from { opacity: 0.4; }
    to   { opacity: 1;   }
}

/* ─── Description ───────────────────────────────────────── */
.hero-video__text {
    font-size: clamp(0.95rem, 1.4vw, 1.35rem);
    line-height: 1.6;
    opacity: 0;
    animation: textFadeIn 0.8s 0.7s ease forwards;
}

@keyframes textFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-video__text > p {
    color: rgba(255,255,255,0.88);
    text-shadow: 0 1px 6px rgba(0,0,0,0.4);
    margin: 0;
}

.hero-video__text > p + p { margin-top: 0.6em; }

/* ─── CTA button ───────────────────────────────────────── */
.hero-video__btn {
    grid-area: video;
    justify-self: end;
    align-self: end;
    margin: 2%;
    z-index: 5;
    opacity: 0;
    animation: btnSlideIn 0.7s 1s ease forwards;
}

.hero-video__btn:link,
.hero-video__btn:visited { color: #fff; }
.hero-video__btn:hover,
.hero-video__btn:hover:link,
.hero-video__btn:hover:visited { color: #0f0f0f; }

@keyframes btnSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
    .hero-video__content { max-width: 55%; }
    .hero-video__title { font-size: clamp(1.5rem, 5vw, 3rem); }
    .hero-video__text  { font-size: clamp(0.9rem, 2.5vw, 1.2rem); }
}

@media (max-width: 768px) {
    .hero-video__overlay { padding: calc(74px + 1rem) 2% 0; }
    .hero-video__content { max-width: 80%; }
    .hero-video__btn { padding: 0.75em 1.4em; margin: 1.5%; }
}

@media (max-width: 480px) {
    .hero-video__overlay {
        /* 74px — висота шапки. --hero-pad-top Customizer обнуляє, коли позицію
           задано вручну; інакше текст стоїть на 15dvh нижче шапки, як і був.
           Нижній відступ тримає текст над кнопкою на всю ширину. */
        padding: calc(74px + var(--hero-pad-top, 15vh)) 5% 5rem;
        padding-top: calc(74px + var(--hero-pad-top, 15dvh));
        align-items: var(--hero-align, center);
    }
    .hero-video__content {
        max-width: 95%;
        text-align: var(--hero-text-align, center);
    }
    .hero-video__btn {
        justify-self: center;
        align-self: end;
        width: calc(100% - 2em);
        margin-bottom: 1.2em;
    }
}
