/* ── Eventcard Medium (.ecm) ─────────────────────────────────────
 * Horizontal card: image left (253px), content right.
 * Matches createCardMediumHTML(). Reference: eventcards/eventcard-medium.html
 * Shared visuals live in eventcard-base.css — this file is layout only.
 * ──────────────────────────────────────────────────────────────── */

/* @penpot cmp.eventcard-medium */
.ecm {
  display: grid;
  grid-template-columns: 253px 1fr;
  /* 688px-Cap (Penpot-Referenzartboard) entfernt 2026-08-27: alle Feed-
   * Eventcards füllen die volle Containerbreite — der Cap machte die
   * Medium-Karte 16px schmaler als die Large-Karte. */
  max-width: 100%;
  min-height: 300px;
  background: var(--ec-card-bg);
}

/* Category tint in a variable so both the card and its badge (which inherits
 * --ec-card-bg) use the same per-category colour. */
.ecm               { --ec-card-bg: var(--cat-default); }
.ecm-music         { --ec-card-bg: var(--cat-music); }
.ecm-film          { --ec-card-bg: var(--cat-film); }
.ecm-community     { --ec-card-bg: var(--cat-community); }
.ecm-arts          { --ec-card-bg: var(--cat-arts); }
.ecm-tech          { --ec-card-bg: var(--cat-tech); }
.ecm-nightlife     { --ec-card-bg: var(--cat-nightlife); }
.ecm-food          { --ec-card-bg: var(--cat-food); }
.ecm-kinder        { --ec-card-bg: var(--cat-kinder); }
.ecm-education     { --ec-card-bg: var(--cat-education); }
.ecm-sports        { --ec-card-bg: var(--cat-sports); }

/* ── Image column ── */
.ecm-media {
  position: relative;
  overflow: hidden;
  /* Round the corners that meet the card edge (card itself is overflow:visible
   * so the attendance dropdown can escape) */
  border-radius: var(--ec-radius) 0 0 var(--ec-radius);
}

.ecm-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Content column ── */
.ecm-body {
  display: flex;
  flex-direction: column;
  gap: 8px;                 /* tight title / desc / meta cluster, like the large card */
  padding: var(--ec-pad);
  min-width: 0;
}

/* Keep the section rhythm: breathing room before social proof + actions */
.ecm-social,
.ecm-bottom-row {
  margin-top: 24px;
}

/* ── Social — avatars stacked above text ── */
.ecm-social {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ecm-avatars {
  display: flex;
  align-items: center;
}

.ecm-av {
  width: 48px;
  height: 48px;
  margin-left: -12px;
  font-size: 18px;
}

.ecm-av:first-child {
  margin-left: 0;
}

/* ── Bottom row: ticket CTA + actions ── */
.ecm-bottom-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.ecm-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  /* The attend + bookmark pills are nowrap; without wrapping they pushed the
   * card past its column in the calendar's narrower content area and put the
   * whole page into horizontal scroll. */
  flex-wrap: wrap;
  min-width: 0;
}

/* ── Responsive: stack when the *container* is narrow ──
 * The media column is a fixed 253px, and the stacking rule below keys off the
 * viewport. That holds in the feed, which is full width, but not in the
 * calendar: there the card sits in a column narrowed by the time gutter, so at
 * a 1000px viewport the body was left with 135px and the title broke one word
 * per line. A container query measures the space the card actually has. */
.ecm-host {
  container-type: inline-size;
}

@container (max-width: 560px) {
  .ecm {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  /* Stacked: image on top (natural DOM order media→body), content below. */
  .ecm-media {
    height: 200px;
    border-radius: var(--ec-radius) var(--ec-radius) 0 0;
  }
  .ecm-body {
    gap: 16px;
    padding: 12px;
  }
}

/* ── Responsive: stack on narrow screens ── */
@media (max-width: 600px) {
  .ecm {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  /* Stacked: image on top, content below (natural DOM order). */
  .ecm-media {
    height: 200px;
    border-radius: var(--ec-radius) var(--ec-radius) 0 0;
  }
  .ecm-body {
    gap: 16px;
    padding: 12px;
  }
  .ecm-title {
    font-size: 24px;
  }
  .ecm-desc {
    font-size: 16px;
  }
  .ecm-av {
    width: 36px;
    height: 36px;
    margin-left: -12px;
  }
}

@media (max-width: 480px) {
  /* See eventcard-small.css — the full-bleed override assumed a 16px parent
   * padding that the feed does not have. */
  .ecm {
    margin-bottom: 16px;
  }
  .ecm-media {
    border-radius: var(--ec-radius) var(--ec-radius) 0 0;
  }
  .ecm-actions {
    flex: 1;
    justify-content: flex-end;
  }
  /* Touch-friendly controls — min-height auf Mobile entfernt */
}
