/* Стили для списка мероприятий (новые) */
.events-list-content {
    --accent: #e74c3c;
    --text: #2c3e50;
    --gray: #7f8c8d;
    --bg: #f7f7f7;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(0, 0, 0, .05);
    --hover-shadow: 0 4px 20px rgba(0, 0, 0, .1);
}

.events-list-content .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.events-list-content h1 {
    margin-bottom: 25px;
    font-weight: 300;
    text-align: center;
    color: var(--text);
}

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

.events-list-content .event-card {
    background: #fff;
    border-radius: var(--radius);
    display: flex;
    gap: 20px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform .3s, box-shadow .3s;
}

.events-list-content .event-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

.events-list-content .event-card img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.events-list-content .event-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.events-list-content .event-title {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.events-list-content .event-title a {
    color: inherit;
    text-decoration: none;
}

.events-list-content .event-title a:hover {
    color: var(--accent);
}

.events-list-content .event-meta {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 4px;
}

.events-list-content .event-link {
    margin-top: 12px;
    align-self: flex-start;
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 14px;
    transition: background .3s;
}

.events-list-content .event-link:hover {
    background: #c0392b;
}

@media(max-width: 600px) {
    .events-list-content .event-card {
        flex-direction: column;
    }

    .events-list-content .event-card img {
        width: 100%;
        height: 200px;
    }
}

/* скрытие дублей */

/* Стили для заголовков месяцев */
.events-list-content .month-section {
    margin-bottom: 40px;
}

.events-list-content .month-section:last-child {
    margin-bottom: 0;
}

.events-list-content .month-header {
    margin-bottom: 25px;
    font-weight: 300;
    text-align: center;
    font-size: 24px;
    color: var(--primary, #2c3e50);
    padding-bottom: 10px;
    position: relative;
}

.events-list-content .month-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: var(--accent, #e74c3c);
}

/* Основной заголовок страницы */
.events-list-content h1 {
    margin-bottom: 25px;
    font-weight: 300;
    text-align: center;
    color: var(--text, #2c3e50);
}

.single-ec_event .wp-block-post-featured-image,
.single-ec_event .wp-block-post-title {
    display: none !important;
}

.single-ec_event .wp-block-post-content>p:first-child {
    display: none !important;
}

/* Calendar Styles (Month View) */
.ec-month-view-container {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
    transition: transform .3s ease, box-shadow .3s ease;
    margin: 0 auto;
}

.ec-month-view-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .1)
}

.ec-month-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ec-month-navigation .nav-arrow {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
    padding: 0 10px;
}

.ec-month-view-container .month-header {
    text-align: center;
    font-size: 20px;
    font-weight: 500;
    color: #2c3e50;
}

.ec-month-view-container .weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.ec-month-view-container .days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.ec-month-view-container .day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 50%;
    cursor: pointer;
    transition: all .3s ease;
    position: relative;
}

.ec-month-view-container .day:hover {
    background: #ecf0f1;
    transform: scale(1.1)
}

.ec-month-view-container .day.other-month {
    color: #bdc3c7;
    cursor: default;
}

.ec-month-view-container .day.other-month:hover {
    background: transparent;
    transform: none;
}

.ec-month-view-container .day.today {
    background: #e74c3c;
    color: #fff;
    font-weight: 600;
    width: 45px;
    /* Фиксированная ширина */
    height: 45px;
    /* Фиксированная высота */
    margin: auto;
    /* Центрируем в ячейке */
    animation: ec-pulse-red 2s infinite;
}

.ec-month-view-container .day.event::after {
    content: '★';
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 12px;
    color: #e74c3c;
}

.ec-month-view-container .day a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    text-decoration: none;
    color: inherit;
}

.ec-month-footer-nav {
    text-align: center;
    margin-top: 15px;
}

.ec-month-footer-nav a {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
}

@keyframes ec-pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, .7)
    }

    70% {
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0)
    }

    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0)
    }
}

@keyframes ec-twinkle-month {

    0%,
    100% {
        opacity: 1;
        transform: scale(1)
    }

    50% {
        opacity: .4;
        transform: scale(.8)
    }
}

/* ---------- DESKTOP ---------- */
@media (min-width:768px) {
    .ec-month-view-container {
        max-width: 720px;
        padding: 35px;
    }

    .ec-month-view-container .month-header {
        font-size: 26px;
        margin-bottom: 20px
    }

    .ec-month-view-container .weekdays {
        font-size: 14px;
        margin-bottom: 15px
    }

    .ec-month-view-container .day {
        font-size: 18px;
    }
}

@media (min-width:1024px) {
    .ec-month-view-container {
        max-width: 1100px
    }
}

/* Year View Styles */
.ec-year-view-container {
    max-width: 1050px;
    margin: 0 auto;
}

.year-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.year-header h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: bold;
}

.year-header a {
    text-decoration: none;
    font-size: 2em;
    color: #333;
    padding: 0 15px;
}

.ec-year-view-container h1 {
    text-align: center;
    font-size: 24px;
    font-weight: 300;
    margin-top: 25px;
    color: #2c3e50;
}

.ec-year-view-container .calendar-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.ec-year-view-container .month {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ec-year-view-container .month:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.ec-year-view-container .month .month-header {
    text-align: center;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 500;
    color: #2c3e50;
}

.ec-year-view-container .month .month-header a {
    color: inherit;
    text-decoration: none;
}

.ec-year-view-container .month .month-header a:hover {
    text-decoration: underline;
}

.ec-year-view-container .month .weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.ec-year-view-container .month .days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.ec-year-view-container .month .day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 50%;
    cursor: default;
    transition: all 0.3s ease;
    position: relative;
}

.ec-year-view-container .month .day:hover:not(.other-month) {
    background: #ecf0f1;
    transform: scale(1.1);
}

.ec-year-view-container .month .day.other-month {
    color: #bdc3c7;
}

.ec-year-view-container .month .day.today {
    background: red;
    color: white;
    font-weight: 600;
    animation: ec-pulse 2s infinite;
}

.ec-year-view-container .month .day.event {
    position: relative;
}

.ec-year-view-container .month .day.event::after {
    content: '★';
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 12px;
    color: #e74c3c;

}

.ec-year-view-container .month .day a {
    color: inherit;
    text-decoration: none;
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

@keyframes ec-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}

@keyframes ec-twinkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .4;
        transform: scale(.8);
    }
}

/* Универсальные стили для легенды (работают в обоих представлениях) */
.legend {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 25px;
    font-size: 14px;
    color: #7f8c8d;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    margin: 0 15px;
}

.legend-star {
    font-size: 12px;
    color: #e74c3c;
    margin-right: 5px;
}

@media (min-width: 768px) {
    .ec-year-view-container .calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ec-year-view-container h1 {
        font-size: 32px;
    }
}

@media (min-width: 1024px) {
    .ec-year-view-container .calendar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .ec-year-view-container .calendar-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Стили для страницы одного мероприятия (шорткод) */
.ec-event-details-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: #333;
    line-height: 1.5;
}

/* Стили для заголовка мероприятия */
.ec-event-header {
    position: relative;
    background: #fff;
    padding: 20px 0;
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.ec-event-title {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    line-height: 1.3;
    text-align: center;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
    .ec-event-header {
        padding: 15px 0;
        margin-bottom: 20px;
    }

    .ec-event-title {
        font-size: 24px;
        padding: 0 15px;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .ec-event-title {
        font-size: 22px;
        line-height: 1.2;
    }
}

/* Дополнительные стили для интеграции с темой */
.single-ec_event .ec-event-details-container {
    margin-top: 0;
}

/* Убираем стандартные элементы темы на страницах мероприятий */
.single-ec_event .article-meta,
.single-ec_event .entry-header,
.single-ec_event h1.entry-title,
.single-ec_event .wp-block-post-title,
.single-ec_event .entry-image {
    display: none !important;
}

.ec-event-details-container header h1 {
    font-size: 26px;
    font-weight: 300;
    color: #2c3e50;
}

.ec-event-details-container figure {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    transition: transform .3s ease;
    margin: 0;
}

.ec-event-details-container figure:hover {
    transform: translateY(-2px)
}

.ec-event-details-container figure img {
    width: 100%;
    height: auto;
    display: block;
}

.ec-event-details-container .details {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
    display: grid;
    gap: 15px;
}

.ec-event-details-container .details h2 {
    font-size: 18px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 5px;
}

.ec-event-details-container .details p {
    font-size: 16px;
    color: #555;
    margin: 0;
}

.ec-event-details-container .map-wrapper {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
    height: 320px;
}

.ec-event-details-container .map-wrapper #ec-yandex-map {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Двухколоночный макет для страницы мероприятия (десктоп) */
.ec-event-main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 25px;
}

.ec-event-image-column figure {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    transition: transform .3s ease;
    margin: 0 !important;
    padding: 0;
}

.ec-event-image-column figure:hover {
    transform: translateY(-2px);
}

.ec-event-image-column figure img {
    width: 100%;
    height: auto;
    display: block;
}

.ec-event-info-column .details {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
    display: grid;
    gap: 15px;
    height: fit-content;
}

.ec-event-info-column .details h2 {
    font-size: 18px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 5px;
}

.ec-event-info-column .details p {
    font-size: 16px;
    color: #555;
    margin: 0;
}

.ec-event-description {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
    margin-bottom: 25px;
}

.ec-event-description .desc h2 {
    font-size: 18px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 15px;
}

.ec-event-description .desc p {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
}

/* Десктопные стили - двухколоночный макет */
@media (min-width: 768px) {
    .ec-event-main-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 30px;
        align-items: start;
    }

    .ec-event-image-column,
    .ec-event-info-column {
        align-self: start;
    }

    .ec-event-image-column {
        order: 1;
    }

    .ec-event-info-column {
        order: 2;
    }
}

/* Для больших экранов увеличиваем пропорции */
@media (min-width: 1024px) {
    .ec-event-main-content {
        grid-template-columns: 1.2fr 0.8fr;
        gap: 40px;
    }
}

/* Мобильные устройства - остается одноколоночный макет */
@media (max-width: 767px) {
    .ec-event-main-content {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .ec-event-info-column .details,
    .ec-event-description {
        padding: 20px;
    }
}

@media (min-width:600px) {
    .ec-event-details-container header h1 {
        font-size: 32px
    }

    .ec-event-details-container .details {
        grid-template-columns: repeat(2, 1fr)
    }

    .ec-event-details-container .details .desc {
        grid-column: 1/-1
    }
}

/* Исправление для мобильного меню */
.ec-event-details-container {
    position: relative;
    z-index: 1;
    /* Ниже чем у меню */
}

.ec-event-header {
    position: relative;
    z-index: 1;
    /* Ниже чем у меню */
    margin-top: 0;
    /* УБИРАЕМ: padding-top: 80px; */
}

.ec-event-title {
    position: relative;
    z-index: 1;
}

/* Специальные стили для мобильных устройств */
@media (max-width: 768px) {

    /* Убеждаемся что контент не перекрывает меню */
    .single-ec_event .ec-event-details-container {
        /* УБИРАЕМ: margin-top: 60px; */
        z-index: 1;
    }

    .ec-event-header {
        padding-top: 20px;
        margin-top: 0;
        position: relative;
        z-index: 1;
    }

    /* Если меню фиксированное, добавляем отступ для body */
    body.single-ec_event {
        padding-top: 0;
    }
}

@media (max-width: 480px) {


    .ec-event-header {
        padding-top: 15px;
    }
}

/* Убеждаемся что меню имеет высокий z-index */
.single-ec_event header,
.single-ec_event nav,
.single-ec_event .main-navigation {
    z-index: 999 !important;
    position: relative;
}

/* Если меню фиксированное */
.single-ec_event header[style*="position: fixed"],
.single-ec_event nav[style*="position: fixed"] {
    z-index: 9999 !important;
}

@media (min-width:600px) {
    .ec-event-details-container header h1 {
        font-size: 32px
    }

    .ec-event-details-container .details {
        grid-template-columns: repeat(2, 1fr)
    }

    .ec-event-details-container .details .desc {
        grid-column: 1/-1
    }
}

/* Убираем отступ сверху у меню на странице мероприятия */
.single-ec_event body {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.single-ec_event header {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.single-ec_event nav {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Убираем любые отступы у контейнера меню */
.single-ec_event .container {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Дополнительно убираем отступы у основных элементов */
.single-ec_event .logos,
.single-ec_event .nav {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Для мобильных устройств */
@media (max-width: 768px) {

    .single-ec_event body,
    .single-ec_event header,
    .single-ec_event nav {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

/* Уникальные стили для страницы month-and-prev (шорткод events_month_with_preview) */
/* Используем префикс .ec-month-preview для избежания конфликтов */

.ec-month-preview {
    --accent: #e74c3c;
    --text: #2c3e50;
    --gray: #7f8c8d;
    --bg: #f7f7f7;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(0, 0, 0, .05);
    --hover-shadow: 0 4px 20px rgba(0, 0, 0, .1);
}

/* Заголовок страницы */
.ec-month-preview .ec-page-title {
    text-align: center;
    margin-bottom: 30px;
}

.ec-month-preview .ec-page-title h1 {
    font-size: 28px;
    font-weight: 300;
    color: var(--text);
    margin: 0;
}

/* 2-колоночный контейнер */
.ec-month-preview .calendar-layout {
    display: grid;
    gap: 25px;
    max-width: 1100px;
    margin: 0 auto;
    align-items: start;
}

@media(min-width: 768px) {
    .ec-month-preview .calendar-layout {
        grid-template-columns: 1fr 360px;
    }
}

/* ---------- МЕСЯЧНЫЙ КАЛЕНДАРЬ ---------- */
.ec-month-preview .ec-month-view-container {
    background: #fff;
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: transform .3s, box-shadow .3s;
    height: fit-content;
    min-height: 500px;
    /* Минимальная высота для соответствия превью */
}

.ec-month-preview .ec-month-view-container:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
}

.ec-month-preview .ec-month-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ec-month-preview .nav-arrow {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent);
    text-decoration: none;
    padding: 0 10px;
    transition: color .3s ease;
}

.ec-month-preview .nav-arrow:hover {
    color: #c0392b;
}

.ec-month-preview .month-header {
    font-size: 20px;
    font-weight: 500;
    color: var(--text);
}

.ec-month-preview .weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 10px;
    font-weight: 500;
}

.ec-month-preview .days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.ec-month-preview .day {
    display: flex;

    justify-content: center;
    font-size: 15px;
    border-radius: 50%;
    cursor: pointer;
    transition: all .3s ease;
    position: relative;
    height: 30px;
    /* Фиксированная высота вместо aspect-ratio */
    width: 30px;
    /* Фиксированная ширина */
    min-height: unset;
    /* Убрать min-height: 40px */
    min-width: unset;
    /* Убрать min-width: 40px */
    margin: auto;
}

.ec-month-preview .day:hover {
    background: #ecf0f1;
    transform: scale(1.1);
}

.ec-month-preview .day.other-month {
    color: #bdc3c7;
    cursor: default;
}

.ec-month-preview .day.other-month:hover {
    background: transparent;
    transform: none;
}

.ec-month-preview .day.today {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    animation: ec-month-preview-pulse-red 2s infinite;
}

.ec-month-preview .day.event::after {
    content: '★';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 8px;
    color: var(--accent);
    animation: ec-month-preview-twinkle 1.5s ease-in-out infinite;
}

.ec-month-preview .day a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    text-decoration: none;
    color: inherit;
    transition: all .3s ease;
}

.ec-month-preview .day a:hover {
    background: #ecf0f1;
    transform: scale(1.1);
}

@keyframes ec-month-preview-pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, .7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

@keyframes ec-month-preview-twinkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .4;
        transform: scale(.8);
    }
}

/* ---------- БЛИЖАЙШЕЕ МЕРОПРИЯТИЕ ---------- */
.ec-month-preview .next-event {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform .3s ease;
    height: fit-content;
    min-height: 500px;
    /* Соответствует минимальной высоте календаря */
}

.ec-month-preview .next-event:hover {
    transform: translateY(-2px);
}

.ec-month-preview .next-event h2 {
    font-size: 22px;
    font-weight: 300;
    color: var(--text);
    margin: 0;
}

.ec-month-preview .next-event h3 {
    font-size: 14px !important;
    font-weight: 500;
    color: var(--text);
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.ec-month-preview .next-event h3 a {
    color: inherit;
    text-decoration: none;
    transition: color .3s ease;
}

.ec-month-preview .next-event h3 a:hover {
    color: var(--accent);
}

.ec-month-preview .next-event figure {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
    height: 150px;
    /* Фиксированная высота */
}

.ec-month-preview .next-event figure img {
    width: 100%;
    height: 100%;
    /* Заполняет всю высоту контейнера */
    object-fit: cover;
    /* Обрезает изображение с сохранением пропорций */
    display: block;
    transition: transform .3s ease;
}

.ec-month-preview .next-event figure:hover img {
    transform: scale(1.05);
}

.ec-month-preview .next-event .meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ec-month-preview .next-event .meta strong {
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
}

.ec-month-preview .next-event .meta span {
    color: var(--gray);
    font-size: 14px;
}

.ec-month-preview .next-event p {
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
}

.ec-month-preview .next-event .btn {
    background: var(--accent);
    color: #fff;
    text-align: center;
    padding: 12px 20px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all .3s ease;
    margin-top: auto;
    /* Прижимаем кнопку к низу */
}

.ec-month-preview .next-event .btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, .3);
}

/* Адаптивные стили */
@media (max-width: 767px) {
    .ec-month-preview .calendar-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ec-month-preview .ec-month-view-container,
    .ec-month-preview .next-event {
        min-height: auto;
        padding: 20px;
    }

    .ec-month-preview .day {
        font-size: 14px;
        min-height: 35px;
        min-width: 35px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .ec-month-preview .calendar-layout {
        max-width: 900px;
    }

    .ec-month-preview .calendar-layout {
        grid-template-columns: 1fr 320px;
    }
}

@media (min-width: 1024px) {
    .ec-month-preview .ec-month-view-container {
        padding: 30px;
        min-height: 450px;
    }

    .ec-month-preview .next-event {
        min-height: 445px;
        padding: 30px;
    }

    .ec-month-preview .day {
        font-size: 16px;
        min-height: 45px;
        min-width: 45px;
    }

    .ec-month-preview .month-header {
        font-size: 22px;
    }
}

/* --- Navigation Tabs --- */
.ec-top-bar {
    display: flex;
    justify-content: flex-end;
    /* Align to the right */
}

.ec-nav-tabs {
    display: flex;
    gap: 8px;
}

.ec-nav-button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text, #2c3e50);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius, 12px);
    cursor: pointer;
    transition: all .3s;
    box-shadow: var(--shadow, 0 2px 10px rgba(0, 0, 0, .05));
    overflow: hidden;
    text-decoration: none;
}

.ec-nav-button svg {
    transition: color .3s;
    position: relative;
    z-index: 1;
}

.ec-nav-button span {
    position: relative;
    z-index: 1;
}

/* Hover effect */
.ec-nav-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent, #e74c3c);
    opacity: 0;
    transform: scale(.4);
    transition: opacity .3s, transform .3s;
    border-radius: var(--radius, 12px);
    z-index: 0;
}

.ec-nav-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow, 0 4px 20px rgba(0, 0, 0, .1));
    color: var(--accent, #e74c3c);
}

.ec-nav-button:hover::before {
    opacity: .1;
    transform: scale(1);
}

.ec-nav-button:hover svg,
.ec-nav-button:hover span {
    color: var(--accent, #e74c3c);
}

/* Active button */
.ec-nav-button.active {
    color: #fff;
    background: var(--accent, #e74c3c);
    border-color: var(--accent, #e74c3c);
    box-shadow: 0 0 0 4px rgba(231, 76, 60, .2);
}

.ec-nav-button.active svg,
.ec-nav-button.active span {
    color: #fff;
}

.ec-nav-button.active::before {
    display: none;
}

@media(max-width: 600px) {
    .ec-top-bar {
        justify-content: center;
        /* Center on mobile */
    }

    .ec-nav-tabs {
        gap: 6px;
    }

    .ec-nav-button {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Стили для заголовка календаря */
.ec-title {
    font-size: 32px;
    font-weight: 300;
    color: var(--text, #2c3e50);
    text-align: center;
    margin: 25px 0 25px 0;
    padding: 0;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .ec-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
}