/* =========================================================
   EVENTS: list page and event page
   Tokens, type, the page header, tabs, badges, pagination and
   prose come from css/wfc.css.
   ========================================================= */

/* ---------- Heading and filter tabs above the list ---------- */

.wfc-events__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 20px 32px;
  margin-bottom: clamp(28px, 4vw, 48px);
}

/* ---------- Event rows ----------
   Phones: photo on top with the date on a tile over its corner.
   Large screens: date, photo and text side by side, ruled between rows. */

.wfc-events {
  display: grid;
  gap: 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wfc-event {
  position: relative;
  display: grid;
  gap: 20px;
}

.wfc-event:has(a:focus-visible) {
  outline: 3px solid var(--wfc-forest);
  outline-offset: 6px;
  border-radius: 20px;
}

.wfc-event__date {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 68px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--wfc-paper);
  color: var(--wfc-forest);
  box-shadow: 0 6px 18px rgba(23, 35, 28, 0.14);
}

.wfc-event__day {
  font-family: var(--wfc-display);
  font-weight: 800;
  font-stretch: 70%;
  font-size: 2rem;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.wfc-event__month {
  font-family: var(--wfc-text);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--wfc-slate);
}

.wfc-event--past .wfc-event__date {
  color: var(--wfc-ink);
}

.wfc-event__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 20px;
  background: var(--wfc-mist);
}

.wfc-section--mist .wfc-event__media {
  background: var(--wfc-line);
}

.wfc-event__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  transition: transform 0.6s var(--wfc-ease);
}

.wfc-event:hover .wfc-event__media img {
  transform: scale(1.04);
}

.wfc-event__body {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 10px;
}

.wfc-event__title {
  margin: 2px 0 0;
  font-family: var(--wfc-display);
  font-weight: 700;
  font-stretch: 80%;
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  line-height: 1.1;
  color: var(--wfc-ink);
  text-wrap: balance;
}

.wfc-event__title a {
  color: inherit;
  text-decoration: none;
  outline: none;
  transition: color 0.2s ease;
}

.wfc-event:hover .wfc-event__title a {
  color: var(--wfc-forest);
}

/* The whole row is clickable through the title link. */
.wfc-event__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}

.wfc-event__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--wfc-text);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--wfc-ink);
}

.wfc-event__meta i {
  margin-right: 6px;
  color: var(--wfc-forest);
}

.wfc-event__text {
  margin: 0;
  max-width: 62ch;
  font-family: var(--wfc-text);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--wfc-slate);
}

.wfc-event__more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-family: var(--wfc-display);
  font-weight: 600;
  color: var(--wfc-ink);
  transition: color 0.2s ease;
}

.wfc-event__more i {
  font-size: 0.85rem;
  color: var(--wfc-forest);
  transition: transform 0.4s var(--wfc-ease);
}

.wfc-event:hover .wfc-event__more {
  color: var(--wfc-forest);
}

.wfc-event:hover .wfc-event__more i {
  transform: translateX(5px);
}

.wfc-events__empty {
  display: grid;
  justify-items: start;
  gap: 16px;
  padding: clamp(32px, 5vw, 56px);
  border-radius: 24px;
  background: var(--wfc-mist);
}

.wfc-events__empty p {
  margin: 0;
  font-family: var(--wfc-display);
  font-weight: 700;
  font-stretch: 80%;
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  line-height: 1.2;
  color: var(--wfc-ink);
}

/* Top-aligned so the date tile stays on the photo's corner. */
@media (min-width: 576px) {
  .wfc-event {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 28px;
    align-items: start;
  }
}

@media (min-width: 992px) {
  .wfc-events {
    gap: 0;
  }

  .wfc-event {
    grid-template-columns: 124px minmax(0, 300px) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
    padding-block: 36px;
    border-top: 1px solid var(--wfc-line);
  }

  .wfc-event:last-child {
    border-bottom: 1px solid var(--wfc-line);
  }

  /* The date leaves the photo and stands in its own column. */
  .wfc-event__date {
    position: static;
    justify-items: start;
    gap: 8px;
    min-width: 0;
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .wfc-event__day {
    font-size: clamp(3.5rem, 2.5rem + 2vw, 4.5rem);
    line-height: 0.82;
  }

  .wfc-event__month {
    font-size: 1rem;
  }
}

/* ---------- Event page ---------- */

.wfc-event-detail {
  display: grid;
  gap: 40px;
}

.wfc-event-detail__photo {
  margin: 0;
}

.wfc-event-detail__photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 24px;
  background: var(--wfc-mist);
}

.wfc-event-detail__body {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 24px;
}

@media (min-width: 992px) {
  .wfc-event-detail {
    grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
    gap: 72px;
    align-items: start;
  }

  /* The photo stays in view beside a long description. */
  .wfc-event-detail__photo {
    position: sticky;
    top: calc(var(--wfc-header-h) + 32px);
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .wfc-event__media img,
  .wfc-event__title a,
  .wfc-event__more,
  .wfc-event__more i {
    transition: none;
  }

  .wfc-event:hover .wfc-event__media img,
  .wfc-event:hover .wfc-event__more i {
    transform: none;
  }
}
