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

.ec-calendar-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 135px;
    align-items: flex-start;
    font-family: "Ony one";
    width: 1245px;
    margin: 0 auto;
}

h1 {
    margin-bottom: 48px !important;
}

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

.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: 22px;
    color: #313332;
}

.calendar__days {
    row-gap: 5px;
}

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

.calendar__days__hidden {
    color: #313332;
    width: 73px;
    height: 73px;
    background-color: #F2F2F2;
    display: flex;
    border: none;
    justify-content: center;
    font-size: 20px;
    align-items: center;
    pointer-events: none;
}

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

.calendar__days button.has-events {
    position: relative;
}

.calendar__days button.has-events::after {
    content: " ";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    width: 44px;
    border-radius: 50%;
    height: 44px;
    background-color: #E9DCFF;
}

.calendar__days button:not(.calendar__days__hidden):hover {
    background-color: #E9DCFF;
}

.calendar__days button.selected {
    background-color: #E9DCFF !important;
}

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

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

.calendar__btn {
    width: 48px;
    height: 48px;
    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;
    max-width: 550px;
}

.ec-events-panel__title {
    font-size: 24px;
    margin: 0 0 16px;
    color: #313332;
    font-weight: 500;
}

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

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

.ec-events-panel__item-title {
    display: block;
    font-size: 18px;
    color: #313332;
    font-weight: 500;
    line-height: 1.3;
}

.ec-events-panel__item time {
    display: block;
    font-weight: 400;
    font-size: 18px;
    color: #313332;
}

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

.ec-events-panel__empty {
    color: #313332;
    font-weight: 500;
    font-size: 18px;
}

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

.ec-events-cards {
    display: flex;
    font-family: "Ony one";
    width: 1245px;
    margin: 64px auto 0 auto;
    flex-direction: column;
    gap: 56px;
}

.ec-event-card {
    display: grid;
    grid-template-columns: 267px 946px;
    column-gap: 32px;
    align-items: flex-start;
}

.ec-event-card a {
    border-bottom: none;
    margin: 0 auto;
    grid-column: span 2;
}

.ec-event-card__image {
    width: 267px;
    height: 174px;
    flex-shrink: 0;
}

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

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

.ec-event-card__date {
    color: #AD83FF;
    font-weight: 500;
    font-size: 15px;
    margin-bottom: 12px;
}

.ec-event-card__desc {
    color: #4a4a4a;
    font-size: 18px;
    line-height: 114.9%;
    margin-bottom: 24px;
}

.ec-event-card__btn {
    display: block;
    padding: 15px 84px;
    width: fit-content;
    background: #A77FF5;
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    transition: background .15s;
}

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

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

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

@media (max-width: 1200px) {
    
    .ec-calendar-wrap {
        width: 1006px;
        gap: 96px;
    }
    
    .ec-events-panel {
        max-width: 351px;
    }
    
    .ec-event-card {
        grid-template-columns: 267px 707px;
    }
    
    .ec-events-cards {
        width: 1006px;
        margin: 56px auto;
    }
    
} 

@media (max-width: 1080px) {
    
    .ec-calendar-wrap {
        width: 96%;
        gap: 40px;
        justify-content: center;
    }
    
    .ec-event-card__body {
        max-width: 98%;
    }
    
    .ec-events-cards {
        width: 92%;
    }
    
} 

@media (max-width: 900px) {
    
    .ec-calendar-wrap {
        flex-direction: column;
    }
    
    .ec-calendar-wrap {
        width: 93%;
        gap: 32px;
        margin: 0 auto;
    }
    
    .calendar {
        margin: 0 auto;
        width: 89.4%;
    }
    
    .calendar__days button:not(.calendar__days__hidden) {
        width: 84px;
        height: 84px;
    }
    
    .calendar__days__hidden {
        width: 84px;
        height: 84px;
    }
    
    .ec-events-cards {
        width: 95%;
        margin: 40px auto;
    }
    
    .ec-events-panel {
        max-width: none;
    }
    
    .ec-event-card {
        grid-template-columns: 1fr;
    }
    
    .ec-event-card a {
        grid-column: span 1;
    }
    
    .ec-event-card__image {
        margin: 0 auto 32px;
    }
}

@media (max-width: 700px) {
    
    .ec-events-panel__title {
        font-size: 18px;
    }
    
    .calendar__month {
        font-size: 20px;
    }
    
    .ec-calendar-wrap {
        width: 90%;
    }
    
    .ec-events-cards {
        width: 90%;
    }
    
    .calendar__days {
        gap: 0;
    }
    
    .calendar__days button.has-events::after {
        width: 29px;
        height: 29px;
    }
    
    .calendar__days__hidden {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .ec-event-card__title{
        font-size: 16px;
    }
    
    .calendar__days button:not(.calendar__days__hidden) {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .ec-event-card__btn {
        padding: 13px 54.3px;
        font-size: 16px;
    }
    
    .ec-events-panel__item-title {
        font-size: 16px;
    }
    
    .ec-events-panel__item time {
        font-size: 16px;
    }
    
    .calendar__day__names span {
        font-size: 18px;
    }
    
    .calendar__days {
        row-gap: 24px;
    }
    
    .ec-events-panel {
        max-width: 100%;
    }
}

@media (max-width: 330px) {
    .ec-calendar-wrap {
        width: 96%;
    }
    
    .ec-events-cards {
        width: 96%;
    }
}
