﻿/* ========================================
   5. Hero Section
======================================== */

.hero-section {
    position: relative;
    height: 100vh;
    min-height: var(--hero-min-height);
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: var(--hero-padding-top) 0 var(--hero-padding-bottom);
}

/* Фон отдельным слоем: анимация только у фона, контент остаётся неподвижным */
/* Динамический URL фона задаётся в шаблоне: style="--bg-image: url('…');"; WebP — через main.js */
.hero-slide-bg {
    position: absolute;
    inset: 0;
    background-image: var(--bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: kenBurns 22s ease-in-out infinite alternate;
}

@media (max-width: 767.98px), (prefers-reduced-motion: reduce), (prefers-reduced-data: reduce) {
    .hero-slide-bg {
        animation: none;
    }
}

/* Плавный zoom эффект для hero фона */
@keyframes kenBurns {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.06);
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-gradient);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    padding: 0 20px;
    max-width: var(--hero-content-max-width);
    margin: 0 auto;
}

.hero-slide .container {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-title {
    font-size: var(--hero-title-size);
    font-weight: var(--font-weight-hero);
    margin-bottom: 1.25rem;
    text-shadow: var(--text-shadow-hero);
    line-height: var(--line-height-display);
    color: var(--white);
    letter-spacing: 0.02em;
    hyphens: manual; /* переносы только там, где указано в CMS */
    overflow-wrap: break-word; /* длинные слова переносятся, но без автопереноса коротких фраз */
}

.hero-subtitle {
    font-size: var(--text-xl);
    margin-bottom: 1.75rem;
    font-weight: var(--font-weight-display-light);
    text-shadow: 0 2px 18px var(--black-alpha-80), 0 1px 4px var(--black-alpha-60);
}

/* Погода + CTA — одна «плашка» на hero, не сдвигает кнопку вниз отдельным блоком */
.hero-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
    max-width: min(100%, 34rem);
    margin: 0.25rem auto 0;
}

.hero-actions--with-weather {
    padding: 0.35rem;
    border-radius: calc(var(--radius-lg) + 4px);
    background: var(--white-alpha-15);
    border: none;
    backdrop-filter: var(--glass-blur-md);
    -webkit-backdrop-filter: var(--glass-blur-md);
    box-shadow: 0 8px 28px var(--black-alpha-20), inset 0 1px 0 var(--white-alpha-10);
}

.hero-actions--solo {
    max-width: none;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.hero-actions .hero-cta-primary {
    margin-top: 0;
    align-self: center;
}

.hero-actions--with-weather .hero-cta-primary {
    flex: 0 0 auto;
    margin: 0.15rem 0.15rem 0.15rem 0;
    padding-left: 1.35rem;
    border-radius: calc(var(--btn-radius) + 2px);
    border-left: 1px solid var(--white-alpha-10);
}

@media (max-width: 767.98px) {
    .hero-actions--with-weather {
        flex-direction: column;
        align-items: stretch;
        max-width: min(100%, 20rem);
        padding: 0.45rem 0.45rem 0.55rem;
    }

    .hero-actions--with-weather .hero-cta-primary {
        width: 100%;
        margin: 0.2rem 0.15rem 0.15rem;
        padding-left: 1.75rem;
        border-left: none;
        border-top: 1px solid var(--white-alpha-10);
        padding-top: 0.65rem;
        padding-bottom: 0.1rem;
        justify-content: center;
    }
}

.hero-content .page-lead-hero {
    text-shadow: 0 2px 14px var(--black-alpha-70), 0 1px 3px var(--black-alpha-50);
}

/* scroll-hint — между виджетом поиска и низом hero (читаемо на тёмном фоне) */
.hero-scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    position: relative;
    z-index: 2;
    color: var(--cream-solid);
    font-size: var(--text-base);
    font-weight: var(--font-weight-display-light);
    letter-spacing: 0.08em;
    text-shadow: 0 2px 14px var(--black-alpha-80), 0 0 20px var(--black-alpha-60);
    cursor: pointer;
    transition: color var(--motion-base) var(--ease-standard),
                transform var(--motion-base) var(--ease-standard),
                text-shadow var(--motion-base) var(--ease-standard);
    flex-shrink: 0;
    padding: 0.65rem 1rem;
}

.hero-scroll-hint span {
    text-shadow: inherit;
}

@media (hover: hover) {
    .hero-scroll-hint:hover {
        color: var(--white);
        transform: translateY(3px);
        text-shadow: 0 2px 18px var(--black-alpha-80), 0 0 28px var(--black-alpha-70);
    }
}

.hero-scroll-hint-arrow {
    font-size: 1.35rem;
    line-height: 1;
    color: inherit;
    filter: drop-shadow(0 2px 10px var(--black-alpha-80));
    animation: scrollBounce 2s ease-in-out infinite;
}

button.hero-scroll-hint {
    font: inherit;
    font-weight: var(--font-weight-display-light);
    color: var(--cream-solid);
    background: none;
    border: none;
    width: 100%;
}

button.hero-scroll-hint:focus-visible {
    outline: var(--focus-ring-width) solid var(--white);
    outline-offset: 4px;
    border-radius: var(--radius-md);
}

@media (prefers-reduced-motion: reduce) {
    .hero-scroll-hint-arrow {
        animation: none !important;
    }
}

/* Анимация "прыгающей" стрелки прокрутки */
@keyframes scrollBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(6px);
    }
}
