:root {
  color-scheme: light;
  --background: #f5f6f4;
  --surface: #ffffff;
  --text: #171a18;
  --muted: #68706c;
  --line: #dfe3e0;
  --line-strong: #cdd4d0;
  --brand: #006b55;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
}

.page {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 0 24px;
}

.site-header > div,
main,
.controls > label,
.event-list,
.event-heading {
  min-width: 0;
}

h1 {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.site-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.suggest-link {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 750;
  text-decoration: none;
}

.suggest-link:hover {
  border-color: var(--brand);
}

.filter-shell {
  position: sticky;
  z-index: 10;
  top: 0;
  padding: 10px 0 12px;
  background: rgb(245 246 244 / 94%);
  backdrop-filter: blur(10px);
}

.controls {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 170px 190px;
  gap: 8px;
}

input,
select,
button {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 0 12px;
}

input {
  font-size: 0.98rem;
}

button {
  min-height: auto;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 750;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(0 107 85 / 18%);
  outline-offset: 2px;
  border-color: var(--brand);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 31px;
  gap: 16px;
  padding: 8px 2px 0;
}

.result-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.event-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.event-card {
  display: grid;
  grid-template-areas:
    "heading meta"
    "description description"
    "tags tags";
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 24px;
  row-gap: 4px;
  min-width: 0;
  padding: 13px 16px;
  background: var(--surface);
  transition: background-color 160ms ease;
}

.event-card + .event-card {
  border-top: 1px solid var(--line);
}

.event-card:hover,
.event-card:focus-within {
  background: #fafbfa;
}

.event-heading {
  grid-area: heading;
  min-width: 0;
}

.event-card h2 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
  text-wrap: pretty;
}

.event-card h2 a {
  text-decoration: none;
  overflow-wrap: anywhere;
}

.event-card h2 a:hover {
  color: var(--brand);
}

.description {
  grid-area: description;
  display: -webkit-box;
  overflow: hidden;
  max-width: 84ch;
  margin: 0;
  color: #424946;
  font-size: 0.8rem;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tags {
  grid-area: tags;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
}

.tags li + li::before {
  width: 1px;
  height: 0.7rem;
  margin: 0 7px;
  background: var(--line-strong);
  content: "";
}

.event-meta {
  display: flex;
  grid-area: meta;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.meta-item {
  display: flex;
  align-items: center;
  min-width: 0;
}

.meta-item + .meta-item::before {
  width: 1px;
  height: 0.9rem;
  margin: 0 10px;
  background: var(--line-strong);
  content: "";
}

.meta-item dd {
  overflow: hidden;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-item--month dd {
  color: var(--brand);
  font-size: 0.73rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.meta-item--region dd {
  color: var(--text);
}

.meta-item--location dd {
  max-width: 18rem;
  color: var(--muted);
}

.empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 54px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

footer {
  display: flex;
  gap: 8px;
  padding: 24px 2px 34px;
  color: var(--muted);
  font-size: 0.73rem;
}

footer a {
  color: var(--brand);
}

@media (max-width: 720px) {
  .filter-shell {
    position: static;
    padding-top: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .event-card {
    grid-template-areas:
      "heading"
      "meta"
      "description"
      "tags";
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
    row-gap: 5px;
  }

  .event-meta {
    justify-content: flex-start;
  }

  .meta-item--location {
    min-width: 0;
  }

  .meta-item--location dd {
    max-width: 44vw;
  }
}

@media (max-width: 480px) {
  .page {
    width: min(100% - 20px, 1040px);
  }

  .site-header {
    align-items: flex-start;
    gap: 12px;
    padding: 22px 0 18px;
  }

  .site-header p {
    max-width: 220px;
    font-size: 0.8rem;
  }

  .suggest-link {
    padding: 7px 8px;
    font-size: 0.75rem;
  }

  .event-card {
    padding: 12px;
  }

  .event-card h2 {
    font-size: 0.98rem;
  }

  .meta-item + .meta-item::before {
    margin: 0 7px;
  }

  .meta-item dd {
    font-size: 0.68rem;
  }

  .meta-item--month dd {
    font-size: 0.69rem;
  }

  .meta-item--location dd {
    max-width: 42vw;
  }
}
