/**
 * Iddocca Search — front-end styles.
 *
 * Built on Bootstrap Italia 1.3.8 (Bootstrap 4) which ships with the
 * iddocca-2022 theme.
 *
 * Palette letta da static/css/iddocca.min.css, il foglio di stile che il sito
 * carica davvero. Attenzione: il tema deriva da un template comunale blu ed e'
 * stato ri-brandizzato, quindi la in `iddocca.css` (non minificato) le classi
 * .bg-blu / .bg-bluscuro puntano a un blu che nel file minificato e' rimappato
 * su #4d4a49 e #f3aa32. Quel blu e' colore morto e non va usato.
 *
 *   #4d4a49  grigio caldo scuro — header, footer, titoli, pulsanti, icone
 *                                 (183 occorrenze: il colore identitario)
 *   #796c31  oro scuro          — hover dei pulsanti, sottotitoli di sezione
 *   #f3aa32  oro                — accento, hover di .btn-cerca in header
 *   #4e7e5b  verde              — etichette tipologia, link "leggi tutto"
 *   #f3aa32  oro                — alone del focus (abbinato a #4d4a49:
 *                                 l'arancio #ff8c00 del tema da solo e' 2.33:1
 *                                 e non supera il 3:1 richiesto da SC 1.4.11)
 *   #51825f  verde scuro        — bordo pagina corrente nel paginatore
 *   #555555  testo corrente
 *   #5a6772  testo secondario
 *   #e5e5e5 / #d8d8d8 / #f2f2f2  grigi di bordo e superficie
 *
 * Plain hex values are used throughout (rather than custom properties) to
 * match the browser support baseline of the rest of the theme.
 */

/* ==========================================================================
   1. Search modal
   ========================================================================== */

.idd-search-modal .modal-content {
	border: 0;
	border-radius: 0;
	background-color: #ffffff;
}

.idd-search-modal__header {
	border: 0;
	border-bottom: 1px solid #e5e5e5;
	padding: 24px 0;
	display: block;
	background-color: #ffffff;
}

.idd-search-modal__title {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
	color: #4d4a49;
	line-height: 1.2;
}

.idd-search-modal__close {
	opacity: 1;
	padding: 4px;
	border: 0;
	background: none;
	cursor: pointer;
	line-height: 0;
}

.idd-search-modal__close .icon {
	width: 32px;
	height: 32px;
	fill: #4d4a49;
	transition: fill 0.2s ease;
}

.idd-search-modal__close:hover .icon,
.idd-search-modal__close:focus .icon {
	fill: #4e7e5b;
}

.idd-search-modal__body {
	padding: 32px 0 64px;
}

/* --- Search form ------------------------------------------------------- */

.idd-search-form__field {
	margin-bottom: 28px;
}

.idd-search-form__label {
	display: block;
	font-size: 0.9rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #5a6772;
	margin-bottom: 10px;
}

.idd-search-form__control {
	position: relative;
	display: flex;
	align-items: center;
	border-bottom: 2px solid #4d4a49;
	/* Allows the input to shrink instead of pushing the button out of view. */
	min-width: 0;
}

.idd-search-form__icon {
	position: absolute;
	left: 0;
	width: 28px;
	height: 28px;
	fill: #4d4a49;
	pointer-events: none;
}

.idd-search-form__input.form-control {
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: #4d4a49;
	font-size: 1.5rem;
	font-weight: 300;
	height: 56px;
	padding: 0 44px 0 40px;
	/* `min-width: 0` is required so the field can shrink inside the flex row. */
	flex: 1 1 auto;
	min-width: 0;
	width: auto;
}

.idd-search-form__input.form-control:focus {
	outline: 2px solid #4d4a49;
	outline-offset: 2px;
	box-shadow: 0 0 0 5px rgba(243, 170, 50, 0.45);
	box-shadow: none;
	background: transparent;
}

.idd-search-form__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}

.idd-search-form__input::placeholder {
	color: #5a6772;
	opacity: 1;
}

.idd-search-form__clear {
	position: absolute;
	right: 0;
	border: 0;
	background: none;
	padding: 4px;
	line-height: 0;
	cursor: pointer;
}

.idd-search-form__clear .icon {
	width: 24px;
	height: 24px;
	fill: #5a6772;
}

.idd-search-form__clear:hover .icon,
.idd-search-form__clear:focus .icon {
	fill: #4d4a49;
}

.idd-search-form__help {
	display: block;
	margin-top: 8px;
	color: #5a6772;
	font-size: 0.8125rem;
}

/* --- Type chips -------------------------------------------------------- */

.idd-search-form__filters {
	border: 0;
	padding: 0;
	margin: 0 0 28px;
}

.idd-search-form__legend {
	font-size: 0.8125rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #5a6772;
	margin-bottom: 12px;
	width: auto;
	float: none;
}

.idd-search-chips {
	display: flex;
	flex-wrap: wrap;
	margin: 0 -4px;
}

.idd-search-chip {
	position: relative;
	margin: 0 4px 8px;
}

.idd-search-chip__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}

.idd-search-chip__label {
	display: inline-block;
	margin: 0;
	padding: 8px 18px;
	border: 1px solid #4d4a49;
	border-radius: 20px;
	background-color: #ffffff;
	color: #4d4a49;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
	user-select: none;
}

.idd-search-chip__label:hover {
	background-color: #e5e5e5;
}

.idd-search-chip__input:checked + .idd-search-chip__label {
	background-color: #4d4a49;
	color: #ffffff;
}

.idd-search-chip__input:focus + .idd-search-chip__label {
	outline: 2px solid #4d4a49;
	outline-offset: 2px;
	box-shadow: 0 0 0 5px rgba(243, 170, 50, 0.45);
}

/* --- Submit ------------------------------------------------------------ */

.idd-search-form__actions {
	margin-bottom: 8px;
}

.idd-search-form__submit.btn-primary {
	background-color: #4d4a49;
	border-color: #4d4a49;
	font-weight: 600;
	padding: 12px 32px;
	display: inline-flex;
	align-items: center;
}

.idd-search-form__submit.btn-primary:hover,
.idd-search-form__submit.btn-primary:focus {
	background-color: #796c31;
	border-color: #796c31;
}

.idd-search-form__submit .icon {
	width: 20px;
	height: 20px;
	fill: #ffffff;
	margin-right: 8px;
}

/* --- Live suggestions -------------------------------------------------- */

.idd-search-suggestions {
	margin-top: 8px;
	border-top: 1px solid #e5e5e5;
	padding-top: 16px;
}

.idd-search-suggestions__heading {
	font-size: 0.8125rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #5a6772;
	margin-bottom: 12px;
}

.idd-search-suggestions__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.idd-search-suggestion {
	border-bottom: 1px solid #e5e5e5;
}

.idd-search-suggestion:last-child {
	border-bottom: 0;
}

.idd-search-suggestion__link {
	display: block;
	padding: 14px 8px;
	text-decoration: none;
	color: #4d4a49;
	transition: background-color 0.15s ease;
}

.idd-search-suggestion__link:hover,
.idd-search-suggestion__link:focus,
.idd-search-suggestion.is-active .idd-search-suggestion__link {
	background-color: #e5e5e5;
	text-decoration: none;
	outline: none;
}

.idd-search-suggestion__type {
	display: inline-block;
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #4e7e5b;
	margin-bottom: 2px;
}

.idd-search-suggestion__date,
.idd-search-suggestion__metainfo {
	font-size: 0.6875rem;
	color: #5a6772;
	margin-left: 8px;
	text-transform: none;
	letter-spacing: 0;
	font-weight: 400;
}

.idd-search-suggestion__title {
	display: block;
	font-size: 1rem;
	font-weight: 600;
	color: #4d4a49;
	margin: 0;
	line-height: 1.35;
}

.idd-search-suggestion__snippet {
	display: block;
	font-size: 0.8125rem;
	color: #5a6772;
	margin: 4px 0 0;
	line-height: 1.4;
}

.idd-search-suggestions__all {
	display: inline-flex;
	align-items: center;
	margin-top: 16px;
	font-weight: 600;
	color: #4d4a49;
}

.idd-search-suggestions__empty {
	padding: 16px 0;
	color: #5a6772;
}

.idd-search-suggestions mark,
.idd-search-result mark {
	background-color: #ffe3b0;
	color: inherit;
	padding: 0 2px;
	border-radius: 2px;
}

/* ==========================================================================
   2. Results page
   ========================================================================== */

.idd-search-page {
	padding-bottom: 64px;
}

.idd-search-page__breadcrumb {
	padding: 16px 0 0;
}

.idd-search-page__intro {
	padding: 8px 0 32px;
}

.idd-search-page__title {
	font-size: 2.25rem;
	font-weight: 700;
	color: #4d4a49;
	margin-bottom: 24px;
}

.idd-search-page__summary {
	margin: 16px 0 0;
	color: #4d4a49;
	font-size: 1.0625rem;
}

.idd-search-page__summary em {
	font-style: normal;
	color: #4d4a49;
}

/* --- Inline search form ------------------------------------------------ */

.idd-search-form--inline .idd-search-form__control {
	border: 1px solid #4d4a49;
	border-radius: 4px;
	background-color: #ffffff;
	padding-left: 12px;
	max-width: 680px;
}

.idd-search-form--inline .idd-search-form__icon {
	left: 12px;
	width: 24px;
	height: 24px;
}

.idd-search-form--inline .idd-search-form__input.form-control {
	font-size: 1.0625rem;
	height: 48px;
	padding: 0 12px 0 40px;
}

.idd-search-form--inline .idd-search-form__submit.btn-primary {
	border-radius: 0 3px 3px 0;
	padding: 12px 24px;
	height: 48px;
	flex: 0 0 auto;
	white-space: nowrap;
}

/* --- Filter sidebar ---------------------------------------------------- */

.idd-search-filters {
	margin-bottom: 32px;
}

.idd-search-filters__toggle {
	width: 100%;
	margin-bottom: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	border-color: #4d4a49;
	color: #4d4a49;
}

.idd-search-filters__toggle .icon {
	width: 20px;
	height: 20px;
	fill: #4d4a49;
	margin-right: 8px;
}

.idd-search-filters__badge {
	margin-left: 8px;
	background-color: #4d4a49;
}

.idd-search-filters__form {
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	padding: 20px;
	background-color: #ffffff;
}

.idd-search-filters__head {
	border-bottom: 2px solid #4d4a49;
	padding-bottom: 12px;
	margin-bottom: 20px;
}

.idd-search-filters__title {
	display: flex;
	align-items: center;
	font-size: 1.125rem;
	font-weight: 700;
	color: #4d4a49;
	margin: 0;
}

.idd-search-filters__title .icon {
	width: 22px;
	height: 22px;
	fill: #4d4a49;
	margin-right: 8px;
}

.idd-search-facet {
	border: 0;
	padding: 0;
	margin: 0 0 24px;
}

.idd-search-facet__legend {
	font-size: 0.8125rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #4d4a49;
	margin-bottom: 10px;
	width: auto;
	float: none;
}

.idd-search-facet__options--scroll {
	max-height: 260px;
	overflow-y: auto;
	padding-right: 4px;
}

.idd-search-facet__option {
	padding: 0;
	margin-bottom: 6px;
	min-height: 0;
}

.idd-search-facet__option input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.idd-search-facet__option label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: relative;
	padding: 4px 0 4px 30px;
	margin: 0;
	cursor: pointer;
	color: #4d4a49;
	font-size: 0.9375rem;
	line-height: 1.4;
}

.idd-search-facet__option label::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	margin-top: -9px;
	width: 18px;
	height: 18px;
	border: 2px solid #5a6772;
	border-radius: 3px;
	background-color: #ffffff;
	box-sizing: border-box;
}

.idd-search-facet__option input[type="checkbox"]:checked + label::before {
	background-color: #4d4a49;
	border-color: #4d4a49;
}

.idd-search-facet__option input[type="checkbox"]:checked + label::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 50%;
	margin-top: -5px;
	width: 6px;
	height: 10px;
	border: solid #ffffff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.idd-search-facet__option input[type="checkbox"]:focus + label::before {
	outline: 2px solid #4d4a49;
	outline-offset: 2px;
	box-shadow: 0 0 0 5px rgba(243, 170, 50, 0.45);
}

.idd-search-facet__label {
	flex: 1 1 auto;
	padding-right: 8px;
}

.idd-search-facet__count {
	flex: 0 0 auto;
	font-size: 0.8125rem;
	font-weight: 600;
	color: #5a6772;
	background-color: #e5e5e5;
	border-radius: 10px;
	padding: 1px 8px;
	min-width: 28px;
	text-align: center;
}

/*
 * The `.form-group` class is deliberately NOT used on these fields: Bootstrap
 * Italia styles `.form-group label` as an absolutely positioned floating
 * label, which would overlap the date input.
 */
.idd-search-facet__date {
	margin-bottom: 12px;
}

.idd-search-facet__date label {
	position: static;
	display: block;
	font-size: 0.8125rem;
	font-weight: 600;
	color: #5a6772;
	margin-bottom: 4px;
	line-height: 1.3;
	transform: none;
	cursor: default;
}

.idd-search-facet__date .form-control {
	height: 40px;
	border: 1px solid #d8d8d8;
	border-radius: 4px;
	background-color: #ffffff;
	color: #4d4a49;
	font-size: 0.9375rem;
	padding: 0 10px;
}

.idd-search-filters__actions .btn-primary {
	background-color: #4d4a49;
	border-color: #4d4a49;
	font-weight: 600;
	padding: 10px 16px;
}

.idd-search-filters__actions .btn-primary:hover,
.idd-search-filters__actions .btn-primary:focus {
	background-color: #796c31;
	border-color: #796c31;
}

.idd-search-filters__reset {
	color: #4d4a49;
	font-weight: 600;
	margin-top: 8px;
	text-decoration: underline;
}

/* --- Toolbar ----------------------------------------------------------- */

.idd-search-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid #e5e5e5;
	padding-bottom: 12px;
	margin-bottom: 8px;
}

.idd-search-toolbar__count {
	margin: 0;
	color: #5a6772;
	font-size: 0.9375rem;
	font-weight: 600;
}

.idd-search-toolbar__sort {
	display: flex;
	align-items: center;
	margin: 0;
}

.idd-search-toolbar__sort label {
	margin: 0 8px 0 0;
	font-size: 0.875rem;
	color: #5a6772;
	font-weight: 600;
	white-space: nowrap;
}

.idd-search-toolbar__sort .form-control {
	height: 38px;
	width: auto;
	min-width: 170px;
	border: 1px solid #d8d8d8;
	border-radius: 4px;
	background-color: #ffffff;
	color: #4d4a49;
	font-size: 0.875rem;
	padding: 0 8px;
}

/* --- Active filter chips ----------------------------------------------- */

.idd-search-active {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 12px 0 4px;
}

.idd-search-active__title {
	font-size: 0.8125rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #5a6772;
	margin-right: 10px;
}

.idd-search-active__chip {
	display: inline-flex;
	align-items: center;
	background-color: #e5e5e5;
	border: 1px solid #d8d8d8;
	border-radius: 16px;
	padding: 4px 10px 4px 12px;
	margin: 0 6px 6px 0;
	color: #4d4a49;
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.idd-search-active__chip:hover,
.idd-search-active__chip:focus {
	background-color: #4d4a49;
	border-color: #4d4a49;
	color: #ffffff;
	text-decoration: none;
}

.idd-search-active__chip .icon {
	width: 14px;
	height: 14px;
	fill: #5a6772;
	margin-left: 6px;
}

.idd-search-active__chip:hover .icon,
.idd-search-active__chip:focus .icon {
	fill: #ffffff;
}

/* --- Result list ------------------------------------------------------- */

.idd-search-results {
	list-style: none;
	margin: 0;
	padding: 0;
}

.idd-search-result {
	border-bottom: 1px solid #e5e5e5;
	padding: 24px 0;
}

.idd-search-result:last-child {
	border-bottom: 0;
}

.idd-search-result__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin-bottom: 8px;
}

.idd-search-result__type {
	display: inline-flex;
	align-items: center;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #4e7e5b;
	margin-right: 12px;
}

.idd-search-result__type .icon {
	width: 16px;
	height: 16px;
	fill: #4e7e5b;
	margin-right: 5px;
}

.idd-search-result__date {
	font-size: 0.8125rem;
	color: #5a6772;
	margin-right: 12px;
}

.idd-search-result__badge {
	display: inline-block;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.5px;
	color: #5a6772;
	background-color: #e5e5e5;
	border-radius: 3px;
	padding: 2px 7px;
	margin-right: 6px;
	text-transform: uppercase;
}

.idd-search-result__title {
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 8px;
}

.idd-search-result__title a {
	color: #4d4a49;
	text-decoration: none;
}

.idd-search-result__title a:hover,
.idd-search-result__title a:focus {
	color: #4e7e5b;
	text-decoration: underline;
}

.idd-search-result__snippet {
	margin: 0;
	color: #555555;
	font-size: 0.9375rem;
	line-height: 1.55;
}

.idd-search-result__source {
	margin: 8px 0 0;
	font-size: 0.8125rem;
}

.idd-search-result__source a {
	display: inline-flex;
	align-items: center;
	color: #5a6772;
	text-decoration: underline;
}

.idd-search-result__source a:hover,
.idd-search-result__source a:focus {
	color: #4d4a49;
}

.idd-search-result__source .icon {
	width: 14px;
	height: 14px;
	fill: currentColor;
	margin-right: 5px;
}

/* --- Empty state ------------------------------------------------------- */

.idd-search-empty {
	text-align: center;
	padding: 48px 16px;
	border: 1px dashed #d8d8d8;
	border-radius: 4px;
	background-color: #f2f2f2;
}

.idd-search-empty__icon {
	width: 48px;
	height: 48px;
	fill: #d8d8d8;
	margin-bottom: 16px;
}

.idd-search-empty__title {
	font-size: 1.375rem;
	font-weight: 700;
	color: #4d4a49;
	margin-bottom: 12px;
}

.idd-search-empty__text {
	color: #5a6772;
	margin-bottom: 8px;
}

.idd-search-empty__tips {
	display: inline-block;
	text-align: left;
	color: #5a6772;
	margin: 0 0 20px;
	padding-left: 20px;
}

.idd-search-empty__tips li {
	margin-bottom: 4px;
}

/* --- Pagination -------------------------------------------------------- */

.idd-search-pagination {
	margin-top: 32px;
	display: flex;
}

.idd-search-pagination .pagination {
	margin: 0;
	flex-wrap: wrap;
	justify-content: center;
}

.idd-search-pagination .page-item {
	margin: 0 2px 4px;
	list-style: none;
}

.idd-search-pagination .page-link {
	color: #4d4a49;
	border: 1px solid transparent;
	border-radius: 4px;
	font-weight: 600;
	padding: 8px 14px;
	display: inline-flex;
	align-items: center;
	background-color: transparent;
	text-decoration: none;
}

.idd-search-pagination .page-link:hover,
.idd-search-pagination .page-link:focus {
	background-color: #e5e5e5;
	border-color: #e5e5e5;
	color: #4d4a49;
}

.idd-search-pagination .page-item.active .page-link,
.idd-search-pagination .page-link.current {
	background-color: #4d4a49;
	border-color: #4d4a49;
	color: #ffffff;
}

.idd-search-pagination .page-link .icon {
	width: 18px;
	height: 18px;
	fill: #4d4a49;
}

.idd-search-pagination .page-link.dots:hover {
	background-color: transparent;
	border-color: transparent;
}

/* ==========================================================================
   3. Responsive
   ========================================================================== */

@media (min-width: 768px) {

	/* The sidebar filter form is always visible from tablet up, regardless of
	   the Bootstrap `collapse` class used for the mobile toggle. */
	.idd-search-filters__form.collapse {
		display: block !important;
		height: auto !important;
		visibility: visible !important;
	}
}

@media (min-width: 992px) {

	.idd-search-page__aside .idd-search-filters__form {
		position: sticky;
		top: 24px;
	}

	.idd-search-modal__title {
		font-size: 1.75rem;
	}

	.idd-search-form__input.form-control {
		font-size: 2rem;
		height: 64px;
	}

	.idd-search-form__icon {
		width: 32px;
		height: 32px;
	}
}

@media (max-width: 767.98px) {

	.idd-search-modal__body {
		padding: 24px 0 48px;
	}

	.idd-search-modal__title {
		font-size: 1.25rem;
	}

	.idd-search-form__input.form-control {
		font-size: 1.125rem;
		height: 48px;
		padding-left: 34px;
	}

	.idd-search-form__icon {
		width: 22px;
		height: 22px;
	}

	/*
	 * Full width only inside the modal, where the button sits on its own row.
	 * In the inline form the button shares a flex row with the input, so it
	 * must keep its intrinsic width.
	 */
	.idd-search-modal .idd-search-form__submit.btn-primary {
		width: 100%;
		justify-content: center;
	}

	.idd-search-page__title {
		font-size: 1.625rem;
	}

	.idd-search-form--inline .idd-search-form__control {
		flex-wrap: nowrap;
	}

	.idd-search-form--inline .idd-search-form__submit.btn-primary {
		width: auto;
		flex: 0 0 auto;
		padding: 12px 14px;
		white-space: nowrap;
	}

	.idd-search-toolbar {
		flex-direction: column;
		align-items: flex-start;
	}

	.idd-search-toolbar__sort {
		margin-top: 12px;
		width: 100%;
	}

	.idd-search-toolbar__sort .form-control {
		flex: 1 1 auto;
		min-width: 0;
	}

	.idd-search-result__title {
		font-size: 1.0625rem;
	}

	.idd-search-suggestion__link {
		padding: 12px 4px;
	}
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {

	.idd-search-chip__label,
	.idd-search-suggestion__link,
	.idd-search-active__chip,
	.idd-search-modal__close .icon {
		transition: none;
	}
}
