/* ==========================================================================
   Search & Archive Shared Styles
   ========================================================================== */

/* Search Header */
.search-header {
  background: white;
  border-bottom: 1px solid #e5e5e5;
  padding: 1.5rem 0;
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  max-width: 700px;
}

.search-input-wrapper {
  flex: 1;
  position: relative;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #999;
  pointer-events: none;
}

.search-bar input[type="text"] {
  width: 100%;
  border: 2px solid #e0e0e0;
  font-size: 1rem;
  padding: 0 2.5rem 0 2.75rem;
  height: 48px;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  background: white;
}

.search-bar input[type="text"]:focus {
  border-color: #B33D3F;
  box-shadow: 0 0 0 3px rgba(179, 61, 63, 0.1);
}

.search-bar input[type="text"]:hover:not(:focus) {
  border-color: #ccc;
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.search-clear:hover {
  background: #f0f0f0;
  color: #666;
}

.search-clear svg {
  width: 16px;
  height: 16px;
  position: static;
  transform: none;
  pointer-events: auto;
}

/* Active Filters */
.active-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.active-filters-label {
  font-size: 0.875rem;
  color: #666;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: #f5f5f5;
  padding: 0 0.625rem;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #333;
  height: 32px;
  line-height: 1;
  box-sizing: border-box;
}

.filter-tag--category {
  display: inline-flex !important;
  align-items: center !important;
  background: #f5f5f5;
  height: 32px;
  line-height: 1;
}

.filter-tag-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Override tag-- styles for filter tags to ensure consistent height/centering */
.filter-tag.filter-tag--topic {
  display: flex;
  align-items: center;
  height: 32px;
  line-height: 1;
  padding: 0 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}

/* Topic filter tag colors - override base filter-tag background */
.filter-tag.filter-tag--topic.tag--blue { background: #eff6ff; color: #1e40af; }
.filter-tag.filter-tag--topic.tag--purple { background: #f5f3ff; color: #6d28d9; }
.filter-tag.filter-tag--topic.tag--green { background: #ecfdf5; color: #047857; }
.filter-tag.filter-tag--topic.tag--teal { background: #f0fdfa; color: #0f766e; }
.filter-tag.filter-tag--topic.tag--orange { background: #fff7ed; color: #c2410c; }
.filter-tag.filter-tag--topic.tag--rose { background: #fff1f2; color: #be123c; }
.filter-tag.filter-tag--topic.tag--amber { background: #fffbeb; color: #b45309; }
.filter-tag.filter-tag--topic.tag--slate { background: #f8fafc; color: #475569; }
.filter-tag.filter-tag--topic.tag--indigo { background: #eef2ff; color: #4338ca; }
.filter-tag.filter-tag--topic.tag--cyan { background: #ecfeff; color: #0e7490; }

.filter-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #888;
  text-decoration: none;
  font-weight: 500;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.filter-tag-remove:hover {
  background: #ddd;
  color: #333;
  text-decoration: none;
}

.clear-all-link {
  font-size: 0.875rem;
  color: #B33D3F;
  text-decoration: none;
  margin-left: 0.5rem;
}

.clear-all-link:hover {
  text-decoration: underline;
}

/* Main Content - scoped to pages with filters sidebar */
.main-content:has(.filters-sidebar) {
  padding: 2rem 0 3rem;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
}

/* Filters Sidebar */
.filters-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.filters-sidebar form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.filter-section {
  background: white;
  border-radius: 6px;
  border: 1px solid #e5e5e5;
  padding: 1.25rem;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.875rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e5e5e5;
}

.filter-section h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.clear-section {
  font-size: 0.8125rem;
  color: #B33D3F;
  text-decoration: none;
}

.clear-section:hover {
  text-decoration: underline;
}

.filter-list {
  list-style: none;
}

.filter-list li {
  margin-bottom: 0.5rem;
}

.filter-list label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  color: #555;
  cursor: pointer;
}

.filter-list input[type="checkbox"],
.filter-list input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #B33D3F;
  cursor: pointer;
}

.filter-list .count {
  margin-left: auto;
  color: #999;
  font-size: 0.8125rem;
}

/* Category dots */
.filter-list--categories label {
  display: flex;
  align-items: center;
  position: relative;
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 0.25rem;
}

.category-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-list--categories li {
  margin: 0 -1rem 0.5rem -1rem;
  padding: 0 1rem;
  border-radius: 4px;
}

.filter-list--categories li:last-child {
  margin-bottom: 0;
}

.filter-list--categories li:hover {
  background: #f5f5f5;
}

.filter-list--categories li:hover .category-name {
  overflow: visible;
}

/* Topic Accordion */
.filter-section--topics {
  padding-bottom: 0.75rem;
}

.topic-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.topic-category {
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  overflow: hidden;
}

.topic-category-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fafafa;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: #333;
  list-style: none;
}

.topic-category-header::-webkit-details-marker {
  display: none;
}

.topic-category-header:hover {
  background: #f5f5f5;
}

.topic-category-header .category-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.topic-category-header .category-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-category-header .category-badge {
  background: #B33D3F;
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

.topic-category-header .chevron {
  color: #888;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.topic-category[open] .chevron {
  transform: rotate(180deg);
}

.topic-category-content {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.topic-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.25rem 0;
  font-size: 0.9375rem;
  color: #555;
  cursor: pointer;
}

.topic-item:hover {
  color: #333;
}

.topic-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #B33D3F;
  cursor: pointer;
}

/* Select all button */
.select-all-btn {
  background: none;
  border: none;
  color: #B33D3F;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0;
  margin-bottom: 0.25rem;
  font-family: inherit;
}

.select-all-btn:hover {
  text-decoration: underline;
}

/* Date Filter */
.filter-date {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-date label {
  font-size: 0.875rem;
  color: #666;
}

.filter-date input {
  padding: 0.625rem 0.75rem;
  font-size: 0.9375rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-family: inherit;
  outline: none;
}

.filter-date input:focus {
  border-color: #B33D3F;
}

.filter-date .btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  background: #B33D3F;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  margin-top: 0.25rem;
}

.filter-date .btn-small:hover {
  background: #9A3335;
}

/* Filter Breadcrumb (for drill-down) */
.filter-breadcrumb {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f0f0f0;
}

.filter-breadcrumb .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: #B33D3F;
  text-decoration: none;
  margin-bottom: 0.25rem;
}

.filter-breadcrumb .current-category {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #333;
}

/* Archive Callout */
.archive-callout {
  text-align: center;
  background: #fafafa;
}

.archive-callout-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111;
}

.archive-callout-divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 1rem 0;
}

.archive-callout-text {
  font-size: 0.875rem;
  color: #888;
  margin-bottom: 0.75rem;
}

.archive-callout .btn {
  display: flex;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

/* Archive Intro */
.archive-intro {
  margin-bottom: 1.25rem;
}

.archive-intro h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 0.25rem;
}

.archive-intro p {
  font-size: 1rem;
  color: #666;
}

/* Results */
.results-section {
  min-width: 0;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-count {
  font-size: 1.0625rem;
  color: #666;
}

.results-count strong {
  color: #111;
}

.results-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: #666;
}

.results-sort select {
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-family: inherit;
  background: white;
  cursor: pointer;
  outline: none;
}

.results-sort select:focus {
  border-color: #B33D3F;
}

/* Conference Cards */
.conference-card {
  background: white;
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border: 1px solid #e5e5e5;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  min-width: 0;
}

.conference-card:hover {
  border-color: #ddd;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.conference-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.625rem;
}

.conference-date-badge {
  font-size: 0.875rem;
  color: #888;
  text-align: right;
}

.conference-date-badge strong {
  display: block;
  color: #B33D3F;
  font-weight: 500;
}

.conference-date-badge--past strong {
  color: #666;
}

.conference-card h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  color: #111;
  margin-bottom: 0.375rem;
}

.conference-card h3 a {
  color: inherit;
  text-decoration: none;
}

.conference-card h3 a:hover {
  color: #B33D3F;
}

.conference-card .description {
  font-size: 1rem;
  color: #666;
  margin-bottom: 0.875rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.conference-meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.875rem;
  color: #777;
}

.conference-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.conference-meta svg {
  width: 14px;
  height: 14px;
  color: #999;
  flex-shrink: 0;
}

.conference-actions {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid #f0f0f0;
  font-size: 0.9375rem;
}

.conference-actions a {
  color: #666;
  text-decoration: none;
}

.conference-actions a:hover {
  color: #B33D3F;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination a,
.pagination span {
  padding: 0.625rem 1rem;
  border-radius: 4px;
  font-size: 0.9375rem;
  text-decoration: none;
  color: #666;
  transition: all 0.2s;
}

.pagination a:hover {
  background: #e5e5e5;
  color: #333;
}

.pagination .active {
  background: #B33D3F;
  color: white;
}

.pagination .disabled {
  color: #ccc;
  cursor: not-allowed;
}

/* No Results */
.no-results {
  background: white;
  border-radius: 6px;
  border: 1px solid #e5e5e5;
  padding: 4rem 2rem;
  text-align: center;
}

.no-results h3 {
  font-size: 1.25rem;
  color: #111;
  margin-bottom: 0.5rem;
}

.no-results p {
  font-size: 1rem;
  color: #666;
  margin-bottom: 1.5rem;
}

.no-results a {
  color: #B33D3F;
  text-decoration: none;
  font-weight: 500;
}

.no-results a:hover {
  text-decoration: underline;
}

/* Expand Toggle */
.filters-sidebar .expand-toggle {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: none;
  border: none;
  color: #B33D3F;
  font-size: 0.9375rem;
  cursor: pointer;
  padding: 0.5rem 0 0;
  font-family: inherit;
  margin-top: 0;
}

.filters-sidebar .expand-toggle:hover {
  text-decoration: underline;
}

.filters-sidebar .expand-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.filters-sidebar .expand-toggle.expanded svg {
  transform: rotate(180deg);
}

/* Responsive */
@media (max-width: 900px) {
  .main-content:has(.filters-sidebar) {
    grid-template-columns: 1fr;
  }

  .filters-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .filter-section {
    flex: 1;
    min-width: 200px;
  }
}

@media (max-width: 600px) {
  .search-bar {
    flex-direction: column;
  }

  .search-bar .btn-primary {
    width: 100%;
  }

  .filters-sidebar {
    flex-direction: column;
  }

  .filter-section {
    min-width: 100%;
  }

  .conference-card-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .conference-date-badge {
    text-align: left;
  }
}
