/* ════════════════════════════════════════════════════════════
   WeTrials — News & Events archive (/events)

   Implements "Events List.inline.html" (Events page layout conversion):
   a list/row layout with a horizontal featured card and numbered
   pagination — replacing the earlier card grid.

   Soft palette: data-palette="soft" on the page wrapper resolves
   sky #EAF6FD, cream #f0f9fb, ink #071e27, line #cde8ec.

   Colors come from css/design-system/tokens/tokens.css. The values
   below are the only ones with no token: the press tag teal, the
   hero button's own pair, and the .ep-art placeholder fill — all
   three hard-coded inside the design system's own styles.css.

   Shared by the WordPress template and events-page/preview.html.
   ════════════════════════════════════════════════════════════ */

.wt-events-page {
  /* Interactive accent — filter chips, pager, and the News & Press tag. */
  --accent: #56bbc8;
  --hero-btn-bg: #f7c413;
  --hero-btn-ink: #063b3b;
  /* Cyan shape sitting behind the featured event's arch image. */
  --arch-cyan: #5BC4CF;
  /* "Read more" — deliberately neutral so it doesn't compete with the tags. */
  --read-more: #5c5c58;
  /* Header wash: teal → deep-teal → gold at low opacity. */
  --grad-head: linear-gradient(180deg, rgba(56,202,211,.10) 0%, rgba(12,91,108,.05) 45%, rgba(255,190,0,.07) 100%);

  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wt-events-page *,
.wt-events-page *::before,
.wt-events-page *::after { box-sizing: border-box; }
.wt-events-page img { display: block; max-width: 100%; }
.wt-events-page a { color: inherit; text-decoration: none; }

.wt-events-page .wrap { max-width: 1160px; margin: 0 auto; padding: 0 var(--space-5); }

/* ── Typography ── */
.wt-events-page h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(38px, 5vw, 62px);
  letter-spacing: -.02em; line-height: 1.02; color: var(--ink); margin: 0;
}
.wt-events-page h2 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(30px, 3.6vw, 42px);
  letter-spacing: -.02em; line-height: 1.05; color: var(--ink); margin: 0;
}
.wt-events-page h3 {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  letter-spacing: -.015em; line-height: 1.2; color: var(--ink); margin: 0;
}
.wt-events-page .lead { font-size: 19px; color: var(--ink-soft); line-height: 1.55; margin: 0; }
.wt-events-page p { font-size: 15px; color: var(--ink-soft); line-height: 1.65; margin: 0; }

/* ── Header band ── */
.wt-events-page .ev-head { background: var(--grad-head); padding: var(--space-7) 0 96px; }
.wt-events-page .ev-head .lead { max-width: 620px; margin-top: var(--space-2); }

/* ── Featured card (horizontal) ── */
.wt-events-page .ep-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .25s, box-shadow .25s;
}
.wt-events-page .ep-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card-hover); }
.wt-events-page .ev-feat {
  margin-top: var(--space-6); display: flex; gap: var(--space-6);
  padding: var(--space-2) var(--space-3); align-items: center;
  /* visible so the arch artwork and its shadow aren't clipped by
     .ep-card's overflow:hidden */
  overflow: visible;
}
/* Gentler than .ep-card's -5px — this rule must stay after it to win. */
.wt-events-page .ev-feat:hover {
  transform: translateY(-2px); box-shadow: 0 12px 26px -20px rgba(28, 27, 23, .28);
}
/* Optional frameless variant — drops the card chrome behind the featured event. */
.wt-events-page .ev-feat-bare,
.wt-events-page .ev-feat-bare:hover {
  background: transparent; border-color: transparent; box-shadow: none;
}

/* ── Featured artwork: arch image with a cyan shape behind it ── */
.wt-events-page .ev-feat-art { flex: 0 0 300px; }
.wt-events-page .ev-arch { position: relative; padding: 34px 0 18px 18px; }
.wt-events-page .ev-arch-cyan {
  position: absolute; bottom: 0; left: 0; width: 72%; height: 46%;
  background: var(--arch-cyan); border-radius: 0 0 0 135px;
  z-index: 1; pointer-events: none;
}
.wt-events-page .ev-arch-img {
  position: relative; z-index: 2; width: 100%; aspect-ratio: 1 / 1;
  border-radius: 38px 0 0 126px; overflow: hidden;
  background: var(--grad-portrait);
  box-shadow: 0 20px 40px -10px rgba(28, 27, 23, .09);
}
.wt-events-page .ev-arch-img img {
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  display: block; border-radius: 38px 0 0 126px; transition: transform .5s ease;
}
.wt-events-page .ev-arch:hover .ev-arch-img img { transform: scale(1.02); }
.wt-events-page .ev-feat-body {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  gap: var(--space-2); justify-content: center;
}
.wt-events-page .ev-feat-title { font-size: 24px; line-height: 1.25; }
.wt-events-page .hero-tag {
  display: inline-flex; align-items: center; gap: 9px; width: fit-content;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-pill); padding: 7px 15px 7px 11px;
  font-weight: 600; font-size: 13px; color: var(--ink-soft);
}
.wt-events-page .hero-tag .dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(0, 105, 110, .16);
  animation: wt-tagpulse 2s infinite;
}
@keyframes wt-tagpulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(0, 105, 110, .2); }
  50%      { box-shadow: 0 0 0 6px rgba(0, 105, 110, 0); }
}
.wt-events-page .ev-meta {
  display: flex; flex-wrap: wrap; gap: var(--space-5);
  font-size: 13px; color: var(--ink-soft);
}
.wt-events-page .ev-meta span { display: inline-flex; align-items: center; gap: 6px; }
.wt-events-page .ev-meta svg { flex: none; }
.wt-events-page .ev-feat-cta { margin-top: 4px; }

/* ── Hero button (gradient reveal on hover) ── */
.wt-events-page .hero-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px var(--space-4);
  font-family: var(--font-display); font-size: 15px; font-weight: 700;
  text-decoration: none; cursor: pointer; border: none; border-radius: 50px;
  position: relative; overflow: hidden; isolation: isolate;
  background-color: var(--hero-btn-bg); color: var(--hero-btn-ink);
  box-shadow: var(--shadow-hero-btn);
  transition: color .18s ease, box-shadow .18s ease;
}
.wt-events-page .hero-btn::before {
  content: ""; position: absolute; inset: -1px; border-radius: 70px; z-index: -1;
  background: var(--grad-btn-hover);
  opacity: 0; transition: opacity 300ms ease;
}
.wt-events-page .hero-btn:hover { color: #000; box-shadow: 0 12px 28px rgba(19, 34, 49, .34); }
.wt-events-page .hero-btn:hover::before { opacity: 1; }
.wt-events-page .btn-arrow { transition: transform .2s; }
.wt-events-page .hero-btn:hover .btn-arrow { transform: translateX(3px); }
.wt-events-page .hero-btn:focus-visible,
.wt-events-page .fchip:focus-visible,
.wt-events-page .pg:focus-visible,
.wt-events-page .ev-row a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ── Filter bar ── */
/* Scrolls away with the page — deliberately not sticky, so it doesn't
   collide with the site's own fixed header. */
.wt-events-page .ev-filterwrap {
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.wt-events-page .filterbar {
  padding: var(--space-3) var(--space-5);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px 16px; flex-wrap: wrap;
}
.wt-events-page .fchips { display: flex; gap: 10px var(--space-1); flex-wrap: wrap; }
.wt-events-page .fchip {
  display: inline-flex; align-items: center; gap: var(--space-1);
  height: 40px; padding: 0 var(--space-3);
  border-radius: var(--radius-pill); border: 1px solid var(--teal-line);
  background: var(--paper);
  font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--ink);
  cursor: pointer; transition: background .2s, border-color .2s, color .2s;
}
.wt-events-page .fchip:hover { border-color: var(--accent); }
.wt-events-page .fchip .fdot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.wt-events-page .fchip[data-type="onsite"] .fdot { background: var(--yellow); }
.wt-events-page .fchip[data-type="virtual"] .fdot { background: var(--teal-deep); }
.wt-events-page .fchip[data-type="press"] .fdot { background: var(--accent); }
/* All states listed so an active chip doesn't lose its fill on hover/focus. */
.wt-events-page .fchip.on,
.wt-events-page .fchip.on:hover,
.wt-events-page .fchip.on:focus,
.wt-events-page .fchip.on:active,
.wt-events-page .fchip.on:focus-visible { background: var(--accent); border-color: var(--accent); color: #fff; }
.wt-events-page .fchip.on .fdot { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .55); }
.wt-events-page .fchip:focus { outline: none; }
.wt-events-page .fchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wt-events-page .filterbar .count { font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* ── Event rows ── */
.wt-events-page .ev-list-pad { padding: var(--space-7) 0; }
.wt-events-page .ev-row {
  display: flex; align-items: center; gap: var(--space-5);
  padding: 26px 4px; border-bottom: 1px solid var(--line);
  position: relative; cursor: pointer; transition: background .2s;
}
.wt-events-page .ev-row:hover { background: var(--teal-light); }
.wt-events-page .ev-row[hidden] { display: none; }
/* Full-bleed anchor makes the whole row clickable; the three columns sit
   above it so their own links stay individually clickable. */
.wt-events-page .ev-row-anchor { position: absolute; inset: 0; z-index: 1; }
.wt-events-page .ev-date,
.wt-events-page .ev-body,
.wt-events-page .ev-cta { position: relative; z-index: 2; }

.wt-events-page .ev-date { flex: 0 0 96px; }
/* Month reads as plain ink for every type — the coloured tag already
   carries the event type, so tinting the month too was redundant. */
.wt-events-page .ev-date .m {
  font-family: var(--font-display); font-size: 11px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink);
}
.wt-events-page .ev-date .d {
  font-family: var(--font-display); font-size: 30px; font-weight: 800;
  color: var(--ink); line-height: 1; margin: 4px 0; font-variant-numeric: tabular-nums;
}
.wt-events-page .ev-date .y { font-size: 12px; font-weight: 600; color: var(--ink-soft); }

.wt-events-page .ev-body { flex: 1; min-width: 0; }
.wt-events-page .ev-body-top {
  display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap;
}
.wt-events-page .ep-tag {
  display: inline-flex; align-items: center;
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  padding: 4px 12px; border-radius: var(--radius-badge); border: none; color: var(--ink);
}
.wt-events-page .ep-tag--event { background: var(--grad-btn-hover); }
.wt-events-page .ep-tag--press { background: var(--accent); }
.wt-events-page .ev-range { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.wt-events-page .ev-row[data-status="upcoming"] .ev-range { color: var(--yellow-deep); }
.wt-events-page .ev-body h3 { font-size: 18px; }
.wt-events-page .ev-body h3 a { color: var(--ink); position: relative; z-index: 2; }
.wt-events-page .ev-body h3 a:hover { color: var(--teal); }

.wt-events-page .ev-cta { flex: 0 0 auto; }
.wt-events-page .ep-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 13px; color: var(--read-more);
  position: relative; z-index: 2;
}
.wt-events-page .ep-link span { transition: transform .2s; }
.wt-events-page .ev-row:hover .ep-link span { transform: translateX(3px); }

/* ── Pagination ── */
.wt-events-page .pager {
  display: flex; gap: var(--space-1); align-items: center; justify-content: center;
  margin-top: var(--space-6); flex-wrap: wrap;
}
.wt-events-page .pager[hidden] { display: none; }
.wt-events-page .pg {
  min-width: 40px; height: 40px; padding: 0 14px;
  border-radius: var(--radius-pill); border: 1px solid var(--line);
  background: var(--paper);
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  color: var(--ink-soft); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.wt-events-page .pg:hover { border-color: var(--accent); color: var(--accent); }
.wt-events-page .pg.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.wt-events-page .pg[disabled] { opacity: .35; pointer-events: none; }

/* ── Empty state ── */
.wt-events-page .ev-empty { text-align: center; padding: 64px 24px; color: var(--ink-soft); }
.wt-events-page .ev-empty[hidden] { display: none; }
.wt-events-page .ev-empty strong {
  display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px;
  font-family: var(--font-display); font-weight: 700;
}

/* ── Tablet ── */
@media (max-width: 900px) {
  .wt-events-page .ev-head { padding: 56px 0 64px; }
  .wt-events-page .ev-feat { gap: var(--space-5); }
  .wt-events-page .ev-feat-art { flex: 0 0 250px; }
  .wt-events-page .ev-arch { padding: 26px 0 13px 13px; }
  .wt-events-page .ev-arch-cyan { border-radius: 0 0 0 112px; }
  .wt-events-page .ev-arch-img,
  .wt-events-page .ev-arch-img img { border-radius: 28px 0 0 93px; }
  .wt-events-page .ev-list-pad { padding: var(--space-6) 0; }
  .wt-events-page .ev-row { gap: var(--space-3); }
  .wt-events-page .ev-date { flex: 0 0 76px; }
  .wt-events-page .ev-filterwrap .filterbar { padding: var(--space-2) var(--space-1); }
  .wt-events-page .filterbar .count { width: 100%; margin-top: 2px; }
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .wt-events-page .wrap { padding: 0 var(--space-3); }
  /* Needs to outrank .wrap above, which shares the same specificity and
     would otherwise zero the vertical padding and jam the chips upward. */
  .wt-events-page .ev-filterwrap .filterbar {
    padding: 10px var(--space-3) var(--space-2);
    gap: 10px var(--space-1);
  }
  /* Four chips cannot fit one row on a phone without shrinking the text
     past comfort, and wrapping stranded "News & Press" on its own line.
     So the strip scrolls sideways instead: labels and touch targets stay
     full size, and the clipped last chip signals there is more. It bleeds
     to the screen edges while the first chip stays aligned with the page. */
  .wt-events-page .fchips {
    flex: 1 1 100%;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-inline: calc(var(--space-3) * -1);
    padding-inline: var(--space-3);
    gap: var(--space-1);
  }
  .wt-events-page .fchips::-webkit-scrollbar { display: none; }
  .wt-events-page .fchip { height: 38px; flex: 0 0 auto; }
  .wt-events-page .filterbar .count { margin-top: 0; }
  .wt-events-page .ev-head { padding: 40px 0 48px; }
  .wt-events-page .ev-feat { flex-direction: column; padding: var(--space-2); }
  .wt-events-page .ev-feat-art { flex: 0 0 auto; width: 100%; max-width: 420px; }
  .wt-events-page .ev-arch { padding: 40px 0 22px 22px; }
  .wt-events-page .ev-arch-cyan { border-radius: 0 0 0 188px; }
  .wt-events-page .ev-arch-img,
  .wt-events-page .ev-arch-img img { border-radius: 47px 0 0 156px; }
  .wt-events-page .ev-meta { flex-direction: column; gap: 6px; }
  .wt-events-page .hero-btn { width: 100%; min-height: 48px; }
  .wt-events-page .ev-row {
    flex-wrap: wrap; align-items: flex-start;
    padding-top: var(--space-3); padding-bottom: var(--space-3);
  }
  .wt-events-page .ev-date { flex: 0 0 auto; display: flex; align-items: baseline; gap: 6px; order: 1; }
  .wt-events-page .ev-date .m, .wt-events-page .ev-date .y { font-size: 12px; }
  .wt-events-page .ev-date .d { font-size: 15px; margin: 0; }
  .wt-events-page .ev-body { flex: 1 1 100%; order: 3; }
  .wt-events-page .ev-cta { order: 2; margin-left: auto; }
  .wt-events-page .ev-cta a { min-height: 44px; display: inline-flex; align-items: center; }
  .wt-events-page .pg { min-width: 44px; height: 44px; }
  .wt-events-page .pager { margin-top: var(--space-5); }
}

@media (prefers-reduced-motion: reduce) {
  .wt-events-page *, .wt-events-page *::before, .wt-events-page *::after {
    animation: none !important; transition: none !important;
  }
}
