:root {
  color-scheme: dark;
  --page: #141415;
  --surface: #1f2022;
  --surface-hi: #26272a;
  --line: #34353a;
  --ink: #f4f3f1;
  --muted: #a9a9ad;
  --accent: #fbe88a; /* pennant yellow */
  --accent-ink: #2a1d05;
  --brand: #7a0a1f; /* pennant maroon */
  --radius: 14px;
  font:
    16px/1.45 system-ui,
    -apple-system,
    "Segoe UI",
    Inter,
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  background: var(--page);
  color: var(--ink);
}
* {
  box-sizing: border-box;
}
body,
h1,
h2,
h3,
p {
  margin: 0;
}
body {
  background: var(--page);
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
select {
  cursor: pointer;
}
button {
  background: transparent;
  border: 0;
}
a {
  color: inherit;
}
.nav,
main,
footer {
  width: min(1100px, calc(100% - 72px));
  margin-inline: auto;
}
header {
  border-bottom: 1px solid #ffffff10;
}
.nav,
.brand,
nav,
footer,
.feed-heading,
.search,
.day {
  display: flex;
  align-items: center;
}
.nav {
  height: 66px;
  justify-content: space-between;
}
.brand {
  gap: 10px;
  font-weight: 750;
  text-decoration: none;
  letter-spacing: -0.03em;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
nav {
  gap: 4px;
}
nav button {
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 550;
  color: var(--muted);
}
nav button:hover {
  color: var(--ink);
}
nav [aria-pressed="true"] {
  background: var(--surface-hi);
  color: var(--ink);
}

/* Layout: illustrated identity on the left, feed on the right */
.calendar {
  display: grid;
  grid-template-columns: minmax(208px, 28%) minmax(0, 1fr);
  gap: clamp(34px, 5vw, 76px);
  padding-block: 48px;
}
.identity {
  align-self: start;
  position: sticky;
  top: 24px;
}
.cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  background: #293739;
}
.location,
.meta {
  font-size: 14px;
  color: var(--muted);
}
.location {
  margin-top: 12px;
}
.feed {
  min-width: 0;
}
.feed-heading {
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 16px;
}
h1 {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
#count {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Search and filters */
.search {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  gap: 12px;
  padding: 0 14px;
}
.search:focus-within {
  border-color: var(--accent);
}
.search-icon {
  width: 14px;
  height: 14px;
  position: relative;
  border: 1.7px solid var(--muted);
  border-radius: 50%;
  flex: none;
}
.search-icon:after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 6px;
  height: 2px;
  background: var(--muted);
  transform: rotate(45deg);
}
.search input {
  border: 0;
  width: 100%;
  background: transparent;
  padding: 12px 0;
  font-size: 16px;
}
.search input::placeholder {
  color: #7d7e83;
}
.search input:focus-visible {
  outline: none;
}
.quick {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
  margin-inline: -2px;
}
.quick::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
  color: var(--ink);
}
.chip:hover {
  border-color: #5a5b60;
}
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.searchrow {
  display: flex;
  gap: 8px;
}
.searchrow .search {
  flex: 1;
  min-width: 0;
}
.filter-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.filter-toggle:hover {
  border-color: #5a5b60;
}
.filter-toggle:before {
  content: "";
  width: 14px;
  height: 10px;
  background:
    linear-gradient(currentColor 0 0) 0 0 / 14px 1.6px no-repeat,
    linear-gradient(currentColor 0 0) 2px 4.2px / 10px 1.6px no-repeat,
    linear-gradient(currentColor 0 0) 4px 8.4px / 6px 1.6px no-repeat;
}
.filter-toggle.has-active,
.filter-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

/* Organiser type tabs */
.tabs {
  display: flex;
  gap: 2px;
  margin-top: 14px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs button {
  flex: none;
  position: relative;
  padding: 10px 12px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.tabs button:first-child {
  padding-left: 2px;
}
.tabs button:hover {
  color: var(--ink);
}
.tabs button[aria-pressed="true"] {
  color: var(--ink);
}
.tabs button[aria-pressed="true"]:after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.tabs button:first-child[aria-pressed="true"]:after {
  left: 2px;
}

/* Active sheet filters, removable */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px 0 12px;
  border-radius: 999px;
  background: #3a3220;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.pill:after {
  content: "✕";
  font-size: 10px;
  opacity: 0.8;
}

/* Filter sheet: dropdown card on wide screens, bottom sheet on phones */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #0009;
}
.sheet {
  position: relative;
  z-index: 21;
  display: grid;
  gap: 18px;
  margin-top: 10px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px #0007;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sheet-head h2 {
  font-size: 17px;
  letter-spacing: -0.02em;
}
.close {
  width: 36px;
  height: 36px;
  margin: -6px -8px -6px 0;
  border-radius: 50%;
  color: var(--muted);
  font-size: 15px;
}
.close:hover {
  background: var(--surface-hi);
  color: var(--ink);
}
fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
legend,
.field {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
legend {
  margin-bottom: 8px;
  padding: 0;
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pills .chip {
  min-height: 34px;
  font-size: 13.5px;
}
.field {
  display: grid;
  gap: 8px;
}
.field select,
.field input {
  width: 100%;
  min-height: 42px;
  padding: 0 34px 0 12px;
  background: var(--surface-hi);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 450;
  letter-spacing: 0;
  text-transform: none;
  text-overflow: ellipsis;
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23a9a9ad' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.field input {
  padding-right: 12px;
}
.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
#reset {
  padding: 8px 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#reset:hover {
  color: var(--ink);
}
.apply {
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
}

/* Day groups: sticky headings, dashed rail on wide screens */
.day-group {
  position: relative;
  padding: 22px 0 0 22px;
}
.day-group:before {
  content: "";
  position: absolute;
  left: 4px;
  top: 40px;
  bottom: -38px;
  border-left: 1px dashed #43444a;
}
.day-group:last-child:before {
  bottom: 14px;
}
.day {
  position: sticky;
  top: 0;
  z-index: 2;
  gap: 9px;
  padding-block: 8px;
  margin-bottom: 6px;
  background: var(--page);
  font-size: 17px;
  line-height: 24px;
  letter-spacing: -0.02em;
}
.day:before {
  content: "";
  position: absolute;
  left: -22px;
  top: 16px;
  width: 9px;
  height: 9px;
  border: 1.5px solid #8a8b90;
  border-radius: 50%;
  background: var(--page);
}
.day-group:first-child .day:before {
  border-color: var(--accent);
  background: var(--accent);
}
.calendar-date {
  color: var(--muted);
  font-size: 14px;
  font-weight: 450;
  letter-spacing: 0;
}
.rows {
  display: grid;
  gap: 10px;
}

/* Cards */
article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 15px;
  background: var(--surface);
  border: 1px solid #ffffff0b;
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color 0.15s, background-color 0.15s;
}
.event-card {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}
article:focus-within,
article:hover {
  border-color: #4c4d53;
  background: #222326;
}
.badge {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: var(--brand);
  color: var(--accent);
  font-weight: 750;
  letter-spacing: 0.02em;
  flex: none;
}
.badge > * {
  grid-area: 1/1;
}
.badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
}
.time {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.clock {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.kind {
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
h3 {
  font-size: clamp(18px, 1.9vw, 21px);
  line-height: 1.22;
  letter-spacing: -0.025em;
  margin: 6px 0 5px;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
h3 a {
  text-decoration: none;
}
h3 a:after {
  content: " ↗";
  font-size: 0.75em;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s;
}
h3 a:hover:after,
h3 a:focus-visible:after {
  opacity: 1;
}
.org-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 13px;
}
.org-links a {
  color: var(--accent);
  text-decoration: none;
}
.org-links a:hover {
  text-decoration: underline;
}
#list > article,
#list > p {
  margin-top: 14px;
}
#list > p.meta {
  padding: 28px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
#more {
  display: block;
  width: 100%;
  margin-top: 18px;
  min-height: 46px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}
#more:hover {
  border-color: #5a5b60;
}

/* Event detail and directory pages */
.detail {
  max-width: 760px;
  padding-block: 40px;
}
.detail p,
.detail h1 {
  margin-block: 18px;
}
.book {
  display: inline-block;
  padding: 11px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
}
footer {
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 18px 0;
  color: var(--muted);
  font-size: 12px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* Phones */
@media (max-width: 740px) {
  .nav,
  main,
  footer {
    width: calc(100% - 32px);
  }
  .nav {
    height: 56px;
  }
  .brand {
    font-size: 15px;
    gap: 8px;
  }
  .brand img {
    width: 30px;
    height: 30px;
  }
  nav {
    gap: 0;
  }
  nav button {
    font-size: 13px;
    padding: 8px 11px;
  }
  .calendar {
    display: block;
    padding: 16px 0 30px;
  }
  .identity {
    display: none;
  }
  .feed-heading {
    margin-bottom: 10px;
  }
  h1 {
    font-size: 22px;
  }
  #count {
    font-size: 12px;
  }
  .quick,
  .tabs {
    margin-inline: -16px;
    padding-inline: 16px;
  }
  .quick {
    gap: 6px;
  }
  .chip {
    padding: 0 13px;
    font-size: 13.5px;
  }
  .filter-toggle {
    padding: 0 13px;
  }
  .sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    max-height: 85vh;
    overflow-y: auto;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
  }
  .sheet:before {
    content: "";
    justify-self: center;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: #4a4b50;
  }
  .sheet-foot {
    position: sticky;
    bottom: 0;
    background: var(--surface);
  }
  .apply {
    flex: 1;
  }
  body.sheet-open {
    overflow: hidden;
  }
  .day-group {
    padding: 14px 0 0;
  }
  .day-group:before,
  .day:before {
    display: none;
  }
  .day {
    margin-inline: -16px;
    padding-inline: 16px;
    font-size: 16px;
  }
  article {
    padding: 14px;
  }
  .event-card {
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: start;
    gap: 6px 12px;
    padding: 14px 10px 14px 16px;
  }
  .badge {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    font-size: 15px;
  }
  .meta {
    font-size: 13px;
  }
}
