:root {
  --navy: #1c478e;
  --mid: #6f9fcf;
  --sky: #9cbed9;
  --paper: #f4f7fb;
  --white: #ffffff;
  --border: #d6e1f0;
  --error: #b73a3a;
  --error-bg: #fceaea;
  --success: #2e6f33;
  --success-bg: #e8f3e9;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--sky);
  color: var(--navy);
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.wide > .container {
  max-width: 920px;
}

.site-header {
  background: var(--navy);
  color: var(--white);
  padding: 0.75rem 0;
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: inherit;
  text-decoration: none;
}

.site-brand:hover {
  color: inherit;
}

.site-header .logo {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

.logo .figure {
  transform-box: view-box;
  transform-origin: 50px 31px;
}

.logo .figure-bottom {
  transform-origin: 50px 93px;
}

.logo.rocking .figure {
  animation: logo-rock 1.1s ease-in-out infinite;
}

@keyframes logo-rock {
  0% {
    transform: rotate(0deg);
    animation-timing-function: ease-out;
  }
  25% {
    transform: rotate(6deg);
    animation-timing-function: ease-in;
  }
  50% {
    transform: rotate(0deg);
    animation-timing-function: ease-out;
  }
  75% {
    transform: rotate(-6deg);
    animation-timing-function: ease-in;
  }
  100% {
    transform: rotate(0deg);
  }
}

.site-header h1 {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.site-header .tagline {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sky);
}

.site-nav {
  background-color: #e8e8e8;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
}

.site-nav a {
  display: inline-block;
  color: var(--navy);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.875rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  border-bottom-color: var(--mid);
}

.site-nav a[aria-current="page"] {
  border-bottom-color: var(--navy);
}

.site-nav a:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

main {
  --pad: 2rem;
  background: var(--white);
  border-radius: 14px;
  padding: var(--pad);
  box-shadow: 0 6px 20px rgba(28, 71, 142, 0.10);
  margin-bottom: 2.5rem;
}

form > :last-child {
  margin-bottom: 0;
}

h2 {
  margin: 0 0 1.5rem;
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 0.01em;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--mid);
}

.button {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.button:hover {
  background: var(--mid);
  color: var(--white);
}

.button:active {
  transform: translateY(1px);
}

.home-boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 2rem 0 2.5rem;
}

.home-box {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.home-box h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}

.home-box p {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
}

.home-box .button {
  margin-top: auto;
  align-self: flex-start;
}

@media (max-width: 640px) {
  .home-boxes {
    grid-template-columns: 1fr;
  }
}

.actions {
  margin-bottom: 1.5rem;
}

.event-filters {
  margin-bottom: 1.5rem;
}

.source-filter {
  position: relative;
}

.source-filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  cursor: pointer;
  white-space: nowrap;
  height: 100%;
  padding: 0.5rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--navy);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: border-color 0.15s ease;
}

.source-filter-trigger::-webkit-details-marker {
  display: none;
}

.source-filter-trigger:hover,
.source-filter[open] .source-filter-trigger {
  border-color: var(--mid);
}

.source-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  font-size: 0.6875rem;
  font-weight: 700;
}

.source-filter-count[hidden] {
  display: none;
}

.source-filter-caret {
  width: 0.7rem;
  height: 0.7rem;
  background-color: var(--navy);
  mask: url("/caret.svg") no-repeat center / contain;
  transition: transform 0.15s ease;
}

.source-filter[open] .source-filter-caret {
  transform: rotate(180deg);
}

.source-filter-menu {
  position: absolute;
  right: 0;
  z-index: 20;
  margin-top: 0.4rem;
  min-width: 13rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(28, 71, 142, 0.12);
  overflow: hidden;
}

.source-filter-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
}

.source-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  color: var(--navy);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.source-option:hover {
  background: var(--paper);
}

.source-option::before {
  content: "";
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--white) no-repeat center / 0.65rem;
}

.source-option[aria-checked="true"]::before {
  border-color: var(--navy);
  background-color: var(--navy);
  background-image: url("/check.svg");
}

.source-filter-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-top: 1px solid var(--border);
}

.source-filter-actions a {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--navy);
}

.source-filter-actions a:hover {
  color: var(--mid);
}

.applied-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.applied-filters[hidden] {
  display: none;
}

.applied-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.5rem 0.4rem 0.75rem;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.applied-chip:hover {
  background: var(--mid);
  color: var(--white);
}

.applied-chip-x {
  font-size: 1rem;
  line-height: 1;
}

.filter-bar {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.filter-search-form {
  position: relative;
  flex: 1;
  margin: 0;
}

.filter-search-form::before {
  content: "";
  position: absolute;
  left: 0.85rem;
  top: 0;
  bottom: 0;
  width: 1.1rem;
  background-color: var(--sky);
  mask: url("/search.svg") no-repeat center / 1.1rem 1.1rem;
  pointer-events: none;
  transition: background-color 0.15s ease;
}

.filter-search-form:focus-within::before {
  background-color: var(--mid);
}

.events {
  list-style: none;
  padding: 0;
  margin: 0;
}

.events li {
  padding: 1.125rem 0;
  border-bottom: 1px solid var(--border);
}

.events li:first-child {
  padding-top: 0;
}

.events li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.event-month + .event-month {
  margin-top: 1.5rem;
}

.event-month-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  list-style: none;
  cursor: pointer;
  background-color: #e8e8e8;
  margin: 2rem calc(-1 * var(--pad)) 1.5rem;
  padding: 0.5rem calc(var(--pad) + 0.5rem);
  color: var(--navy);
}

.event-month-title::-webkit-details-marker {
  display: none;
}

.event-month-title h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.event-month-toggle {
  flex-shrink: 0;
  width: 0.875rem;
  height: 0.875rem;
  background-color: var(--navy);
  mask: url("/caret.svg") no-repeat center / contain;
  transition: transform 0.15s ease;
}

.event-month:not([open]) .event-month-toggle {
  transform: rotate(-90deg);
}

.event-month:not([open]) .event-month-title {
  margin-bottom: 0;
}

.event-time {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 0.25rem;
}

.event-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--navy);
}

.event-location {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--mid);
}

.event-description {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  color: var(--navy);
  white-space: pre-line;
}

.empty-state {
  color: var(--mid);
  font-style: italic;
}

.resource-section {
  margin-bottom: 2.5rem;
}

.resource-section:last-child {
  margin-bottom: 0;
}

.resource-section h3 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
}

.resource-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.resource-table th,
.resource-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  overflow-wrap: break-word;
}

@media (min-width: 601px) {
  .resource-table {
    table-layout: fixed;
  }
  .resource-table tr > :nth-child(1) {
    width: 28%;
  }
  .resource-table tr > :nth-child(2) {
    width: 54%;
  }
  .resource-table tr > :nth-child(3) {
    width: 18%;
  }
}

.resource-table thead th {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mid);
  border-bottom-width: 2px;
}

.resource-table tbody th {
  font-weight: 700;
  color: var(--navy);
}

.resource-table tbody tr:last-child th,
.resource-table tbody tr:last-child td {
  border-bottom: none;
}

.contact-value {
  display: none;
}

@media (max-width: 600px) {
  .resource-table thead {
    display: none;
  }
  .resource-table,
  .resource-table tbody,
  .resource-table tr,
  .resource-table th,
  .resource-table td {
    display: block;
  }
  .resource-table tr {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
  }
  .resource-table th,
  .resource-table td {
    padding: 0.15rem 0;
    border-bottom: none;
  }
  .resource-table tbody th {
    font-size: 1.0625rem;
    margin-bottom: 0.25rem;
  }
  .resource-table td[data-label]::before {
    content: attr(data-label) ": ";
    font-weight: 700;
    color: var(--mid);
  }
  .contact-label {
    display: none;
  }
  .contact-value {
    display: inline;
  }
}

.skeleton-month {
  height: 2.75rem;
  margin: 0 calc(-1 * var(--pad)) 1.5rem;
  background-color: #e8e8e8;
}

.skeleton-event {
  padding: 1.125rem 0;
  border-bottom: 1px solid var(--border);
}

.skeleton-event:first-of-type {
  padding-top: 0;
}

.skeleton-line {
  display: block;
  height: 0.9rem;
  border-radius: 4px;
}

.skeleton-time {
  width: 9rem;
  height: 0.7rem;
  margin-bottom: 0.5rem;
}

.skeleton-title {
  width: 65%;
  margin-bottom: 0.45rem;
}

.skeleton-loc {
  width: 40%;
  height: 0.7rem;
}

.skeleton-line {
  background: linear-gradient(90deg, var(--border) 25%, var(--paper) 37%, var(--border) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

@keyframes skeleton-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-line {
    animation: none;
  }
  .logo.rocking .figure {
    animation: none;
  }
}

.required-marker {
  color: var(--error);
  font-weight: 700;
}

form .field {
  margin-bottom: 1.25rem;
}

form label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  color: var(--navy);
}

input[type="text"],
input[type="datetime-local"],
input[type="url"],
input[type="email"],
.filter-search,
textarea {
  display: block;
  width: 100%;
  padding: 0.625rem 0.75rem;
  font: inherit;
  color: var(--navy);
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="url"],
input[type="email"] {
  display: block;
}

input[type="datetime-local"] {
  appearance: none;
  min-width: 0;
  max-width: 100%;
  min-height: calc(1.5em + 1.25rem + 4px);
}

.filter-search {
  padding-left: 2.5rem;
}

.cta {
  padding: 0.5rem 1rem;
}

.event-month:first-child > .event-month-title {
  margin-top: 1.5rem;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--mid);
  box-shadow: 0 0 0 3px rgba(111, 159, 207, 0.3);
}

textarea {
  resize: vertical;
  min-height: 6rem;
}

button[type="submit"] {
  font: inherit;
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

button[type="submit"]:hover {
  background: var(--mid);
}

button[type="submit"]:active {
  transform: translateY(1px);
}

.error-summary {
  background: var(--error-bg);
  border-left: 4px solid var(--error);
  padding: 0.875rem 1rem;
  margin-bottom: 1.5rem;
  border-radius: 0 6px 6px 0;
  color: var(--error);
  font-size: 0.875rem;
}

.field-error {
  display: block;
  color: var(--error);
  font-size: 0.8125rem;
  margin-top: 0.4rem;
  font-weight: 500;
}

.field-hint {
  display: block;
  color: var(--mid);
  font-size: 0.8125rem;
  margin-top: 0.4rem;
}

.thanks {
  background: var(--success-bg);
  border-left: 4px solid var(--success);
  padding: 1rem 1.25rem;
  border-radius: 0 6px 6px 0;
  color: var(--success);
  font-weight: 500;
}

.submit-disclaimer {
  display: block;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--navy);
}

@media (max-width: 480px) {
  .site-header {
    padding: 1.25rem 0;
  }
  .site-brand {
    gap: 1rem;
  }
  .site-header .logo {
    width: 68px;
    height: 68px;
  }
  .site-header h1 {
    font-size: 1.375rem;
  }
  .site-header .tagline {
    font-size: 0.6875rem;
  }
  .site-nav ul {
    gap: 0.875rem;
  }
  .site-nav a {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
  }
  .filter-bar {
    flex-direction: column;
  }
  .source-filter {
    width: 100%;
  }
  .source-filter-trigger {
    width: 100%;
    justify-content: space-between;
  }
  .source-filter-menu {
    left: 0;
    right: 0;
  }
  main {
    --pad: 1.25rem;
    border-radius: 10px;
  }
}
