:root {
  color-scheme: light;
  --bg: #f5efe2;
  --panel: rgba(255, 252, 246, 0.84);
  --panel-strong: #fffaf0;
  --text: #1f1c16;
  --muted: #665f52;
  --accent: #b45309;
  --accent-soft: rgba(180, 83, 9, 0.12);
  --border: rgba(62, 45, 18, 0.12);
  --shadow: 0 18px 50px rgba(74, 52, 24, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Instrument Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 214, 153, 0.45), transparent 28%),
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.18), transparent 24%),
    linear-gradient(180deg, #fbf4e4 0%, #f3ead8 100%);
}

.page-shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.hero {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

h1 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: clamp(2.7rem, 8vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 52rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.hero-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-note a,
.event-card__links a,
.empty-state a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.hero-note a:hover,
.event-card__links a:hover,
.empty-state a:hover {
  text-decoration: underline;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.controls__top-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.9fr) auto;
  align-items: end;
  width: 100%;
}

.field {
  display: grid;
  gap: 0.45rem;
  min-width: 240px;
  flex: 1 1 260px;
}

.field--sort {
  min-width: 200px;
}

.field span,
.status,
.filter-group__label {
  font-size: 0.95rem;
  color: var(--muted);
}

input,
button,
select {
  font: inherit;
}

input[type="date"],
select {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(96, 77, 46, 0.18);
  border-radius: 14px;
  background: var(--panel-strong);
  color: var(--text);
}

button {
  padding: 0.9rem 1.2rem;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #c2410c, #ea580c);
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(194, 65, 12, 0.22);
}

button:hover {
  filter: brightness(1.03);
}

.filter-group {
  display: grid;
  gap: 0.65rem;
  flex: 1 1 100%;
}

.filter-group__label {
  margin: 0;
}

.pill-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  min-height: 2.5rem;
}

.pill-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(96, 77, 46, 0.16);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
}

.pill-filter input {
  accent-color: #c2410c;
}

.pill-filter-list__empty {
  margin: 0;
  color: var(--muted);
}

.status {
  margin: 0;
  min-height: 1.5rem;
  flex: 1 1 100%;
}

.event-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.event-card {
  display: grid;
  gap: 0.9rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 251, 244, 0.92);
  box-shadow: var(--shadow);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.event-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 48px rgba(74, 52, 24, 0.12);
}

.event-card__date {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.event-card__title {
  margin: 0.2rem 0 0;
  font-size: 1.25rem;
  line-height: 1.2;
  font-family: "Newsreader", serif;
}

.event-card__title-marker {
  margin-left: 0.12rem;
  color: var(--accent);
  font-size: 0.58em;
  font-weight: 800;
  line-height: 1;
}

.event-card__areas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.event-card__city,
.event-card__district {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 237, 213, 0.95);
  color: #9a3412;
  font-size: 0.88rem;
  font-weight: 700;
}

.event-card__district {
  border: 0;
  background: rgba(254, 243, 199, 0.95);
  color: #92400e;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(146, 64, 14, 0.12);
}

.event-card__district:hover {
  filter: brightness(0.98);
}

.event-card__district.is-active {
  background: #c2410c;
  color: #fff7ed;
  box-shadow: none;
}

.event-card__district:focus-visible {
  outline: 2px solid rgba(194, 65, 12, 0.35);
  outline-offset: 2px;
}

.event-card__district:disabled {
  cursor: default;
  opacity: 0.65;
}

.event-card__meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.event-card__location-icon {
  margin-right: 0.35rem;
}

.event-card__meta a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(180, 83, 9, 0.24);
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1.5px;
  transition:
    color 180ms ease,
    text-decoration-color 180ms ease;
}

.event-card__meta a:hover {
  color: #92400e;
  text-decoration-color: rgba(146, 64, 14, 0.5);
}

.event-card__meta a:focus-visible {
  outline: 2px solid rgba(180, 83, 9, 0.22);
  outline-offset: 3px;
  border-radius: 4px;
}

.event-card__details {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.event-card__details li {
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: var(--accent-soft);
  line-height: 1.45;
}

.event-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.event-card__link-group {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.16rem;
}

.event-card__link-alternates {
  display: inline-flex;
  gap: 0.12rem;
  font-size: 0.68em;
  line-height: 1;
}

.event-card__link-alternates a {
  font-weight: 800;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 1.5rem;
  border: 1px dashed rgba(96, 77, 46, 0.25);
  border-radius: 22px;
  background: rgba(255, 251, 244, 0.65);
  text-align: center;
  color: var(--muted);
}

.empty-state--error {
  text-align: left;
  border-style: solid;
  border-color: rgba(194, 65, 12, 0.22);
  background: rgba(255, 247, 237, 0.92);
}

.empty-state--error h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: #9a3412;
}

.empty-state--error p {
  margin: 0.75rem 0 0;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 1rem, 1100px);
    padding-top: 1rem;
  }

  .controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .controls__top-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .field,
  .field--sort,
  .filter-group,
  .status,
  #clear-filter {
    min-width: 0;
    width: 100%;
  }

  #clear-filter {
    justify-self: stretch;
  }

  @supports (-webkit-touch-callout: none) {
    .field,
    .field--sort {
      inline-size: 100%;
    }

    input[type="date"],
    select {
      inline-size: -webkit-fill-available;
      width: -webkit-fill-available;
      max-width: -webkit-fill-available;
    }
  }

  .hero,
  .controls,
  .event-card,
  .empty-state {
    border-radius: 20px;
  }
}
