/* === Community events =======================================================
   Loaded only on the events category archive.
   ========================================================================== */

.icrt-eventpage__section { margin: 2.5rem 0; }

.icrt-eventpage__heading {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding-bottom: 0.55rem;
  border-bottom: 0;
}

.icrt-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

/* Cards, not rows, once there is room. A flat stack of identical rows gave a
   reader no sense of which event was imminent. */
@media (min-width: 60rem) {
  .icrt-events--upcoming { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* The soonest event is the one anyone can still act on, so it spans. */
  .icrt-events--upcoming .icrt-event--lead { grid-column: 1 / -1; }
}

.icrt-event {
  position: relative;
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  padding: 1.1rem 1.2rem;
  background: var(--icrt-paper);
  border: 1px solid var(--icrt-line);
  border-left: 4px solid var(--cw-show, var(--icrt-accent));
  border-radius: 0.8rem;
}

/* The lead card earns more room and a heavier title. */
.icrt-event--lead {
  padding: 1.5rem 1.6rem;
  background:
    linear-gradient(120deg, rgba(17, 96, 212, .06) 0%, transparent 45%),
    var(--icrt-paper);
}

.icrt-event--lead .icrt-event__title { font-size: 1.4rem; }
.icrt-event--lead .icrt-event__date { width: 5rem; }
.icrt-event--lead .icrt-event__day { font-size: 1.9rem; }

/* --- the date plate ------------------------------------------------------
   The date leads because "when" is the only question that decides whether the
   rest of the row matters. */

.icrt-event__date {
  /* flex-none: without it a long title squeezes the plate out of square. */
  flex: 0 0 auto;
  width: 4.1rem;
  padding: 0.5rem 0 0.55rem;
  text-align: center;
  border-radius: 0.6rem;
  background: linear-gradient(170deg, var(--cw-show, var(--icrt-accent)) 0%, var(--cw-show-deep, var(--icrt-accent-dark)) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.icrt-event__day { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }

.icrt-event__month {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.9;
}

.icrt-event__time {
  margin-top: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.icrt-event__body { min-width: 0; }

.icrt-event__title {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.3;
}

.icrt-event__title a { color: inherit; text-decoration: none; }
.icrt-event__title a:hover { color: var(--icrt-accent); }

.icrt-event__venue {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--icrt-muted);
}

.icrt-event__blurb {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--icrt-ink-soft);
}

/* Past events stay on the page but must never be mistaken for an invitation. */
.icrt-events--past .icrt-event { background: var(--icrt-mist); }
.icrt-events--past .icrt-event__date { background: var(--icrt-muted); }

.icrt-events__none {
  margin: 0;
  padding: 1.4rem 1.2rem;
  background: var(--icrt-mist);
  border-radius: 0.8rem;
  color: var(--icrt-ink-soft);
}

/* --- add to calendar -----------------------------------------------------
   The event travels as an inline .ics file, so the link works without a route
   of its own. */

.icrt-event__cal {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--icrt-line);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--icrt-accent);
  text-decoration: none;
}

.icrt-event__cal:hover {
  border-color: var(--icrt-accent);
  background: var(--icrt-mist);
}

/* Past events keep their grey plate: they must never look actionable. */
.icrt-events--past .icrt-event { border-left-color: var(--icrt-line); }
