:root {
    --stem-eb-purple: #623c7c;
    --stem-eb-salmon: #ff7979;
    --stem-eb-ice: #eaf7f8;
    --stem-eb-coal: #343434;
}

.stem-eb-page { background: #fff; }

.stem-eb-events {
    margin-inline: auto;
    max-width: 75rem;
    padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem);
}

.stem-eb-events__header {
    margin: 0 auto clamp(2rem, 5vw, 3.5rem);
    max-width: 48rem;
    text-align: center;
}

.stem-eb-events__header h2 { margin-bottom: .75rem; }
.stem-eb-events__header p { font-size: 1.1rem; line-height: 1.6; }

.stem-eb-events__filters {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    justify-content: center;
    margin: 0 0 2rem;
}

.stem-eb-events__filters button {
    background: #fff;
    border: 2px solid var(--stem-eb-purple);
    border-radius: 99rem;
    color: var(--stem-eb-purple);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: .65rem 1rem;
}

.stem-eb-events__filters button:hover,
.stem-eb-events__filters button:focus-visible,
.stem-eb-events__filters button.is-active {
    background: var(--stem-eb-purple);
    color: #fff;
}

.stem-eb-events [hidden] { display: none !important; }

.stem-eb-events__grid {
    display: grid;
    gap: 1.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stem-eb-card {
    background: #fff;
    border: 1px solid rgba(98, 60, 124, .14);
    border-radius: 1.5rem;
    box-shadow: 0 .7rem 2rem rgba(52, 52, 52, .08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.stem-eb-card__image {
    aspect-ratio: 16 / 8;
    background: var(--stem-eb-ice);
    overflow: hidden;
}

.stem-eb-card__image img,
.stem-eb-card__image span {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.stem-eb-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: clamp(1.25rem, 3vw, 2rem);
}

.stem-eb-card h3 {
    color: var(--stem-eb-purple);
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin: 0 0 1rem;
}

.stem-eb-card__facts { display: grid; gap: .5rem; margin: 0 0 1.2rem; }
.stem-eb-card__facts div { display: grid; gap: .5rem; grid-template-columns: 6.5rem 1fr; }
.stem-eb-card__facts dt { color: var(--stem-eb-purple); font-weight: 700; }
.stem-eb-card__facts dd { margin: 0; }
.stem-eb-card__summary { font-size: 1.05rem; line-height: 1.6; }

.stem-eb-card__status {
    align-self: flex-start;
    background: #ffe4e4;
    border-radius: 99rem;
    color: #8b2525;
    font-weight: 700;
    margin: 0 0 1rem;
    padding: .4rem .8rem;
}

.stem-eb-card__status--remaining {
    background: #e8f6f1;
    color: #21664f;
}

.stem-eb-card__details { margin: .25rem 0 1.25rem; }
.stem-eb-card__details summary {
    color: var(--stem-eb-purple);
    cursor: pointer;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: .2em;
}
.stem-eb-card__details > div { border-top: 1px solid #ddd; margin-top: .8rem; padding-top: .8rem; }

.stem-eb-card__action { margin: auto 0 0; padding-top: .5rem; }
.stem-eb-card__action a {
    background: var(--stem-eb-purple);
    border-radius: 99rem;
    color: #fff;
    display: inline-block;
    font-weight: 700;
    padding: .75rem 1.25rem;
    text-decoration: none;
}
.stem-eb-card__action a:hover,
.stem-eb-card__action a:focus-visible { background: var(--stem-eb-salmon); color: #fff; }

.stem-eb-events__empty {
    background: var(--stem-eb-ice);
    border-radius: 1.5rem;
    padding: clamp(2rem, 5vw, 4rem);
    text-align: center;
}
.stem-eb-events__empty p { margin: 0 auto; max-width: 42rem; }

@media (max-width: 720px) {
    .stem-eb-events__grid { grid-template-columns: 1fr; }
    .stem-eb-card__facts div { grid-template-columns: 5.5rem 1fr; }
}

/* Monthly calendar, with an agenda layout on narrow screens. */
.stem-eb-view-controls { display:flex; justify-content:center; gap:.5rem; margin-bottom:1.5rem; }
.stem-eb-view-controls button, .stem-eb-calendar__nav button { background:#fff; color:var(--stem-eb-purple); border:1px solid var(--stem-eb-purple); border-radius:.5rem; padding:.55rem .85rem; font:inherit; cursor:pointer; }
.stem-eb-view-controls button[aria-pressed="true"] { background:var(--stem-eb-purple); color:#fff; }
.stem-eb-calendar__nav { display:flex; align-items:center; justify-content:center; gap:.75rem; flex-wrap:wrap; margin-bottom:1rem; }
.stem-eb-calendar__nav h3 { margin:0; font-size:1.4rem; color:var(--stem-eb-purple); }
.stem-eb-calendar__weekdays, .stem-eb-calendar__days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:1px; background:#ded5e4; }
.stem-eb-calendar__weekdays span { background:var(--stem-eb-purple); color:white; text-align:center; padding:.65rem .2rem; font-weight:bold; }
.stem-eb-calendar__days { border:1px solid #ded5e4; }
.stem-eb-calendar__day { min-width:0; min-height:7rem; background:white; padding:.45rem; }
.stem-eb-calendar__day > time { display:block; font-weight:bold; margin-bottom:.4rem; }
.stem-eb-calendar__day.is-outside { background:#f5f3f6; }
.stem-eb-calendar__day.is-today { box-shadow:inset 0 0 0 2px var(--stem-eb-purple); }
.stem-eb-calendar__event { display:block; margin-bottom:.4rem; padding:.5rem; border-left:3px solid var(--stem-eb-purple); border-radius:.3rem; background:var(--stem-eb-ice); color:#343434; text-decoration:none; font-size:.85rem; line-height:1.4; overflow-wrap:anywhere; }
.stem-eb-calendar__event strong, .stem-eb-calendar__event span { display:block; }
.stem-eb-calendar__event:hover { background:#e3d7eb; color:#343434; }
.stem-eb-calendar button:focus-visible, .stem-eb-view-controls button:focus-visible, .stem-eb-calendar__event:focus-visible { outline:3px solid var(--stem-eb-purple); outline-offset:3px; }
.stem-eb-calendar__empty { text-align:center; padding:1.5rem; background:var(--stem-eb-ice); }
@media(max-width:720px) {
    .stem-eb-calendar__weekdays, .stem-eb-calendar__day.is-outside, .stem-eb-calendar__day.is-empty { display:none; }
    .stem-eb-calendar__days { display:block; border:0; background:transparent; }
    .stem-eb-calendar__day { min-height:0; margin-bottom:1rem; border:1px solid #ded5e4; border-radius:.5rem; padding:.75rem; }
    .stem-eb-calendar__event { font-size:1rem; }
}
