/* ==========================================================================
   List pages: search (/festivals/), state, city and culture.
   templates/catalog/{search,state,city,culture}.html, loaded through
   {% block extra_css %}. Everything here is built from the tokens and
   components in site.css (DESIGN.md, "Страницы → Списки"): only how those
   parts sit together on these pages lives in this file.
   ========================================================================== */

/* A heading can carry the visitor's own search words ("matching “…”"), up
   to 100 characters with no space in them: let them break. */
.page-head h1 { overflow-wrap: break-word; }

/* Toolbar under the heading -------------------------------------------------
   The count and the quick date chips share a line, the filters in force sit
   under them, then the filter drawer (folded on a phone, open from 48rem). */
.list-tools { margin-bottom: var(--space-6); }
.list-tools__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  margin-bottom: var(--space-4);
}
.list-tools__line > .result-count,
.list-tools__line > .chips { margin: 0; }
.list-tools > .chips { margin-bottom: var(--space-4); }
.list-tools > :last-child { margin-bottom: 0; }
.list-tools .chip { max-width: 100%; overflow-wrap: anywhere; }   /* a long search word wraps inside its chip */

/* The filter panel. Phone: two selects to a row (filters--compact) and a
   full-width button. Desktop: the search line with the button beside it,
   the four selects under it, and the "Open to sponsors" / "Accepting
   vendors" pair on a line of its own — one group, side by side as space
   allows. */
.filters__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-6);
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
@media (max-width: 47.99rem) {
  .list-filters .filters__actions .btn { flex: 1; }
}
@media (min-width: 64rem) {
  .list-filters { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
  .list-filters .filters__search { grid-row: 1; grid-column: 1 / 5; }
  .list-filters .filters__actions { grid-row: 1; grid-column: 5; }
  .list-filters .filters__actions .btn { width: 100%; }
}

/* Results by month --------------------------------------------------------- */
.month-group .grid { margin-bottom: 0; }
.list-results + .pagination { margin-top: var(--space-7); }
.list-results { margin-bottom: var(--space-6); }

/* "Looking wider?" — after a single result, and inside an empty state. */
.widen { margin: 0 0 var(--space-6); }
.widen__title { margin: 0 0 var(--space-3); color: var(--color-muted); font-weight: 600; }
.widen .chips, .empty__more .chips { margin: 0; }

/* State page ----------------------------------------------------------------
   "Coming up" follows the toolbar closely. (Each band ends without its last
   list's bottom margin: .home-section in site.css.) */
.list-tools + .home-section { padding-top: var(--space-2); }
.list-cultures .tradition-tiles { margin-bottom: var(--space-5); }   /* tags follow */

/* Cities: the li are chips (.chip.chip--option, site.css) from 48rem; on a
   phone they fold back into the compact .city-list columns — one row per
   city, the whole row still the link. */
@media (max-width: 47.99rem) {
  .city-list--chips { columns: 8.5rem 3; column-gap: var(--space-4); }   /* two columns from 320px */
  .city-list--chips .chip {
    display: block;
    min-height: 0;
    padding: var(--space-1) 0;
    border: 0;
    border-radius: 0;
    background: none;
    font: 600 var(--text-base)/1.3 var(--font-body);
  }
}
@media (min-width: 48rem) {
  .city-list--chips { display: flex; flex-wrap: wrap; gap: var(--space-2); columns: auto; }
  .city-list--chips > li { padding-block: 0; }
}

/* Closing link of a list ("More festivals in …", "Search … by month"). */
.list-more { margin-block: var(--space-6) 0; }
