/* ===== Обёртка: календарь + панель мероприятий ===== */

.ec-calendar-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
    font-family: inherit;
}

/* ===== Календарь ===== */

.calendar {
    width: 559px;
    max-width: 100%;
    height: auto;
    overflow: hidden;
    color: #313332;
}

.calendar__header {
    display: flex;
    justify-content: space-between;
    align-content: center;
    position: relative;
    margin-bottom: 24px;
}

.calendar__btns {
    display: flex;
    width: 100%;
    justify-content: space-between;
}

.calendar__day__names,
.calendar__days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    color: #313332;
    gap: 8px;
    justify-items: center;
    margin-bottom: 10px;
}

.calendar__day__names span {
    font-size: 16px;
    color: #9b9b9b;
}

.calendar__days {
    row-gap: 5px;
}

.calendar__days span:not(.calendar__days__hidden) {
    cursor: pointer;
    width: 73px;
    height: 73px;
    color: #313332;
    display: flex;
    justify-content: center;
    font-size: 18px;
    align-items: center;
    position: relative;
    border-radius: 50%;
    transition: background .15s, color .15s;
}

.calendar__days__hidden {
    color: #c7c7c7;
    width: 73px;
    height: 73px;
    background-color: transparent;
    display: flex;
    justify-content: center;
    font-size: 18px;
    align-items: center;
    pointer-events: none;
}

.calendar__days span.today {
    box-sizing: border-box;
    border: 1px #AD83FF solid;
    border-radius: 8px;
}

.calendar__days span.has-events {
    background-color: #E7DBFB;
}

.calendar__days span:not(.calendar__days__hidden):hover {
    background-color: #A77FF5;
    color: #fff;
}

.calendar__days span.selected {
    background-color: #A77FF5 !important;
    color: #fff;
    border-radius: 8px;
}

.calendar__month {
    font-size: 22px;
    font-weight: 600;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ===== Кнопки навигации ===== */

.calendar__btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1.05px solid #A77FF5;
    border-radius: 50%;
    cursor: pointer;
}

.calendar__btn svg {
    width: 22px;
    height: 22px;
}

.calendar__btn path {
    fill: none;
    stroke: #A77FF5;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.calendar__btn:hover {
    background: #F7F2FF;
}

.calendar__btn.prev svg {
    transform: rotate(180deg);
}

/* ===== Панель "Расписание на ..." (справа) ===== */

.ec-events-panel {
    flex: 1;
    min-width: 240px;
}

.ec-events-panel__title {
    font-size: 20px;
    margin: 0 0 20px;
    color: #313332;
    font-weight: 600;
}

.ec-events-panel__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ec-events-panel__item a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ec-events-panel__item-title {
    display: block;
    font-size: 16px;
    color: #313332;
    margin-bottom: 4px;
    line-height: 1.3;
}

.ec-events-panel__item time {
    display: block;
    font-size: 14px;
    color: #9b9b9b;
}

.ec-events-panel__item a:hover .ec-events-panel__item-title {
    color: #A77FF5;
}

.ec-events-panel__empty {
    color: #9b9b9b;
    font-size: 15px;
}

/* ===== Карточки мероприятий (снизу) ===== */

.ec-events-cards {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ec-event-card {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding-bottom: 24px;
    border-bottom: 1px solid #eee;
}

.ec-event-card:last-child {
    border-bottom: none;
}

.ec-event-card__image {
    width: 160px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.ec-event-card__body {
    flex: 1;
    min-width: 0;
}

.ec-event-card__title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 6px;
    color: #313332;
}

.ec-event-card__date {
    color: #A77FF5;
    font-size: 14px;
    margin-bottom: 12px;
}

.ec-event-card__desc {
    color: #4a4a4a;
    font-size: 15px;
    line-height: 1.55;
    margin-bottom: 16px;
}

.ec-event-card__desc p {
    margin: 0 0 10px;
}

.ec-event-card__btn {
    display: inline-block;
    padding: 10px 24px;
    background: #A77FF5;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: background .15s;
}

.ec-event-card__btn:hover {
    background: #8f5eea;
}

.ec-events-cards__empty {
    color: #9b9b9b;
    font-size: 15px;
}

/* ===== Адаптив ===== */

@media (max-width: 700px) {
    .ec-calendar-wrap {
        flex-direction: column;
    }
    .calendar {
        width: 100%;
    }
    .calendar__days span:not(.calendar__days__hidden),
    .calendar__days__hidden {
        width: 100%;
        height: 44px;
        font-size: 15px;
    }
    .ec-event-card {
        flex-direction: column;
    }
    .ec-event-card__image {
        width: 100%;
        height: 180px;
    }
}
