/* =============================================================================
   EVENTS
   Classes: .event-list, .event-card, .event-card-body, .event-card-info, .event-image
   Figma: event-card (horizontal), event-image
   Verify the Divi 5 markup these sit on (see docs/CLASSES.md).
============================================================================= */

/* ─── .event-image ───
   Any image that fills its frame. Type it on the Image module (or the
   element that wraps the <img>). Used in event cards, spaces and gallery. */
.event-image {
  overflow: hidden;
  border-radius: var(--card-radius);
}

.event-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ─── .event-card ───
   Horizontal card: image left, text right.
   Type it on the container that holds the image and the body
   (Row / Group, or the Loop item). Its two direct children are the grid cells:
   the .event-image and the .event-card-body. */
.event-card {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: var(--space-3);
  padding-top: var(--card-padding-top);
  padding-bottom: var(--card-padding-bottom);
  padding-left: var(--card-padding-left);
  padding-right: var(--card-padding-right);
  border-radius: var(--card-radius);
}

/* Text column: tag, title, date, text on top; button pinned to the bottom */
.event-card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-2);
}

/* Tag, title, date and text, stacked */
.event-card-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--card-gap);
}

.event-card-info > * {
  margin: 0;
}

/* ─── .event-list ───
   The repeating container of the loop (one card per event). */
.event-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The "view event" button is the Secondary button — see buttons.css
   (.event-card .et_pb_button is in the secondary selector list). */

/* Mobile = Figma event-card "vertical": image on top with the tag over it,
   then title, date, text, button. */
@media (max-width: 768px) {
  .event-card {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--card-gap);
  }

  .event-card .event-image {
    aspect-ratio: var(--card-image-ratio-horizontal);
  }

  .event-card-body {
    gap: var(--card-gap);
  }

  .event-card .tag {
    position: absolute;
    top: 0;
    left: 0;
  }
}
