/* ============================================================
   МОДУЛЬНАЯ ШКАЛА: px → rem (база 15px).
   Масштабируется от html font-size: clamp(15px, 0.7vw + 4.5px, 30px)
   в bundle.css. Скругления, блюр и @media-брейкпоинты не тронуты.
   ============================================================ */
/* ============================================================
   events.css — Мероприятия
   Mobile-first. Десктоп — через @media (min-width).
   Токены — из bundle.css.
   ============================================================ */


/* ============================================================
   1. HERO
   ============================================================ */

.events-hero {
    padding: 3.47rem 1.33rem 3.07rem;
    background: linear-gradient(135deg, #151515 0%, #450000 100%);
    color: #fff;
    text-align: center;
}

.events-hero-content {
    max-width: 52rem;
    margin: auto;
}

.events-kicker {
    display: block;
    margin-bottom: 0.8rem;
    color: #ff8a8a;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.events-hero h1 {
    font-size: clamp(2.13rem, 7vw, 3.87rem);
    line-height: 1.05;
    margin-bottom: 1.2rem;
}

.events-hero p {
    max-width: 42.67rem;
    margin: auto;
    color: rgba(255, 255, 255, 0.76);
    font-size: clamp(1rem, 3vw, 1.27rem);
}


/* ============================================================
   2. СЕКЦИИ
   ============================================================ */

.events-section {
    padding: 2.67rem 1.07rem;
}

.events-section-gray {
    background: #f5f5f7;
}

.events-container {
    max-width: 74.67rem;
    margin: auto;
}

.events-heading {
    font-size: clamp(1.73rem, 5vw, 2.67rem);
    line-height: 1.15;
    margin-bottom: 0.8rem;
}

.events-intro {
    max-width: 50.67rem;
    color: #666;
    margin-bottom: 2rem;
}


/* ============================================================
   3. СЕТКА НАВИГАЦИИ
   ============================================================ */

.events-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
}

.events-nav-card,
.event-card,
.video-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    overflow: hidden;
}

.events-nav-card {
    padding: 1.73rem;
    min-height: 12rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.events-nav-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 1rem 2.33rem rgba(0, 0, 0, 0.08);
}

.events-nav-card span {
    color: #cd0000;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.events-nav-card h2 {
    font-size: 1.6rem;
    line-height: 1.2;
    margin: 0.67rem 0;
}

.events-nav-card p {
    color: #707070;
    font-size: 0.93rem;
}

.events-nav-card strong {
    margin-top: auto;
    padding-top: 1.2rem;
    font-size: 0.93rem;
    color: #cd0000;
}


/* ============================================================
   4. КАРТОЧКИ СОБЫТИЙ
   ============================================================ */

.event-card {
    margin-bottom: 1.6rem;
}

.event-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #e9e9ec;
    display: block;
}

.event-body {
    padding: 1.27rem;
}

.event-meta {
    display: flex;
    gap: 0.53rem;
    flex-wrap: wrap;
    margin-bottom: 0.73rem;
}

.event-tag {
    padding: 0.33rem 0.67rem;
    border-radius: 20px;
    background: #f5f5f7;
    color: #666;
    font-size: 0.73rem;
    font-weight: 600;
}

.event-body h2 {
    font-size: clamp(1.4rem, 4vw, 2.07rem);
    line-height: 1.2;
    margin-bottom: 0.8rem;
}

.event-body p {
    color: #606060;
    margin-top: 0.67rem;
}

.event-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.53rem;
    margin-top: 1.33rem;
}

.event-gallery img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
}

.event-list {
    margin: 1.07rem 0 0 1.33rem;
    color: #555;
}

.event-list li {
    margin-bottom: 0.53rem;
}


/* ============================================================
   5. ВИДЕО
   Две сетки: .video-grid (вертикальные 9/16) и
   .video-grid--wide (горизонтальные 16/9). Внутри сетки
   соотношение единое — ряды выравниваются без пустот.
   ============================================================ */

.video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
    margin-bottom: 2.67rem;
}

/* Контейнер плеера / постера: вертикальный по умолчанию */
.video-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: 72vh;
    background: #111;
    overflow: hidden;
}

/* Горизонтальный плеер */
.video-embed--wide {
    aspect-ratio: 16 / 9;
    max-height: none;
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Постер + кнопка Play (ленивая загрузка iframe) */
.video-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: #111;
    cursor: pointer;
    display: block;
}

.video-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease, opacity .3s ease;
}

.video-poster:hover img {
    transform: scale(1.03);
    opacity: .9;
}

.video-poster:focus-visible {
    outline: 3px solid #cd0000;
    outline-offset: -3px;
}

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4.27rem;
    height: 4.27rem;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(205, 0, 0, .9);
    box-shadow: 0 0.53rem 1.6rem rgba(0, 0, 0, .35);
    transition: transform .2s ease, background .2s ease;
}

.video-play-icon::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 0.67rem 0 0.67rem 1.07rem;
    border-color: transparent transparent transparent #fff;
}

.video-poster:hover .video-play-icon {
    transform: translate(-50%, -50%) scale(1.08);
    background: #cd0000;
}

.video-card-body {
    padding: 1.2rem;
}

.video-card h2 {
    font-size: 1.13rem;
    line-height: 1.35;
}


/* ============================================================
   6. CTA
   ============================================================ */

.event-cta {
    padding: 2rem;
    border-radius: 22px;
    background: #1a1a1a;
    color: #fff;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 1.67rem;
}

.event-cta p {
    color: #bbb;
    margin-top: 0.33rem;
}

.event-cta .btn {
    flex-shrink: 0;
    width: 100%;
    text-align: center;
}

.events-note {
    font-size: 0.8rem;
    color: #888;
    margin-top: 1.33rem;
}

.event-video {
    display: block;
    width: 100%;
    max-height: 34.67rem;
    margin-top: 1.33rem;
    border-radius: 14px;
    background: #111;
    object-fit: contain;
}

.event-video-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-top: 1.33rem;
    border-radius: 14px;
    background: #111;
    overflow: hidden;
}
.event-video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ============================================================
   7. DEVELOPMENT
   ============================================================ */

.development-page {
    min-height: calc(100vh - 9.33rem);
    padding: 3.07rem 1.33rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 25%, #fff 0, #f5f5f7 70%);
    overflow: hidden;
}

.development-card {
    width: 100%;
    max-width: 45.33rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.development-label {
    display: block;
    margin: 0 0 0.67rem;
    color: #cd0000;
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.development-card h1 {
    width: 100%;
    margin: 0 0 1.47rem;
    font-size: clamp(1.93rem, 6vw, 3.33rem);
    line-height: 1.1;
    text-align: center;
}

.development-hourglass {
    flex: 0 0 5.87rem;
    width: 5.07rem !important;
    height: 5.87rem !important;
    max-width: 5.07rem !important;
    max-height: 5.87rem !important;
    margin: 0 auto 1.33rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transform-origin: 50% 50%;
    animation: hourglass-turn 3.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.development-hourglass svg {
    display: block !important;
    flex: none !important;
    width: 3.73rem !important;
    height: 4.93rem !important;
    min-width: 3.73rem !important;
    min-height: 4.93rem !important;
    max-width: 3.73rem !important;
    max-height: 4.93rem !important;
    overflow: visible;
}

.hourglass-stream {
    animation: hourglass-flow 1.6s ease-in-out infinite;
}

.development-card p {
    width: 100%;
    max-width: 38rem;
    margin: 0 auto 1.87rem;
    color: #666;
    font-size: 0.93rem;
    line-height: 1.65;
    text-align: center;
}

.development-card .btn-outline {
    background: #fff;
}

.development-card .btn {
    width: 100%;
    padding-left: 1.2rem;
    padding-right: 1.2rem;
}

@keyframes hourglass-turn {
    0%, 40%   { transform: rotate(0deg); }
    55%, 90%  { transform: rotate(180deg); }
    100%      { transform: rotate(360deg); }
}

@keyframes hourglass-flow {
    0%, 100%    { opacity: 0.12; }
    30%, 72%    { opacity: 1; }
}


/* ============================================================
   8. МЕДИА-ЗАПРОСЫ
   ============================================================ */

/* ----- Tablet ≥ 46.67rem ----- */

@media (min-width: 700px) {

    .events-hero {
        padding: 4.8rem 1.47rem 4.27rem;
    }

    .events-section {
        padding: 3.6rem 1.47rem;
    }

    .events-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .events-nav-card {
        min-height: 14rem;
    }

    .event-body {
        padding: 1.6rem;
    }

    .event-gallery {
        grid-template-columns: repeat(4, 1fr);
    }

    .video-grid,
    .video-grid--wide {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Снимаем ограничение высоты на планшете: оно ломало соотношение */
    .video-embed {
        max-height: none;
    }

    .event-cta {
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
    }

    .event-cta .btn {
        width: auto;
    }
}


/* ----- Desktop ≥ 68.27rem ----- */

@media (min-width: 1024px) {

    .events-hero {
        padding: 6.4rem 2.67rem 5.87rem;
    }

    .events-hero h1 {
        font-size: 3.87rem;
    }

    .events-hero p {
        font-size: 1.27rem;
    }

    .events-section {
        padding: 4.8rem 2.67rem;
    }

    .events-heading {
        font-size: 2.67rem;
    }

    .events-intro {
        font-size: 1.13rem;
    }

    .events-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.47rem;
    }

    .events-nav-card {
        padding: 2.13rem;
        min-height: 16rem;
    }

    .events-nav-card h2 {
        font-size: 1.73rem;
    }

    .events-nav-card p {
        font-size: 1rem;
    }

    .event-body {
        padding: 2.13rem;
    }

    .event-card {
        margin-bottom: 2.13rem;
    }

    .video-card h2 {
        font-size: 1.27rem;
    }
    
    .video-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .video-grid--wide {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .event-cta {
        padding: 2.67rem;
    }

    /* Development */
    .development-page {
        min-height: calc(100vh - 12rem);
        padding: 4.27rem 1.47rem;
    }

    .development-card p {
        font-size: 1.07rem;
    }

    .development-card .btn {
        width: auto;
        padding-left: 2.13rem;
        padding-right: 2.13rem;
    }
}

@media (min-width: 1280px) {
    .video-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    /* Широкие остаются крупными: 3 в ряд */
    .video-grid--wide {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1600px) {
    .video-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    /* Широкие остаются крупными: 3 в ряд */
    .video-grid--wide {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ============================================================
   9. REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .development-hourglass,
    .hourglass-stream,
    .video-poster img,
    .video-play-icon {
        animation: none;
        transition: none;
    }
}