/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --border: #e4e4e0;
  --text: #1a1a1a;
  --text-muted: #7a7a72;
  --accent: #2c5f8a;
  --accent-light: #ddeaf5;
  --sold-out: #c5c5c0;
  --today-ring: #2c5f8a;
  --radius: 8px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.last-updated {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Main layout ── */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ── Page header ── */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ── Filters ── */
.filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
  overflow-x: auto;
}

.filter-group--venues {
  flex: 1;
  min-width: 0;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.filter-group:last-child {
  border-right: none;
}

.filter-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  white-space: nowrap;
}

.filter-options {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  align-items: center;
}

.filter-options--wrap {
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  position: relative;
  flex-shrink: 0;
}

.filter-chip input[type="checkbox"] {
  appearance: none;
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.filter-chip span {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.filter-chip input:checked + span {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

/* ── Calendar ── */
.calendar-container {
  display: block;
}

.month {
  margin-bottom: 2.5rem;
  width: 100%;
}

.month-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
}

.cal-dow {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: center;
  padding: 0.25rem 0;
}

.cal-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-height: 72px;
  padding: 0.375rem 0.4rem 0.4rem;
  position: relative;
  transition: border-color 0.1s;
}

.cal-day--empty {
  background: transparent;
  border-color: transparent;
  pointer-events: none;
}

.cal-day[data-today] {
  border-color: var(--today-ring);
  box-shadow: 0 0 0 1px var(--today-ring);
}

.cal-day-num {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  line-height: 1;
}

.cal-day[data-today] .cal-day-num {
  color: var(--accent);
}

/* ── Event chips inside calendar cells ── */
.cal-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.event-chip {
  display: block;
  font-size: 0.7rem;
  line-height: 1.3;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
  background: var(--accent-light);
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  font-weight: 500;
  border-left: 2px solid var(--accent);
  transition: opacity 0.1s;
}

.event-chip:hover {
  opacity: 0.8;
  text-decoration: none;
}

.event-chip.sold-out {
  background: #f0f0ee;
  color: var(--sold-out);
  border-left-color: var(--sold-out);
}

.event-chip .chip-time {
  display: block;
  font-size: 0.65rem;
  opacity: 0.75;
  font-weight: 400;
}

/* Venue colour accents — up to 6 venues get distinct colours */
.venue-color-0 { background: #ddeaf5; color: #2c5f8a; border-left-color: #2c5f8a; }
.venue-color-1 { background: #f0eafd; color: #6840a8; border-left-color: #6840a8; }
.venue-color-2 { background: #e9f6ee; color: #2a7d4f; border-left-color: #2a7d4f; }
.venue-color-3 { background: #fdf4e3; color: #a06820; border-left-color: #a06820; }
.venue-color-4 { background: #fde8e8; color: #b83232; border-left-color: #b83232; }
.venue-color-5 { background: #e8f5f5; color: #256868; border-left-color: #256868; }

/* ── Month hidden when all days empty ── */
.month[data-hidden] { display: none; }

/* ── Empty state ── */
.empty-msg {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 3rem 0;
}

/* ── Agenda list (mobile) ── */
.agenda { display: none; }

.agenda-day {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.agenda-date {
  flex: 0 0 3rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.2;
  padding-top: 0.15rem;
}

.agenda-date .agenda-day-num {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.agenda-day[data-today] .agenda-date,
.agenda-day[data-today] .agenda-date .agenda-day-num {
  color: var(--accent);
}

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

.agenda-chip {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.35;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
}

.agenda-chip:hover { opacity: 0.8; text-decoration: none; }

.agenda-chip.sold-out {
  background: #f0f0ee;
  color: var(--sold-out);
  border-left-color: var(--sold-out);
}

.agenda-chip .chip-meta {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.8;
  margin-top: 0.1rem;
}

/* Venue colour accents for agenda */
.agenda-chip.venue-color-0 { background: #ddeaf5; color: #2c5f8a; border-left-color: #2c5f8a; }
.agenda-chip.venue-color-1 { background: #f0eafd; color: #6840a8; border-left-color: #6840a8; }
.agenda-chip.venue-color-2 { background: #e9f6ee; color: #2a7d4f; border-left-color: #2a7d4f; }
.agenda-chip.venue-color-3 { background: #fdf4e3; color: #a06820; border-left-color: #a06820; }
.agenda-chip.venue-color-4 { background: #fde8e8; color: #b83232; border-left-color: #b83232; }
.agenda-chip.venue-color-5 { background: #e8f5f5; color: #256868; border-left-color: #256868; }

/* ── Responsive ── */
@media (max-width: 600px) {
  main { padding: 1.25rem 1rem 3rem; }
  .cal-grid, .cal-dow, .month-title { display: none; }
  .month { margin-bottom: 0; }
  .agenda { display: block; }
  .filter-group { padding: 0.5rem 0.75rem; }
  .page-header h1 { font-size: 1.2rem; }
}

/* ── Misc ── */
.empty { color: var(--text-muted); font-style: italic; margin-top: 1rem; }

code {
  background: #eee;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.9em;
}
