/**
 * Vibemap Event Feed — date-grouped agenda list.
 *
 * Theme-overridable via CSS custom properties (set them on .vibemap-event-feed
 * or a parent, e.g. the neighborhood page template):
 *   --vmef-accent        link / title colour (default a warm red)
 *   --vmef-row-bg        row background
 *   --vmef-muted         secondary text (venue / time meta)
 *   --vmef-radius        row corner radius
 */
.vibemap-event-feed {
  --vmef-accent: #d6312a;
  --vmef-accent-ink: #b8261f;
  --vmef-row-bg: #ffffff;
  --vmef-page-bg: transparent;
  --vmef-muted: #6b6b6b;
  --vmef-line: rgba(0, 0, 0, 0.08);
  --vmef-radius: 8px;

  display: block;
  width: 100%;
  color: #1a1a1a;
}

.vibemap-event-feed * {
  box-sizing: border-box;
}

/* Feed heading. Renamed from .vmef-heading to .vmef-title so site-level custom
 * CSS that hides .vmef-heading no longer affects it — manage that separately. */
.vmef-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.vmef-title__icon {
  display: inline-flex;
  align-items: center;
  color: var(--vmef-accent);
  line-height: 0;
}

.vmef-title__icon svg {
  width: 20px;
  height: 20px;
}

/* ---- Date group header (SATURDAY, APRIL 25) ---- */
.vmef-group {
  margin-bottom: 1.75rem;
}

.vmef-group__date {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1a1a1a;
  margin: 0 0 0.75rem;
}

.vmef-group__date::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--vmef-accent);
  flex: 0 0 auto;
}

/* ---- Rows ---- */
.vmef-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.vmef-row {
  position: relative;
  display: grid;
  grid-template-columns: 100px 84px 1fr auto;
  align-items: stretch; /* let the image fill the card's full height */
  gap: 1rem;
  /* Fixed height so every card is identical and the media column is a perfect
   * square (square media width === row height). Text is clamped to fit. */
  height: 100px;
  /* No padding on the row itself — the image sits flush against the left,
   * top and bottom edges of the card. The text columns re-add their own
   * spacing below. overflow:hidden clips the flush image to the card radius. */
  padding: 0;
  overflow: hidden;
  background: var(--vmef-row-bg);
  border: 1px solid var(--vmef-line);
  border-radius: var(--vmef-radius);
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.vmef-row:hover {
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.09);
  border-color: rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

/* Stretched-link overlay: whole row is clickable. */
.vmef-row__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  text-indent: -9999px;
  overflow: hidden;
}

.vmef-row__media {
  width: 100px;          /* === row height -> always a perfect square */
  align-self: stretch;   /* fill the full card height, flush top + bottom */
  aspect-ratio: 1 / 1;
  border-radius: 0;      /* flush to the card edge — no inset, no rounding */
  overflow: hidden;
  background: #ededed;
}

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

.vmef-row__media--empty {
  background: linear-gradient(135deg, #f0f0f0, #e2e2e2);
}

.vmef-row__time {
  align-self: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--vmef-muted);
  white-space: nowrap;
}

.vmef-row__body {
  align-self: center;
  min-width: 0;
  /* Vertical breathing room (the row no longer has padding). */
  padding: 0.8rem 0;
}

/* The favourite button keeps its distance from the right edge. */
.vmef-row .vmef-fav {
  align-self: center;
  margin-right: 0.6rem;
}

.vmef-row__title {
  font-size: 1.08rem;
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 0.15rem;
  color: var(--vmef-accent);
  /* Clamp so the fixed-height card never overflows. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vmef-row:hover .vmef-row__title {
  color: var(--vmef-accent-ink);
}

.vmef-row__venue {
  font-size: 0.82rem;
  color: var(--vmef-muted);
  margin-bottom: 0.2rem;
}

.vmef-row__desc {
  font-size: 0.9rem;
  line-height: 1.45;
  color: #4a4a4a;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Favourite (heart) ---- */
.vmef-fav {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c9c9c9;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.vmef-fav:hover {
  color: var(--vmef-accent);
  background: rgba(214, 49, 42, 0.08);
}

.vmef-fav:active {
  transform: scale(0.9);
}

.vmef-fav[aria-pressed="true"] {
  color: var(--vmef-accent);
}

.vmef-fav[aria-pressed="true"] .vmef-fav__icon path {
  fill: currentColor;
  stroke: currentColor;
}

.vmef-fav:focus-visible {
  outline: 2px solid var(--vmef-accent);
  outline-offset: 2px;
}

/* ---- Empty / loading ---- */
.vmef-empty,
.vmef-loading {
  font-size: 0.95rem;
  color: var(--vmef-muted);
  padding: 1.25rem 0;
  margin: 0;
}

.vmef-loading {
  opacity: 0.8;
}

/* ---- Designed empty state (My List / recommendations) ----
 * Horizontal card: icon · copy · actions. Matches the card shortcode's
 * empty state so both surfaces read the same. */
.vmef-emptystate {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.75rem 2rem;
  background: var(--vmef-row-bg);
  border: 1px solid var(--vmef-line);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.vmef-emptystate__icon {
  flex: 0 0 auto;
  line-height: 0;
}

.vmef-emptystate__body {
  flex: 1 1 320px;
  min-width: 0;
}

.vmef-emptystate__heading {
  margin: 0 0 0.35rem;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.15;
  color: #1a1a1a;
}

.vmef-emptystate__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--vmef-muted);
}

.vmef-emptystate__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.vmef-emptystate__btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: var(--vmef-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 6px;
  transition: filter 0.15s ease;
}

.vmef-emptystate__btn:hover {
  filter: brightness(0.92);
  color: #fff;
}

.vmef-emptystate__secondary {
  font-size: 0.9rem;
  color: var(--vmef-muted);
  text-decoration: none;
}

.vmef-emptystate__secondary:hover {
  color: #1a1a1a;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .vmef-emptystate {
    padding: 1.25rem;
    gap: 1rem;
  }
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .vmef-row {
    grid-template-columns: 88px 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.25rem 0.85rem;
    height: 88px;        /* equal-height cards; === media width -> square */
    padding: 0; /* image stays flush to the card edges on mobile too */
  }

  .vmef-row__media {
    width: 88px;         /* === row height -> always a perfect square */
    align-self: stretch; /* fill the row height, flush top + bottom */
    grid-row: 1 / span 2;
  }

  /* Time moves under the title on small screens. */
  .vmef-row__time {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    font-size: 0.8rem;
    order: -1;
    margin-bottom: -0.1rem;
    padding-top: 0.7rem; /* row has no padding now */
  }

  .vmef-row__body {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    padding: 0 0 0.7rem; /* bottom breathing room */
  }

  .vmef-row .vmef-fav {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    margin-right: 0.35rem;
  }
}
