
.events-section {
    background: #f5f7fa;
    padding: 60px 0 80px;
    min-height: 60vh;
}


.events-filter {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 40px;
}

.dropdown {
    position: relative;
    width: 280px;
}

.dropdown__button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dropdown__button:hover {
    border-color: #1a5c9e;
}

.dropdown__button.active {
    border-color: #1a5c9e;
    box-shadow: 0 2px 8px rgba(26, 92, 158, 0.15);
}

.dropdown__selected {
    font-weight: 400;
    font-size: 14px;
    line-height: 150%;
    color: #333333;
}

.dropdown__arrow {
    width: 12px;
    height: 12px;
    margin-left: 12px;
    transition: transform 0.2s;
}

.dropdown__button.active .dropdown__arrow {
    transform: rotate(180deg);
}

.dropdown__menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    z-index: 100;
}

.dropdown__menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown__item {
    padding: 12px 20px;
    font-weight: 400;
    font-size: 14px;
    line-height: 150%;
    color: #333333;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown__item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown__item:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown__item:hover {
    background: #f0f4f8;
}

.dropdown__item.active {
    background: #1a5c9e;
    color: #ffffff;
}

/* Сетка мероприятий */
.events-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Карточка мероприятия - идентична events__item на home.html */
.events-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    min-height: 200px;
}

.events-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.events-card__title {
    font-weight: 600;
    font-size: 16px;
    line-height: 140%;
    color: #1a5c9e;
    flex: 1;
    margin: 0;
}

.events-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.events-card__date {
    font-weight: 400;
    font-size: 13px;
    line-height: 150%;
    color: #666666;
}

.events-card__button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #1a5c9e;
    border-radius: 50%;
    transition: background 0.3s, transform 0.2s;
    flex-shrink: 0;
}

.events-card__button:hover {
    background: #0d3a5c;
    transform: translateX(3px);
}

.events-card__button img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

/* Бейдж даты (используется в мобильной версии) */
.events-card__badge {
    display: none;
}

/* Адаптация */
@media (max-width: 430px) {
    .events-section {
        padding: 40px 16px;
    }

    .events-filter {
        justify-content: center;
        margin-bottom: 20px;
    }

    .dropdown {
        width: 100%;
        max-width: 340px;
    }

    .dropdown__button {
        padding: 12px 16px;
    }

    .section-title {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .events-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .events-card {
        display: grid;
        grid-template-columns: 64px 1fr;
        gap: 12px;
        padding: 14px 14px;
        min-height: 0;
        align-items: center;
        border-radius: 12px;
    }

    .events-card__badge {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: #e9f2ff;
        border-radius: 10px;
        padding: 8px 6px;
        height: 100%;
    }

    .events-card__badge-day {
        font-weight: 600;
        font-size: 12px;
        line-height: 140%;
        color: #1a5c9e;
        margin: 0 0 2px 0;
    }

    .events-card__badge-year {
        font-weight: 500;
        font-size: 12px;
        line-height: 140%;
        color: rgba(26, 92, 158, 0.75);
        margin: 0;
    }

    .events-card__title {
        font-size: 12px;
        line-height: 140%;
    }

    .events-card__footer {
        grid-column: 2;
        margin-top: 6px;
    }

    .events-card__date {
        font-size: 11px;
    }

    .events-card__button {
        width: 32px;
        height: 32px;
    }
}

/* Events Popup */
.events-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.events-popup.active {
    opacity: 1;
    visibility: visible;
}

.events-popup__content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    max-width: 680px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px;
    z-index: 10000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.events-popup__close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
    z-index: 10001;
}

.events-popup__close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.events-popup__close img {
    width: 20px;
    height: 20px;
}

.events-popup__title {
    font-weight: 700;
    font-size: 24px;
    line-height: 130%;
    color: #1a5c9e;
    margin-bottom: 16px;
}

.events-popup__datetime {
    font-weight: 400;
    font-size: 16px;
    line-height: 150%;
    color: #666666;
    margin-bottom: 24px;
}

.events-popup__text {
    font-weight: 400;
    font-size: 14px;
    line-height: 150%;
    color: #333333;
}

.events-popup__text p {
    margin-bottom: 12px;
}

.events-popup__text p:last-child {
    margin-bottom: 0;
}

.events-popup__list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

.events-popup__list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
}

.events-popup__list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #1a5c9e;
    font-size: 18px;
    line-height: 150%;
}

/* Адаптация events popup */
@media (max-width: 430px) {
    .events-popup__content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        padding: 64px 16px 20px;
    }

    .events-popup__title {
        font-size: 18px;
    }

    .events-popup__datetime {
        font-size: 14px;
    }

    .events-popup__text {
        font-size: 13px;
    }

    .events-popup__close {
        top: 16px;
        right: 12px;
    }
}
