/* ============ EVENTS ARCHIVE (archive-events.php) ============
   Namespaced: event-tile / event-row. Deliberately does NOT reuse .event-card,
   which is defined differently in upcoming-events.css and event-highlight-cards.css. */

.events-archive {
  background: #fff;
  padding: 64px 0 88px;
}

.events-archive__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.events-archive__group {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.events-archive__group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.events-archive__group-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.2;
  color: var(--purple-dark);
}

.events-archive__group-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  max-width: 52ch;
  margin-top: 4px;
}

.events-archive__count {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  color: var(--purple-dark);
  background: var(--purple-light);
  border-radius: 9999px;
  padding: 6px 12px;
}

/* ---------- Upcoming tiles ---------- */

.event-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.event-tile {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(69, 46, 134, 0.08), 0 1px 2px -1px rgba(69, 46, 134, 0.08);
  transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

a.event-tile:hover,
.event-tile:has(.event-tile__stretch:hover) {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px -14px rgba(69, 46, 134, 0.28);
}

a.event-tile:active {
  transform: translateY(0);
}

a.event-tile:focus-visible,
.event-tile__stretch:focus-visible,
.event-tile__book:focus-visible {
  outline: 3px solid var(--purple-mid);
  outline-offset: 2px;
}

.event-tile__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 24px 12px;
  color: #fff;
  text-align: center;
  background: linear-gradient(160deg, var(--purple-dark) 0%, #5a3aa8 60%, var(--purple-mid) 100%);
  font-family: var(--font-heading);
}

.event-tile__day {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.event-tile__month {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: rgba(255, 255, 255, 0.85);
}

.event-tile__year {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.event-tile__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 26px 22px;
  min-width: 0;
}

.event-tile__tags {
  display: flex;
  align-items: center;
  gap: 10px 12px;
  flex-wrap: wrap;
}

.event-tile__type {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 9999px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 10.9px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 1.09px;
  background: var(--purple-light);
  color: var(--purple-dark);
}

.event-tile__type--conference { background: var(--red-light); color: #a20519; }
.event-tile__type--training   { background: var(--blue);      color: #004b7d; }
.event-tile__type--showcase   { background: var(--green);     color: #0f5a3b; }
.event-tile__type--masterclass { background: var(--orange-bg); color: #8a4b0d; }

.event-tile__where {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  min-width: 0;
}

.event-tile__where svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--red);
}

.event-tile__where span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-tile__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.3;
  color: var(--purple-deep);
}

.event-tile__desc {
  font-size: 14.2px;
  line-height: 1.6;
  color: var(--text-body);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-tile__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 6px;
}

.event-tile__price {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 16px;
  color: var(--purple-text);
}

.event-tile__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13.2px;
  line-height: 1;
  color: var(--purple-dark);
  border: 2px solid var(--purple-dark);
  border-radius: 9999px;
  padding: 10px 18px;
  transition: background 0.2s ease, color 0.2s ease;
}

a.event-tile:hover .event-tile__cta {
  background: var(--purple-dark);
  color: #fff;
}

.event-tile__cta svg,
.event-tile__book svg,
.event-row__link svg {
  width: 14px;
  height: 14px;
}

/* ---------- Featured tile (next event) ---------- */

.event-tile--featured {
  grid-template-columns: 200px minmax(0, 1fr);
  border-color: transparent;
  box-shadow: 0 22px 44px -22px rgba(69, 46, 134, 0.35), 0 0 0 1px var(--border-light);
}

.event-tile--featured .event-tile__date {
  padding: 36px 20px;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.event-tile--featured .event-tile__date::before {
  content: '';
  position: absolute;
  right: -40%;
  bottom: -45%;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 70%);
}

.event-tile--featured .event-tile__day   { font-size: 64px; }
.event-tile--featured .event-tile__month { font-size: 15px; }
.event-tile--featured .event-tile__year  { font-size: 13px; }

.event-tile--featured .event-tile__weekday {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  width: 100%;
}

.event-tile--featured .event-tile__body {
  padding: 32px 36px 30px;
  gap: 14px;
}

.event-tile--featured .event-tile__title {
  font-size: 30px;
  line-height: 1.18;
  font-weight: 800;
}

.event-tile--featured .event-tile__desc {
  -webkit-line-clamp: 3;
  font-size: 15px;
  max-width: 62ch;
}

.event-tile--featured .event-tile__footer {
  padding-top: 10px;
}

.event-tile__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.event-tile__book {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  color: #fff;
  background: var(--red-btn);
  border-radius: 9999px;
  padding: 13px 24px;
  transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.25s ease,
              background 0.25s ease;
}

.event-tile__book:hover {
  transform: translateY(-2px);
  background: #c9403d;
  box-shadow: 0 6px 20px -4px rgba(222, 78, 75, 0.4);
}

/* Stretched link: "Event details" covers the whole featured tile; Book now sits above it. */
.event-tile__stretch::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 16px;
}

/* ---------- Past events list ---------- */

.event-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border-light);
}

.event-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 18px 12px;
  border-bottom: 1px solid var(--border-light);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: background 0.2s ease;
}

.event-row:hover {
  background: var(--purple-bg-light);
}

.event-row:focus-visible {
  outline: 3px solid var(--purple-mid);
  outline-offset: -3px;
}

.event-row__date {
  display: block;
  font-family: var(--font-heading);
  text-align: center;
  color: var(--purple-text);
  background: var(--purple-bg);
  border-radius: 12px;
  padding: 10px 6px;
  line-height: 1.1;
}

.event-row__date b {
  display: block;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.event-row__date span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--purple-mid);
  margin-top: 3px;
}

.event-row__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.event-row__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16.5px;
  color: var(--purple-dark);
}

.event-row__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}

.event-row__meta .event-tile__type {
  opacity: 0.85;
}

.event-row__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  color: var(--purple-dark);
  white-space: nowrap;
}

.event-row__link svg {
  transition: transform 0.2s ease;
}

.event-row:hover .event-row__link svg {
  transform: translateX(3px);
}

/* ---------- Empty state ---------- */

.events-archive__empty {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 32px 36px;
  border-radius: 16px;
  background: var(--purple-bg-light);
  border: 1px dashed var(--border);
}

.events-archive__empty h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--purple-dark);
  margin-bottom: 6px;
}

.events-archive__empty p {
  font-size: 14.5px;
  color: var(--text-muted);
  max-width: 56ch;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .event-tiles {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .events-archive {
    padding: 44px 0 64px;
  }

  .events-archive__inner {
    gap: 48px;
  }

  .events-archive__group-title {
    font-size: 22px;
  }

  .event-tile,
  .event-tile--featured {
    grid-template-columns: 1fr;
  }

  .event-tile__date,
  .event-tile--featured .event-tile__date {
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 14px 22px;
  }

  .event-tile__day,
  .event-tile--featured .event-tile__day {
    font-size: 26px;
  }

  .event-tile__month,
  .event-tile__year {
    font-size: 12.5px;
  }

  .event-tile--featured .event-tile__weekday {
    display: none;
  }

  .event-tile__body,
  .event-tile--featured .event-tile__body {
    padding: 20px 22px 22px;
  }

  .event-tile--featured .event-tile__title {
    font-size: 23px;
  }

  .event-tile__desc,
  .event-tile--featured .event-tile__desc {
    -webkit-line-clamp: 3;
  }

  .event-tile__actions {
    width: 100%;
    flex-direction: column;
  }

  .event-tile__book,
  .event-tile__cta {
    width: 100%;
    justify-content: center;
  }

  .event-row {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 14px;
  }

  .event-row__link {
    grid-column: 2;
    justify-self: start;
  }

  .events-archive__empty {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .event-tile,
  .event-tile__cta,
  .event-tile__book,
  .event-row,
  .event-row__link svg {
    transition: none;
  }
}
