/* Shared homepage and events-group styles; override asynchronously loaded widget CSS. */
:is(.home, .elamusvoog-events-group) [data-widget="grid"] {
    container-type: inline-size;
    width: 100%;
    min-width: 0;
}

:is(.home, .elamusvoog-events-group) [data-widget="grid"] .event-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

:is(.home, .elamusvoog-events-group) [data-widget="grid"] .event-grid-item {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    align-items: start;
    min-width: 0;
    padding: 16px !important;
    gap: 16px 20px;
    justify-content: flex-start;
    border: 1px solid #dedbd7;
    border-radius: 12px;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

:is(.home, .elamusvoog-events-group) [data-widget="grid"] .event-grid-item:hover {
    border-color: #cf4a28;
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.09);
    transform: none;
}

:is(.home, .elamusvoog-events-group) [data-widget="grid"] .event-grid-image {
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 409 / 579;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f3f0;
}

/* Keep poster text visible without stretching or cropping portrait images. */
:is(.home, .elamusvoog-events-group) [data-widget="grid"] .event-grid-image img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
}

:is(.home, .elamusvoog-events-group) [data-widget="grid"] .event-grid-content {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

:is(.home, .elamusvoog-events-group) [data-widget="grid"] .event-grid-content h3 {
    margin: 0 0 10px;
    font-family: var(--wp--preset--font-family--core-sans-d-55-bold);
    font-size: 1.125rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

:is(.home, .elamusvoog-events-group) [data-widget="grid"] .event-grid-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    color: #4b4642;
    font-size: 0.875rem;
    line-height: 1.45;
}

:is(.home, .elamusvoog-events-group) [data-widget="grid"] .event-grid-meta br {
    display: none;
}

:is(.home, .elamusvoog-events-group) [data-widget="grid"] .event-grid-meta span {
    display: flex;
    align-items: flex-start;
    overflow-wrap: anywhere;
}

:is(.home, .elamusvoog-events-group) [data-widget="grid"] .event-grid-meta span::before {
    flex: 0 0 18px;
    margin-top: 1px;
    width: 18px;
    height: 18px;
}

:is(.home, .elamusvoog-events-group) [data-widget="grid"] .add-calendar-btn {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    justify-self: start;
    width: auto;
    max-width: 100%;
    height: auto;
    min-height: 40px;
    margin: 0;
    padding: 7px 14px;
    border-radius: 24px;
    background: #cf4a28;
    color: #fff;
    text-decoration: none;
    font-size: 0.8125rem;
    line-height: 1.5;
}

:is(.home, .elamusvoog-events-group) [data-widget="grid"] .add-calendar-btn::before {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

:is(.home, .elamusvoog-events-group) [data-widget="grid"] .add-calendar-btn:hover {
    background: #a9300e;
}

:is(.home, .elamusvoog-events-group) [data-widget="grid"] .add-calendar-btn:focus-visible {
    outline: 2px solid #a9300e;
    outline-offset: 3px;
}

@container (max-width: 850px) {
    :is(.home, .elamusvoog-events-group) [data-widget="grid"] .event-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }
}

@container (max-width: 420px) {
    :is(.home, .elamusvoog-events-group) [data-widget="grid"] .event-grid-item {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 12px;
        padding: 12px !important;
    }

    :is(.home, .elamusvoog-events-group) [data-widget="grid"] .event-grid-content h3 {
        font-size: 1rem;
    }

    :is(.home, .elamusvoog-events-group) [data-widget="grid"] .event-grid-meta {
        font-size: 0.8125rem;
    }
}
