/* ============================================================
   Our Events (/events) and the event pages (/events/<slug>).
   Sections: shared bits, past-event card, event page, photo gallery,
   lightbox. The upcoming lists (.ev-list, .ev-row) are styled inline
   in events.php.
   ============================================================ */

/* ---------- Shared: meta line, pills, closing CTA ---------- */
.ev-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: var(--fs-14);
  color: var(--uw-ink-500);
  margin: 0;
}
.ev-meta span { display: inline-flex; align-items: center; gap: 5px; }
.ev-meta svg { flex-shrink: 0; color: var(--uw-ink-400); }
.ev-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--uw-ink-600);
  background: var(--uw-ink-100);
}
.ev-pill--open { color: #fff; background: var(--uw-red-500); }
.ev-pill--live { color: var(--uw-blue-700, var(--uw-blue-600)); background: var(--uw-blue-50); }

.pg-cta-wrap { padding-block: clamp(72px, 9vw, 120px); }
.pg-cta-card {
  background: #08111f;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: clamp(20px, 2.4vw, 28px);
  box-shadow: var(--shadow-lg);
  padding: clamp(48px, 6vw, 80px) clamp(32px, 5vw, 72px);
  text-align: center;
}
.pg-cta-card .msp-h2 { color: #fff; text-align: center; max-width: 24ch; margin-inline: auto; margin-bottom: 0; }
.pg-cta-card .msp-sub { color: rgba(255,255,255,.65); max-width: 54ch; margin-inline: auto; margin-top: clamp(14px,2vw,20px); text-align: center; }
.pg-cta-card .msp-cta-row { justify-content: center; margin-inline: auto; margin-top: clamp(28px,4vw,44px); }
.pg-cta-card .btn--outline {
  border-color: rgba(255,255,255,.4) !important; color: #fff !important; background: transparent !important;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.pg-cta-card .btn--outline:hover { background: #fff !important; border-color: #fff !important; color: #08111f !important; }

/* ---------- Past-event card (on /events) ----------
   The whole card is one click target: the button's ::after stretches over it. */
.evc {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  background: var(--uw-surface);
  border: 1px solid var(--uw-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.evc + .evc { margin-top: clamp(20px, 2.4vw, 32px); }
.evc:hover { border-color: var(--uw-blue-200); box-shadow: var(--shadow-lg); }
.evc:has(.evc__link:focus-visible) { outline: 3px solid var(--uw-blue-500); outline-offset: 3px; }

.evc__media {
  position: relative;
  min-height: 340px;
  background: var(--uw-surface-sunk);
}
.evc__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.evc:hover .evc__media img { transform: scale(1.03); }
.evc__count {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(8, 17, 31, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.evc__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(24px, 3.6vw, 52px);
}
.evc__meta { margin-bottom: var(--space-4); }
.evc__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-2xl);
  line-height: var(--lh-snug);
  color: var(--uw-ink-900);
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}
.evc__blurb {
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--uw-ink-600);
  max-width: 46ch;
  margin: 0 0 var(--space-6);
}
.evc__link::after { content: ""; position: absolute; inset: 0; }
/* .btn nudges itself 1px down while pressed. A transformed element becomes the
   containing block for its ::after, which would shrink the card-wide click area
   to just the button on mouse-down and swallow clicks on the photo and text. */
.evc__link, .evc__link:hover, .evc__link:active { transform: none; }

/* ---------- Event page (/events/<slug>) ---------- */
.ed-hero { padding-block-end: clamp(24px, 3vw, 40px); }
.ed-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-14);
  color: var(--uw-ink-500);
  text-decoration: none;
  margin-bottom: var(--space-6);
  transition: color 0.15s ease;
}
.ed-back:hover { color: var(--uw-blue-500); }
.ed-hero .ev-meta { margin-bottom: var(--space-5); }
.ed-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 7.4vw, var(--fs-3xl));
  line-height: var(--lh-tight);
  color: var(--uw-ink-900);
  max-width: 26ch;
  margin: 0 0 var(--space-5);
  text-wrap: balance;
}
.ed-hero .msp-lede { max-width: 62ch; margin-bottom: 0; }

.ed-body { padding-block: clamp(32px, 4vw, 56px) clamp(72px, 9vw, 120px); }
.ed-cover {
  margin: 0 0 clamp(40px, 5vw, 72px);
  border-radius: var(--r-xl);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--uw-surface-sunk);
}
.ed-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
}
.ed-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.ed-main .msp-head { margin-bottom: clamp(24px, 3vw, 36px); }

/* program */
.ed-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: ed-step;
}
.ed-step {
  counter-increment: ed-step;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  padding-block: clamp(20px, 2.4vw, 28px);
  border-top: 1px solid var(--uw-border);
}
.ed-step:first-child { border-top: 2px solid var(--uw-blue-500); }
.ed-step::before {
  content: counter(ed-step, decimal-leading-zero);
  padding-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--uw-blue-600);
}
.ed-step h3 {
  font-family: var(--font-sans);
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--uw-ink-900);
  margin: 0 0 4px;
}
.ed-step__session {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-md);
  line-height: 1.35;
  color: var(--uw-blue-500);
  margin: 0 0 var(--space-3);
}
.ed-step__text {
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--uw-ink-600);
  margin: 0;
}
.ed-closing {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  line-height: 1.4;
  color: var(--uw-ink-900);
  max-width: 48ch;
  margin: clamp(32px, 4vw, 48px) 0 0;
  padding-left: clamp(16px, 2vw, 24px);
  border-left: 3px solid var(--uw-red-500);
  text-wrap: balance;
}

/* aside: facts and speakers */
.ed-aside {
  display: grid;
  gap: var(--space-5);
  position: sticky;
  top: 96px;
}
.ed-card {
  background: var(--uw-surface);
  border: 1px solid var(--uw-border);
  border-radius: var(--r-xl);
  padding: clamp(20px, 2.4vw, 28px);
}
.ed-card__title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--uw-blue-600);
  margin: 0 0 var(--space-4);
}
.ed-facts { margin: 0; display: grid; gap: var(--space-4); }
.ed-facts dt {
  font-size: var(--fs-sm);
  color: var(--uw-ink-500);
  margin: 0 0 2px;
}
.ed-facts dd {
  font-size: var(--fs-base);
  font-weight: 500;
  line-height: 1.4;
  color: var(--uw-ink-900);
  margin: 0;
}
.ed-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ed-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--uw-border);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.ed-person:hover { border-color: var(--uw-blue-200); background: var(--uw-blue-50); }
.ed-person img {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--uw-surface-sunk);
}
.ed-person__name {
  display: block;
  font-size: var(--fs-14-5);
  font-weight: 600;
  line-height: 1.3;
  color: var(--uw-ink-900);
}
.ed-person__topic {
  display: block;
  font-size: var(--fs-14);
  line-height: 1.35;
  color: var(--uw-ink-500);
}

/* ---------- Photo gallery ---------- */
.ed-gallery {
  background: var(--uw-surface-sunk);
  border-block: 1px solid var(--uw-border);
}
.ed-photos {
  list-style: none;
  margin: 0;
  padding: 0;
  column-count: 2;
  column-gap: 12px;
}
.ed-photo {
  break-inside: avoid;
  margin: 0 0 12px;
}
.ed-photo__btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--uw-surface);
  cursor: zoom-in;
  line-height: 0;
}
.ed-photo__btn img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.ed-photo__btn:hover img { transform: scale(1.04); }
.ed-photo__btn:focus-visible { outline: 3px solid var(--uw-blue-500); outline-offset: 2px; }
.ed-photo__cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 28px 12px 10px;
  text-align: left;
  font-size: var(--fs-14);
  line-height: 1.35;
  color: #fff;
  background: linear-gradient(to top, rgba(8, 17, 31, 0.78), rgba(8, 17, 31, 0));
  opacity: 0;
  transition: opacity 0.2s ease;
}
.ed-photo__btn:hover .ed-photo__cap,
.ed-photo__btn:focus-visible .ed-photo__cap { opacity: 1; }
@media (hover: none) { .ed-photo__cap { display: none; } }
@media (min-width: 900px) {
  .ed-photos { column-count: 3; column-gap: 16px; }
  .ed-photo { margin-bottom: 16px; }
}

/* ---------- Lightbox ---------- */
.ev-lb {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  background: rgba(8, 17, 31, 0.92);
}
.ev-lb[hidden] { display: none; }
.ev-lb__fig {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  max-height: 100%;
}
.ev-lb__img {
  display: block;
  max-width: min(100%, 1400px);
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  width: auto;
  height: auto;
  border-radius: var(--r-md);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  background: rgba(255, 255, 255, 0.06);
  transition: opacity 0.2s ease;
}
.ev-lb.is-loading .ev-lb__img { opacity: 0.35; }
.ev-lb__cap {
  text-align: center;
  font-size: var(--fs-14-5);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.85);
  max-width: 64ch;
}
.ev-lb__count {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.5);
}
.ev-lb__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}
.ev-lb__btn:hover { background: rgba(255, 255, 255, 0.24); }
.ev-lb__btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.ev-lb__btn svg { width: 22px; height: 22px; }
.ev-lb__close { top: clamp(10px, 2vw, 22px); right: clamp(10px, 2vw, 22px); }
.ev-lb__prev  { left: clamp(10px, 2vw, 22px);  top: 50%; transform: translateY(-50%); }
.ev-lb__next  { right: clamp(10px, 2vw, 22px); top: 50%; transform: translateY(-50%); }
body.ev-lb-open { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .ed-layout { grid-template-columns: 1fr; }
  .ed-aside { position: static; }
}
@media (max-width: 820px) {
  .evc { grid-template-columns: 1fr; }
  .evc__media { min-height: 0; aspect-ratio: 3 / 2; }
}
@media (max-width: 640px) {
  .ed-cover { aspect-ratio: 3 / 2; }
  .ed-step { grid-template-columns: 40px minmax(0, 1fr); }
  /* arrows sit at the lower corners so the photo can use the full width */
  .ev-lb__prev, .ev-lb__next { top: auto; bottom: 18px; transform: none; }
  .ev-lb__prev { left: 18px; }
  .ev-lb__next { right: 18px; }
  .ev-lb__img { max-height: calc(100vh - 200px); max-height: calc(100dvh - 200px); }
}

@media (prefers-reduced-motion: reduce) {
  .evc, .evc__media img, .ed-photo__btn img, .ed-photo__cap, .ev-lb__img { transition: none; }
  .evc:hover .evc__media img, .ed-photo__btn:hover img { transform: none; }
}
