:root {
  --bg: #eef3fb;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --ink: #1c2430;
  --muted: #607086;
  --accent: #2b6df6;
  --accent-strong: #1f57c8;
  --accent-soft: #edf3ff;
  --berry: #5f7097;
  --line: rgba(28, 36, 48, 0.07);
  --success: #0f9f6e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(232, 241, 255, 0.9) 0%, rgba(232, 241, 255, 0) 34%),
    linear-gradient(180deg, #f8fbff 0%, #eef3fb 52%, #e9eff8 100%);
}
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.hero {
  position: relative;
  overflow: hidden;
  padding: 46px 0 22px;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(251, 253, 255, 0.92) 0%, rgba(238, 245, 255, 0.94) 55%, rgba(232, 240, 255, 0.92) 100%);
  pointer-events: none;
}
.hero .wrap,
main,
.footer { position: relative; z-index: 1; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; color: var(--berry); font-weight: 800; }
h1, h2, p { margin-top: 0; }
h1, h2 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.6rem, 5vw, 4.1rem); line-height: 0.98; margin-bottom: 10px; max-width: none; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.lead { max-width: 620px; font-size: 1rem; line-height: 1.5; color: #435161; }
.hero-actions, .filters { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-copy {
  display: grid;
  gap: 8px;
}
.button {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
  padding: 12px 18px; font-weight: 700; text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 8px 18px rgba(43, 109, 246, 0.18);
}
.button.primary:hover { background: var(--accent-strong); }
.button.secondary { background: rgba(255, 255, 255, 0.84); color: var(--ink); border-color: var(--line); }
.panel, .event-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
}
.panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 16px 0 24px;
  margin-bottom: 16px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.panel-head h2 {
  margin-bottom: 0;
}
.section-note { max-width: 38rem; color: var(--muted); line-height: 1.55; margin-bottom: 0; }
.filters {
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}
.filters label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: var(--muted);
}
select, input {
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font: inherit; background: white; min-width: 160px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
select:focus, input:focus {
  outline: none;
  border-color: rgba(43, 109, 246, 0.42);
  box-shadow: 0 0 0 3px rgba(43, 109, 246, 0.1);
}
.filters label {
  gap: 6px;
  font-size: 0.82rem;
}
.filters select {
  min-width: 0;
  width: 132px;
  height: 34px;
  padding: 6px 28px 6px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  background-color: rgba(255, 255, 255, 0.94);
}
#locationFilter {
  width: 146px;
}
#timeFilter {
  width: 122px;
}
.event-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.pagination-wrap {
  display: flex;
  justify-content: center;
  padding-top: 18px;
}
.pagination {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.pagination-button {
  min-width: 108px;
  height: 38px;
  padding: 0 14px;
  font-size: 0.84rem;
}
.pagination-button:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}
.pagination-status {
  min-width: 96px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.event-card {
  padding: 18px;
  display: grid;
  gap: 9px;
  background: var(--surface-strong);
  border-radius: 20px;
  box-shadow: 0 6px 18px rgba(39, 68, 120, 0.035);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.event-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(39, 68, 120, 0.055);
  border-color: rgba(43, 109, 246, 0.12);
}
.event-meta, .pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .66rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.pill-muted {
  background: #f2f5f9;
  color: #637188;
}
.event-card h3 { margin-bottom: 4px; font-size: 1.12rem; line-height: 1.28; }
.event-card p { color: #566376; margin-bottom: 0; line-height: 1.42; }
.event-meta {
  align-items: baseline;
  color: var(--muted);
  font-weight: 600;
  gap: 10px;
  margin-bottom: 2px;
}
.event-meta strong {
  color: var(--ink);
  font-size: 0.97rem;
}
.event-summary {
  font-size: 0.95rem;
  color: #5a6778;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}
.event-deadline {
  font-size: 0.84rem;
  font-weight: 700;
  color: #8d5d2a;
  margin-top: 0;
}
.event-location {
  color: var(--muted);
  font-size: 0.9rem;
}
.event-location {
  margin-top: 3px;
}
.event-location strong {
  font-size: 0.96rem;
  color: var(--ink);
}
.event-link-row {
  margin-top: 3px;
}
.event-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}
.event-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.empty-state {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(39, 68, 120, 0.035);
}
.empty-state h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}
.empty-state p {
  color: var(--muted);
  max-width: 32rem;
  margin: 0 auto 14px;
}
.empty-state-button {
  height: 36px;
  padding: 0 14px;
  font-size: 0.84rem;
}
.footer { padding: 24px 0 40px; color: #748196; font-size: .9rem; }
@media (max-width: 920px) {
  .panel-head {
    align-items: start;
  }
  .filters {
    width: 100%;
    justify-content: flex-start;
    row-gap: 8px;
  }
}
@media (max-width: 760px) {
  .wrap {
    width: min(100%, calc(100% - 24px));
  }
  .hero {
    padding: 34px 0 16px;
  }
  h1 {
    font-size: clamp(2.2rem, 9vw, 3rem);
    line-height: 1.02;
    margin-bottom: 8px;
  }
  .lead {
    font-size: 0.95rem;
    line-height: 1.46;
    max-width: 32rem;
  }
  .panel {
    padding-top: 12px;
  }
  .panel-head {
    gap: 12px;
    margin-bottom: 14px;
  }
  .filters {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
  }
  .filters label {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
  }
  .filters select,
  #locationFilter,
  #timeFilter {
    width: 100%;
  }
  .event-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .event-card {
    padding: 16px;
    gap: 8px;
  }
  .pill-row {
    gap: 6px;
  }
}
@media (max-width: 480px) {
  .wrap {
    width: min(100%, calc(100% - 20px));
  }
  .hero {
    padding-top: 30px;
  }
  h1 {
    font-size: 2rem;
  }
  .panel-head h2 {
    font-size: 1.9rem;
  }
  .filters label {
    grid-template-columns: 58px minmax(0, 1fr);
    font-size: 0.8rem;
  }
  .filters select {
    font-size: 0.8rem;
  }
  .event-card h3 {
    font-size: 1.06rem;
  }
  .event-summary {
    -webkit-line-clamp: 5;
  }
  .pagination {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }
  .pagination-button {
    min-width: 96px;
  }
  .pagination-status {
    min-width: auto;
    font-size: 0.8rem;
  }
}
