.iem-events,
.iem-calendar,
.iem-card-grid {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.iem-calendar__section {
    display: grid;
    gap: 16px;
}

.iem-calendar__section > h2 {
    margin: 0;
}

.iem-calendar__section--past {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(28, 28, 28, 0.14);
}

.iem-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.iem-people {
    grid-template-columns: repeat(auto-fill, minmax(180px, 220px));
    align-items: start;
}

.iem-event-slider,
.iem-people-slider {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.iem-events--slider,
.iem-people--slider {
    display: flex;
    grid-auto-flow: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    padding: 0 2px 8px;
}

.iem-events--slider .iem-event-card {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

.iem-people--slider .iem-profile-card {
    flex: 0 0 clamp(170px, 22vw, 220px);
    max-width: 220px;
    min-width: 0;
    scroll-snap-align: start;
}

.iem-slider-button {
    position: absolute;
    top: 96px;
    z-index: 2;
    width: 36px;
    min-height: 36px;
    border-radius: 999px;
    padding: 0;
    background: rgba(28, 28, 28, 0.88);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
}

.iem-slider-button--prev {
    left: 8px;
}

.iem-slider-button--next {
    right: 8px;
}

.iem-event-card,
.iem-event-detail-card,
.iem-profile-card,
.iem-venue-card {
    display: grid;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(28, 28, 28, 0.12);
    border-radius: 8px;
}

.iem-event-card__media,
.iem-event-detail-card__media,
.iem-venue-card > a,
.iem-profile-card__media {
    display: block;
    background: #f4f2ed;
}

.iem-venue-card > a {
    aspect-ratio: 16 / 10;
    max-height: 240px;
    overflow: hidden;
}

.iem-event-card__media {
    aspect-ratio: 4 / 3;
    max-height: 280px;
}

.iem-events--compact .iem-event-card__media {
    aspect-ratio: 16 / 10;
    max-height: 180px;
}

.iem-events--slider .iem-event-card__media {
    aspect-ratio: 16 / 10;
    max-height: 175px;
}

.iem-people--slider .iem-profile-card {
    max-width: 220px;
}

.iem-people--slider .iem-profile-card__media {
    max-height: 180px;
}

.iem-event-detail-card {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    align-items: start;
}

.iem-event-detail-card--no-media {
    grid-template-columns: 1fr;
}

.iem-event-detail-card__body {
    display: grid;
    align-content: start;
    padding: 24px;
    min-width: 0;
}

.iem-event-detail-card__media {
    align-self: start;
    overflow: hidden;
}

.iem-event-detail-card__media img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.iem-event-detail-card__description {
    margin-top: 18px;
}

.iem-event-detail-card__description p {
    margin: 0 0 12px;
}

.iem-profile-card__media {
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.iem-people .iem-profile-card {
    width: 100%;
    max-width: 220px;
}

.iem-people .iem-profile-card__body {
    display: grid;
    align-content: start;
    min-height: 132px;
}

.single-iem_event .iem-event-card__media {
    aspect-ratio: 16 / 9;
    max-height: 420px;
}

.iem-event-card img,
.iem-venue-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.iem-venue-card__gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.iem-venue-card__gallery a {
    display: block;
    width: 72px;
    height: 72px;
    overflow: hidden;
    border-radius: 6px;
    background: #f4f2ed;
}

.iem-venue-card__gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.iem-venue-detail-card {
    display: grid;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(28, 28, 28, 0.12);
    border-radius: 8px;
}

.iem-venue-detail-card__media {
    max-height: 420px;
    overflow: hidden;
    background: #f4f2ed;
}

.iem-venue-detail-card__media img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.iem-venue-detail-card__body {
    display: grid;
    gap: 12px;
    padding: 24px;
}

.iem-venue-detail-card__body p {
    margin: 0;
}

.iem-venue-detail-card__note {
    display: grid;
    gap: 4px;
}

.iem-venue-detail-card__note h3 {
    margin: 0;
    font-size: 1rem;
}

.iem-venue-detail-card__gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    padding: 0 24px 24px;
}

.iem-venue-detail-card__gallery a {
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    background: #f4f2ed;
}

.iem-venue-detail-card__gallery img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.iem-profile-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.iem-button,
.iem-button:visited,
.iem-button:hover,
.iem-button:focus {
    color: #fff;
}

.iem-button--secondary {
    background: #1d2327;
}

.iem-reservation-form-wrap {
    margin-top: 24px;
    padding: 24px;
    background: #fff;
    border: 1px solid rgba(28, 28, 28, 0.12);
    border-radius: 8px;
}

.iem-reservation-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}

.iem-form__field {
    display: grid;
    gap: 6px;
    margin: 0;
}

.iem-form__field label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.iem-form__field input {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    border: 1px solid rgba(28, 28, 28, 0.25);
    border-radius: 5px;
    font: inherit;
}

.iem-form__actions,
.iem-form__honeypot {
    grid-column: 1 / -1;
}

.iem-form__honeypot {
    position: absolute;
    left: -9999px;
}

.iem-form-notice {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 6px;
    font-weight: 700;
}

.iem-form-notice--success {
    background: #e7f6ed;
    color: #135e2b;
}

.iem-form-notice--error {
    background: #fcf0f1;
    color: #8a2424;
}

.iem-event-card__body,
.iem-profile-card__body,
.iem-venue-card__body {
    padding: 16px;
    min-width: 0;
}

.iem-venue-card__body {
    display: grid;
    align-content: start;
    gap: 8px;
}

.iem-venue-card__body h3,
.iem-venue-card__body p {
    margin: 0;
}

.iem-venue-card__body h3 {
    margin-bottom: 2px;
}

.iem-event-card__body {
    display: flex;
    flex-direction: column;
}

.iem-event-card__body h3 {
    order: 1;
}

.iem-event-card__date {
    order: 2;
}

.iem-event-card__venue {
    order: 3;
}

.iem-event-card__body > p:not(.iem-event-card__date):not(.iem-event-card__venue) {
    order: 4;
}

.iem-event-cast {
    order: 5;
}

.iem-event-card__actions {
    order: 6;
}

.iem-event-card h3,
.iem-profile-card h3,
.iem-venue-card h3 {
    margin: 4px 0 10px;
    font-size: 1.18rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.iem-event-card__date {
    margin: 0;
    color: #626262;
    font-weight: 700;
}

.iem-event-card__venue {
    margin: 2px 0 0;
    color: #626262;
}

.iem-venue-card__address {
    color: #626262;
    font-weight: 700;
}

.iem-profile-card__role,
.iem-person-profile__role {
    margin: 0 0 8px;
    color: #626262;
    font-weight: 700;
}

.iem-profile-card__excerpt {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
}

.iem-person-profile {
    display: grid;
    grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    margin-bottom: 24px;
}

.iem-person-profile-page {
    max-width: 900px;
}

.iem-person-profile__headshot img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
}

.iem-person-profile__bio p {
    margin-top: 0;
}

.iem-event-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    min-width: 0;
}

.iem-event-card__actions .iem-button {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    text-align: center;
}

.iem-ticket-state--private {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 6px;
    background: #f6f4ee;
    color: #2a2a2a;
    font-weight: 700;
}

.iem-calendar-menu {
    position: relative;
    display: inline-flex;
}

.iem-calendar-menu__toggle {
    min-height: 0;
    border: 0;
    background: transparent;
    color: var(--it-color-secondary, #126c7a);
    font: inherit;
    padding: 0;
    text-decoration: underline;
    cursor: pointer;
}

.iem-calendar-menu__toggle:hover,
.iem-calendar-menu__toggle:focus {
    color: var(--it-color-primary, #df321f);
}

.iem-calendar-menu__panel {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    display: grid;
    min-width: 230px;
    max-width: calc(100vw - 24px);
    padding: 8px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.iem-calendar-menu__panel[hidden] {
    display: none;
}

.iem-calendar-menu__panel a {
    display: block;
    padding: 9px 10px;
    border-radius: 6px;
    color: #1f1f1f;
    text-decoration: none;
    white-space: nowrap;
}

.iem-calendar-menu__panel a:hover,
.iem-calendar-menu__panel a:focus {
    background: #f3f3f3;
    color: #1f1f1f;
}

@media (max-width: 600px) {
    .iem-events,
    .iem-calendar,
    .iem-card-grid,
    .iem-event-slider {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .iem-events--slider {
        gap: 12px;
        padding: 0 0 8px;
    }

    .iem-events--slider .iem-event-card {
        flex-basis: 100%;
        width: 100%;
        max-width: 100%;
    }

    .iem-event-card__body,
    .iem-event-detail-card__body,
    .iem-venue-card__body {
        padding: 14px;
    }

    .iem-event-card h3,
    .iem-profile-card h3,
    .iem-venue-card h3 {
        font-size: 1.08rem;
    }

    .iem-event-card__actions {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 10px;
    }

    .iem-event-card__actions .iem-button,
    .iem-event-card__actions .iem-calendar-menu,
    .iem-event-card__actions .iem-calendar-menu__toggle {
        width: 100%;
    }

    .iem-slider-button {
        top: 78px;
        width: 32px;
        min-height: 32px;
        font-size: 1.45rem;
    }
}

.iem-event-cast {
    margin-top: 12px;
}

.iem-event-cast__names {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.iem-person-link {
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--it-color-secondary, #126c7a);
    font: inherit;
    font-weight: 700;
    padding: 0;
    text-decoration: underline;
}

.iem-person-link:hover,
.iem-person-link:focus {
    color: var(--it-color-primary, #d9381e);
    background: transparent;
}

.iem-modal[hidden] {
    display: none;
}

.iem-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 24px;
}

.iem-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.54);
}

.iem-modal__dialog {
    position: relative;
    width: min(100%, 520px);
    max-height: min(720px, 90vh);
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.24);
}

.iem-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    min-height: 34px;
    width: 34px;
    padding: 0;
    border-radius: 999px;
}

.iem-person-modal__headshot img {
    width: 128px;
    height: 128px;
    object-fit: cover;
    border-radius: 999px;
}

.iem-person-modal__role {
    color: #626262;
    font-weight: 700;
}

.iem-button,
.iem-ticket-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 8px;
    background: var(--it-color-primary, #d9381e);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    padding: 8px 14px;
}

.iem-ticket-state {
    background: #202020;
}

.iem-button:hover,
.iem-button:focus {
    color: #fff;
    background: var(--it-color-primary, #d9381e);
    text-decoration: none;
    filter: brightness(0.92);
}

.iem-button--secondary:hover,
.iem-button--secondary:focus {
    color: #fff;
    background: #1d2327;
}

.iem-calendar__day {
    display: grid;
    gap: 12px;
}

.iem-calendar__day h3 {
    margin: 24px 0 0;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(28, 28, 28, 0.14);
}

.iem-events--calendar .iem-event-card {
    grid-template-columns: 170px minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
    overflow: hidden;
}

.iem-events--calendar .iem-event-card--no-media {
    grid-template-columns: 1fr;
}

.iem-events--calendar .iem-event-card__media {
    aspect-ratio: 1 / 1;
    max-height: none;
    height: 100%;
    min-width: 0;
}

.iem-events--calendar .iem-event-card__body {
    display: grid;
    align-content: start;
    min-width: 0;
    overflow-wrap: anywhere;
}

.iem-events--calendar .iem-event-card h3 {
    margin-top: 6px;
}

.iem-events--calendar .iem-event-card__actions {
    margin-top: 10px;
    max-width: 100%;
    min-width: 0;
}

.iem-events--calendar .iem-button,
.iem-events--calendar .iem-ticket-state {
    white-space: normal;
    text-align: center;
}

.iem-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 18px;
}

.iem-admin-section {
    margin: 0 0 24px;
}

.iem-admin-section h3 {
    margin: 0 0 10px;
}

.iem-admin-grid--textareas {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.iem-admin-grid input,
.iem-admin-grid select,
.iem-admin-grid textarea {
    width: 100%;
}

.iem-headshot-preview img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 999px;
    border: 1px solid #dcdcde;
}

@media (max-width: 680px) {
    .iem-events,
    .iem-calendar,
    .iem-card-grid {
        gap: 14px;
    }

    .iem-events--slider {
        gap: 12px;
        padding-bottom: 6px;
    }

    .iem-people--slider {
        gap: 12px;
        overflow-x: hidden;
        padding: 0;
    }

    .iem-people--slider .iem-profile-card {
        flex-basis: 100%;
        max-width: 100%;
    }

    .iem-events--slider .iem-event-card__media {
        max-height: 150px;
    }

    .iem-event-card__body,
    .iem-profile-card__body,
    .iem-venue-card__body {
        padding: 14px;
    }

    .iem-event-card__actions {
        gap: 10px;
    }

    .iem-calendar-menu__panel {
        min-width: min(230px, calc(100vw - 24px));
    }

    .iem-people {
        grid-template-columns: 1fr;
    }

    .iem-people .iem-profile-card {
        max-width: none;
    }

    .iem-person-profile {
        grid-template-columns: 1fr;
    }

    .iem-events--calendar .iem-event-card {
        grid-template-columns: 1fr;
    }

    .iem-event-detail-card {
        grid-template-columns: 1fr;
    }

    .iem-event-detail-card__media {
        order: -1;
        min-height: 0;
    }

    .iem-reservation-form {
        grid-template-columns: 1fr;
    }

    .iem-events--calendar .iem-event-card__media {
        aspect-ratio: 16 / 10;
    }

    .iem-slider-button {
        top: 76px;
    }
}
