:root {
  --teal: #28b5b5;
  --yellow: #fdc85a;
  --text: #707173;
  --text-dark: #212b36;
  --surface: #f0f0f0;
  --white: #ffffff;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  --radius-lg: 20px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Baloo 2", system-ui, sans-serif;
  color: var(--text);
  background: var(--white);
}

body.filters-open {
  overflow: hidden;
}

h1,
h2,
h3,
.logo,
.button {
  font-family: "Fredoka One", system-ui, sans-serif;
  color: var(--text-dark);
}

a {
  color: var(--teal);
  text-decoration: none;
}

.hidden {
  display: none;
}

.announcement {
  background: var(--teal);
  color: var(--white);
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  transition: transform 0.2s ease;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.header-hidden .announcement,
.header-hidden .site-header {
  transform: translateY(-110%);
}

.logo {
  font-size: 1.5rem;
  color: var(--teal);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-link {
  background: none;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
}

.hero {
  padding: 2rem;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  background: #f7f1f0;
}

.hero-text h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2.4rem;
}

.search-panel {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.search-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.search-input {
  display: flex;
  gap: 0.5rem;
}

.search-input input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--surface);
  font-size: 1rem;
}

.button {
  border: none;
  background: var(--yellow);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.button.ghost {
  background: var(--surface);
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  padding: 2rem;
}

.filters-shell summary {
  display: none;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1rem;
}

.filters-panel {
  position: static;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

#closeFilters {
  display: none;
}

.sort-select {
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--surface);
  font-family: "Fredoka One", system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--text-dark);
  cursor: pointer;
  appearance: none;
  height: 36px;
  line-height: 1;
}

.filters-container {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.date-filter {
  margin-top: 1rem;
}

.date-inputs {
  display: grid;
  gap: 0.6rem;
}

.date-inputs label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.85rem;
}

.date-inputs input {
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--surface);
  font-family: inherit;
}

.filter-group h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  background: var(--white);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-dark);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.chip[data-filter-state="include"] {
  box-shadow: 0 0 0 2px var(--teal);
}

.chip[data-filter-state="exclude"] {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
  text-decoration: line-through;
  opacity: 0.7;
}

.results-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.results-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.toolbar-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

body.options-open .toolbar-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: fixed;
  right: 1.5rem;
  bottom: 10.5rem;
  background: var(--white);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  z-index: 12;
}

#scrollTop {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  display: none;
  z-index: 10;
  box-shadow: var(--shadow);
}

#scrollTop.show {
  display: inline-flex;
}

.filters-toggle {
  position: fixed;
  right: 1.5rem;
  bottom: 7rem;
  z-index: 10;
  display: none;
  box-shadow: var(--shadow);
}

.options-toggle {
  position: fixed;
  right: 1.5rem;
  bottom: 4.25rem;
  z-index: 10;
  display: none;
  box-shadow: var(--shadow);
}

.options-toggle.show {
  display: inline-flex;
}

.search-toggle {
  position: fixed;
  right: 1.5rem;
  bottom: 9.75rem;
  z-index: 10;
  display: none;
  box-shadow: var(--shadow);
}

.search-toggle.show {
  display: inline-flex;
}

.filters-toggle.show {
  display: inline-flex;
}

.filters-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  z-index: 15;
}

body.filters-open .filters-overlay {
  display: block;
}

.options-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  display: none;
  z-index: 11;
}

body.options-open .options-overlay {
  display: block;
}

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  display: none;
  z-index: 11;
}

body.search-open .search-overlay {
  display: block;
}

.search-drawer {
  position: fixed;
  right: 1.5rem;
  bottom: 12.5rem;
  background: var(--white);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: none;
  z-index: 12;
  min-width: 220px;
  gap: 0.5rem;
}

body.search-open .search-drawer {
  display: grid;
}

.search-drawer input {
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--surface);
  font-family: inherit;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.result-card {
  background: var(--surface);
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  box-shadow: var(--shadow);
}

.card-date {
  font-size: 0.85rem;
  color: var(--text-dark);
  opacity: 0.75;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.card-categories {
  display: grid;
  gap: 0.4rem;
}

.category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.category-label {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.category-values {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tag-pill {
  background: var(--white);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  border: 1px solid transparent;
  color: var(--text-dark);
}

button.tag-pill {
  border: 1px solid transparent;
  background: var(--white);
  cursor: pointer;
  font-family: inherit;
  appearance: none;
  color: var(--text-dark);
  text-decoration: none;
}

.tag-pill[data-filter-state="include"] {
  box-shadow: inset 0 0 0 1px var(--teal);
}

.tag-pill[data-filter-state="exclude"] {
  text-decoration: line-through;
  opacity: 0.7;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.link-button {
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--teal);
  color: var(--teal);
  font-weight: 600;
  font-size: 0.85rem;
  background: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 32px;
}

.link-button.icon-only {
  padding: 0.35rem 0.55rem;
}

.platform-icon {
  width: 18px;
  height: 18px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.embed-shell {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  padding: 0.75rem;
}

.results-grid.compact {
  display: block;
}

.compact-table {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
}

.compact-table table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.compact-table th,
.compact-table td {
  padding: 0.6rem;
  text-align: left;
  vertical-align: top;
}

.compact-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dark);
}

.compact-table tr:not(:last-child) td {
  border-bottom: 1px solid #e4e4e4;
}

.result-row-title {
  font-weight: 700;
  color: var(--text-dark);
}

.result-row-description {
  font-size: 0.85rem;
}

.official-links-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.site-footer {
  background: var(--teal);
  color: var(--white);
  text-align: center;
  padding: 1.5rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--white);
  text-decoration: underline;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.modal {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 560px;
}

.modal-content {
  padding: 2rem;
}

.noscript {
  padding: 1rem;
  text-align: center;
  background: var(--surface);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .filters-panel {
    position: static;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6rem;
  }

  .filters-shell {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 85%;
    max-width: 360px;
    transform: translateX(-110%);
    transition: transform 0.25s ease;
    z-index: 20;
  }

  body.filters-open .filters-shell {
    transform: translateX(0);
  }

  .filters-shell summary {
    display: none;
  }

  #closeFilters {
    display: inline-flex;
  }

  .filters-toggle {
    display: inline-flex;
  }

  .options-toggle {
    display: inline-flex;
  }

  .toolbar-controls {
    display: none;
  }

}

@media (min-width: 981px) {
  .filters-shell {
    position: sticky;
    top: 110px;
    align-self: start;
  }

  .filters-panel {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
  }

  .filters-panel:hover {
    scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
  }

  .filters-panel::-webkit-scrollbar {
    width: 8px;
  }

  .filters-panel::-webkit-scrollbar-track {
    background: transparent;
  }

  .filters-panel::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 999px;
  }

  .filters-panel:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
  }

  .search-toggle {
    bottom: 7rem;
  }

  .search-drawer {
    bottom: 9.5rem;
  }
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding: 1.5rem;
  }

  .results-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .search-input {
    flex-direction: column;
  }

  .compact-table table {
    min-width: 0;
  }
}
