/* BlackItaly – Database page (module AdvancedSearch): facets strip + grid of cards. November 2026. */

:root { --bi-border: #e3e6ea; --bi-muted: #5f6b76; --bi-soft: #f3f6f8; --bi-tag: #e6f1f4; }

.bi-search__intro { max-width: 60rem; color: var(--bi-muted); margin: 0 0 1.5rem; }

/* Search bar */
.bi-search__bar { margin: 0 0 .75rem; }
.bi-search__label { display: block; font-weight: 600; margin-bottom: .4rem; }
.bi-search__row { display: flex; gap: .5rem; max-width: 46rem; }
.bi-search__row input[type="search"] { flex: 1; min-width: 0; font-size: 1.05rem; padding: .7rem 1rem; border: 1px solid var(--bi-border); border-radius: 999px; }
.bi-search__submit { white-space: nowrap; }

/* Advanced form (module form) folded under a summary.
   The theme styles every fieldset and .field as a dashed box (style.css) and forces
   p/ol/ul/li to 1.25rem/2.5rem with !important: both are undone here. */
.bi-advanced { margin: 0 0 2rem; }
.bi-advanced summary { cursor: pointer; color: var(--primary, #237e91); font-weight: 600; width: max-content; }
.bi-advanced__form { margin-top: 1rem; padding: 1.25rem 1.5rem; background: var(--bi-soft); border-radius: 12px; }
.bi-advanced__form fieldset.form-search { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.1rem 1.5rem; width: auto; border: 0; border-radius: 0; padding: 0; margin: 0; }
.bi-advanced__form fieldset.form-search > .field { border: 0; border-radius: 0; padding: 0; margin: 0; min-width: 0; max-width: none; flex: none; }
.bi-advanced__form .field:has(input[name="q"]) { display: none; } /* same as the search bar above */
.bi-advanced__form .field-meta { margin: 0 0 .35rem; }
.bi-advanced__form .field-meta label { display: block; font-size: .9rem; font-weight: 600; }
.bi-advanced__form .inputs { min-width: 0; }
.bi-advanced__form .inputs > label { display: inline-flex; align-items: center; gap: .3rem; margin: .4rem 1rem 0 0; font-size: .95rem; } /* radio buttons */
.bi-advanced__form input[type="radio"] { width: auto; margin: 0; }
.bi-advanced__form .search-form-buttons { margin-top: 1.25rem; display: flex; gap: .5rem; }

/* Chosen selects inside the form */
.bi-advanced__form .chosen-container { width: 100% !important; font-size: .95rem; }
.bi-advanced__form .chosen-container ul, .bi-advanced__form .chosen-container li { font-size: .95rem !important; line-height: 1.35 !important; color: #1f2933 !important; }
.bi-advanced__form .chosen-container-multi .chosen-choices { height: auto !important; min-height: 2.6rem; padding: .25rem .5rem; border: 1px solid var(--bi-border); border-radius: 12px; background: #fff; box-shadow: none; }
.bi-advanced__form .chosen-container-multi .chosen-choices li.search-field input[type="text"] { height: 2rem; margin: 0; font-family: inherit; }
.bi-advanced__form .chosen-container-multi .chosen-choices li.search-choice { margin: .2rem .3rem .2rem 0; padding: .2rem 1.4rem .2rem .55rem; border: 0; border-radius: 999px; background: var(--bi-tag); box-shadow: none; }
.bi-advanced__form .chosen-container-multi .chosen-choices li.search-choice .search-choice-close { top: .45rem; right: .4rem; }
.bi-advanced__form .chosen-container-single .chosen-single { height: 2.6rem; line-height: 2.6rem; padding: 0 0 0 .8rem; border: 1px solid var(--bi-border); border-radius: 12px; background: #fff; box-shadow: none; }
.bi-advanced__form .chosen-container-single .chosen-single div b { background-position: 0 10px; }
.bi-advanced__form .chosen-container .chosen-drop { border-color: var(--bi-border); border-radius: 0 0 12px 12px; }
.bi-advanced__form .chosen-container .chosen-results li { padding: .35rem .6rem; }
.bi-advanced__form .chosen-container .chosen-results li.highlighted { background: var(--primary, #237e91); color: #fff !important; }

/* Period: only the two year boxes (the sliders have no min/max in this config) */
.bi-advanced__form .range-double { margin: 0; gap: 0; }
.bi-advanced__form .range-double .range-sliders { display: none; }
.bi-advanced__form .range-double .range-numerics { flex-wrap: nowrap; gap: .75rem; }
.bi-advanced__form .range-double .range-numeric { flex: 1; display: flex; align-items: center; gap: .4rem; font-size: .9rem; }
.bi-advanced__form .range-double input[type="number"] { display: inline-block; width: 100%; min-width: 0; height: 2.6rem; padding: 0 .6rem; border: 1px solid var(--bi-border); border-radius: 12px; background: #fff; }

/* Results area */
.bi-results-wrapper { display: flex; gap: 2.5rem; align-items: flex-start; }
.bi-results { flex: 1; min-width: 0; }
.bi-results__count { font-size: 1.4rem; font-weight: 700; color: var(--primary-dark, #096477); margin: 0 0 .5rem; }
.search-results-header, .search-results-footer { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; font-size: .9rem; margin-bottom: 1rem; }
.search-results-header .search-filters { width: 100%; }
.search-results-count, .search-results-count-total { display: none !important; } /* the module count: replaced by .bi-results__count */

/* Facet items (dropdowns of the strip) */
.facet-item a span { display: inline; }
.facet-item a:hover { color: var(--primary, #237e91); text-decoration: underline; }
.facet-item a::before { display: none !important; } /* module: FontAwesome square glyph, often unavailable */
.facet-items { list-style: none; margin: .4rem 0 0; padding: 0; }
.bi-facets-strip .facet-item { font-size: .95rem !important; line-height: 1.45 !important; padding: .2rem 0; }
.facet-item a, .facet-item label { color: inherit; text-decoration: none; display: block; }
.facet-item.active { font-weight: 700; color: var(--primary, #237e91); }
.facet-item .count { color: var(--bi-muted); font-weight: 400; }
.facet-see-more button { background: none; border: 0; padding: 0; color: var(--primary, #237e91); font-size: .85rem; cursor: pointer; }
.facets-actions { margin: 0 0 .5rem; }
.facets-actions .button { font-size: .8rem; padding: .3rem .8rem; }
.facet-range-double { font-size: .85rem; }
.facet-range-double input[type="number"] { width: 5rem; }

/* Facets strip: one pill-shaped dropdown per facet */
.bi-facets-strip { margin: 0 0 1.5rem; }
.bi-facets-strip #search-facets h3 { display: none; }
.bi-facets-strip .facets-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.bi-facets-strip .facet { position: relative; font-size: 1rem !important; line-height: 1.4 !important; }
.bi-facets-strip .facet h4, .bi-facets-strip .facet-button { margin: 0; font-size: .9rem; font-weight: 600; padding: .45rem .9rem; border: 1px solid var(--bi-border); border-radius: 999px; background: #fff; cursor: pointer; color: inherit; }
/* module search.css: `.facets .facet-button:hover { border-radius: 0; border-bottom: 1px inset }` made the pill square */
.bi-facets-strip .facets .facet-button:hover, .bi-facets-strip .facets .facet-button:focus { border: 1px solid var(--primary-dark, #096477); border-radius: 999px; box-shadow: none; }
.bi-facets-strip .facets .facet-button::after { float: none; display: inline-block; margin-left: .4rem; vertical-align: middle; }
/* dropdown; the ::after of the hovered facet bridges the gap, so the pointer reaches the list without losing :hover */
.bi-facets-strip .facet-elements { display: none; position: absolute; z-index: 20; top: calc(100% + .35rem); left: 0; min-width: 18rem; max-height: 22rem; overflow: auto; background: #fff; border: 1px solid var(--bi-border); border-radius: 12px; padding: .75rem 1rem; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.bi-facets-strip .facet:hover::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: .5rem; }
.bi-facets-strip .facet:hover .facet-elements, .bi-facets-strip .facet:focus-within .facet-elements { display: block; }
.bi-facets-strip .facets-actions { display: inline-block; margin: 0 0 .5rem; }
.bi-facets-strip .facet-see-more { margin-top: .25rem; }

/* Cards */
.bi-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.bi-cards--grid { grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); }
.bi-card { border: 1px solid var(--bi-border); border-radius: 14px; padding: 1rem 1.25rem; background: #fff; }
.bi-card__head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.bi-card__title { font-size: 1.15rem; margin: 0; line-height: 1.3; }
.bi-card__period { white-space: nowrap; color: var(--bi-muted); font-size: .9rem; }
.bi-card__tags { margin: .4rem 0 .5rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.bi-tag { display: inline-block; font-size: .8rem; padding: .15rem .6rem; border-radius: 999px; background: var(--bi-tag); }
.bi-tag--occupation { background: #f6efe0; }
.bi-tag a { color: inherit; text-decoration: none; }
.bi-card__meta { margin: 0; font-size: .9rem; display: flex; flex-wrap: wrap; gap: .2rem 1.5rem; }
.bi-card__meta div { display: flex; gap: .4rem; }
.bi-card__meta dt { color: var(--bi-muted); }
.bi-card__meta dt::after { content: ":"; }
.bi-card__meta dd { margin: 0; }
.bi-card__text { margin: .6rem 0 0; font-size: .92rem; color: #2b333b; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* Pagination of the module */
.search-results-footer nav, .search-results-header nav { display: inline-block; }

@media (max-width: 900px) {
    .bi-results-wrapper { flex-direction: column; }
    .bi-cards--grid { grid-template-columns: 1fr; }
}
