/* Header e menu del telefono, comuni a tutte le pagine (home e blog).
   Cambiando qui cambia ovunque: le voci del menu devono restare uguali. */

:root {
  --margine: clamp(20px, 6vw, 120px);
  --alt-testata: 84px;
  --ink-2: #1e293b;
  --grigio-chiaro: #cbd5e1;   /* testo secondario su fondo scuro: contrasto > 10:1 */
  --curva: cubic-bezier(.2, .8, .2, 1);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body { overflow-x: hidden; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.salta {
  position: absolute; left: var(--margine); top: -100px; z-index: 100;
  padding: .75rem 1rem; background: var(--yellow); color: var(--ink); font-weight: 600;
  border-radius: 8px;
}
.salta:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 4px; }

/* ---------- Bottoni ---------- */
.bottone {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: 0 1.6rem;
  border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none; white-space: nowrap;
  transition: background-color .25s var(--curva), color .25s var(--curva), border-color .25s var(--curva);
  cursor: pointer;
}
.bottone--pieno { background: var(--blue); border: 2px solid var(--blue); color: var(--paper); }
.bottone--pieno:hover { background: transparent; }
.bottone--vuoto { border: 2px solid rgba(241, 245, 249, .35); color: var(--paper); }
.bottone--vuoto:hover { border-color: var(--paper); background: rgba(241, 245, 249, .08); }

/* ============ HEADER ============ */
.testata {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--alt-testata);
  display: flex; align-items: center; gap: 2rem;
  padding: 0 var(--margine);
  color: var(--paper);
  transition: transform .45s var(--curva), background-color .35s ease, height .35s ease;
}
.testata.is-scorsa {
  background: rgba(15, 23, 42, .82);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(241, 245, 249, .08);
}
.testata.is-nascosta { transform: translateY(-100%); }

.testata__logo { display: inline-flex; margin-right: auto; }
.testata__logo svg { width: clamp(108px, 9vw, 132px); height: auto; overflow: visible; }

.testata__nav ul { display: flex; gap: clamp(1rem, 2.2vw, 2.25rem); list-style: none; margin: 0; padding: 0; }
.testata__nav a {
  position: relative; color: var(--paper); text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: .5rem 0;
}
.testata__nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--pink); transform: scaleX(0); transform-origin: right;
  transition: transform .35s var(--curva);
}
.testata__nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.testata__cta { min-height: 44px; padding: 0 1.3rem; }

.testata__burger {
  display: none; position: relative; z-index: 2;
  width: 48px; height: 48px; margin-right: -10px;
  background: none; border: 0; cursor: pointer; color: var(--paper);
}
/* Due linee lunghe e spesse; aperto diventano una X */
.burger-riga {
  position: absolute; left: 5px; right: 5px; height: 3px; background: currentColor; border-radius: 3px;
  transition: transform .35s var(--curva);
}
.burger-riga:nth-of-type(2) { top: 17px; }
.burger-riga:nth-of-type(3) { top: 28px; }
.testata__burger[aria-expanded="true"] .burger-riga:nth-of-type(2) { transform: translateY(5.5px) rotate(45deg); }
.testata__burger[aria-expanded="true"] .burger-riga:nth-of-type(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Icone rapide (telefono e WhatsApp): stessi colori del menu aperto */
.testata__rapidi { display: none; gap: .5rem; }
.testata__rapido {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--blue); color: var(--paper);
}
.testata__rapido--wa { background: #25d366; }
.testata__rapido svg { width: 20px; height: 20px; }

@media (max-width: 1080px) {
  .testata__nav, .testata__cta { display: none; }
  .testata__burger { display: block; }
  .testata__rapidi { display: flex; }
  .testata { gap: 1rem; }
  :root { --alt-testata: 72px; }
}

/* Menu a tutto schermo (telefono) */
.menu-mobile {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--alt-testata) + 1rem) var(--margine) 2.5rem;
  background: var(--ink); color: var(--paper);
}
.menu-mobile[hidden] { display: none; }
.menu-mobile ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.menu-mobile a {
  display: inline-block; padding: .3rem 0;
  color: var(--paper); text-decoration: none;
  font-weight: 800; font-size: clamp(2rem, 9vw, 3.5rem); letter-spacing: -.03em; line-height: 1.1;
}
/* Sotto le voci: il marchio GIBE e i contatti diretti (telefono e WhatsApp) */
.menu-mobile__piede { display: grid; gap: 1.5rem; margin-top: 2.5rem; }
.menu-mobile__marchio { width: 56px; height: 56px; }
.menu-mobile .menu-mobile__cta { display: inline-flex; justify-self: start; min-height: 52px; padding: 0 2rem; font-size: 1.1rem; font-weight: 600; letter-spacing: 0; line-height: 1; }
.menu-mobile__contatti { display: flex; flex-wrap: wrap; gap: .75rem; }
.menu-mobile .menu-mobile__contatto {
  display: inline-flex; align-items: center; gap: .65rem; min-height: 48px; padding: 0 1.1rem 0 .5rem;
  border: 2px solid rgba(241, 245, 249, .2); border-radius: 999px;
  font-size: 1rem; font-weight: 600; letter-spacing: 0; line-height: 1;
}
.menu-mobile__icona {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--blue); color: var(--paper);
}
.menu-mobile__icona--wa { background: #25d366; }
.menu-mobile__icona svg { width: 18px; height: 18px; }
body.menu-aperto { overflow: hidden; }

/* Voce della pagina in cui ci si trova (es. Blog nel blog): sottolineata fissa */
.testata__nav a[aria-current="page"]::after { transform: scaleX(1); }
.menu-mobile a[aria-current="page"] { color: var(--pink); }
/* Pagine con fondo chiaro (blog): header sempre scuro */
.testata--piena { background: var(--ink); }
