/* Events Calendar — scoped to .ec-events-root for safer theme coexistence */
.ec-events-root {
    --ec-primary: #0066b2;
    --ec-primary-dark: #004f8a;
    /*--ec-bg: #f5f7f9;*/
    --ec-title: #1a1a1a;
    --ec-text: #555555;
    --ec-radius: 8px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ec-text);
    line-height: 1.5;
}

.ec-events-root *,
.ec-events-root *::before,
.ec-events-root *::after {
    box-sizing: border-box;
}

/* Grid */
.ec-events-root .ec-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    margin: 24px 0;
}

.ec-events-root .ec-event-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ec-events-root .ec-event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.ec-events-root .ec-event-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ec-events-root .ec-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ec-events-root .ec-event-card:hover .ec-event-image img {
    transform: scale(1.04);
}

.ec-events-root .ec-event-content {
    padding: 18px 20px 22px;
}

.ec-events-root .ec-event-date {
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.ec-events-root .ec-day {
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    color: var(--ec-primary);
}

.ec-events-root .ec-month {
    font-size: 14px;
    color: #666;
}

.ec-events-root .ec-event-range {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--ec-text);
}

.ec-events-root .ec-venue {
    font-size: 13px;
    color: #999;
    margin-left: 4px;
}

.ec-events-root .ec-event-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ec-title);
}

.ec-events-root .ec-event-description {
    color: var(--ec-text);
    line-height: 1.6;
    margin-bottom: 16px;
    font-size: 14px;
}

.ec-events-root .ec-event-description p {
    margin: 0 0 8px;
}

.ec-events-root .ec-event-description p:last-child {
    margin-bottom: 0;
}

/* Buttons */
.ec-events-root .ec-event-button,
.ec-events-root .ec-list-button,
.ec-events-root .ec-minimal-button,
.ec-events-root .ec-prod-cta {
    display: inline-block;
    background: var(--global-palette-highlight) !important;
    color: #fff !important;
    padding: 10px 20px !important;
    text-decoration: none !important;
    border-radius: var(--ec-radius) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: background 0.2s ease, transform 0.2s ease !important;
    border: none !important;
    cursor: pointer !important;
    line-height: 1.2;
}

.ec-events-root .ec-event-button:hover,
.ec-events-root .ec-list-button:hover,
.ec-events-root .ec-minimal-button:hover,
.ec-events-root .ec-prod-cta:hover {
    background: var(--ec-primary-dark) !important;
    color: #fff !important;
    text-decoration: none !important;
}

/* List */
.ec-events-root .ec-events-list-container {
    margin: 24px 0;
}

.ec-events-root .ec-list-item {
    display: flex;
    align-items: stretch;
    gap: 18px;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 14px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ec-events-root .ec-list-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ec-events-root .ec-list-date {
    text-align: center;
    min-width: 76px;
    padding: 10px 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: #fff;
    align-self: center;
}

.ec-events-root .ec-list-day {
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
}

.ec-events-root .ec-list-month {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ec-events-root .ec-list-details {
    flex: 1;
    min-width: 0;
}

.ec-events-root .ec-list-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ec-title);
}

.ec-events-root .ec-list-range {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--ec-text);
}

.ec-events-root .ec-list-excerpt {
    color: var(--ec-text);
    font-size: 14px;
}

.ec-events-root .ec-list-excerpt p {
    margin: 0 0 6px;
}

.ec-events-root .ec-list-excerpt p:last-child {
    margin-bottom: 0;
}

/* Minimal */
.ec-events-root .ec-minimal {
    margin: 16px 0;
    border: 1px solid #e6e8eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.ec-events-root .ec-minimal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s ease;
}

.ec-events-root .ec-minimal-item:last-child {
    border-bottom: 0;
}

.ec-events-root .ec-minimal-item:hover {
    background: #f9fafb;
}

.ec-events-root .ec-minimal-date {
    font-weight: 600;
    min-width: 120px;
    color: var(--ec-primary);
    font-size: 13px;
}

.ec-events-root .ec-minimal-title {
    flex: 1;
    margin: 0;
    font-weight: 600;
    color: var(--ec-title);
    font-size: 15px;
}

.ec-events-root .ec-minimal-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border-radius: 50% !important;
}

/* Production alternating layout */
.ec-events-root .ec-prod-wrap {
    margin: 28px 0;
    padding: 8px 0 8px;
    background: var(--ec-bg);
    border-radius: 12px;
}

.ec-events-root .ec-prod-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 28px;
    padding: 28px 24px;
    margin: 0;
}

.ec-events-root .ec-prod-row--reverse {
    flex-direction: row-reverse;
}

.ec-events-root .ec-prod-media {
    flex: 0 0 42%;
    max-width: 520px;
}

.ec-events-root .ec-prod-img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 0;
}

.ec-events-root .ec-prod-img--placeholder {
    background: linear-gradient(135deg, #cfd9df 0%, #e2ebf0 100%);
    min-height: 220px;
}

.ec-events-root .ec-prod-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}

.ec-events-root .ec-prod-head {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 18px;
}

.ec-events-root .ec-prod-row--reverse .ec-prod-head {
    flex-direction: row-reverse;
    text-align: right;
}

.ec-events-root .ec-prod-badge {
    flex: 0 0 auto;
    min-width: 92px;
    background: #fff;
    padding: 20px 24px;
    border-radius: 12px 4px 4px 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.ec-events-root .ec-prod-row--reverse .ec-prod-badge {
    border-radius: 4px 12px 12px 4px;
}

.ec-events-root .ec-prod-badge-day {
    display: block;
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    color: var(--ec-primary);
}

.ec-events-root .ec-prod-badge-sub {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #555;
}

.ec-events-root .ec-prod-text {
    flex: 1;
    min-width: 0;
}

.ec-events-root .ec-prod-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 800;
    color: var(--global-palette3);
    line-height: 1.25;
}

.ec-events-root .ec-prod-dates {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--ec-text);
}

.ec-events-root .ec-prod-excerpt {
    font-size: 15px;
    color: var(--ec-text);
    line-height: 1.55;
}

.ec-events-root .ec-prod-excerpt p {
    margin: 0 0 8px;
}

.ec-events-root .ec-prod-excerpt p:last-child {
    margin-bottom: 0;
}

.ec-events-root .ec-prod-cta {
    align-self: flex-start;
    text-transform: none;
    letter-spacing: 0.01em;
    margin-top: 25px;
}

.ec-events-root .ec-prod-row--reverse .ec-prod-cta {
    align-self: flex-end;
}

/* Footer note */
.ec-events-root .ec-footer-note {
    margin-top: 18px;
    padding: 10px 6px 4px;
    font-size: 12px;
    line-height: 1.45;
    color: #6a6f76;
    border-top: 1px solid #e6e8eb;
}

.ec-events-root .ec-footer-note a {
    color: var(--ec-primary);
}

/* Empty state */
.ec-no-events {
    text-align: center;
    padding: 32px 20px;
    background: #f9fafb;
    border-radius: var(--ec-radius);
    color: #666;
    margin: 16px 0;
}

/* Responsive */
@media (max-width: 900px) {
    .ec-events-root .ec-prod-row,
    .ec-events-root .ec-prod-row--reverse {
        flex-direction: column;
    }

    .ec-events-root .ec-prod-media {
        flex: 1 1 auto;
        max-width: none;
        width: 100%;
    }

    .ec-events-root .ec-prod-head,
    .ec-events-root .ec-prod-row--reverse .ec-prod-head {
        flex-direction: column;
        text-align: left;
    }

    .ec-events-root .ec-prod-row--reverse .ec-prod-cta {
        align-self: flex-start;
    }

    .ec-events-root .ec-prod-badge,
    .ec-events-root .ec-prod-row--reverse .ec-prod-badge {
        border-radius: 12px;
        align-self: flex-start;
    }
}

@media (max-width: 768px) {
    .ec-events-root .ec-events-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ec-events-root .ec-list-item {
        flex-direction: column;
        text-align: left;
    }

    .ec-events-root .ec-list-button {
        width: 100%;
        text-align: center;
    }

    .ec-events-root .ec-minimal-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .ec-events-root .ec-minimal-date {
        min-width: 0;
    }
}
