/* Design Scuole Italia — child "Formigine 2" · f2-search.css
 * Stile della palette "Trova tutto". 100% canonico al tema (Bootstrap Italia / DSI):
 * usa SOLO token reali del design system — raggi 4px (.modal-content/.btn) e 12px (.chip),
 * ombra nativa del modal, superfici #f2f6f9, hairline #d9dadb, muted #5c6f82,
 * accent blu istituto #0000f5, colori-sezione del menu per i badge tipo.
 * Nessuno "stondo" custom, niente backdrop-blur, niente pill 999px: solo gli stondi del sito.
 * v0.43: più grande/presente, close = X (round), riga attiva con accento blu, hint solo desktop.
 * GPU-safe (opacity/transform), prefers-reduced-motion aware, mobile = foglio a tutto schermo.
 *
 * Token nativi (bootstrap-italia.css / scuole.css):
 *   --radius-panel: 4px   (.modal-content{border-radius:4px})
 *   --radius-chip : 12px  (.chip{border-radius:12px;height:24px})
 *   --radius-ui   : 4px   (.btn{border-radius:4px})
 *   --shadow      : 0 2px 10px 0 rgba(0,0,0,.1)  (.modal-content) + elevated card token
 *   --hairline    : #d9dadb  (.card border)
 *   --surface     : #f2f6f9  (superficie chiara del tema)
 *   --muted       : #5c6f82  (.chip-label / testo secondario)
 *   --ink         : #19191a  (testo)   --accent: #0000f5 (blu istituto)
 */

.f2s-lock { overflow: hidden; }

.f2s-root {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  font-family: inherit;
}
.f2s-root[hidden] { display: none; }

/* backdrop = scrim nativo del modal, senza blur */
.f2s-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  transition: opacity .2s ease-out;
}
.f2s-root.f2s-in .f2s-backdrop { opacity: 1; }

/* pannello = .modal-content: radius 4px, border:none, ombra nativa (modal + elevated card) */
.f2s-panel {
  position: relative;
  width: min(720px, calc(100% - 2rem));
  margin-top: clamp(1rem, 8vh, 6rem);
  background: #fff;
  border: none;
  border-radius: 4px;
  box-shadow: 0 2px 10px 0 rgba(0, 0, 0, .1), 0 24px 38px 6px rgba(0, 0, 0, .06);
  overflow: hidden;
  transform: translateY(-16px);
  opacity: 0;
  transition: opacity .2s ease-out, transform .3s ease-out;
  will-change: transform, opacity;
}
.f2s-root.f2s-in .f2s-panel { transform: none; opacity: 1; }

/* input */
.f2s-inputwrap {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid #d9dadb;
}
.f2s-ic { width: 26px; height: 26px; flex: 0 0 auto; fill: #5c6f82; }
.f2s-input {
  flex: 1 1 auto;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1.5;
  font-weight: 400;
  color: #19191a;
  padding: .15rem 0;
  min-width: 0;
}
.f2s-input::placeholder { color: #5c6f82; opacity: 1; }
.f2s-input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* close = X (round hit-area, muted -> accento su hover) */
.f2s-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #5c6f82;
  cursor: pointer;
  transition: background-color .15s ease-in-out, color .15s ease-in-out;
}
.f2s-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.f2s-close:hover, .f2s-close:focus-visible { background: #f2f6f9; color: #19191a; outline: 0; }
.f2s-close:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0000f5; }

/* results */
.f2s-list {
  list-style: none;
  margin: 0;
  padding: .45rem;
  max-height: min(64vh, 34rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.f2s-sec {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #5c6f82;
  padding: .7rem .85rem .35rem;
  font-weight: 700;
}
.f2s-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .8rem .85rem;
  border-radius: 4px;
  cursor: pointer;
  scroll-margin: .5rem;
}
.f2s-item[aria-selected="true"] {
  background: #f2f6f9;
  box-shadow: inset 3px 0 0 #0000f5;
}
.f2s-item[aria-selected="true"] .f2s-t { color: #0000f5; }
.f2s-body { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.f2s-t {
  font-size: 1.06rem;
  font-weight: 600;
  color: #19191a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.f2s-x {
  font-size: .84rem;
  color: #5c6f82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.f2s-date { flex: 0 0 auto; font-size: .78rem; color: #7b8794; white-space: nowrap; }

/* chip tipo = .chip nativo (radius 12px), riempito col colore-sezione del menu */
.f2s-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 6.2rem;
  height: 26px;
  text-align: center;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: #fff;
  border-radius: 12px;
  padding: 0 .75rem;
  text-transform: uppercase;
  line-height: 1;
}
.f2s-quick .f2s-chip { min-width: 26px; padding: 0; font-size: 1.1rem; }
.f2s-greendark   { background: #0e865c; }
.f2s-bluelectric { background: #0a00cc; }
.f2s-redbrown    { background: #d1344c; }
.f2s-purplelight { background: #8c17a3; }
.f2s-petrol      { background: #00666e; }

.f2s-empty { padding: 1.3rem 1rem; color: #5c6f82; font-size: .96rem; line-height: 1.55; }

/* footer: brand sempre, hint da tastiera solo su desktop (al tocco sono inutili) */
.f2s-foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .7rem 1.1rem;
  border-top: 1px solid #d9dadb;
  font-size: .74rem;
  color: #5c6f82;
  background: #f2f6f9;
}
.f2s-hints { display: flex; align-items: center; gap: 1.1rem; }
.f2s-foot kbd {
  font-family: inherit;
  font-size: .7rem;
  background: #fff;
  border: 1px solid #d9dadb;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: .08rem .34rem;
  margin-right: .18rem;
  color: #5c6f82;
}
.f2s-brand { margin-left: auto; font-weight: 700; font-size: .82rem; color: #0000f5; letter-spacing: .01em; }
.f2s-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* mobile: foglio a tutto schermo, pieno e opaco (come il modal del tema) */
@media (max-width: 575.98px) {
  .f2s-root { align-items: stretch; }
  .f2s-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    transform: translateY(8px);
  }
  .f2s-root.f2s-in .f2s-panel { transform: none; }
  .f2s-inputwrap { padding: 1rem 1.1rem; }
  .f2s-input { font-size: 1.15rem; }
  .f2s-list { max-height: none; flex: 1 1 auto; }
  .f2s-chip { min-width: 5rem; }
  .f2s-date { display: none; }
  .f2s-foot { display: none; }         /* niente barra comandi su mobile (inutile al tocco) */
}

@media (prefers-reduced-motion: reduce) {
  .f2s-backdrop, .f2s-panel { transition: none; }
  .f2s-panel { transform: none; }
}
