/**
 * Адаптивные стили лендинга
 * Breakpoints: 320 | 480 | 768 | 992 | 1200 | 1400
 * Touch targets: min 44px (iOS) / 48dp (Android)
 * Поддержка: iOS Safari, Android Chrome, Samsung Internet
 */

/* === iOS + Android: общие стили для мобильных === */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

/* Убираем подсветку при тапе (iOS/Android) */
a, button, input, select, textarea, label, [role="button"] {
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

/* Быстрый отклик на тап без задержки 300ms (iOS/Android) */
@media (hover: none) {
    a, button, input, select, textarea, label {
        touch-action: manipulation;
    }
}

/* Android: font-size >= 16px в input предотвращает авто-зум при фокусе */
@media (max-width: 767px) {
    input[type="email"],
    input[type="text"],
    input[type="tel"],
    input[type="number"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Чекбоксы и радио: нативный вид на Android */
input[type="checkbox"],
input[type="radio"] {
    -webkit-appearance: auto;
    appearance: auto;
}

/* === Переменные для адаптива === */
:root {
    --bp-xs: 320px;
    --bp-sm: 480px;
    --bp-md: 768px;
    --bp-lg: 992px;
    --bp-xl: 1200px;
    --bp-xxl: 1400px;
    --touch-min: 44px;
    --safe-top: env(safe-area-inset-top, 0);
    --safe-bottom: env(safe-area-inset-bottom, 16px);
    --safe-left: env(safe-area-inset-left, 0);
    --safe-right: env(safe-area-inset-right, 0);
}

/* === Контейнер === */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    padding-left: calc(16px + var(--safe-left));
    padding-right: calc(16px + var(--safe-right));
}

@media (min-width: 480px) {
    .container {
        padding: 0 20px;
        padding-left: calc(20px + var(--safe-left));
        padding-right: calc(20px + var(--safe-right));
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding: 0 24px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
        padding: 0 32px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1200px;
    }
}

.nav-container {
    padding: 0 16px;
    padding-left: calc(16px + var(--safe-left));
    padding-right: calc(16px + var(--safe-right));
}

@media (min-width: 768px) {
    .nav-container {
        padding: 0 24px;
        max-width: 720px;
        margin: 0 auto;
    }
}

@media (min-width: 992px) {
    .nav-container {
        max-width: 960px;
        padding: 0 32px;
    }
}

@media (min-width: 1400px) {
    .nav-container {
        max-width: 1200px;
    }
}

/* === Навигация (адаптив) === */
.navbar {
    padding-top: calc(0.75rem + var(--safe-top));
    padding-bottom: 0.75rem;
}

/* Минималистичная шапка — только логотип */
.navbar-minimal .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-minimal .nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.navbar-minimal .nav-link-verify {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

@media (min-width: 768px) {
    .nav-link {
        min-height: var(--touch-min);
        padding: 0.6rem 1.2rem;
    }
}

@media (max-width: 767px) {
    .nav-link {
        min-height: var(--touch-min);
        min-width: var(--touch-min);
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .nav-logo-text {
        font-size: 1.3rem;
    }

    .nav-logo-mark {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

@media (max-width: 479px) {
    .nav-logo-text {
        font-size: 1.15rem;
    }

    .nav-link {
        padding: 0.45rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* === Hero (единый адаптивный блок) === */
.hero {
    background: var(--primary-color);
    color: var(--white);
    padding: calc(4rem + var(--safe-top)) 0 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Hero «Москва Роскошная»: компактная секция, крупная картинка */
.hero-minimal {
    background: #74131A;
    padding: calc(1rem + var(--safe-top)) 0 calc(1rem + var(--safe-bottom));
    min-height: clamp(240px, 55vw, 360px);
    max-height: clamp(240px, 55vw, 360px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-minimal .hero-container {
    width: 100%;
}

.hero-banner-img {
    display: block;
    width: min(360px, 80vw);
    max-width: min(360px, 80vw);
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
    object-fit: contain;
}

@media (min-width: 768px) {
    .hero-minimal {
        min-height: clamp(320px, 42vw, 520px);
        max-height: clamp(320px, 42vw, 520px);
        padding: calc(1.25rem + var(--safe-top)) 0 calc(1.25rem + var(--safe-bottom));
    }

    .hero-banner-img {
        width: min(560px, 65vw);
        max-width: min(560px, 65vw);
    }
}

.hero::before {
    content: none;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    max-width: 100%;
}

.hero-label {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
}

/* Минималистичный hero: Москва Роскошная */
.hero-minimal .hero-container {
    justify-content: center;
    text-align: center;
}

.hero-minimal .hero-content {
    max-width: 100%;
    text-align: center;
}

.hero-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .hero-title-row {
        gap: 0.5rem;
        flex-wrap: nowrap;
    }
    .hero-sol-box .hero-sol-logo {
        height: 1rem;
    }
}

/* Блок Sol — как на макете */
.hero-sol-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25em 0.5em;
    background: rgba(86, 16, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
}

/* Текст ~20% площади: мелкие шрифты, фон занимает больше места */
.hero-sol-box .hero-sol-logo,
.hero-sol-logo {
    height: clamp(0.9rem, 2.2vw, 1.3rem);
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}


.hero-title-moscow {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05em;
    margin: 0;
    font-weight: 400;
    line-height: 1.1;
}

.hero-moscow {
    font-family: 'Cormorant', serif;
    font-style: italic;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: #FFFFFF;
    letter-spacing: 0.02em;
}

.hero-roskoshnaya {
    font-family: 'Poiret One', sans-serif;
    font-size: clamp(1.1rem, 3vw, 1.6rem);
    font-weight: 400;
    color: #FFFFFF;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.hero-minimal .btn-minimal {
    font-size: 0.85rem;
    padding: 0.6rem 1.4rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.95);
}

.hero-minimal .btn-minimal:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

.hero-minimal .btn-minimal::before {
    display: none;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--white);
}

.hero-subtitle {
    font-size: 0.95rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.btn-large {
    min-height: var(--touch-min);
    padding: 0.85rem 1.8rem;
    font-size: 0.95rem;
    border-radius: 999px;
    font-weight: 600;
}

@media (min-width: 480px) {
    .hero {
        padding: 5rem 0 4rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.05rem;
    }

    .btn-large {
        padding: 1rem 2.2rem;
        font-size: 1rem;
    }
}

@media (min-width: 768px) {
    .hero {
        padding: 6rem 0 5rem;
        text-align: left;
    }

    .hero-container {
        justify-content: flex-start;
    }

    .hero-content {
        max-width: 520px;
    }

    .hero-label {
        letter-spacing: 0.35em;
        font-size: 0.75rem;
    }

    .hero-title {
        font-size: 3rem;
        margin-bottom: 1.25rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .btn-large {
        padding: 1rem 2.4rem;
        font-size: 1rem;
    }
}

@media (min-width: 1200px) {
    .hero {
        padding: 7rem 0 5.5rem;
    }

    .hero-title {
        font-size: 3.2rem;
    }
}

/* === Секция video-promo (Москва роскошная) === */
.video-promo {
    padding: 2.5rem 0;
    padding-top: calc(2.5rem + var(--safe-top));
    background: var(--gray-light);
}

.video-promo-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: stretch;
}

.video-promo-text {
    order: 1;
}

.video-player.video-promo-gallery {
    order: 2;
}

.video-promo-text h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    white-space: pre-line;
    color: var(--text-dark);
}

.video-promo-text p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.video-label {
    font-size: 0.7rem;
}

@media (min-width: 480px) {
    .video-promo {
        padding: 3rem 0;
    }

    .video-promo-text h2 {
        font-size: 2rem;
    }

    .video-promo-text p {
        font-size: 1rem;
    }
}

/* Планшет и выше: двухколоночная композиция — текст слева, афиша справа */
@media (min-width: 768px) {
    .video-promo {
        padding: 4rem 0;
    }

    .video-promo-content {
        display: grid;
        grid-template-columns: 1.2fr 1fr;
        gap: 48px;
        align-items: stretch;
    }

    .video-promo-text {
        min-width: 0;
        order: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .video-player.video-promo-gallery {
        min-width: 0;
        order: 2;
        display: flex;
        justify-content: center;
        align-items: stretch;
        overflow: hidden;
    }

    .video-promo-text h2 {
        font-size: 2.25rem;
    }

    .video-promo-text p {
        font-size: 1.05rem;
        line-height: 1.7;
    }
}

@media (min-width: 992px) {
    .video-promo {
        padding: 5rem 0;
    }

    .video-promo-content {
        gap: 64px;
    }

    .video-promo-text h2 {
        font-size: 2.5rem;
    }
}

/* Афиша промо-блока «Наедине с искусством» */
.video-promo-afisha-img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    object-fit: cover;
    display: block;
}

/* Мобилка: картинка на всю ширину */
@media (max-width: 767px) {
    .video-promo-gallery-single .video-promo-afisha-img,
    .video-promo-gallery-single img {
        max-width: 100%;
    }
}

/* Планшет и десктоп: афиша справа, того же размера что и левая колонка */
@media (min-width: 768px) {
    .video-player.video-promo-gallery.video-promo-gallery-single {
        display: flex;
        align-items: stretch;
        background: transparent;
    }

    .video-promo-gallery-single .video-promo-afisha-img,
    .video-promo-gallery-single img {
        width: 100%;
        height: 100%;
        min-height: 100%;
        max-height: none;
        border-radius: 16px;
        object-fit: contain;
        object-position: center;
    }
}

/* === Секция мероприятий === */
.performances {
    padding: 2.5rem 0 3rem;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--text-dark);
    font-weight: 600;
    text-align: center;
}

.section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

.performance-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.filter-btn {
    min-height: var(--touch-min);
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .performances {
        padding: 4rem 0 5rem;
    }

    .section-title {
        font-size: 2.25rem;
        margin-bottom: 2.5rem;
        text-align: left;
    }

    .section-title::after {
        left: 0;
        transform: none;
    }

    .performance-filters {
        justify-content: flex-start;
        gap: 0.75rem;
    }
}

@media (min-width: 992px) {
    .performances {
        padding: 5rem 0 6rem;
    }

    .section-title {
        font-size: 2.4rem;
        margin-bottom: 3rem;
    }
}

/* === Карточки мероприятий === */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.card {
    border-radius: 16px;
}

.card-image {
    height: 264px; /* 220 + 20% для мобильной версии */
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    background: transparent;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.card-actions .btn {
    min-height: var(--touch-min);
}

@media (min-width: 480px) {
    .cards-grid {
        gap: 1.75rem;
    }

    .card-image {
        height: 312px; /* 260 + 20% мобильная */
    }
}

@media (min-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 2rem;
    }

    .card {
        border-radius: 20px;
    }

    .card-image {
        height: 420px; /* 280 + 50% десктоп */
    }
}

@media (min-width: 992px) {
    .cards-grid {
        gap: 2.5rem;
    }

    .card-image {
        height: 450px; /* 300 + 50% десктоп */
    }
}

@media (min-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    }

    .card-image {
        height: 480px; /* 320 + 50% десктоп */
    }
}

/* === Футер (safe area) === */
.footer {
    background: #74131A;
    padding: 0;
}

.footer-container {
    padding: 0 16px;
    padding-left: calc(16px + var(--safe-left));
    padding-right: calc(16px + var(--safe-right));
}

@media (max-width: 767px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        text-align: center;
    }

    .footer-contacts a,
    .footer-contacts p {
        font-size: 0.85rem;
    }
}

@media (min-width: 768px) {
    .footer-container {
        padding: 0 24px;
    }
}

@media (min-width: 992px) {
    .footer-container {
        padding: 0 32px;
    }
}

/* === Галерея 2×2 (адаптив) === */
/* Афиша «Наедине с искусством» — текст на чёрном фоне (вместо картинки) */
.afisha-moscow-luxury {
    background: #000;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 5vw, 3rem) clamp(1rem, 4vw, 2rem);
    border-radius: 12px;
    font-family: 'Cormorant', serif;
    font-weight: 300;
    min-height: 200px;
    aspect-ratio: 3 / 4;
    max-height: 500px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.afisha-moscow-luxury .afisha-line {
    display: flex;
    justify-content: center;
    width: 100%;
    line-height: 1.3;
}

.afisha-moscow-luxury .afisha-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 400;
    margin-bottom: 0.5em;
    white-space: nowrap;
}

.afisha-moscow-luxury .afisha-subtitle {
    font-size: clamp(0.85rem, 2.5vw, 1.1rem);
    font-weight: 300;
    text-transform: lowercase;
    margin-bottom: 0.4em;
    opacity: 0.95;
}

.afisha-moscow-luxury .afisha-date {
    font-size: clamp(1rem, 3vw, 1.4rem);
    font-weight: 400;
}

/* Первый блок (video-promo): афиша в промо */
.video-promo-gallery-single .afisha-moscow-luxury {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    aspect-ratio: 3 / 4;
    min-height: 280px;
    max-height: none;
}

/* Второй и третий: +40% по ширине (448×597) */
.card-image .afisha-moscow-luxury,
.highlight-poster .afisha-moscow-luxury {
    width: 100%;
    max-width: 448px;
    margin: 0 auto;
    aspect-ratio: 3 / 4;
    min-height: 280px;
    max-height: none;
}


/* Одна афиша вместо галереи */
.video-player.video-promo-gallery-single {
    background: transparent;
    box-shadow: none;
}

.video-promo-gallery-single img,
.video-promo-afisha-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    object-fit: cover;
    object-position: center;
}

.video-promo-gallery img {
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: contain;
    object-position: center;
}

@media (min-width: 480px) {
    .video-promo-gallery img {
        max-height: 320px;
    }
}

@media (min-width: 768px) {
    .video-promo-gallery img {
        max-height: 420px;
    }
}

@media (max-width: 767px) {
    .video-promo-gallery {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .video-promo-main,
    .video-promo-thumbs {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem;
        align-items: stretch;
    }

    .video-promo-gallery img {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: none;
        object-fit: contain;
        object-position: center;
        border-radius: 12px;
        display: block;
    }
}

@media (max-width: 479px) {
    .video-promo-gallery {
        gap: 0.75rem;
    }

    .video-promo-main,
    .video-promo-thumbs {
        gap: 0.75rem;
    }
}

/* === Модальное окно (safe area) === */
.modal-content {
    padding-bottom: calc(2.5rem + var(--safe-bottom));
}

@media (max-width: 767px) {
    .modal {
        padding: 12px;
        padding-left: calc(12px + var(--safe-left));
        padding-right: calc(12px + var(--safe-right));
    }

    .modal-content {
        max-height: calc(100vh - 24px - var(--safe-bottom));
    }
}
