/* "Upcoming" events — restyled to the design system.
 * ===========================================================================
 *
 * The Webflow block is left as it is and only re-dressed: it is a CMS
 * collection list, so its markup is regenerated from the Events collection and
 * a string-level rewrite would not survive the next scrape.
 *
 * Same register as the capability tiles and the course spec sheets: one
 * hairline grid, mono labels, 2px corners, the numbered rail. Each event
 * becomes a row of the register rather than a card floating in space — which
 * is how both dark references list dated things.
 *
 * Scoped to [data-mode="frontier"], like the rest of the design layer, so the
 * second ported site keeps its own.
 */

[data-mode="frontier"] .home_events {
  --ev-line: rgba(255, 255, 255, 0.14);
  --ev-muted: rgba(255, 255, 255, 0.62);
  --ev-accent: var(--site-accent, #c4b798);
}

/* The list itself: one shared hairline grid, the gap doing the drawing. */
[data-mode="frontier"] .home_events .collection-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  background-color: var(--ev-line);
  border: 1px solid var(--ev-line);
  border-radius: 2px;
  overflow: hidden;
}

[data-mode="frontier"] .home_events .event_item {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 2rem;
  background-color: #0b0b0b;
  transition: background-color 0.24s ease;
}

[data-mode="frontier"] .home_events .event_item:hover {
  background-color: #151515;
}

/* --- Heading -------------------------------------------------------------- */

[data-mode="frontier"] .home_events .event_heading-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Webflow prints a literal "Event:" above the name. It becomes the mono label
   the rest of the system uses for a category. */
[data-mode="frontier"] .home_events .event_heading-wrapper > :first-child {
  color: var(--ev-accent);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

/* font-size: 0 on the element (below) also zeroes this, so it is restored. */
[data-mode="frontier"] .home_events .event_heading-wrapper > :first-child::before {
  content: "// ";
  font-size: 0.6875rem;
  letter-spacing: 0;
}

/* The collection prints "Event:" — the colon is noise once it is a label. */
[data-mode="frontier"] .home_events .event_heading-wrapper > :first-child {
  font-size: 0;
}

[data-mode="frontier"] .home_events .event_heading-wrapper > :first-child::after {
  content: "Event";
  font-size: 0.6875rem;
}

[data-mode="frontier"] .home_events .event_heading-wrapper > :last-child {
  color: #fff;
  font-size: clamp(1.375rem, 1.9vw, 1.75rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

/* --- The facts ------------------------------------------------------------ */

/* Place, date and time read as a spec list rather than three icon rows. */
[data-mode="frontier"] .home_events .event_date-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.75rem 0;
  border-top: 1px solid var(--ev-line);
}

[data-mode="frontier"] .home_events .event_date-wrapper img {
  width: 0.9375rem;
  height: 0.9375rem;
  flex: 0 0 auto;
  opacity: 0.5;
  /* The icons ship black; on the dark ground they have to be inverted. */
  filter: invert(1);
}

[data-mode="frontier"] .home_events .event_date-wrapper p {
  margin: 0;
  color: var(--ev-muted);
  font-size: 0.9375rem;
  line-height: 1.35;
}

/* --- Action --------------------------------------------------------------- */

[data-mode="frontier"] .home_events .margin-top.margin-xsmall {
  margin-top: auto;
  padding-top: 1.5rem;
}

/* The action itself lives in buttons.css, with the site's other button.
 *
 * It was here, and being here is part of why it broke: these rules only ever
 * reached the box holding the label, so the two arrow tiles kept Webflow's own
 * colours and the button came apart — a crack down the middle at rest, a white
 * arrow on sand on hover. A section-scoped selector also outranks the
 * site-wide one, so a copy left here would quietly win over the fix. */

/* --- The heading above the list ------------------------------------------- */

[data-mode="frontier"] .home_events + *,
[data-mode="frontier"] .margin-bottom.margin-xxlarge:has(+ .home_events) h2 {
  letter-spacing: -0.015em;
}

@media (max-width: 767px) {
  [data-mode="frontier"] .home_events .event_item {
    padding: 1.5rem;
  }
}
