.cehd-events {
  display: grid;
  gap: 1.25rem;
  font-family: var(--cehd-font);
}

.cehd-events--grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.cehd-events--list {
  grid-template-columns: 1fr;
  gap: 0.875rem;
}

.cehd-events--inline {
  grid-auto-flow: column;
  grid-auto-columns: minmax(20rem, 25rem);
  overflow-x: auto;
  padding: 0.25rem 0.25rem 0.9rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.cehd-event-card,
.cehd-event-card *,
.cehd-event-card *::before,
.cehd-event-card *::after {
  box-sizing: border-box;
}

.cehd-event-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--cehd-border);
  border-radius: var(--cehd-radius);
  background: var(--cehd-white);
  box-shadow: var(--cehd-shadow);
  color: var(--cehd-text);
}

.cehd-events--inline .cehd-event-card {
  scroll-snap-align: start;
}

.cehd-event-card__image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.cehd-event-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  padding: 1.4rem;
  background: var(--cehd-surface-alt);
}

.cehd-event-card__header {
  display: grid;
  gap: 0.7rem;
}

.cehd-event-card__classification {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.cehd-event-card__type,
.cehd-event-card__state,
.cehd-event-card__format {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  margin: 0;
  padding: 0.3rem 0.55rem;
  border-radius: 0.25rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  line-height: 1.2;
  text-transform: uppercase;
}

.cehd-event-card__type {
  background: var(--cehd-maroon);
  color: var(--cehd-white);
}

.cehd-event-card__state {
  background: #e4f5e9;
  color: #185c2d;
}

.cehd-event-card__format {
  border: 1px solid var(--cehd-border-dark);
  background: var(--cehd-white);
  color: var(--cehd-text);
}

.cehd-event-card__title {
  margin: 0;
  color: var(--cehd-maroon-dark);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.cehd-event-card__schedule {
  display: grid;
  gap: 0.2rem;
}

.cehd-event-card__date,
.cehd-event-card__time,
.cehd-event-card__venue,
.cehd-event-card__location-detail,
.cehd-event-card__excerpt {
  margin: 0;
}

.cehd-event-card__date {
  color: var(--cehd-heading);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
}

.cehd-event-card__time {
  color: var(--cehd-text);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
}

.cehd-event-card__location {
  display: grid;
  gap: 0.15rem;
  color: var(--cehd-text-muted);
  line-height: 1.45;
}

.cehd-event-card__venue {
  color: var(--cehd-text);
  font-weight: 700;
}

.cehd-event-card__excerpt {
  line-height: 1.6;
}

.cehd-event-card__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
}

.cehd-event-card__footer {
  flex: 0 0 auto;
  padding: 1.2rem 1.4rem 1.4rem;
  border-top: 1px solid var(--cehd-border);
  background: var(--cehd-white);
}

.cehd-event-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  min-width: 0;
  max-width: 100%;
}

.cehd-event-actions__secondary {
  display: grid;
  flex: 1 1 14rem;
  gap: 0.7rem;
  min-width: 0;
  max-width: 100%;
}

.cehd-event-actions__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  min-width: 0;
}

.cehd-event-actions__utility {
  min-width: 0;
  max-width: 100%;
}

.cehd-event-card__registration {
  flex: 0 0 auto;
}

.cehd-event-action-link,
.cehd-event-calendar summary,
.cehd-event-calendar__menu a {
  color: var(--cehd-maroon);
  font-weight: 700;
  line-height: 1.35;
  text-underline-offset: 0.16em;
}

.cehd-event-action-link,
.cehd-event-calendar__menu a {
  overflow-wrap: anywhere;
}

.cehd-event-calendar {
  position: relative;
  min-width: 0;
}

.cehd-event-calendar summary {
  cursor: pointer;
}

.cehd-event-calendar summary::marker {
  color: var(--cehd-maroon);
}

.cehd-event-calendar__menu {
  display: grid;
  gap: 0.55rem;
  width: min(16rem, 100%);
  margin-top: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--cehd-border);
  border-radius: var(--cehd-radius-sm);
  background: var(--cehd-surface-alt);
}

.cehd-event-action-link:focus-visible,
.cehd-event-calendar summary:focus-visible,
.cehd-event-calendar__menu a:focus-visible {
  outline: 3px solid #f1b82d;
  outline-offset: 2px;
}

.cehd-event-single-details {
  display: grid;
  gap: 1rem;
  margin-block: 0 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--cehd-border);
  border-radius: var(--cehd-radius);
  background: var(--cehd-surface-alt);
  font-family: var(--cehd-font);
}

.cehd-event-single-details__schedule,
.cehd-event-single-details__location p {
  margin: 0;
}

.cehd-event-single-details__schedule {
  color: var(--cehd-heading);
  font-size: 1.05rem;
  font-weight: 800;
}

.cehd-event-single-details__location {
  display: grid;
  gap: 0.15rem;
}

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

.cehd-events-directory {
  width: 100%;
  min-width: 0;
}

.cehd-events-directory__browser {
  margin-bottom: 1.5rem;
}

.cehd-events-directory__browser-fields {
  display: grid;
  grid-template-columns: minmax(16rem, 2fr) repeat(3, minmax(10rem, 1fr));
  gap: 0.75rem;
  align-items: end;
  min-width: 0;
}

.cehd-events-directory__browser-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.cehd-events-directory__result-count {
  margin: 0;
  color: var(--cehd-text-muted);
  font-weight: 700;
}

.cehd-events-directory__clear {
  min-height: 44px;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--cehd-maroon);
  border-radius: var(--cehd-radius-sm);
  background: var(--cehd-white);
  color: var(--cehd-maroon);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cehd-events-directory__clear:hover:not(:disabled) {
  background: var(--cehd-maroon);
  color: var(--cehd-white);
}

.cehd-events-directory__clear:focus-visible,
.cehd-events-directory input:focus-visible,
.cehd-events-directory select:focus-visible {
  outline: 3px solid #f1b82d;
  outline-offset: 2px;
}

.cehd-events-directory__clear:disabled {
  opacity: 0.55;
  cursor: default;
}

.cehd-event-list-item[hidden],
.cehd-events-directory__empty[hidden] {
  display: none !important;
}

.cehd-events-directory__empty {
  margin: 1rem 0 0;
  padding: 1rem;
  border: 1px solid var(--cehd-border);
  border-radius: var(--cehd-radius-sm);
  background: var(--cehd-surface-alt);
  color: var(--cehd-text-muted);
}

.cehd-event-list-item,
.cehd-event-list-item *,
.cehd-event-list-item *::before,
.cehd-event-list-item *::after {
  box-sizing: border-box;
}

.cehd-event-list-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) minmax(170px, 184px);
  min-height: 124px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--cehd-border);
  border-radius: var(--cehd-radius-sm);
  background: var(--cehd-white);
  color: var(--cehd-text);
}

.cehd-event-list-item--no-date {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 184px);
}

.cehd-event-list-item--no-actions {
  grid-template-columns: 96px minmax(0, 1fr);
}

.cehd-event-list-item--no-date.cehd-event-list-item--no-actions {
  grid-template-columns: minmax(0, 1fr);
}

.cehd-event-list-item__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.75rem 0.55rem;
  background: var(--cehd-maroon);
  color: var(--cehd-white);
  text-align: center;
}

.cehd-event-list-item__month {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.cehd-event-list-item__day {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.cehd-event-list-item__content {
  display: grid;
  align-content: center;
  justify-content: stretch;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.8rem 1rem;
}

.cehd-event-list-item__content--has-image {
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: start;
  gap: 0.8rem;
}

.cehd-event-list-item__image img {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: var(--cehd-radius-sm);
  object-fit: cover;
}

.cehd-event-list-item__information {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  min-width: 0;
}

.cehd-event-list-item__header {
  display: grid;
  gap: 0.35rem;
}

.cehd-event-list-item__classification {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.cehd-event-list-item__type,
.cehd-event-list-item__state,
.cehd-event-list-item__format {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0.18rem 0.42rem;
  border-radius: 0.2rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  line-height: 1.15;
  text-transform: uppercase;
}

.cehd-event-list-item__type {
  background: var(--cehd-maroon);
  color: var(--cehd-white);
}

.cehd-event-list-item__state {
  background: #e4f5e9;
  color: #185c2d;
}

.cehd-event-list-item__format {
  border: 1px solid var(--cehd-border-dark);
  background: var(--cehd-white);
  color: var(--cehd-text);
}

.cehd-event-list-item__title {
  margin: 0;
  color: var(--cehd-maroon-dark);
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.cehd-event-list-item__title a {
  color: inherit;
  text-decoration: none;
}

.cehd-event-list-item__title a:hover,
.cehd-event-list-item__title a:focus-visible {
  color: var(--cehd-maroon);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.cehd-event-list-item__title a:focus-visible {
  outline: 3px solid #f1b82d;
  outline-offset: 2px;
}

.cehd-event-list-item__metadata,
.cehd-event-list-item__excerpt {
  margin: 0;
}

.cehd-event-list-item__metadata {
  color: var(--cehd-text);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.cehd-event-list-item__location,
.cehd-event-list-item__location-detail {
  color: var(--cehd-text-muted);
}

.cehd-event-list-item__excerpt {
  color: var(--cehd-text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.cehd-event-list-item__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cehd-event-list-item__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.75rem 0.85rem;
  border-left: 1px solid var(--cehd-border);
  background: #fafafa;
}

.cehd-event-list-item__rsvp {
  min-height: 2.25rem;
  padding: 0.45rem 0.75rem;
}

.cehd-event-list-item__action-link,
.cehd-event-list-item__actions .cehd-event-calendar summary {
  color: var(--cehd-maroon);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  text-underline-offset: 0.16em;
}

.cehd-event-list-item__actions .cehd-event-calendar summary {
  color: var(--cehd-text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.cehd-event-list-item__action-link:focus-visible,
.cehd-event-list-item__rsvp:focus-visible {
  outline: 3px solid #f1b82d;
  outline-offset: 2px;
}

.cehd-event-list-item__details-label--mobile {
  display: none;
}

@media (max-width: 1000px) {
  .cehd-events-directory__browser-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cehd-events-directory__search-field {
    grid-column: 1 / -1;
  }
}

.cehd-events--inline .cehd-event-card__excerpt {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .cehd-event-card {
    transition: transform var(--cehd-transition), box-shadow var(--cehd-transition);
  }

  .cehd-event-card:hover,
  .cehd-event-card:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.13);
  }
}

@media (max-width: 600px) {
  .cehd-events--inline {
    grid-auto-columns: 86%;
  }

  .cehd-event-actions,
  .cehd-event-actions__links {
    align-items: flex-start;
  }

  .cehd-event-actions__secondary {
    flex-basis: 100%;
  }

  .cehd-event-calendar,
  .cehd-event-calendar__menu {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  .cehd-events--list {
    gap: 0.75rem;
  }

  .cehd-event-list-item,
  .cehd-event-list-item--no-date,
  .cehd-event-list-item--no-actions,
  .cehd-event-list-item--no-date.cehd-event-list-item--no-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .cehd-event-list-item__date {
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.4rem;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--cehd-border);
    background: var(--cehd-maroon);
    color: var(--cehd-white);
    text-align: left;
  }

  .cehd-event-list-item__month,
  .cehd-event-list-item__day {
    font-size: 0.85rem;
    line-height: 1.2;
  }

  .cehd-event-list-item__content {
    gap: 0.4rem;
    padding: 0.85rem 0.9rem;
  }

  .cehd-event-list-item__content--has-image {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 0.7rem;
  }

  .cehd-event-list-item__image img {
    width: 64px;
    height: 64px;
  }

  .cehd-event-list-item__actions {
    align-items: stretch;
    gap: 0.4rem;
    padding: 0.75rem 0.9rem 0.85rem;
    border-top: 1px solid var(--cehd-border);
    border-left: 0;
    background: var(--cehd-white);
  }

  .cehd-event-list-item__rsvp {
    width: 100%;
  }

  .cehd-event-list-item__details-label--desktop {
    display: none;
  }

  .cehd-event-list-item__details-label--mobile {
    display: inline;
  }

  .cehd-events-directory__browser-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .cehd-events-directory__search-field {
    grid-column: auto;
  }
}
