/* Events on the GROW member portal (public/portal-events.js), and the
   "New" mark Home's Events cards share with it.

   The events the team has announced, as white cards in the mockup's look
   (18px corners, 1px lines), two to a row on a wide screen and one on a
   phone; then their own sign-ups. Colours come only from the palette in
   portal.css, as var(--p-...): see the note there. */

/* An event announced in the last fortnight, on Home and here alike. */
.portal-new {
  display: inline-block; flex: none; padding: 3px 12px; border-radius: 999px;
  font-size: 12.75px; line-height: 16px; white-space: nowrap; background: var(--p-blue); color: #fff;
}

.events-list { margin-top: 27px; }
.events-loading, .events-empty { margin: 0; font-size: 15px; line-height: 1.5; color: var(--p-muted); }
.events-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: stretch;
}
.events-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.events-card.is-new { border-color: var(--p-blue); box-shadow: 0 6px 22px var(--p-shadow); }
.events-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.events-for {
  display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12.75px; line-height: 16px;
  background: var(--p-sky); color: var(--p-sky-ink);
}
.events-name { margin: 0; font-size: 19px; font-weight: 400; line-height: 1.35; color: var(--p-ink); overflow-wrap: anywhere; }
.events-name a { color: inherit; text-decoration: none; }
.events-name a:hover { color: var(--p-blue); text-decoration: underline; text-underline-offset: 3px; }
.events-name a:focus-visible { outline: 2px solid var(--p-blue); outline-offset: 2px; border-radius: 4px; }
.events-when { margin: 0; font-size: 15px; line-height: 20px; color: var(--p-blue); }
.events-meta { margin: 0; font-size: 14px; line-height: 19px; color: var(--p-muted); overflow-wrap: anywhere; }
.events-blurb { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--p-ink); overflow-wrap: anywhere; }
/* The button sits at the foot of the card, so a row of cards lines up. */
.events-action { margin-top: auto; padding-top: 12px; }
.events-action .portal-pill { min-height: 40px; padding: 0 20px; font-size: 14px; }
@media (pointer: coarse) {
  .events-action .portal-pill { min-height: 44px; }
}

.events-none { margin: 0; }
.events-mine { margin-top: 22px; }
.events-mine .portal-row { flex-wrap: wrap; }
.events-mine .portal-row > .portal-row-main { flex: 1 1 220px; gap: 2px; }
.events-mine .portal-row-title, .events-mine .portal-row-sub { overflow-wrap: anywhere; }
.events-mine .events-empty { padding-top: 14px; }
.events-ref { display: block; font-size: 13px; line-height: 18px; color: var(--p-muted); }
.events-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.92em; }
.events-more { margin: 18px 0 0; font-size: 14px; }
.events-more a { color: var(--p-blue); text-underline-offset: 2px; }

@media (max-width: 900px) {
  .events-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
/* A phone: 44px whatever the pointer (this rule outranks portal.css's own),
   and the event's name, a press target of its own, too. */
@media (max-width: 760px) {
  .events-action .portal-pill { min-height: 44px; }
}
@media (pointer: coarse), (max-width: 760px) {
  .events-name a { display: inline-flex; align-items: center; min-height: 44px; }
}
