/**
 * Listing sportello (Eventi, Novità, Luoghi, Documenti, Uffici, Persone) — «Due colonne sportello»
 * Token: primario ente, carta tinta, Titillium via BI.
 */

.listing-sportello {
  --eventi-tint: color-mix(in srgb, var(--bs-primary) 8%, var(--bs-gray-100, #f3f3f5));
  --eventi-shadow: 0 0.125rem 0.25rem rgba(17, 24, 39, 0.08);
  --eventi-shadow-lift: 0 0.5rem 1.25rem color-mix(in srgb, var(--bs-primary) 18%, rgba(17, 24, 39, 0.08));
  background-color: var(--eventi-tint);
  border-top: 1px solid color-mix(in srgb, var(--bs-primary) 14%, transparent);
}

.listing-sportello__header {
  padding-top: 2rem;
  padding-bottom: 0.5rem;
}

.listing-sportello__title {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.listing-sportello__count {
  margin: 0.35rem 0 0;
  color: var(--bs-gray-700, #495057);
  font-size: 0.95rem;
}

.listing-sportello__layout {
  padding-bottom: 3rem;
}

.listing-sportello__filters {
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--bs-primary) 12%, var(--bs-gray-200, #e9ecef));
  border-radius: 0.5rem;
  box-shadow: var(--eventi-shadow);
  padding: 1.25rem 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
  .listing-sportello__filters {
    position: sticky;
    top: 1rem;
    margin-bottom: 0;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.listing-sportello__filters-legend {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bs-gray-700, #495057);
  margin: 0 0 1rem;
}

.listing-sportello__field + .listing-sportello__field {
  margin-top: 1.25rem;
}

.listing-sportello__field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--bs-dark, #17324d);
}

.listing-sportello__field .form-text {
  margin-top: 0.4rem;
  color: var(--bs-gray-700, #495057);
  font-size: 0.8125rem;
}

.listing-sportello__field-legend {
  display: block;
  float: none;
  width: auto;
  padding: 0;
  margin: 0 0 0.4rem;
  font-size: inherit;
  font-weight: 600;
  color: var(--bs-dark, #17324d);
}

.listing-sportello__tipologie {
  min-width: 0;
}

.listing-persona__section-title {
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.listing-persona__letters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.listing-persona__letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--bs-primary) 22%, var(--bs-gray-200, #e9ecef));
  border-radius: 0.375rem;
  background: #fff;
  color: var(--bs-dark, #17324d);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  text-decoration: none;
}

.listing-persona__letter:hover,
.listing-persona__letter:focus-visible {
  border-color: var(--bs-primary);
  color: var(--bs-primary);
  text-decoration: none;
}

.listing-persona__letter.is-active {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
}

.listing-persona__letter.is-active:hover,
.listing-persona__letter.is-active:focus-visible {
  color: #fff;
}

.listing-sportello__results .listing-persona__card .it-card-profile-name a,
.listing-sportello__results .listing-ufficio__card .it-card-profile-name a {
  text-decoration: none;
}

.listing-persona__deleghe {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

.listing-persona__deleghe > :first-child {
  margin-top: 0;
}

.listing-persona__deleghe > :last-child {
  margin-bottom: 0;
}

.listing-persona__deleghe ul,
.listing-persona__deleghe ol {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
}

.listing-sportello__results .listing-persona__card .avatar img,
.listing-sportello__results .listing-persona__card .avatar .figure-img,
.listing-sportello__results .listing-ufficio__card .avatar img,
.listing-sportello__results .listing-ufficio__card .avatar .figure-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-ufficio__section-title {
  margin: 0.5rem 0 1rem;
}

.listing-aree__area-card {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.listing-aree__child .it-card {
  height: 100%;
}

.listing-sportello__results .listing-ufficio__card .it-card-profile-image {
  flex-shrink: 0;
}

.listing-sportello__results .listing-ufficio__card .it-card-profile-image img,
.listing-sportello__results .listing-ufficio__card .it-card-profile-image .figure-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-sportello__field + .listing-sportello__tipologie {
  margin-top: 0.5rem;
}

.listing-sportello__tipologie > .listing-sportello__field-legend {
  margin-bottom: 0;
}

.listing-sportello__tipologie > .form-text {
  margin-top: 0.1rem;
  margin-bottom: 0.5rem;
}

.listing-sportello__tipologia-list {
  max-height: min(12rem, 32vh);
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  margin: 0;
  padding: 0.35rem 0.25rem 0.35rem 0;
  border: 1px solid color-mix(in srgb, var(--bs-primary) 12%, var(--bs-gray-200, #e9ecef));
  border-radius: 0.375rem;
  background: color-mix(in srgb, var(--bs-primary) 3%, #fff);
}

.listing-sportello__flag-list {
  margin: 0;
  padding: 0;
}

.listing-sportello__flag-list .form-check {
  margin-bottom: 0.5rem;
}

.listing-sportello__flag-list .form-check:last-child {
  margin-bottom: 0;
}

.listing-sportello__tipologia-item {
  padding: 0.2rem 0.65rem;
}

.listing-sportello__tipologia-item .form-check {
  margin: 0;
}

.listing-sportello__tipologia-item label {
  font-weight: 500;
  cursor: pointer;
}

.listing-sportello__tipologie > .listing-sportello__clear {
  margin-top: 0.5rem;
}

.listing-sportello__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.listing-sportello__actions .btn {
  min-height: 44px;
  width: 100%;
  justify-content: center;
}

.listing-sportello__clear {
  align-self: flex-start;
  min-height: 44px;
  padding: 0.25rem 0;
  border: 0;
  background: transparent;
  color: var(--bs-primary);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  font-weight: 600;
}

.listing-sportello__clear:hover,
.listing-sportello__clear:focus-visible {
  color: color-mix(in srgb, var(--bs-primary) 80%, #000);
}

.listing-sportello__clear.d-none {
  display: none !important;
}

.listing-sportello__evidenza {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--bs-primary) 12%, transparent);
}

.listing-sportello__evidenza-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bs-gray-700, #495057);
  margin-bottom: 0.5rem;
}

.listing-sportello__evidenza .link-list {
  margin: 0;
}

/* Servizi in evidenza nell'hero (colonna destra) */
.hero-evidenza {
  padding: 0;
}

.hero-evidenza__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bs-gray-700, #495057);
  margin: 0 0 0.75rem;
}

.hero-evidenza__list {
  margin: 0;
  padding: 0;
}

.hero-evidenza__list li:last-child {
  margin-bottom: 0 !important;
}

@media (min-width: 992px) {
  .hero-evidenza {
    margin-top: 0.25rem;
  }
}

.listing-sportello__results .it-card:not(.listing-sportello__map-card) {
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.listing-sportello__results .it-card-title a,
.listing-sportello__results .it-card-profile-name a {
  text-decoration: none;
}

.listing-sportello__results .it-card-title a:hover,
.listing-sportello__results .it-card-title a:focus-visible,
.listing-sportello__results .it-card-profile-name a:hover,
.listing-sportello__results .it-card-profile-name a:focus-visible {
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .listing-sportello__results .it-card:not(.listing-sportello__map-card):hover {
    transform: translateY(-4px);
    box-shadow: var(--eventi-shadow-lift);
  }
}

.listing-sportello__results .it-card:has(a:focus-visible) {
  outline: 3px solid color-mix(in srgb, var(--bs-primary) 40%, transparent);
  outline-offset: 2px;
}

.listing-sportello__empty {
  background: #fff;
  border: 1px dashed color-mix(in srgb, var(--bs-primary) 22%, var(--bs-gray-300, #dee2e6));
  border-radius: 0.5rem;
  padding: 2rem 1.5rem;
}

.listing-sportello__empty p {
  margin: 0;
  color: var(--bs-gray-800, #343a40);
}

.listing-sportello__view-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.listing-sportello__view-toggle .btn {
  min-height: 44px;
  flex: 1;
  justify-content: center;
}

.listing-sportello__view-toggle .btn[aria-pressed="true"] {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
}

.listing-sportello__map {
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--bs-primary) 12%, var(--bs-gray-200, #e9ecef));
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: var(--eventi-shadow);
}

.listing-sportello__map-canvas {
  width: 100%;
  height: min(70vh, 32rem);
  z-index: 0;
}

.listing-sportello__map-empty {
  padding: 2rem 1.5rem;
  margin: 0;
  color: var(--bs-gray-800, #343a40);
}

.listing-sportello__map-pin.leaflet-div-icon {
  background: transparent !important;
  border: 0 !important;
  width: 28px !important;
  height: 40px !important;
  margin-left: -14px !important;
  margin-top: -40px !important;
  color: var(--bs-primary);
  filter: drop-shadow(0 1px 2px rgba(17, 24, 39, 0.35));
}

.listing-sportello__map-pin svg {
  display: block;
  width: 28px;
  height: 40px;
  overflow: visible;
}

.listing-sportello__map-pin svg path {
  fill: var(--bs-primary) !important;
}

.listing-sportello__map-pin svg circle {
  fill: #fff !important;
}

.listing-sportello-map-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: var(--eventi-shadow-lift);
  border: 1px solid color-mix(in srgb, var(--bs-primary) 12%, var(--bs-gray-200, #e9ecef));
}

.listing-sportello-map-popup .leaflet-popup-content {
  margin: 0;
  min-width: 280px;
  line-height: 1.35;
}

.listing-sportello-map-popup .leaflet-popup-tip {
  box-shadow: none;
}

.listing-sportello__map-card {
  background: #fff;
  transform: none !important;
  transition: none !important;
  box-shadow: none !important;
}

.listing-sportello__map-card:hover {
  transform: none !important;
  box-shadow: none !important;
}

.listing-sportello__map-card .it-card-profile-header {
  gap: 0.75rem;
  padding: 0.85rem 0.85rem 0.5rem;
  align-items: flex-start;
}

.listing-sportello__map-card .it-card-profile-name {
  font-size: 1rem;
  margin: 0;
}

.listing-sportello__map-card .it-card-profile-name a,
.listing-sportello-map-popup a {
  color: var(--bs-primary);
  text-decoration: none;
}

.listing-sportello__map-card .it-card-profile-name a:hover,
.listing-sportello__map-card .it-card-profile-name a:focus-visible,
.listing-sportello-map-popup a:hover,
.listing-sportello-map-popup a:focus-visible {
  color: color-mix(in srgb, var(--bs-primary) 80%, #000);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.listing-sportello__map-card .it-card-profile-type {
  font-size: 0.8125rem;
  color: var(--bs-gray-700, #495057);
}

.listing-sportello__map-card .it-card-profile-image {
  width: 4rem;
  flex: 0 0 4rem;
}

.listing-sportello__map-card .it-card-body {
  padding: 0 0.85rem 0.85rem;
}

.listing-sportello__map-card .it-card-description-list {
  margin: 0;
  font-size: 0.875rem;
}

.listing-sportello__map-card .it-card-description-list dt {
  font-weight: 600;
}

.listing-sportello.is-map-view .listing-sportello__list-panel,
.listing-sportello.is-map-view .listing-sportello__pagination {
  display: none;
}

.listing-sportello.is-list-view .listing-sportello__map-panel {
  display: none;
}

.listing-sportello__pagination .pagination .page-link {
  min-width: 2.75rem;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.listing-sportello__pagination button.page-link {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.listing-sportello__results .listing-documento__card .it-card-footer {
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.listing-sportello__results .listing-documento__card .it-card-footer .it-card-link + .it-card-link {
  margin-left: 0;
}

@media (prefers-reduced-motion: reduce) {
  .listing-sportello__results .it-card:not(.listing-sportello__map-card) {
    transition: none;
  }

  .listing-sportello__results .it-card:not(.listing-sportello__map-card):hover {
    transform: none;
  }
}

::selection {
  background: color-mix(in srgb, var(--bs-primary) 28%, transparent);
  color: inherit;
}
