/* ============================================================
   Modulo LAYOUT — masthead (header.php): brand a sinistra,
   social + ricerca compatta a destra; sotto i 700px si impila.
   Carica dopo style.css: qui solo le regole del masthead v2.
   ============================================================ */

/* Testo solo per screen reader (etichette form, nomi social) */
.tu-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tu-masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
}
.tu-masthead-brand { min-width: 0; flex: 1 1 280px; }
.tu-masthead-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 1 auto;
  margin-left: auto;
}

/* Larghezza massima del logo: CSS var inline dal config (logo_width) */
.tu-masthead .tu-logo-img { max-width: var(--tu-logo-w, 400px); }

/* Social: cerchi compatti con SVG monocromatico (colore testata) */
.tu-social {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tu-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--tu-primary);
  border: 1px solid var(--tu-border);
  background: #fff;
  transition: background .15s, color .15s;
}
.tu-social a:hover,
.tu-social a:focus-visible {
  background: var(--tu-primary);
  color: #fff;
  text-decoration: none;
  outline: none;
}
.tu-social svg { width: 16px; height: 16px; fill: currentColor; display: block; }

/* Ricerca compatta nel masthead (override della .tu-search-form del 404) */
.tu-masthead-search {
  display: flex;
  align-items: stretch;
  margin: 0;
}
.tu-masthead-search input[type=search] {
  width: 180px;
  padding: 6px 10px;
  font-size: .85rem;
  font-family: Arial, Helvetica, sans-serif;
  border: 1px solid var(--tu-border);
  border-right: 0;
  border-radius: 3px 0 0 3px;
  min-width: 0;
}
.tu-masthead-search input[type=search]:focus {
  outline: none;
  border-color: var(--tu-primary);
}
.tu-masthead-search button {
  padding: 6px 12px;
  font-size: 1rem;
  line-height: 1;
  background: var(--tu-primary);
  color: #fff;
  border: 0;
  border-radius: 0 3px 3px 0;
  cursor: pointer;
}
.tu-masthead-search button:hover { filter: brightness(1.1); }

@media (max-width: 700px) {
  .tu-masthead-tools {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }
  .tu-masthead-search { flex: 1 1 auto; }
  .tu-masthead-search input[type=search] { width: 100%; }
}
@media (max-width: 420px) {
  .tu-masthead-tools { flex-direction: column; align-items: stretch; gap: 10px; }
  .tu-social { justify-content: center; }
}
