/*
 * Events (T2.1): /events, /events/:id and "Coming up" on /.
 * Designs: Events-*.dc.html, Event-Detail-*.dc.html;
 * docs/design/2026-10-19-home-groups-events/project/{Main,A-Desktop}.dc.html.
 */

/* ---------- /events ---------- */

.events-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
}

.site-main > .events-header {
  padding-top: 24px;
}

.events-header__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.events-header__subtitle {
  font-weight: 500;
  font-size: 18px;
  color: var(--pc-text-2);
}

.events-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.events-past {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.events-past__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.events-past__header h2 {
  font-weight: 900;
  font-size: 26px;
}

.event-row {
  background: var(--pc-surface);
  border-radius: var(--pc-radius-lg);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  color: var(--pc-text);
  text-decoration: none;
  box-shadow: var(--pc-shadow);
}

.event-row:hover .event-row__title {
  text-decoration: underline;
}

.event-row__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.event-row__title {
  font-weight: 800;
  font-size: 17px;
  line-height: 1.25;
}

.event-row__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--pc-text-2);
}

.event-row__meta .icon {
  flex: none;
}

.event-row__by {
  font-weight: 600;
  font-size: 13px;
  color: var(--pc-muted);
}

/* Status badge with the old StatusBadge dot. */
.event-status .badge {
  gap: 6px;
}

.event-status .badge::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

/* "Full": ink on the brand yellow (about 10:1), apart from the other tones. */
.badge--accent {
  background: var(--pc-accent);
  color: var(--pc-text);
}

/* "12 going (max 20)" + comment count (old EventCard stats row). */
.event-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  font-weight: 600;
  font-size: 14px;
  color: var(--pc-text-2);
}

.event-row .event-stats {
  margin-top: 2px;
}

.event-stats__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.event-stats__item .icon {
  flex: none;
  color: var(--pc-link);
}

@media (max-width: 719px) {
  .site-main > .events-header {
    padding-top: 0;
  }

  .events-header__text {
    gap: 4px;
  }

  .events-header__subtitle {
    font-size: 16px;
  }

  .events-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ---------- "Coming up" (on /) ---------- */

/* Desktop (≥ 960 px): a sidebar card with a vertical list. */
.coming-up {
  min-width: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--pc-surface);
  border-radius: var(--pc-radius-lg);
  box-shadow: var(--pc-shadow);
}

.coming-up__header {
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.coming-up__title {
  font-weight: 900;
  font-size: 20px;
}

/* The header link is the phone strip's; desktop has the button below. */
.coming-up__see-all {
  display: none;
}

.coming-up__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.coming-up__card {
  margin: 0 -8px;
  padding: 10px 8px;
  display: flex;
  gap: 12px;
  border-radius: var(--pc-radius-sm);
  color: var(--pc-text);
  text-decoration: none;
}

.coming-up__card:hover {
  background: var(--pc-bg);
}

.coming-up__card:hover .coming-up__name {
  text-decoration: underline;
}

.coming-up__card .date-tile {
  width: 48px;
  height: 54px;
}

.coming-up__card .date-tile__month {
  font-size: 11px;
}

.coming-up__card .date-tile__day {
  font-size: 20px;
}

.coming-up__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.coming-up__name {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.coming-up__meta {
  font-weight: 600;
  font-size: 13px;
  color: var(--pc-muted);
}

.coming-up__body .event-status {
  margin-top: 2px;
}

.coming-up__body .badge {
  min-height: 22px;
  padding: 2px 8px;
  font-size: 12px;
}

.coming-up__all.btn {
  margin-top: 8px;
  border-color: var(--pc-border);
}

/* Narrow screens: a sideways scroll-snap strip above the groups. */
@media (max-width: 959px) {
  .coming-up {
    padding: 0;
    gap: 10px;
    background: none;
    border-radius: 0;
    box-shadow: none;
  }

  .coming-up__header {
    margin-bottom: 0;
  }

  .coming-up__title {
    font-size: 19px;
  }

  .coming-up__see-all {
    display: inline-flex;
  }

  .coming-up__all.btn {
    display: none;
  }

  .coming-up__list {
    margin: 0 calc(-1 * var(--pc-gutter));
    padding: 0 var(--pc-gutter) 4px;
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 var(--pc-gutter);
    scrollbar-width: none;
  }

  .coming-up__item {
    flex: none;
    width: 244px;
    display: flex;
    scroll-snap-align: start;
  }

  .coming-up__card {
    flex: 1;
    margin: 0;
    padding: 12px;
    background: var(--pc-surface);
    border-radius: var(--pc-radius-md);
    box-shadow: var(--pc-shadow);
  }

  .coming-up__card:hover {
    background: var(--pc-surface);
  }

  /* Two lines at most, so every card has the same height. */
  .coming-up__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* ---------- /events/:id ---------- */

/* "All events" + "Browse community groups". */
.event-topbar {
  margin-bottom: -12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
}

.event-not-found__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/*
 * Desktop: main column (hero, title, about, comments) + aside. Phone: one
 * column with the aside after the title (Event-Detail-Phone).
 */
.event-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 340px);
  grid-template-rows: auto auto auto 1fr;
  grid-template-areas:
    "hero aside"
    "heading aside"
    "about aside"
    "comments aside";
  gap: 24px 32px;
  align-items: start;
}

.event-hero {
  grid-area: hero;
  min-height: 240px;
  border-radius: var(--pc-radius-lg);
  background: var(--pc-chip-bg);
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.event-hero__organiser {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.event-hero__label {
  font-weight: 700;
  font-size: 15px;
  color: var(--pc-text-2);
}

.event-hero__name {
  font-weight: 800;
  font-size: 22px;
  line-height: 1.25;
}

.event-heading {
  grid-area: heading;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.event-heading__title {
  font-size: 36px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.event-aside {
  grid-area: aside;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.event-facts {
  margin: 0;
  padding: 20px;
  list-style: none;
  background: var(--pc-surface);
  border-radius: var(--pc-radius-lg);
  box-shadow: var(--pc-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-facts__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.event-facts__icon {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: var(--pc-radius-sm);
  background: var(--pc-chip-bg);
  color: var(--pc-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-facts__text {
  min-width: 0;
  padding-top: 9px;
  font-weight: 700;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.event-facts__text--stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.event-facts__text--inline {
  padding-top: 0;
  min-height: var(--pc-target);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.event-facts__group {
  min-height: var(--pc-target);
  display: inline-flex;
  align-items: center;
  color: var(--pc-primary);
  font-weight: 800;
}

.event-manage {
  background: var(--pc-surface);
  border-radius: var(--pc-radius-lg);
  padding: 20px;
  box-shadow: var(--pc-shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-manage__title {
  margin-bottom: 4px;
}

.event-about {
  grid-area: about;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-about__text {
  max-width: 680px;
  font-weight: 500;
  font-size: 17px;
  line-height: 1.6;
  color: var(--pc-text-2);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.event-comments {
  grid-area: comments;
  min-width: 0;
}

@media (max-width: 899px) {
  .event-page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas:
      "hero"
      "heading"
      "aside"
      "about"
      "comments";
    gap: 16px;
  }

  .event-topbar {
    margin-bottom: -4px;
  }

  .event-hero {
    min-height: 160px;
    padding: 20px;
    gap: 16px;
  }

  .event-hero .date-tile--lg {
    width: 84px;
    height: 92px;
    border-radius: var(--pc-radius-md);
  }

  .event-hero .date-tile--lg .date-tile__month {
    font-size: 16px;
  }

  .event-hero .date-tile--lg .date-tile__day {
    font-size: 40px;
  }

  .event-hero__organiser {
    gap: 2px;
  }

  .event-hero__label {
    font-size: 13px;
  }

  .event-hero__name {
    font-size: 17px;
  }

  .event-heading__title {
    font-size: 26px;
    line-height: 1.2;
  }

  .event-aside {
    gap: 16px;
  }

  /* Phone design: the facts list sits on the page, not in a card. */
  .event-facts {
    padding: 0;
    background: none;
    box-shadow: none;
  }

  .event-about__text {
    font-size: 16px;
    line-height: 1.55;
  }
}
