/*
 * Sothra Search — motore di ricerca
 *
 * Portato dal tema PoeTheme senza cambiare il disegno. Non dipende da Tailwind
 * né da nessuna classe del tema: l'unica variabile che usa (--st-line) è
 * dichiarata qui sotto con un valore di ripiego, così il foglio sta in piedi
 * da solo e un tema può ridefinirla per ritingere i bordi.
 *
 * In coda al file c'è il solo blocco davvero nuovo: l'adattamento da Lucide
 * (SVG) a FontAwesome (glifi di un font).
 */

.sothra-search,
.sothra-active-filters {
  --st-line: var(--sothra-line-color, #e4e9ec);
}

/* -----------------------------------------------------------------------------
 * Motore di ricerca — variante hero
 * -------------------------------------------------------------------------- */
.sothra-search {
  position: relative;
}

.sothra-search--hero {
  margin-top: 1.75rem;
}

.sothra-search__bar {
  position: relative;
  background: #fff;
  border-radius: 40px;
  box-shadow: 0 8px 30px rgba(10, 40, 55, 0.28);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.375rem 0.375rem 1.375rem;
}

.sothra-search__bar:focus-within {
  box-shadow: 0 8px 30px rgba(10, 40, 55, 0.28), 0 0 0 3px rgba(61, 141, 196, 0.35);
}

.sothra-search__bar-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: #8a99a3;
  flex: none;
}

.sothra-search__input {
  border: 0;
  background: none;
  padding: 0.75rem 0;
  font-size: 1rem;
  color: #1c3548;
  font-weight: 500;
  flex: 1 1 auto;
  min-width: 0;
  appearance: none;
}

.sothra-search__input::placeholder {
  color: #9aa8b1;
  font-weight: 400;
}

.sothra-search__input:focus {
  outline: none;
}

/* La X che svuota il campo: compare solo quando c'è qualcosa da svuotare. */
.sothra-search__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: #eef1f3;
  color: #6b7c88;
  cursor: pointer;
  flex: none;
}

.sothra-search__clear:hover,
.sothra-search__clear:focus-visible {
  background: #dde4e8;
  color: #1c3548;
}

.sothra-search__clear i {
  width: 0.875rem;
  height: 0.875rem;
}

.sothra-search__submit {
  background: #3d8dc4;
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.875rem 1.875rem;
  border-radius: 32px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex: none;
}

.sothra-search__submit:hover,
.sothra-search__submit:focus-visible {
  background: #2f6f9e;
}

.sothra-search__submit-icon {
  width: 1.125rem;
  height: 1.125rem;
}

/* Pannello ricerca avanzata */
.sothra-search__advanced-bar {
  margin-top: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sothra-search__advanced-button {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 20px;
  padding: 0.4375rem 0.9375rem;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
}

.sothra-search__advanced-button:hover,
.sothra-search__advanced-button:focus-visible,
.sothra-search__advanced-button[aria-expanded='true'] {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.sothra-search__advanced-icon {
  width: 0.9375rem;
  height: 0.9375rem;
}

/* Contatore dei filtri applicati, sul pulsante che apre il pannello. */
.sothra-search__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.3125rem;
  border-radius: 999px;
  background: #7cb93a;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
}

.sothra-search__filters-button .sothra-search__count {
  background: #3d8dc4;
}

.sothra-search__chevron {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s ease;
}

.sothra-search__advanced-button.is-open .sothra-search__chevron {
  transform: rotate(180deg);
}

.sothra-search__advanced {
  margin-top: 0.875rem;
  border-radius: 16px;
  padding: 1rem 1.125rem;
  display: grid;
  gap: 1rem;
}

/* Il `display` dichiarato qui sopra batte il `display:none` che lo user agent
   applica a [hidden]: senza questa regola il pannello non si chiude mai. */
.sothra-search__advanced[hidden],
.sothra-search__count[hidden],
.sothra-search__clear[hidden] {
  display: none;
}

.sothra-search__advanced-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sothra-search__advanced-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
}

.sothra-search__advanced-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: none;
  color: #fff;
  cursor: pointer;
  flex: none;
}

.sothra-search__advanced-close:hover,
.sothra-search__advanced-close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

.sothra-search__advanced-close i {
  width: 0.9375rem;
  height: 0.9375rem;
}

.sothra-search__groups {
  display: grid;
  gap: 1.125rem;
}

.sothra-search__advanced--compact .sothra-search__advanced-title {
  color: #7a8a95;
}

.sothra-search__advanced--compact .sothra-search__advanced-close {
  border-color: #cdd8de;
  color: #1c3548;
}

.sothra-search__advanced--compact .sothra-search__advanced-close:hover,
.sothra-search__advanced--compact .sothra-search__advanced-close:focus-visible {
  background: #f0f6fa;
  border-color: #3d8dc4;
  color: #3d8dc4;
}

.sothra-search__advanced--hero {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.sothra-search__advanced--compact {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  z-index: 45;
  background: #fff;
  border: 1px solid var(--st-line, #e4e9ec);
  box-shadow: 0 18px 50px rgba(10, 40, 55, 0.18);
}

.sothra-search__group {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sothra-search__group-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  padding: 0;
}

.sothra-search__advanced--compact .sothra-search__group-title {
  color: #7a8a95;
}

.sothra-search__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4375rem;
}

/* La chip è la label: la checkbox resta operabile ma fuori dal flusso visivo. */
.sothra-search__chip-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.sothra-search__chip {
  font-size: 0.78125rem;
  font-weight: 500;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  padding: 0.3125rem 0.75rem;
  cursor: pointer;
  display: inline-block;
}

.sothra-search__chip:hover {
  background: rgba(255, 255, 255, 0.15);
}

.sothra-search__chip-input:checked + .sothra-search__chip {
  background: #fff;
  color: #1c3548;
  border-color: #fff;
  font-weight: 700;
}

.sothra-search__chip-input:focus-visible + .sothra-search__chip {
  outline: 3px solid rgba(255, 255, 255, 0.65);
  outline-offset: 2px;
}

.sothra-search__advanced--compact .sothra-search__chip {
  color: #1c3548;
  border-color: #cdd8de;
}

.sothra-search__advanced--compact .sothra-search__chip:hover {
  background: #f0f6fa;
  border-color: #3d8dc4;
  color: #3d8dc4;
}

.sothra-search__advanced--compact .sothra-search__chip-input:checked + .sothra-search__chip {
  background: #3d8dc4;
  color: #fff;
  border-color: #3d8dc4;
}

.sothra-search__advanced--compact .sothra-search__chip-input:focus-visible + .sothra-search__chip {
  outline: 3px solid rgba(61, 141, 196, 0.45);
}

.sothra-search__advanced-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sothra-search__advanced-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 20px;
  padding: 0.4375rem 0.875rem;
  color: #fff;
  font-size: 0.78125rem;
  font-weight: 700;
  cursor: pointer;
}

.sothra-search__advanced-reset:hover:not(:disabled),
.sothra-search__advanced-reset:focus-visible:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}

.sothra-search__advanced-reset:disabled {
  opacity: 0.45;
  cursor: default;
}

.sothra-search__advanced-reset i {
  width: 0.875rem;
  height: 0.875rem;
}

.sothra-search__advanced--compact .sothra-search__advanced-reset {
  border-color: #cdd8de;
  color: #1c3548;
}

.sothra-search__advanced--compact .sothra-search__advanced-reset:hover:not(:disabled),
.sothra-search__advanced--compact .sothra-search__advanced-reset:focus-visible:not(:disabled) {
  background: #f0f6fa;
  border-color: #3d8dc4;
  color: #3d8dc4;
}

.sothra-search__advanced-submit {
  background: #1c3548;
  color: #fff;
  font-weight: 700;
  font-size: 0.84375rem;
  padding: 0.6875rem 1.25rem;
  border: 0;
  border-radius: 24px;
  cursor: pointer;
}

.sothra-search__advanced-submit:hover,
.sothra-search__advanced-submit:focus-visible {
  background: #2a4a63;
}

/* Ricerche rapide */
.sothra-search__quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4375rem;
  margin: 0.875rem 0 0;
  padding: 0;
  list-style: none;
}

.sothra-search__quick-tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 0.3125rem 0.75rem;
  display: inline-block;
}

.sothra-search__quick-tag:hover,
.sothra-search__quick-tag:focus-visible {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* -----------------------------------------------------------------------------
 * Motore di ricerca — variante compatta
 * -------------------------------------------------------------------------- */
.sothra-search--compact {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex: 1 1 auto;
}

.sothra-search__compact-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  background: #f4f7f9;
  border: 1px solid #dde4e8;
  border-radius: 22px;
  padding: 0.5625rem 1rem;
}

.sothra-search__compact-field:focus-within {
  border-color: #3d8dc4;
  box-shadow: 0 0 0 3px rgba(61, 141, 196, 0.18);
}

.sothra-search__compact-icon {
  width: 1rem;
  height: 1rem;
  color: #8a99a3;
  flex: none;
}

.sothra-search__compact-input {
  border: 0;
  background: none;
  font-size: 0.84375rem;
  color: #1c3548;
  width: 100%;
}

.sothra-search__compact-input:focus {
  outline: none;
}

.sothra-search__filters-button {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.78125rem;
  font-weight: 700;
  color: #1c3548;
  background: none;
  border: 1px solid #cdd8de;
  border-radius: 20px;
  padding: 0.4375rem 0.875rem;
  cursor: pointer;
  flex: none;
}

.sothra-search__filters-button:hover,
.sothra-search__filters-button:focus-visible,
.sothra-search__filters-button[aria-expanded='true'] {
  border-color: #3d8dc4;
  color: #3d8dc4;
}

.sothra-search__filters-icon {
  width: 0.9375rem;
  height: 0.9375rem;
}

/* -----------------------------------------------------------------------------
 * Ricerca sulla mappa
 * -------------------------------------------------------------------------- */

/* Il pulsante vive sulla stessa riga del campo, subito prima di "Cerca". */
.sothra-search__map-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex: none;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.sothra-search__map-toggle i {
  width: 1rem;
  height: 1rem;
  flex: none;
}

.sothra-search__map-toggle--hero {
  border: 1px solid #dde4e8;
  background: #f4f7f9;
  color: #1c3548;
  font-size: 0.8125rem;
  border-radius: 32px;
  padding: 0.6875rem 1.0625rem;
}

.sothra-search__map-toggle--hero:hover,
.sothra-search__map-toggle--hero:focus-visible,
.sothra-search__map-toggle--hero[aria-expanded='true'] {
  border-color: #3d8dc4;
  background: #eaf4fa;
  color: #3d8dc4;
}

.sothra-search__map-toggle--compact {
  border: 1px solid #cdd8de;
  background: none;
  color: #1c3548;
  font-size: 0.78125rem;
  border-radius: 20px;
  padding: 0.4375rem 0.875rem;
}

.sothra-search__map-toggle--compact:hover,
.sothra-search__map-toggle--compact:focus-visible,
.sothra-search__map-toggle--compact[aria-expanded='true'] {
  border-color: #3d8dc4;
  color: #3d8dc4;
}

/* Sotto i 640px la barra hero è già stretta: resta la sola icona. */
@media (max-width: 640px) {
  .sothra-search__map-toggle--hero {
    padding: 0.6875rem 0.75rem;
  }

  .sothra-search__map-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Il pannello: stesso linguaggio della ricerca avanzata, hero in vetro e
   compatta a tendina bianca sopra il contenuto. */
.sothra-search__map {
  margin-top: 0.875rem;
  border-radius: 16px;
  padding: 1rem 1.125rem;
  display: grid;
  gap: 0.75rem;
  text-align: left;
}

/* Come per la ricerca avanzata, il `display` qui sopra batterebbe il
   `display:none` dello user agent: senza questa regola il pannello non si
   chiude mai. */
.sothra-search__map[hidden] {
  display: none;
}

.sothra-search__map--hero {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.sothra-search__map--compact {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  z-index: 48;
  background: #fff;
  border: 1px solid var(--st-line, #e4e9ec);
  box-shadow: 0 18px 50px rgba(10, 40, 55, 0.18);
}

.sothra-search__map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sothra-search__map-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
}

.sothra-search__map--compact .sothra-search__map-title {
  color: #7a8a95;
}

.sothra-search__map-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.8);
}

.sothra-search__map--compact .sothra-search__map-hint {
  color: #7a8a95;
}

.sothra-search__map-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: none;
  color: #fff;
  cursor: pointer;
  flex: none;
}

.sothra-search__map-close:hover,
.sothra-search__map-close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

.sothra-search__map-close i {
  width: 0.9375rem;
  height: 0.9375rem;
}

.sothra-search__map--compact .sothra-search__map-close {
  border-color: #cdd8de;
  color: #1c3548;
}

.sothra-search__map--compact .sothra-search__map-close:hover,
.sothra-search__map--compact .sothra-search__map-close:focus-visible {
  background: #f0f6fa;
  border-color: #3d8dc4;
  color: #3d8dc4;
}

/* Lo shortcode del plugin porta con sé stili inline: per allinearlo al resto
   del form servono gli `!important`, non c'è selettore che li batta. */
.sothra-search__map-canvas .alma-geo-map-search {
  margin: 0 0 0.75rem !important;
}

.sothra-search__map-canvas .alma-geo-map-search-input {
  padding: 0.6875rem 1rem !important;
  font-size: 0.875rem !important;
  border: 1px solid #dde4e8 !important;
  border-radius: 22px !important;
  background: #fff;
  color: #1c3548;
  font-family: inherit;
}

.sothra-search__map-canvas .alma-geo-map-search-input:focus {
  outline: none;
  border-color: #3d8dc4 !important;
  box-shadow: 0 0 0 3px rgba(61, 141, 196, 0.18);
}

.sothra-search__map-canvas .alma-geo-map-search-feedback {
  margin: 0.375rem 0.125rem 0 !important;
  font-size: 0.8125rem !important;
}

.sothra-search__map-canvas .alma-geo-map {
  border-radius: 14px !important;
}

/* -----------------------------------------------------------------------------
 * Suggerimenti
 * -------------------------------------------------------------------------- */
.sothra-search__suggestions {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(10, 40, 55, 0.22);
  padding: 0.875rem 1rem;
  display: grid;
  gap: 0.875rem;
  max-height: min(70vh, 30rem);
  overflow-y: auto;
  text-align: left;
}

.sothra-search__suggestions[hidden] {
  display: none;
}

.sothra-search__suggestions-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.625rem;
}

.sothra-search__suggestions-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #7a8a95;
  margin: 0;
}

.sothra-search__see-all {
  font-size: 0.75rem;
  font-weight: 700;
  color: #3d8dc4;
  white-space: nowrap;
}

.sothra-search__see-all:hover,
.sothra-search__see-all:focus-visible {
  color: #2f6f9e;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sothra-search__suggestions-empty {
  font-size: 0.8125rem;
  color: #8a99a3;
  margin: 0;
}

.sothra-search__suggestions-list--destination {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

/* Guide e idee: fino a 12 risultati su 3 colonne. */
.sothra-search__suggestions-list--post {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.125rem 0.75rem;
}

.sothra-search__suggestion {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5625rem 0.625rem;
  border-radius: 10px;
  color: inherit;
}

.sothra-search__suggestion:hover,
.sothra-search__suggestion.is-active {
  background: #f0f6fa;
  color: inherit;
}

.sothra-search__suggestion--destination {
  flex-direction: column;
  align-items: stretch;
  gap: 0.375rem;
  padding: 0;
}

.sothra-search__suggestion-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  background-color: #2c7f96;
  background-image: linear-gradient(135deg, #2c7f96, #63b06e);
  background-size: cover;
  background-position: center;
}

.sothra-search__suggestion-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #e7f2f9;
  flex: none;
}

.sothra-search__suggestion-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sothra-search__suggestion-label {
  font-size: 0.84375rem;
  font-weight: 500;
  color: #1c3548;
}

.sothra-search__suggestion-meta {
  font-size: 0.71875rem;
  color: #8a99a3;
}

.sothra-search__suggestions-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4375rem;
}

.sothra-search__suggestion-chip {
  font-size: 0.75rem;
  font-weight: 500;
  color: #3d8dc4;
  background: #e7f2f9;
  border: 0;
  border-radius: 14px;
  padding: 0.3125rem 0.75rem;
  cursor: pointer;
}

.sothra-search__suggestion-chip:hover,
.sothra-search__suggestion-chip:focus-visible {
  background: #d3e8f5;
}

/* -----------------------------------------------------------------------------
 * Filtri attivi sopra i risultati
 * -------------------------------------------------------------------------- */
.sothra-active-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}

.sothra-active-filters__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #7a8a95;
}

.sothra-active-filters__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4375rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sothra-active-filters__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.78125rem;
  font-weight: 500;
  color: #1c3548;
  background: #e7f2f9;
  border-radius: 16px;
  padding: 0.3125rem 0.75rem;
}

.sothra-active-filters__chip:hover,
.sothra-active-filters__chip:focus-visible {
  background: #d3e8f5;
  color: #2f6f9e;
}

.sothra-active-filters__remove {
  width: 0.8125rem;
  height: 0.8125rem;
}

.sothra-active-filters__reset {
  font-size: 0.75rem;
  font-weight: 700;
  color: #3d8dc4;
}

/* -----------------------------------------------------------------------------
 * Da tablet in su
 * -------------------------------------------------------------------------- */
@media (min-width: 768px) {


  .sothra-search__groups {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2.25rem;
  }

  .sothra-search__suggestions-list--post {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sothra-search__suggestions {
    padding: 1rem 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sothra-search__chevron {
    transition: none;
  }
}

/* -----------------------------------------------------------------------------
 * Pertinenza dei suggerimenti
 * Il risultato migliore riceve un badge; gli altri una percentuale discreta,
 * relativa al primo. Si attiva da Sothra → Indicizzazione.
 * -------------------------------------------------------------------------- */
.sothra-search__relevance {
  margin-left: auto;
  flex: none;
  align-self: center;
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #9aa8b1;
  white-space: nowrap;
}

/* Meter radiale: un rapporto contro un limite, non una torta a due fette.
   Il track è una tonalità più chiara dello stesso blu del riempimento, così
   l'anello si legge come un'unica scala; il valore vive nell'aria-label. */
.sothra-search__meter {
  display: block;
  overflow: visible;
}

.sothra-search__meter-track {
  stroke: #cfe4f1;
}

.sothra-search__meter-fill {
  stroke: #3d8dc4;
}

@media (prefers-reduced-motion: no-preference) {
  .sothra-search__meter-fill {
    transition: stroke-dashoffset 0.25s ease;
  }
}

.sothra-search__relevance--best {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #4c7a1e;
  background: #eef7e2;
  border: 1px solid #d3e8b8;
  border-radius: 12px;
  padding: 0.125rem 0.5rem;
  letter-spacing: 0.2px;
}

.sothra-search__relevance-star {
  font-size: 0.75rem;
  line-height: 1;
}

/* Nella griglia delle guide la riga è verticale: la pertinenza torna in linea. */
.sothra-search__suggestions-list--post .sothra-search__suggestion {
  gap: 0.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  .sothra-search__relevance--best {
    transition: background 0.2s ease;
  }
}

/* -----------------------------------------------------------------------------
 * Attesa durante la ricerca
 * L'indicatore vive dentro al campo, allineato a destra: alla prima ricerca il
 * pannello è ancora vuoto e lì dentro non avrebbe dove comparire — ed è
 * proprio quella l'attesa da spiegare. I risultati già a schermo, se ci sono,
 * si attenuano sotto per dire che sono i precedenti.
 * -------------------------------------------------------------------------- */
.sothra-search__busy {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #3d8dc4;
  white-space: nowrap;
  flex: none;
}

/* `display:inline-flex` batterebbe il `display:none` dello user agent. */
.sothra-search__busy[hidden] {
  display: none;
}

.sothra-search__busy--compact {
  font-size: 0.6875rem;
}

/* Su schermi stretti resta la sola rotella: la frase mangerebbe il campo. */
@media (max-width: 860px) {
  .sothra-search__busy-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.sothra-search__busy-spinner {
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  border: 2px solid #cfe4f1;
  border-top-color: #3d8dc4;
  flex: none;
  animation: sothra-search-spin 0.7s linear infinite;
}

@keyframes sothra-search-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Il contenuto già a schermo è ancora quello vecchio: lo si dichiara. */
.sothra-search__suggestions.is-busy .sothra-search__suggestions-list {
  opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
  .sothra-search__busy-spinner {
    animation-duration: 2s;
  }

  .sothra-search__suggestions.is-busy .sothra-search__suggestions-list {
    opacity: 0.4;
  }
}


/* -----------------------------------------------------------------------------
 * Adattamento a FontAwesome
 *
 * Tutto quello che c'è sopra arriva dal tema, dove le icone erano SVG di Lucide
 * e la misura si dava con width/height. FontAwesome disegna un glifo di un
 * font: la misura la comanda font-size, e il box va lasciato libero — con una
 * width fissa il glifo resta piccolo al centro di una scatola grande.
 *
 * Il selettore `i.sothra-icon` vale 0,1,1 come `.sothra-search__clear i`, e
 * arriva dopo: vince senza bisogno di !important.
 * -------------------------------------------------------------------------- */
i.sothra-icon {
  width: auto;
  height: auto;
  line-height: 1;
  text-align: center;
  flex: none;
}

.sothra-search__bar-icon {
  font-size: 1.25rem;
}

.sothra-search__clear i {
  font-size: 0.875rem;
}

.sothra-search__submit-icon {
  font-size: 1.125rem;
}

.sothra-search__advanced-icon,
.sothra-search__filters-icon,
.sothra-search__advanced-close i,
.sothra-search__map-close i {
  font-size: 0.9375rem;
}

.sothra-search__chevron,
.sothra-search__compact-icon,
.sothra-search__map-toggle i {
  font-size: 1rem;
}

.sothra-search__advanced-reset i {
  font-size: 0.875rem;
}

.sothra-active-filters__remove {
  font-size: 0.8125rem;
}

/* Il chevron ruotava come SVG; da glifo ruota allo stesso modo, ma serve un
   box con origine al centro perché non "salti" durante la rotazione. */
.sothra-search__chevron {
  display: inline-block;
  transform-origin: 50% 50%;
}

/* -----------------------------------------------------------------------------
 * Il blocco dello shortcode
 *
 * Vive dentro una riga del costruttore di pagine, che ha già il suo sfondo,
 * il suo titolo e il suo sottotitolo. Il blocco non aggiunge contorno: porta
 * la barra e basta.
 * -------------------------------------------------------------------------- */
.sothra-search-block {
  width: 100%;
}

/* Nel costruttore di pagine la barra hero non ha il margine che aveva sotto
   al titolo della testata: lo spazio lo decide la riga. */
.sothra-search-block .sothra-search--hero {
  margin-top: 0;
}

/* -----------------------------------------------------------------------------
 * Il campo dentro la pillola
 *
 * Betheme stampa un foglio inline a `wp_enqueue_scripts` priorità 100 — dopo
 * questo, che è accodato a 20 — e mette bordo, sfondo bianco e un colore di
 * testo su `input[type="search"]`, con un altro colore sul fuoco. A parità di
 * specificità vince chi arriva dopo: le regole qui sotto non si affidano
 * all'ordine, dichiarano una specificità più alta.
 *
 *   input[type="search"]                        0,1,1
 *   .sothra-search input.sothra-search__input   0,2,1   ← vince a parità di
 *                                                         b più alto
 *   input[type="search"]:focus                  0,2,1
 *   .sothra-search input.…__input:focus         0,3,1   ← vince sempre
 *
 * `!important` avrebbe funzionato ed è peggio: chiuderebbe la porta a un tema
 * che voglia ritingere il campo, e la porta va lasciata aperta.
 * -------------------------------------------------------------------------- */
.sothra-search input.sothra-search__input,
.sothra-search input.sothra-search__compact-input {
  border: 0;
  border-radius: 0;
  background: none;
  background-color: transparent;
  box-shadow: none;
  -webkit-box-shadow: none;
  height: auto;
  min-height: 0;
  margin: 0;
  line-height: 1.4;
  color: #1c3548;
}

.sothra-search input.sothra-search__input:focus,
.sothra-search input.sothra-search__compact-input:focus {
  border: 0;
  background: none;
  background-color: transparent;
  box-shadow: none;
  -webkit-box-shadow: none;
  outline: none;
  color: #1c3548;
}

.sothra-search input.sothra-search__input {
  padding: 0.75rem 0;
}

.sothra-search input.sothra-search__compact-input {
  padding: 0;
}

/* La crocetta che i browser mettono da soli nei campi di ricerca: qui c'è già
   il nostro pulsante per svuotare, e due modi di fare la stessa cosa a due
   pixel di distanza sono un modo di confondere. */
.sothra-search input[type='search']::-webkit-search-decoration,
.sothra-search input[type='search']::-webkit-search-cancel-button,
.sothra-search input[type='search']::-webkit-search-results-button,
.sothra-search input[type='search']::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

/* Tutta la pillola è zona di scrittura: cliccare accanto al testo deve
   portare il cursore nel campo, non sembrare un punto morto. */
.sothra-search__bar,
.sothra-search__compact-field {
  cursor: text;
}

.sothra-search__bar > *,
.sothra-search__compact-field > * {
  cursor: auto;
}

.sothra-search__bar button,
.sothra-search__compact-field button {
  cursor: pointer;
}

/* -----------------------------------------------------------------------------
 * Testo per screen reader
 *
 * Il plugin usa `.screen-reader-text` in dieci punti — l'etichetta del campo,
 * il nome dei pulsanti con la sola icona, la descrizione del filtro da
 * rimuovere — dando per scontato che la definisca il tema. Betheme la
 * definisce solo dentro bbPress, quindi su sothra.it quelle dieci etichette
 * erano testo visibile in pagina, in mezzo alla barra.
 *
 * Definirla qui è l'unica cosa giusta: toglierle dal markup lascerebbe muti
 * dei pulsanti che hanno solo un'icona dentro. La classe resta quella
 * canonica di WordPress, così un tema che già la dichiara non fa che
 * ripetere la stessa cosa.
 * -------------------------------------------------------------------------- */
.sothra-search .screen-reader-text,
.sothra-search-block .screen-reader-text,
.sothra-active-filters .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Un'eccezione sola: se ci arriva il fuoco da tastiera deve tornare visibile,
   altrimenti chi naviga con il tab perde di vista dove si trova. */
.sothra-search .screen-reader-text:focus,
.sothra-search-block .screen-reader-text:focus,
.sothra-active-filters .screen-reader-text:focus {
  position: static !important;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
}

/* -----------------------------------------------------------------------------
 * Il pannello dei suggerimenti: densità e miniature
 *
 * Tre cose viste sul sito.
 *
 * La destinazione era una colonna con la foto a tutta larghezza in 4:3. Con
 * una sola destinazione in elenco la cella resta larga un terzo del pannello,
 * e la foto diventa alta quasi mezzo schermo per dire una parola: «Lecce».
 * Diventa una scheda orizzontale con una miniatura piccola.
 *
 * Le guide avevano un quadrato azzurro vuoto al posto dell'immagine, perché
 * l'immagine in evidenza non arrivava nemmeno dal server. Ora arriva, e qui
 * si dimensiona.
 *
 * Betheme sottolinea i link: dentro il pannello ogni titolo, ogni categoria e
 * ogni conteggio erano sottolineati, e l'elenco si leggeva come un blocco di
 * righe barrate.
 * -------------------------------------------------------------------------- */
.sothra-search__suggestions a,
.sothra-search__suggestions a:hover,
.sothra-search__suggestions a:focus {
  text-decoration: none;
}

.sothra-search__suggestions {
  padding: 0.75rem;
  gap: 0.625rem;
}

/* --- Destinazioni --------------------------------------------------------- */

.sothra-search__suggestions-list--destination {
  gap: 0.5rem;
}

.sothra-search__suggestion--destination {
  flex-direction: row;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem;
  background: #f4f8fb;
  border: 1px solid #e4edf3;
  border-radius: 12px;
}

.sothra-search__suggestion--destination:hover,
.sothra-search__suggestion--destination.is-active {
  background: #e7f2f9;
  border-color: #cfe3f1;
}

.sothra-search__suggestion--destination .sothra-search__suggestion-thumb {
  width: 64px;
  height: 48px;
  flex: none;
  aspect-ratio: auto;
  border-radius: 8px;
}

.sothra-search__suggestion--destination .sothra-search__suggestion-label {
  font-weight: 700;
  color: #1c3548;
}

/* --- Guide ---------------------------------------------------------------- */

.sothra-search__suggestion--post {
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.4375rem 0.5rem;
}

.sothra-search__suggestion--post .sothra-search__suggestion-thumb {
  width: 44px;
  height: 44px;
  flex: none;
  aspect-ratio: auto;
  border-radius: 8px;
}

/* Il titolo di una guida è una frase intera: si ferma a due righe, perché la
   terza sposterebbe in basso tutte le schede della stessa riga. */
.sothra-search__suggestion--post .sothra-search__suggestion-label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.sothra-search__suggestion--post .sothra-search__suggestion-meta {
  margin-top: 0.125rem;
}

/* --- Il ripiego senza immagine in evidenza -------------------------------- */

.sothra-search__suggestion-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9db6c6;
  font-size: 1rem;
}

/* --- Risposta al puntatore ------------------------------------------------ */

.sothra-search__suggestion--post:hover,
.sothra-search__suggestion--post.is-active {
  background: #f0f6fa;
}

.sothra-search__suggestion:focus-visible {
  outline: 2px solid #3d8dc4;
  outline-offset: 1px;
}

/* -----------------------------------------------------------------------------
 * I filtri scelti, sotto la barra
 *
 * Una riga di etichette, una per valore. Compare appena si spunta un filtro,
 * prima ancora di inviare la ricerca, e ogni etichetta si toglie da sola.
 * Sta dentro il form, non nella pagina dei risultati: serve mentre si sceglie,
 * non dopo.
 * -------------------------------------------------------------------------- */
.sothra-search__applied {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.sothra-search__applied[hidden] {
  display: none;
}

.sothra-search__applied-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 6px rgba(10, 40, 55, 0.35);
}

.sothra-search__applied-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sothra-search__applied-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  color: #1c3548;
  background: #fff;
  border: 1px solid #dde4e8;
  border-radius: 20px;
  padding: 0.375rem 0.6875rem;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(10, 40, 55, 0.12);
}

.sothra-search__applied-chip:hover,
.sothra-search__applied-chip:focus-visible {
  border-color: #3d8dc4;
  color: #2f6f9e;
  text-decoration: none;
}

.sothra-search__applied-remove {
  font-size: 0.6875rem;
  color: #8a99a3;
}

.sothra-search__applied-chip:hover .sothra-search__applied-remove {
  color: #ef5b25;
}

.sothra-search__applied-clear {
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-shadow: 0 1px 6px rgba(10, 40, 55, 0.35);
}

.sothra-search__applied-clear[hidden] {
  display: none;
}

/* Nella barra compatta la riga vive su fondo chiaro, non sull'immagine. */
.sothra-search__applied--compact .sothra-search__applied-label,
.sothra-search__applied--compact .sothra-search__applied-clear {
  color: #5c6f7c;
  text-shadow: none;
}

.sothra-search__applied--compact .sothra-search__applied-chip {
  background: #f4f7f9;
  box-shadow: none;
}

/* Con molti termini il pannello si allunga: gli si dà un tetto e scorre,
   invece di spingere il fondo della pagina fuori dallo schermo. */
.sothra-search__groups {
  max-height: min(60vh, 32rem);
  overflow-y: auto;
}
