/* Events hero: copy (title + text) left, photo right */
.events-hero {
  display: flex;
  gap: calc(60 * var(--u));
  align-items: stretch;
  padding: var(--hero-top) var(--page-gutter) calc(80 * var(--u));
}

.events-hero-copy {
  flex: 1 1 75%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: calc(24 * var(--u));
}

.events-hero-media {
  flex: 1 1 50%;
  min-height: calc(480 * var(--u));
  border-radius: calc(40 * var(--u));
  overflow: hidden;
}

.events-hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.events-text {
  max-width: calc(640 * var(--u));
  line-height: 1.5;
  color: var(--color-pine-forest);
}

@media (max-width: 767px) {
  .events-hero {
    flex-direction: column;
  }

  .events-hero-media {
    min-height: calc(320 * var(--u));
  }
}

/* Filters */
.filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: calc(16 * var(--u));
  margin: 0 var(--page-gutter) calc(60 * var(--u));
}

.filter-tabs {
  display: flex;
  gap: calc(21 * var(--u));
  flex-wrap: wrap;
}

.filter-tab {
  display: inline-block;
  min-width: calc(214 * var(--u));
  white-space: nowrap;
  text-align: center;
  border: 1px solid var(--color-pastel-blood);
  border-radius: calc(30 * var(--u));
  padding: calc(10 * var(--u)) calc(22 * var(--u));
  font-size: calc(24 * var(--fu));
  font-weight: var(--body-b-weight);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
  line-height: 0.85em;
}

.filter-tab.is-active {
  background: var(--color-rose-20);
  border-color: var(--color-pastel-blood);
  color: var(--color-persian-plum);
}

.filter-status {
  font-size: max(var(--font-min), calc(14 * var(--fu)));
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-pine-forest);
}

/* Grid */
.events-grid {
  padding: 0 var(--page-gutter) var(--section-space);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: calc(60 * var(--u));
}

.events-grid > li {
  grid-column: span 2;
}

/* quantity query: 3 posts remainder 1 -> first item spans the full row */
.events-grid > li:first-child:nth-last-child(3n + 1) {
  grid-column: span 6;
}

/* quantity query: 3 posts remainder 2 -> first two items split the row evenly */
.events-grid > li:first-child:nth-last-child(3n + 2),
.events-grid > li:first-child:nth-last-child(3n + 2) + li {
  grid-column: span 3;
}

.event-media {
  position: relative;
  aspect-ratio: 1800 / 590;
  margin-bottom: calc(24 * var(--u));
  border-radius: calc(16 * var(--u));
  overflow: hidden;
  background: var(--color-sea-nymph);
}

.event-media .wp-block-post-featured-image,
.event-media img {
  display: block;
  width: 100%;
  height: 100%;
}

.event-tag {
  position: absolute;
  top: calc(30 * var(--u));
  left: calc(30 * var(--u));
  padding: calc(10 * var(--u)) calc(20 * var(--u));
  border-radius: calc(30 * var(--u));
  background: var(--color-white);
  font-size: max(var(--font-min), calc(16 * var(--fu)));
  font-weight: var(--body-r-weight);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-pine-forest);
  z-index: 1;
}

.event-meta {
  font-size: max(var(--font-min), calc(12 * var(--fu)));
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-pastel-blood);
  margin-bottom: calc(12 * var(--u));
}

.event-meta:empty {
  display: none;
}

.event-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.event-body {
  flex: 0 0 50%;
  min-width: 0;
  box-sizing: border-box;
  padding-right: calc(25 * var(--u));
}

.event-title {
  font-weight: var(--body-b-weight);
  font-size: max(var(--font-min), calc(24 * var(--fu)));
  margin-bottom: calc(14 * var(--u));
  color: var(--color-persian-plum);
}

.event-text {
  font-size: max(var(--font-min), calc(14 * var(--fu)));
  line-height: 1.4;
  color: var(--color-pine-forest);
}

.event-text p {
  font-size: inherit;
}

.event-btn {
  flex: 0 0 50%;
  width: 50%;
  max-width: 15em;
  height: calc(58 * var(--u));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 calc(46 * var(--u));
  border-radius: calc(50 * var(--u));
  background: var(--color-sage-26);
  color: var(--color-pine-forest);
  font-weight: var(--body-b-weight);
  font-size: max(var(--font-min), calc(24 * var(--fu)));
  line-height: var(--body-b-line-height);
  text-transform: uppercase;
  white-space: nowrap;
}

/* Page numbers under the grid */
.events-pagination {
  margin: 0 var(--page-gutter) var(--section-space);
  gap: calc(20 * var(--u));
  font-weight: var(--body-b-weight);
  text-transform: uppercase;
}

.events-empty {
  padding: 0 var(--page-gutter) var(--section-space);
}

@media (max-width: 992px) {
  .filter-tab {
    min-width: calc(222 * var(--u));
  }
}

@media (max-width: 600px) {
  .event-btn {
    min-height: calc(62 * var(--u));
    padding: calc(14 * var(--u)) calc(32 * var(--u));
    white-space: normal;
  }
}

@media (max-width: 767px) {
  .events-grid {
    grid-template-columns: 1fr;
  }

  .events-grid > li {
    grid-column: span 1;
  }
}

@media (max-width: 479px) {
  .events-text {
    align-self: flex-start;
  }
}

/* Big circle behind the events hero: same as the About hero circle, in pastel blood */
.events-hero {
  position: relative;
  overflow: visible;
}
.events-hero::before {
  content: "";
  position: absolute;
  top: calc(-450 * var(--u));
  left: 40%;
  width: calc(800 * var(--u));
  height: calc(800 * var(--u));
  border-radius: 50%;
  background: var(--color-sea-nymph);
  filter: blur(calc(70 * var(--u)));
  z-index: -1;
  pointer-events: none;
}

/* Keep the events title above the hero circle (same as the About title) */
.events-title {
  position: relative;
  z-index: 1;
}

/* On phones the circle gets fixed sizes, like the About circle */
@media (max-width: 767px) {
  .events-hero::before {
    top: -270px;
    left: 35%;
    width: 320px;
    height: 320px;
    filter: blur(28px);
  }
}

/* The hero is its own layer so the circle (z-index -1) sits behind the hero text and the header/burger */
.events-hero {
  isolation: isolate;
}
