/* ════════════════════════════════
   ARCHIVE — Events, Filter bar
   All values use --tb-* design tokens
   ════════════════════════════════ */


/* ── Archive header ─────────────────────────── */
.tb-archive-header {
  padding: calc(var(--nav-h) + var(--tb-space-8)) var(--tb-space-6) var(--tb-space-6);
}
.tb-archive-header .section-label { margin-bottom: var(--tb-space-3); }
.tb-archive-header .section-title { line-height: 1; }
.tb-archive-count {
  margin-top: var(--tb-space-3);
  font-size: var(--tb-text-xs);
  letter-spacing: 0.08em;
  color: var(--tb-text-muted);
}


/* ── Filter bar ─────────────────────────────── */
.tb-filter-bar {
  padding: var(--tb-space-4) var(--tb-space-6);
  border-bottom: 1px solid var(--tb-cream-200);
  background: rgba(245, 249, 249, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: var(--nav-h);
  z-index: 10;
}
.tb-filter-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--tb-space-4);
}
.tb-filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--tb-space-1);
  min-width: 150px;
}
.tb-filter-group--sort {
  margin-left: auto;
  min-width: 140px;
}
.tb-filter-label {
  font-size: var(--tb-text-xs);
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--tb-text-muted);
  font-weight: 600;
}
.tb-filter-select {
  background: var(--tb-card-bg);
  border: 1px solid var(--tb-cream-300);
  color: var(--tb-black);
  padding: var(--tb-space-2) var(--tb-space-8) var(--tb-space-2) var(--tb-space-3);
  font-size: var(--tb-text-sm);
  font-family: var(--tb-font);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b6460' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  border-radius: var(--tb-radius-full);
  transition: border-color var(--tb-transition);
}
.tb-filter-select:hover { border-color: var(--tb-black); }
.tb-filter-select:focus { outline: none; border-color: var(--tb-black); box-shadow: 0 0 0 3px var(--tb-cream-200); }
.tb-filter-select option { background: #fff; color: var(--tb-black); }

.tb-filter-clear {
  align-self: flex-end;
  font-size: var(--tb-text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tb-text-muted);
  text-decoration: none;
  padding: var(--tb-space-2) 0;
  transition: color var(--tb-transition);
  white-space: nowrap;
}
.tb-filter-clear:hover { color: var(--tb-red-500); }

/* Active filter badges */
.tb-filter-active {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tb-space-2);
  margin-top: var(--tb-space-3);
}
.tb-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--tb-space-2);
  font-size: var(--tb-text-xs);
  letter-spacing: 0.08em;
  background: var(--tb-red-50);
  border: 1px solid var(--tb-red-100);
  color: var(--tb-red-500);
  padding: var(--tb-space-1) var(--tb-space-3);
  border-radius: var(--tb-radius-sm);
}
.tb-filter-badge__remove {
  color: var(--tb-red-500);
  text-decoration: none;
  line-height: 1;
  transition: opacity var(--tb-transition-fast);
  opacity: 0.6;
}
.tb-filter-badge__remove:hover { opacity: 1; }

/* Empty state */
.tb-archive-empty {
  column-span: all;
  break-inside: avoid;
  padding: 40px 0;
  text-align: center;
  font-family: var(--font-body);
  font-style: normal;
  text-decoration: none;
  font-size: 16px;
  color: #666666;
}
.tb-archive-empty .tb-filter-reset-link {
  display: inline-block;
  margin-top: var(--tb-space-4);
  font-size: var(--tb-text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tb-red-500);
  text-decoration: none;
  font-style: normal;
  font-weight: 500;
}


/* ── Pagination ─────────────────────────────── */
.tb-archive-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--tb-space-2);
  padding: 0 var(--tb-space-6) var(--tb-space-9);
}
.tb-archive-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 var(--tb-space-3);
  font-size: var(--tb-text-xs);
  letter-spacing: 0.08em;
  color: var(--tb-text-muted);
  border: 1px solid var(--tb-cream-200);
  text-decoration: none;
  transition: background var(--tb-transition), border-color var(--tb-transition), color var(--tb-transition);
  border-radius: var(--tb-radius-sm);
}
.tb-archive-pagination .page-numbers:hover {
  border-color: var(--tb-cream-300);
  color: var(--tb-black);
}
.tb-archive-pagination .page-numbers.current {
  background: var(--tb-red-500);
  border-color: var(--tb-red-500);
  color: var(--tb-text-on-dark);
}
.tb-archive-pagination .page-numbers.dots {
  border: none;
  background: none;
  pointer-events: none;
}


/* ── Generic page ───────────────────────────── */
.tb-page {
  padding: calc(var(--nav-h) + var(--tb-space-8)) var(--tb-space-6) var(--tb-space-10);
  max-width: 760px;
  margin: 0 auto;
}
.tb-page__header { margin-bottom: var(--tb-space-7); }
.tb-page__content {
  font-size: var(--tb-text-md);
  line-height: 1.85;
  color: var(--tb-text);
}
.tb-page__content p + p { margin-top: var(--tb-space-4); }
.tb-page__content h2 {
  font-size: var(--tb-text-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: var(--tb-space-7) 0 var(--tb-space-4);
  color: var(--tb-black);
}
.tb-page__content a { color: var(--tb-red-500); border-bottom: 1px solid rgba(0,103,127, 0.25); }
.tb-page__content a:hover { border-color: var(--tb-red-500); }


/* ── 404 ────────────────────────────────────── */
.tb-404 {
  min-height: calc(100vh - var(--nav-h));
  padding-top: var(--nav-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-left: var(--tb-space-5);
  padding-right: var(--tb-space-5);
  gap: var(--tb-space-4);
}
.tb-404__num {
  font-family: var(--tb-font);
  font-size: var(--tb-text-3xl);
  line-height: 1;
  color: var(--tb-cream-200);
  letter-spacing: 0.04em;
  font-weight: 700;
  user-select: none;
}
.tb-404__title {
  font-size: var(--tb-text-2xl);
  margin-top: calc(-1 * var(--tb-space-4));
  font-weight: 600;
  color: var(--tb-black);
}
.tb-404__text {
  font-size: var(--tb-text-base);
  font-style: italic;
  color: var(--tb-text-muted);
  max-width: 380px;
  line-height: 1.65;
}
.tb-404__actions {
  display: flex;
  gap: var(--tb-space-5);
  align-items: center;
  margin-top: var(--tb-space-3);
  flex-wrap: wrap;
  justify-content: center;
}


/* ════════════════════════════════
   RESPONSIVE
   ════════════════════════════════ */
@media (max-width: 960px) {
  .tb-archive-header { padding: calc(var(--nav-h) + var(--tb-space-7)) var(--tb-space-5) var(--tb-space-5); }
  .tb-filter-bar { padding: var(--tb-space-3) var(--tb-space-5); position: static; }
  .tb-filter-form { gap: var(--tb-space-3); }
  .tb-filter-group { min-width: 130px; }

  .tb-archive-pagination { padding: 0 var(--tb-space-5) var(--tb-space-7); flex-wrap: wrap; }


  .tb-page { padding: calc(var(--nav-h) + var(--tb-space-7)) var(--tb-space-5) var(--tb-space-8); }
  .tb-404__num { font-size: var(--tb-text-3xl-mobile); }
}


@media (max-width: 768px) {
  .tb-filter-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--tb-space-3);
  }
  .tb-filter-group,
  .tb-filter-group--sort {
    min-width: 0;
    margin-left: 0; /* reset the desktop "push to right" on sort */
    width: 100%;
  }
  .tb-filter-select { width: 100%; }
  .tb-filter-label { font-size: var(--tb-text-xs); }
  .tb-filter-clear { display: none; } /* collapsed on narrow; active badges still show */
}

@media (max-width: 480px) {
  .tb-filter-form { grid-template-columns: 1fr; gap: var(--tb-space-2); }
}
