:root {
  --aw-transition-speed: 0.215s;
  --aw-filter-padding: 0.75rem;
  --aw-filter-active-bg: #f8f9fa;
}

.highlighted {
  font-weight: bolder;
}

/* ===================================================
   Search page — results table
   =================================================== */
.aw-results-table {
  table-layout: fixed;
}
.aw-date-col {
  width: 130px;
  min-width: 130px;
  max-width: 130px;
  white-space: nowrap;
}
.aw-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.aw-filter-summary {
  line-height: 1.6;
}
.aw-doc-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.25rem;
}
.aw-toggle-embed {
  padding: 0;
  text-decoration: none;
}
.aw-embed-iframe {
  width: 100%;
  height: 350px;
  border: 1px solid #ccc;
  border-radius: 6px;
}
.aw-doc-col {
  width: 33%;
  overflow-wrap: break-word;
}
.aw-type-col {
  width: 13%;
  overflow-wrap: break-word;
}
.aw-place-col {
  width: 30%;
}
.aw-state-col {
  width: 9%;
  white-space: nowrap;
}

/* ===================================================
   Search page — mobile stacked result list
   =================================================== */
.aw-result-item {
  padding: 0.625rem 0;
  border-bottom: 1px solid #dee2e6;
}

.aw-result-item:last-child {
  border-bottom: none;
}

.aw-result-alt {
  background-color: #f8f9fa;
}

/* icon inside the search box */
.aw-search-help {
  position: absolute;
  right: 2.25rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #6c757d;
}

/* Keep search input + submit button visually merged as one control. */
#search-form .input-group > .aw-search-input-wrapper > .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 0;
}

#search-form .input-group > .aw-search-submit {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: 0;
}

/* ===================================================
   Search page — filter rail (left column)
   =================================================== */
.aw-filter-rail {
  position: sticky;
  top: 1rem;
  align-self: flex-start; /* keeps sticky working inside a flex/grid row */
}

/* Accordion styling — compact, visually light, +/× toggle icons */
.aw-filter-rail .accordion-button {
  padding: 0.5rem var(--aw-filter-padding);
  font-size: 0.875rem;
  font-weight: 600;
}

.aw-filter-rail .accordion-button:not(.collapsed) {
  background-color: var(--aw-filter-active-bg);
  color: inherit;
  box-shadow: none;
}

/* Replace Bootstrap's default chevron with a + that rotates to × */
.aw-filter-rail .accordion-button::after {
  content: "+";
  background-image: none; /* remove Bootstrap chevron SVG */
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1;
  width: auto;
  height: auto;
  transform: rotate(0deg);
  transition: transform var(--aw-transition-speed) ease;
}

.aw-filter-rail .accordion-button:not(.collapsed)::after {
  transform: rotate(45deg);
}

.aw-filter-rail .accordion-body {
  padding: var(--aw-filter-padding);
}

/* Make document type dropdown toggle use the same chevron style as form-select. */
.aw-filter-rail #filter-doc-type-toggle.dropdown-toggle {
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
}

.aw-filter-rail #filter-doc-type-toggle.dropdown-toggle::after {
  display: none;
}

/* Inactive doc-type toggle: match form-control border (#ced4da) */
.aw-filter-rail #filter-doc-type-toggle.btn-outline-secondary {
  border-color: #ced4da;
  color: #495057;
}

/* Date preset toggle — inactive labels blend with form-control border (#ced4da);
   active (checked) label keeps brand primary fill. */
.aw-date-preset-group .btn-outline-primary {
  border-color: #ced4da;
  color: #495057;
}

.aw-date-preset-group .btn-outline-primary.active,
.aw-date-preset-group .btn-check:checked + .btn-outline-primary {
  border-color: #003049;
  background-color: #003049;
  color: #fff;
}

/* Hover only on unchecked labels — Bootstrap 5 btn-check never adds .active to the label,
   so :not(.active) would always match. Use the sibling selector to track the input state. */
.aw-date-preset-group .btn-check:not(:checked) + .btn-outline-primary:hover {
  background-color: #e9ecef;
  color: #212529;
  border-color: #adb5bd;
}

/* Reset-filters link */
.aw-reset-filters {
  font-size: 0.8125rem;
}

/* Mobile: filter toggle button shown only below lg */
.aw-filter-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

@media (max-width: 991.98px) {
  .aw-filter-rail {
    position: static; /* disable sticky on mobile */
  }

  .aw-filter-toggle {
    display: inline-flex;
    color: #6c757d;
    background-color: #fff;
    border-color: #ced4da;
  }

  .aw-filter-toggle:hover,
  .aw-filter-toggle:active {
    color: #495057;
    background-color: #fff;
    border-color: #adb5bd;
  }

  .aw-filter-toggle:focus,
  .aw-filter-toggle:focus-visible {
    color: #495057;
    background-color: #fff;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  }

  /* Speed up Bootstrap's default collapse animation (0.35s → variable) */
  #filter-panel.collapsing {
    transition: height var(--aw-transition-speed) ease;
  }
}
