/* =============================================================
   Event detail page — /events/<slug>/
   Loaded only by event.php, and the only stylesheet it needs:
   registration is a Google Form the page links out to, so there
   is no form on the page and forms.css is not loaded.

   Deliberately a light page rather than one that follows the
   newsroom's dark toggle, which is scoped to .news and would
   leave this page's tokens half-applied.
   ============================================================= */

.event { padding-bottom: 5rem; }

/* ---------- Banner ---------- */
/* Full width of the narrow container, aspect held by the width/height on the
   img so the hero does not reflow while it loads. */
.event-banner {
  margin: 0 0 1.75rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-glass);
  line-height: 0;
}
.event-banner img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Breadcrumb ---------- */
/* Same look as the article page, redefined here because article.css
   is not loaded on this page. */
.event .crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-soft);
  margin-bottom: 1.5rem;
}
.event .crumbs a { color: var(--text-soft); text-decoration: none; }
.event .crumbs a:hover { color: var(--primary); }

/* ---------- Hero ---------- */
.event-hero {
  padding-block: 3.5rem 2.5rem;
  background:
    radial-gradient(80% 120% at 12% 0%, var(--primary-soft), transparent 60%),
    var(--surface);
  border-bottom: 1px solid var(--line-soft);
}

.event-hero__eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-soft);
  margin: 0 0 0.875rem;
}

.event-tag {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.event-hero__title {
  font-size: clamp(1.75rem, 1.15rem + 2.4vw, 2.75rem);
  margin: 0 0 1rem;
}

.event-hero__lede {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0;
  max-width: 40rem;
}

.event-hero__actions { margin: 1.75rem 0 0; }

.event-past {
  margin: 1.75rem 0 0;
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.event__body { padding-top: 2.5rem; }

/* ---------- Detail tiles ---------- */
.event-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 3rem;
}

.event-fact {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.125rem 1.25rem;
  background: var(--surface);
}
.event-fact .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 0.1875rem;
  color: var(--primary);
}
.event-fact div { display: flex; flex-direction: column; gap: 0.1875rem; min-width: 0; }
.event-fact__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.event-fact__value {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

/* ---------- Body blocks ---------- */
.event-block { margin-bottom: 2.75rem; }

.event-block__title {
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

.event-prose {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin: 0 0 1rem;
}
.event-prose:last-child { margin-bottom: 0; }
.event-prose--muted { font-size: 0.9375rem; color: var(--text-soft); }
.event-prose a { color: var(--primary); }

/* ---------- Ticked list ---------- */
.event-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.event-checks li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.event-checks .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 0.1875rem;
  color: #16a34a;
}

/* ---------- Audience chips ---------- */
.event-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.event-chips li {
  padding: 0.4375rem 0.875rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ---------- Credits ---------- */
.event-credits {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  padding: 1.5rem 0;
  border-block: 1px solid var(--line-soft);
  margin-bottom: 3rem;
}
.event-credit { display: flex; flex-direction: column; gap: 0.625rem; }
.event-credit__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Sized by height so the two wordmarks sit on one optical baseline whatever
   their aspect ratio; width follows from the intrinsic size on the img, which
   is what keeps the row from reflowing while the images load. */
.event-credit__logo { display: flex; align-items: center; }
.event-credit__logo a { display: inline-flex; align-items: center; }
.event-credit__logo img {
  display: block;
  height: 34px;
  width: auto;
  max-width: 100%;
}
/* The Niyuk mark is squarer than the Best Work Culture wordmark, so at a shared
   height it reads noticeably larger. Nudged down to match by eye. */
.event-credit__logo--sm img { height: 26px; }

/* ---------- Registration ---------- */
/* Registration is a Google Form, so this is a link-out card rather than a form.
   Nothing here depends on forms.css. */
.event-register { scroll-margin-top: 6rem; }

.event-cta {
  padding: 2.25rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(90% 140% at 100% 0%, var(--primary-soft), transparent 62%),
    var(--surface);
  box-shadow: var(--shadow-glass);
}
.event-cta .event-block__title { margin-bottom: 0.75rem; }
.event-cta__actions { margin: 1.5rem 0 0; }
.event-cta__actions .icon {
  width: 16px;
  height: 16px;
  margin-left: 0.375rem;
  vertical-align: -2px;
}
.event-cta__note {
  margin: 0.875rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-soft);
}

@media (max-width: 640px) {
  .event-hero { padding-block: 2.5rem 2rem; }
  .event-facts { grid-template-columns: 1fr; }
  .event-credits { gap: 1.5rem; }
  .event-cta { padding: 1.5rem; }
}

/* ---------- Register panel ----------
   The registration form for somebody who is not signed in. Deliberately an
   ordinary positioned overlay rather than a <dialog> opened with showModal():
   a modal dialog renders in the top layer, above every z-index on the page,
   which would put the reCAPTCHA image challenge behind it and out of reach.
   See the note at the top of assets/js/event.js. With scripting off, the
   <noscript> block in event.php overrides these rules and unfolds the whole
   thing into the page. */
.event-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: rgba(15, 23, 42, 0.55);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* The page behind holds still while the panel is open. */
.has-dialog, .has-dialog body { overflow: hidden; }

.event-dialog__panel {
  width: min(46rem, 100%);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  padding: 1.5rem 1.75rem 1.75rem;
  background: var(--surface, #fff);
  border-radius: var(--radius, 12px);
  box-shadow: 0 24px 64px -24px rgba(15, 23, 42, 0.45);
}

/* The heading and the close button stay put while eleven fields move under
   them. */
.event-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1;
  margin: -1.5rem -1.75rem 1.25rem;
  padding: 1.25rem 1.75rem 0.875rem;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--line, #e2e8f0);
}

.event-dialog__title { margin: 0; font-size: 1.25rem; font-weight: 700; }

.event-dialog__close {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-soft, #64748b);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.event-dialog__close:hover { background: var(--bg, #f1f5f9); color: inherit; }
.event-dialog__close:focus-visible { outline: 2px solid var(--primary, #2563eb); outline-offset: 2px; }

/* The fields come from forms.css, which lays them out for a full-width page.
   Two columns here where there is room, because eleven single-file fields in a
   panel is a scroll nobody finishes. */
@media (min-width: 40rem) {
  .event-dialog .event-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
  }
  /* The ones that need the full width: the honeypot, the upload, the whole-form
     error and the actions row. */
  .event-dialog .event-form > .form-honeypot,
  .event-dialog .event-form > .form-actions,
  .event-dialog .event-form > .alert,
  .event-dialog .event-form > .field:has(input[type="file"]) {
    grid-column: 1 / -1;
  }
}

.event-dialog .form-actions { margin-top: 0.5rem; }

@media (max-width: 640px) {
  .event-dialog { padding: 0; }
  .event-dialog__panel {
    width: 100%;
    min-height: 100vh;
    max-height: none;
    border-radius: 0;
    padding: 1.25rem 1.125rem 1.5rem;
  }
  .event-dialog__head { margin: -1.25rem -1.125rem 1rem; padding: 1rem 1.125rem 0.75rem; }
}

/* ---------- Submitting ----------
   The button while the registration is on its way. Registering uploads a photo,
   writes two records and sends two emails, so the wait is real — and a button
   that looks pressable during it gets pressed again. */
.btn.is-busy {
  position: relative;
  padding-left: 2.6rem;
  cursor: progress;
  opacity: 0.85;
}

.btn.is-busy::before {
  content: '';
  position: absolute;
  left: 1.1rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  margin-top: -0.5rem;
  border: 2px solid currentColor;
  /* One transparent side is what makes a ring read as spinning. */
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin { to { transform: rotate(360deg); } }

/* Somebody who has asked not to see movement gets a static ring: the point is
   "this is working", and that survives without the rotation. */
@media (prefers-reduced-motion: reduce) {
  .btn.is-busy::before { animation: none; }
}

/* A disabled button is normally dimmed to say "you cannot use this". Here it
   means "this is already running", so it keeps its colour. */
.btn.is-busy[disabled] { opacity: 0.85; }
