/* Card presentation; listing layout and controls stay in the widget. */
.item-event,
.item-event *,
.item-event *::before,
.item-event *::after {
    box-sizing: border-box;
}

.item-event {
    color: var(--bivb-color-text);
    font-family: var(--bivb-font-family-base-stack);
}

.item-event[hidden] {
    display: none !important;
}

.item-event { list-style: none; }

.item-event .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.bivb-events__event {
    display: grid;
    min-width: 0;
    align-items: center;
    column-gap: 1.875em;
    row-gap: 0.625em;
    grid-template-areas:
        "image heading time"
        "image actions time";
    grid-template-columns: 8.3125em minmax(0, 1fr) max-content;
}

.bivb-events__event--no-time {
    grid-template-areas:
        "image heading"
        "image actions";
    grid-template-columns: 8.3125em minmax(0, 1fr);
}

.bivb-events__image-frame {
    position: relative;
    width: 8.3125em;
    overflow: hidden;
    border-radius: var(--bivb-radius-6);
    aspect-ratio: 133 / 96;
    background: var(--bivb-color-surface-muted);
    grid-area: image;
}

.bivb-events__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100% !important;
    object-fit: cover;
}

.bivb-events__event-heading {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.1875em;
    grid-area: heading;
}

.bivb-events__event-title {
    margin: 0;
    color: var(--bivb-color-black);
    font-size: 1.125em;
    font-weight: var(--bivb-font-weight-medium);
    line-height: 1.2;
}

.item-event .bivb-events__event-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.item-event .bivb-events__event-title a:hover,
.item-event .bivb-events__event-title a:focus-visible {
    color: var(--bivb-color-primary);
    text-decoration: underline;
}

.bivb-events__event-type {
    margin: 0;
    color: var(--bivb-color-primary);
    font-size: 0.8125em;
    font-weight: var(--bivb-font-weight-regular);
    line-height: 1.2;
}

.bivb-events__event-location {
    margin: 0;
    color: var(--bivb-color-text-meta);
    font-size: 0.8125em;
    line-height: 1.35;
}

/* Action pills --------------------------------------------------------- */

.bivb-events__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.625em;
    grid-area: actions;
}

.item-event .bivb-events__action {
    --bivb-button-background: var(--bivb-color-surface-muted);
    --bivb-button-border-color: var(--bivb-color-surface-muted);
    --bivb-button-color: var(--bivb-color-black);
    --bivb-button-hover-background: var(--bivb-color-surface-soft);
    --bivb-button-hover-border-color: var(--bivb-color-border-black-20);
    --bivb-button-hover-color: var(--bivb-color-black);

    gap: var(--bivb-button-gap);
    /* 6px / 15px at the 12px button size. */
    padding: 0.5em 1.25em;
}

.bivb-events__action-icon {
    display: block;
    flex: 0 0 auto;
    background: currentColor;
}

.bivb-events__action-icon--add {
    width: 0.75em;
    height: 0.75em;
    -webkit-mask: url("../../assets/img/plus.svg") center / contain no-repeat;
    mask: url("../../assets/img/plus.svg") center / contain no-repeat;
}

.bivb-events__action-icon--mail {
    width: 1.1667em;
    height: 1.1667em;
    -webkit-mask: url("../../assets/img/mail.svg") center / contain no-repeat;
    mask: url("../../assets/img/mail.svg") center / contain no-repeat;
}

/* Time block ----------------------------------------------------------- */

.bivb-events__event-time {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: stretch;
    justify-content: center;
    margin: 0;
    padding-inline: 1.875em;
    color: var(--bivb-color-primary);
    grid-area: time;
    text-align: center;
    white-space: nowrap;
}

.bivb-events__event-time::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 1px;
    background: var(--bivb-color-border-light);
    content: "";
}

.bivb-events__hour {
    font-size: 1.25em;
    font-weight: var(--bivb-font-weight-semibold);
    line-height: 1.4;
}

/* Figma overlaps the three lines: 28 + 6 + 28 = the 62px time block. */
.bivb-events__time-separator {
    font-size: 1.5em;
    font-weight: var(--bivb-font-weight-regular);
    line-height: 0.25em;
}

/* mobile and tablet */
@media (max-width: 1023px) {

    .bivb-events__event,
    .bivb-events__event--no-time {
        column-gap: 1.25em;
        grid-template-areas:
            "image image"
            "time heading"
            "actions actions";
        grid-template-columns: max-content minmax(0, 1fr);
    }

    .bivb-events__image-frame {
        width: 100%;
        aspect-ratio: 16 / 9;
    }

    .bivb-events__event-type {
        font-size: 0.875em;
    }

    .bivb-events__event-time {
        /* Figma: 60px column, rule at 80px, identity at 100px. */
        min-width: 5em;
        align-self: center;
        padding-right: 1.25em;
        padding-left: 0;
    }

    .bivb-events__event-time::before {
        top: 0.3437em;
        right: 0;
        bottom: 0.3437em;
        left: auto;
    }

    .bivb-events__hour {
        font-size: 1.1875em;
        line-height: 1.42;
    }

    .bivb-events__time-separator {
        font-size: 1.0625em;
        line-height: 0.2353em;
    }

    /*
     * Both pills stay on one line. Figma draws them at 14px/25px inside a 340px
     * column; the real column is 320px at the widest breakpoint and 280px on a
     * small phone, so the size/gutter pair is reduced to never wrap.
     */
    .bivb-events__actions {
        flex-wrap: nowrap;
    }

    .item-event .bivb-events__action {
        min-height: var(--bivb-button-height-md);
        /* 14px / 20px at the 12px button size. */
        padding: 1.1667em 1.6667em;
    }

    /* The second pill is icon-only in the mobile mockup. */
    .bivb-events__action--share .bivb-events__action-label {
        display: none;
    }

    .bivb-events__action-icon--mail {
        width: 1.5em;
        height: 1.5em;
    }
}

@media (prefers-reduced-motion: reduce) {

    .item-event .bivb-events__event-title a {
        transition: none;
    }
}
