/* The event detail page — /events/:id and /programs/:slug/events/:id.

   The fourth 3.0 surface, after the Actions, Calendar and Map tools, and built the
   same way: its own stylesheet loaded via yield :page_stylesheets rather than on
   every page, everything resolving through --zw-* tokens.

   Not zw_components.css. That file is the shared layer, is linked on every page in
   the app, and is deliberately small; a surface's own layout belongs beside the
   other surface stylesheets. */

/* --- page and layout ----------------------------------------------------------- */

/* Matches the site header's measure exactly. A page wider than the menu above it
   reads as broken rather than wide. */
.zw-evt-page {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 24px 1rem 64px;
}

@media (min-width: 640px) { .zw-evt-page { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .zw-evt-page { padding-inline: 2rem; } }

.zw-evt-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--zw-blue-700);
}

.zw-evt-back:hover { color: var(--zw-blue-800); }

/* One column until there is room for two. The rail is fixed so the main column
   takes the slack — a fluid rail makes the cover square resize on every breakpoint
   between. */
.zw-evt-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}

@media (min-width: 900px) {
  .zw-evt-layout { grid-template-columns: 340px 1fr; gap: 48px; }
}

.zw-evt-main { min-width: 0; }

/* --- rail ------------------------------------------------------------------------ */

.zw-evt-rail { display: flex; flex-direction: column; gap: 20px; }

/* Sticky only where the rail sits beside the content. Stacked on mobile it is just
   the top of the page and pinning it would cover the thing being read. */
@media (min-width: 900px) {
  .zw-evt-rail { position: sticky; top: 16px; }
}

/* The square belongs to the wrapper, not to a pixel height: the rail is fixed at
   340px on desktop but full width when stacked, and a fixed height stops being
   square the moment the column changes. */
.zw-evt-rail__cover {
  aspect-ratio: 1 / 1;
  border-radius: var(--zw-radius-xl);
  overflow: hidden;
}

.zw-evt-rail__block { padding-top: 20px; border-top: 1px solid var(--zw-border-warm); }

.zw-evt-rail__manage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--fg-2);
  background: var(--zw-surface-warm);
  border-radius: var(--zw-radius-lg);
}

.zw-evt-rail__presenter {
  margin: 6px 0 0;
  font-weight: 600;
  color: var(--zw-ink);
}

.zw-evt-rail__orgs { margin: 8px 0 0; padding: 0; list-style: none; }
.zw-evt-rail__orgs li { display: flex; flex-direction: column; margin-bottom: 8px; }
.zw-evt-rail__org-link { font-weight: 500; color: var(--zw-blue-700); }
.zw-evt-rail__org-link:hover { color: var(--zw-blue-800); }
.zw-evt-rail__org-name { font-weight: 500; color: var(--zw-ink); }
.zw-evt-rail__org-note { font-size: 12px; color: var(--fg-3); }

/* --- host ------------------------------------------------------------------------ */

.zw-evt-host { display: flex; align-items: center; gap: 12px; margin-top: 10px; }

.zw-evt-host__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--zw-radius-pill);
  background: var(--zw-avatar-1);
  color: var(--zw-ink);
  font-size: 13px;
  font-weight: 700;
}

.zw-evt-host__body { min-width: 0; }
.zw-evt-host__name { margin: 0; font-weight: 600; color: var(--zw-ink); }
.zw-evt-host__title { margin: 2px 0 0; font-size: 13px; color: var(--fg-3); }
.zw-evt-host__bio { margin: 10px 0 0; font-size: 14px; line-height: 1.6; color: var(--fg-2); }

/* --- attendees -------------------------------------------------------------------- */

.zw-evt-attendees { display: flex; align-items: center; margin-top: 10px; }

.zw-evt-attendees__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: -8px;
  border-radius: var(--zw-radius-pill);
  border: 2px solid var(--zw-paper);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.zw-evt-attendees__more {
  margin-left: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-3);
}

/* --- meta rows ---------------------------------------------------------------------- */

.zw-evt-meta { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.zw-evt-meta__row { display: flex; align-items: center; gap: 12px; }

.zw-evt-meta__pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--zw-radius-md);
  border: 1px solid var(--zw-border-warm);
  background: var(--zw-surface-warm);
}

.zw-evt-meta__pill-month {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--zw-green-700);
}

.zw-evt-meta__pill-day {
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  color: var(--zw-ink);
}

.zw-evt-meta__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--zw-radius-md);
  border: 1px solid var(--zw-border-warm);
  background: var(--zw-surface-warm);
  color: var(--fg-3);
}

.zw-evt-meta__text { display: flex; flex-direction: column; min-width: 0; }
.zw-evt-meta__primary { font-weight: 600; color: var(--zw-ink); }
.zw-evt-meta__secondary { font-size: 14px; color: var(--fg-3); }

/* --- registration ------------------------------------------------------------------ */

.zw-evt-registration { margin-top: 28px; padding: 0; overflow: hidden; }

.zw-evt-registration__header {
  margin: 0;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
  background: var(--zw-surface-warm);
  border-bottom: 1px solid var(--zw-border-warm);
}

.zw-evt-registration__body { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.zw-evt-registration__note { margin: 0; font-size: 13px; color: var(--fg-3); }
.zw-evt-registration__form { display: flex; flex-direction: column; gap: 12px; }
.zw-evt-registration__label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--fg-2); }

.zw-evt-registration__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--zw-border-warm);
  border-radius: var(--zw-radius-lg);
  background: var(--bg-1);
  color: var(--fg-1);
}

.zw-evt-registration__input:focus {
  outline: none;
  border-color: var(--zw-blue-700);
  box-shadow: 0 0 0 3px var(--zw-blue-100);
}

/* Blue acts. Every button on this page is blue or it is not a button. */
.zw-evt-registration__submit {
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: var(--zw-radius-sm);
  background: var(--zw-blue-700);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--zw-ease-duration, 150ms) ease;
}

.zw-evt-registration__submit:hover { background: var(--zw-blue-800); }

/* Sold out is a different action, not a different system: still blue, quieter. */
.zw-evt-registration__submit--waitlist { background: var(--zw-blue-900); }
.zw-evt-registration__submit--waitlist:hover { background: var(--zw-ink); }

.zw-evt-registration__cancel { margin: 0; }

.zw-evt-registration__cancel-button,
.zw-evt-registration__leave-button {
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--zw-radius-sm);
  border: 1px solid var(--zw-border-warm);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.zw-evt-registration__cancel-button { color: var(--zw-danger, #b3261e); }
.zw-evt-registration__leave-button { color: var(--fg-2); }
.zw-evt-registration__cancel-button:hover,
.zw-evt-registration__leave-button:hover { background: var(--zw-surface-warm); }

.zw-evt-registration__section { padding-top: 14px; border-top: 1px solid var(--zw-border-warm); }
.zw-evt-registration__capacity { padding-top: 14px; border-top: 1px solid var(--zw-border-warm); }
.zw-evt-registration__qr { width: 128px; margin-top: 8px; }
.zw-evt-registration__qr svg { width: 100%; height: auto; }

.zw-evt-registration__calendar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }

.zw-evt-registration__calendar-link {
  padding: 8px 0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-2);
  border: 1px solid var(--zw-border-warm);
  border-radius: var(--zw-radius-sm);
}

.zw-evt-registration__calendar-link:hover { background: var(--zw-surface-warm); }

.zw-evt-registration__share { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.zw-evt-registration__share-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--zw-blue-700);
  cursor: pointer;
}

/* Green measures. A capacity bar is the clearest case of what green is for, and it
   is not a button. */
.zw-evt-capacity {
  height: 6px;
  margin-top: 8px;
  border-radius: var(--zw-radius-pill);
  background: var(--zw-border-warm);
  overflow: hidden;
}

.zw-evt-capacity__fill { height: 100%; background: var(--zw-green-600); }

/* --- state pills ------------------------------------------------------------------- */

.zw-evt-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: var(--zw-radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Green measures a state. These are spans, never buttons. */
.zw-evt-pill--in { background: var(--zw-green-100); color: var(--zw-green-900); }
.zw-evt-pill--waiting { background: var(--zw-sand); color: var(--zw-ink); }

/* --- body ---------------------------------------------------------------------------- */

.zw-evt-prose { margin-top: 8px; line-height: 1.7; color: var(--fg-2); }
.zw-evt-prose p { margin: 0 0 12px; }

.zw-evt-list { margin: 12px 0 0; padding: 0; list-style: none; }
.zw-evt-list li { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; color: var(--fg-2); }
.zw-evt-list__mark { flex-shrink: 0; color: var(--zw-green-600); }

.zw-evt-callout { margin-top: 12px; line-height: 1.7; color: var(--fg-2); }
.zw-evt-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.zw-evt-related { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--zw-border-warm); }

.zw-evt-related__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 20px;
}

@media (min-width: 640px) { .zw-evt-related__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .zw-evt-related__grid { grid-template-columns: repeat(3, 1fr); } }

/* --- sections ---------------------------------------------------------------- */

.zw-evt-section + .zw-evt-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--zw-border-warm);
}

/* --- location ---------------------------------------------------------------- */

.zw-evt-location__address {
  margin: 8px 0 0;
  color: var(--fg-2);
  line-height: 1.6;
}

/* A map with no height is not a small map, it is an invisible one — Leaflet sizes
   itself to its container and the container has no content of its own. */
.zw-evt-location__map {
  height: 280px;
  margin-top: 16px;
  border-radius: var(--zw-radius-xl);
  overflow: hidden;
  border: 1px solid var(--zw-border-warm);
}
