.ebt-events,
.ebt-events * {
    box-sizing: border-box;
}

.ebt-events {
    --ebt-accent: #c8102e;
    --ebt-accent-soft: #fdf0f2;
    --ebt-text: #1f1f1f;
    --ebt-muted: #666;
    --ebt-border: #e6e6e6;
    --ebt-surface: #f7f7f7;
    --ebt-radius: 10px;
    margin: 0 auto;
    max-width: 1200px;
    color: var(--ebt-text);
    font-family: inherit;
}

.ebt-events__empty,
.ebt-events__license-notice {
    margin: 0;
    padding: 28px 20px;
    border: 1px dashed var(--ebt-border);
    border-radius: var(--ebt-radius);
    background: var(--ebt-surface);
    color: var(--ebt-muted);
    text-align: center;
}

.ebt-events__license-notice {
    background: #fff8e5;
    border: 1px solid #f0d58b;
    color: #6b4f00;
    text-align: left;
}

.ebt-events__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.ebt-events[data-columns="1"] .ebt-events__grid {
    grid-template-columns: minmax(0, 1fr);
}

.ebt-events[data-columns="2"] .ebt-events__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ebt-events[data-columns="4"] .ebt-events__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ebt-event-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--ebt-border);
    border-radius: var(--ebt-radius);
    min-height: 100%;
}

.ebt-event-card.is-expired {
    opacity: 0.72;
}

.ebt-event-card__image-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--ebt-surface);
    overflow: hidden;
}

.ebt-events button.ebt-event-card__image-button {
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--ebt-surface) !important;
    box-shadow: none !important;
    cursor: pointer;
    text-align: left;
}

.ebt-event-card__image,
.ebt-events .ebt-event-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 220ms ease;
}

.ebt-events button.ebt-event-card__image-button:hover .ebt-event-card__image,
.ebt-events button.ebt-event-card__image-button:focus .ebt-event-card__image {
    transform: scale(1.06);
}

.ebt-event-card__image-button::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 20, 0);
    pointer-events: none;
    transition: background 220ms ease;
}

.ebt-events button.ebt-event-card__image-button:hover::after,
.ebt-events button.ebt-event-card__image-button:focus::after {
    background: rgba(20, 20, 20, 0.32);
}

.ebt-event-card__image-hint {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 1;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(20, 20, 20, 0.82);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease;
}

.ebt-events button.ebt-event-card__image-button:hover .ebt-event-card__image-hint,
.ebt-events button.ebt-event-card__image-button:focus .ebt-event-card__image-hint {
    opacity: 1;
    transform: translateY(0);
}

.ebt-event-card__image--placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg, #ececec 0%, #f7f7f7 100%);
}

.ebt-event-card__date-badge {
    position: absolute;
    left: 10px;
    bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    padding: 5px 8px 6px;
    border-radius: 8px;
    background: #fff;
    color: var(--ebt-text);
    line-height: 1;
    z-index: 1;
}

.ebt-event-card__date-day {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.ebt-event-card__date-month {
    margin-top: 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ebt-accent);
}

.ebt-event-card__content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px 14px;
    flex: 1 1 auto;
}

.ebt-event-card__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
}

.ebt-event-card__category {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--ebt-accent-soft);
    color: var(--ebt-accent);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.ebt-event-card__title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ebt-text);
}

.ebt-event-card__when {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    margin: 0;
    color: var(--ebt-muted);
    font-size: 13px;
    line-height: 1.3;
}

.ebt-event-card__when-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.ebt-event-card__when-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--ebt-accent);
}

.ebt-event-card__when-text {
    min-width: 0;
}

.ebt-event {
    display: contents;
}

.ebt-event-card__description {
    margin: 2px 0 0;
    color: var(--ebt-muted);
    font-size: 13px;
    line-height: 1.45;
}

.ebt-event-card__description p {
    margin: 0 0 0.5em;
}

.ebt-event-card__description p:last-child {
    margin-bottom: 0;
}

.ebt-events .ebt-event-card__more,
.ebt-events button.ebt-event-card__more {
    appearance: none;
    display: inline-flex !important;
    align-items: center;
    align-self: flex-start;
    width: auto;
    margin-top: auto;
    padding: 6px 0 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--ebt-accent) !important;
    cursor: pointer;
    font: inherit !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    text-decoration: none !important;
    text-transform: none !important;
}

.ebt-events .ebt-event-card__more:hover,
.ebt-events .ebt-event-card__more:focus,
.ebt-events button.ebt-event-card__more:hover,
.ebt-events button.ebt-event-card__more:focus {
    background: transparent !important;
    color: var(--ebt-text) !important;
    outline: none;
}

.ebt-event-modal[hidden] {
    display: none !important;
}

.ebt-event-modal {
    position: fixed;
    z-index: 100000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ebt-event-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 20, 0.62);
}

.ebt-event-modal__dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(0, 1.15fr);
    align-items: stretch;
    width: min(980px, 100%);
    height: auto;
    max-height: min(92vh, 880px);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--ebt-border);
    border-radius: 12px;
}

.ebt-events .ebt-event-modal__close,
.ebt-events button.ebt-event-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px;
    min-height: 34px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #1f1f1f !important;
    box-shadow: none !important;
    color: #fff !important;
    cursor: pointer;
    font-size: 22px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    text-transform: none !important;
}

.ebt-events .ebt-event-modal__close:hover,
.ebt-events .ebt-event-modal__close:focus,
.ebt-events button.ebt-event-modal__close:hover,
.ebt-events button.ebt-event-modal__close:focus {
    background: var(--ebt-accent) !important;
    color: #fff !important;
}

.ebt-event-modal__media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    background: #111;
    overflow: hidden;
}

.ebt-event-modal__image,
.ebt-events .ebt-event-modal__image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: min(92vh, 880px);
    object-fit: contain;
    object-position: center;
}

.ebt-event-modal__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 22px 24px 24px;
}

.ebt-event-modal__title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ebt-text);
}

.ebt-event-modal__description {
    color: var(--ebt-muted);
    font-size: 15px;
    line-height: 1.6;
}

.ebt-event-modal__description p {
    margin: 0 0 0.8em;
}

.ebt-event-modal__description p:last-child {
    margin-bottom: 0;
}

body.ebt-event-modal-open {
    overflow: hidden;
}

@media (max-width: 720px) {
    .ebt-event-modal__dialog {
        grid-template-columns: 1fr;
        height: auto;
        max-height: 88vh;
        overflow: auto;
    }

    .ebt-event-modal__media {
        aspect-ratio: auto;
        height: auto;
        max-height: 48vh;
        background: #111;
    }

    .ebt-event-modal__image,
    .ebt-events .ebt-event-modal__image {
        height: auto;
        max-height: 48vh;
        object-fit: contain;
    }

    .ebt-event-modal__body {
        padding: 16px 18px 20px;
    }
}

@media (max-width: 960px) {
    .ebt-events__grid,
    .ebt-events[data-columns="3"] .ebt-events__grid,
    .ebt-events[data-columns="4"] .ebt-events__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .ebt-events__grid,
    .ebt-events[data-columns="1"] .ebt-events__grid,
    .ebt-events[data-columns="2"] .ebt-events__grid,
    .ebt-events[data-columns="3"] .ebt-events__grid,
    .ebt-events[data-columns="4"] .ebt-events__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
