/* Poppins + PT Serif - copie locali (SIL Open Font License 1.1).
   La coppia di focusconsulting.it: PT Serif per i titoli, Poppins per testo,
   menu e bottoni. Dichiarate qui e non via Google: il sito deve rendere
   uguale anche senza rete. I file stanno in assets/fonts/.
   ========================================================================= */
@font-face {
  font-family: 'Poppins';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/poppins-400-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Poppins';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/poppins-400-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(../fonts/poppins-300-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(../fonts/poppins-300-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/poppins-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/poppins-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/poppins-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(../fonts/poppins-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/poppins-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/poppins-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/poppins-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/poppins-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'PT Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/pt-serif-400-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'PT Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/pt-serif-400-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'PT Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/pt-serif-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'PT Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/pt-serif-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'PT Serif';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/pt-serif-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'PT Serif';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/pt-serif-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =========================================================================
   Studio Focus - Dott. Umberto Pavoni
   Design system + header unificato.
   Sovrascrive il tema legacy (framework.css / style-*.css / placeholders-*.css)
   e va quindi caricato per ultimo.
   ========================================================================= */

/* ---------- 1. Token ---------------------------------------------------- */
:root {
  /* Colore - allineato al marchio Studio Focus (focusconsulting.it) */
  --sf-ink:        #1a243f;   /* blu navy, superficie strutturale        */
  --sf-ink-soft:   #26314f;
  --sf-ink-line:   rgba(255, 255, 255, .14);

  /* L'oro del marchio vive su superficie, non nel testo: su bianco il
     contrasto e ~1.8:1. Per link e testo si usa la versione profonda. */
  --sf-gold:       #eac753;   /* superfici, bottoni, indicatori          */
  --sf-gold-hi:    #d6ab1a;
  --sf-accent:     #8a6f14;   /* oro profondo - 5.2:1 su bianco          */
  --sf-accent-hi:  #6f5810;

  --sf-text:       #191919;
  --sf-text-mute:  #5f6672;
  --sf-surface:    #ffffff;
  --sf-surface-2:  #eff3f4;
  --sf-line:       rgba(26, 36, 63, .12);

  /* Tipografia - la coppia di focusconsulting.it. Nessun Arial in catena:
     se un font manca si scende al font di sistema. */
  --sf-font:         "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sf-font-display: "PT Serif", Georgia, "Times New Roman", serif;

  /* Materiale traslucido (sezione 12 della guida) */
  --sf-glass:      rgba(26, 36, 63, .86);
  --sf-glass-blur: blur(20px) saturate(180%);

  /* Ritmo - in rem, cosi scala con il font-size scelto dall'utente */
  --sf-shell:      1260px;
  /* Misura di lettura: circa 80 caratteri, il limite alto per un testo
     istituzionale. Oltre, l'occhio perde la riga. */
  --sf-measure:    880px;
  --sf-gap:        1.5rem;
  --sf-radius:     14px;
  --sf-radius-sm:  10px;

  /* Elevazione */
  --sf-shadow-1: 0 1px 2px rgba(12, 18, 34, .06), 0 4px 14px rgba(12, 18, 34, .06);
  --sf-shadow-2: 0 2px 6px rgba(12, 18, 34, .10), 0 18px 40px rgba(12, 18, 34, .14);

  /* Motion - curve che approssimano una molla criticamente smorzata:
     damping 1.0, response ~0.35s. Nessun overshoot sul chrome. */
  --sf-spring:     cubic-bezier(.32, .72, 0, 1);
  --sf-ease-out:   cubic-bezier(.22, 1, .36, 1);
  --sf-t-fast:     140ms;
  --sf-t-base:     340ms;

  --sf-header-h:   84px;
}

/* ---------- 2. Struttura di base ---------------------------------------- */
/* Senza questo, su ogni elemento con larghezza al 100% il padding si somma
   invece di stare dentro: su un telefono il contenuto sborda di 32px e il
   testo esce dallo schermo. Il tema legacy non lo dichiara. */
.sf-shell,
.sf-shell *,
.sf-header,
.sf-header *,
.sf-drawer,
.sf-drawer *,
.sf-footer,
.sf-footer *,
.sf-hero,
.sf-hero *,
.sf-contact,
.sf-contact * { box-sizing: border-box; }

.sf-shell {
  width: 100%;
  max-width: var(--sf-shell);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 4vw, 2rem);
  padding-right: clamp(1rem, 4vw, 2rem);
}

.sf-skip {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 9999;
  padding: .7rem 1.1rem;
  border-radius: var(--sf-radius-sm);
  background: var(--sf-surface);
  color: var(--sf-ink);
  font: 600 .9rem/1 var(--sf-font);
  box-shadow: var(--sf-shadow-2);
  transition: top var(--sf-t-base) var(--sf-spring);
}
.sf-skip:focus { top: 1rem; }

/* Anello di focus coerente su tutto il sito */
.sf-header :focus-visible,
.sf-drawer :focus-visible,
.sf-footer :focus-visible {
  outline: 2px solid var(--sf-gold);
  outline-offset: 3px;
  border-radius: 6px;
}

/* =========================================================================
   3. HEADER
   Un layer traslucido sopra cui scorre il contenuto, non una fascia opaca
   che consuma una striscia fissa di pagina.
   ========================================================================= */
.sf-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  color: #fff;
  background: var(--sf-glass);
  -webkit-backdrop-filter: var(--sf-glass-blur);
  backdrop-filter: var(--sf-glass-blur);
  border-bottom: 1px solid var(--sf-ink-line);
  /* L'ombra compare solo quando il contenuto passa sotto - vedi .is-scrolled */
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: box-shadow var(--sf-t-base) var(--sf-ease-out),
              background var(--sf-t-base) var(--sf-ease-out);
}
.sf-header.is-scrolled {
  background: rgba(26, 36, 63, .90);
  box-shadow: 0 10px 30px rgba(12, 18, 34, .30);
}

/* --- 3a. Barra di servizio ---------------------------------------------- */
.sf-header__utility {
  border-bottom: 1px solid var(--sf-ink-line);
  font-size: .82rem;
  letter-spacing: .01em;      /* tracking positivo sul testo piccolo */
  /* Si ritrae allo scroll: il chrome cede spazio al contenuto */
  max-height: 44px;
  overflow: hidden;
  transition: max-height var(--sf-t-base) var(--sf-spring),
              opacity var(--sf-t-fast) linear;
}
.sf-header.is-scrolled .sf-header__utility { max-height: 0; opacity: 0; }

.sf-header__utility .sf-shell {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 44px;
  flex-wrap: wrap;
}
.sf-utility__item {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: rgba(255, 255, 255, .82);
  text-decoration: none;
  transition: color var(--sf-t-fast) var(--sf-ease-out),
              transform var(--sf-t-fast) var(--sf-ease-out);
}
a.sf-utility__item:hover { color: #fff; text-decoration: none; }
a.sf-utility__item:active { transform: scale(.97); }   /* feedback sul press, non sul rilascio */
.sf-utility__item svg { width: 15px; height: 15px; flex: none; opacity: .8; }
.sf-utility__spacer { margin-left: auto; }

/* --- 3b. Riga principale ------------------------------------------------ */
.sf-header__main .sf-shell {
  display: flex;
  align-items: center;
  gap: var(--sf-gap);
  min-height: var(--sf-header-h);
  transition: min-height var(--sf-t-base) var(--sf-spring);
}
.sf-header.is-scrolled .sf-header__main .sf-shell { min-height: 66px; }

/* Marchio */
.sf-brand {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  text-decoration: none;
  color: #fff;
  flex: none;
  transform-origin: left center;
  transition: transform var(--sf-t-fast) var(--sf-ease-out);
}
.sf-brand:hover { text-decoration: none; color: #fff; }
.sf-brand:active { transform: scale(.985); }
.sf-brand__logo {
  /* Il marchio e su fondo scuro: si usa il lockup in bianco, non il logo
     per fondo chiaro dentro un riquadro. */
  height: 42px;
  width: auto;
  display: block;
  transition: height var(--sf-t-base) var(--sf-spring);
}
.sf-header.is-scrolled .sf-brand__logo { height: 34px; }
.sf-brand__divider {
  width: 1px;
  height: 34px;
  background: rgba(255, 255, 255, .22);
  flex: none;
}
.sf-brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.sf-brand__name {
  font-family: var(--sf-font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.005em;     /* tracking negativo sul testo grande */
  white-space: nowrap;
}
.sf-brand__role {
  font-size: .72rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  /* Su vetro il grigio piatto sparisce: peso e spaziatura in piu */
  color: rgba(255, 255, 255, .72);
  font-weight: 600;
  white-space: nowrap;
}

/* --- 3c. Navigazione ---------------------------------------------------- */
.sf-nav { margin-left: auto; }
.sf-nav__list {
  display: flex;
  align-items: center;
  gap: .15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.sf-nav__item { position: relative; }
.sf-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .62rem .7rem;
  border: 0;
  background: transparent;
  border-radius: 9px;
  color: rgba(255, 255, 255, .88);
  font: 500 .9rem/1 var(--sf-font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--sf-t-fast) var(--sf-ease-out),
              color var(--sf-t-fast) var(--sf-ease-out),
              transform var(--sf-t-fast) var(--sf-ease-out);
}
.sf-nav__link:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  text-decoration: none;
}
.sf-nav__link:active { transform: scale(.97); }
.sf-nav__item.is-current > .sf-nav__link { color: #fff; }
.sf-nav__item.is-current > .sf-nav__link::after {
  content: "";
  position: absolute;
  left: .8rem;
  right: .8rem;
  bottom: .25rem;
  height: 2px;
  border-radius: 2px;
  background: var(--sf-gold);
}
.sf-nav__caret {
  width: 9px; height: 9px;
  flex: none;
  opacity: .7;
  transition: transform var(--sf-t-base) var(--sf-spring);
}
.sf-nav__item.is-open > .sf-nav__link .sf-nav__caret { transform: rotate(180deg); }

/* Sottomenu - origine ancorata alla voce che lo apre */
.sf-nav__panel {
  position: absolute;
  top: calc(100% - .25rem);
  left: 0;
  min-width: 268px;
  padding: .4rem;
  margin: 0;
  list-style: none;
  border-radius: var(--sf-radius);
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: var(--sf-glass-blur);
  backdrop-filter: var(--sf-glass-blur);
  border: 1px solid rgba(255, 255, 255, .5);
  box-shadow: var(--sf-shadow-2);
  transform-origin: top left;
  /* Il vetro si materializza: scala + sfocatura insieme, non un fade piatto */
  opacity: 0;
  transform: translateY(-6px) scale(.97);
  filter: blur(3px);
  pointer-events: none;
  transition: opacity 180ms var(--sf-ease-out),
              transform var(--sf-t-base) var(--sf-spring),
              filter 180ms var(--sf-ease-out);
}
.sf-nav__item.is-open > .sf-nav__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
}
.sf-nav__panel a {
  display: block;
  padding: .6rem .75rem;
  border-radius: var(--sf-radius-sm);
  color: var(--sf-text);
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--sf-t-fast) var(--sf-ease-out),
              color var(--sf-t-fast) var(--sf-ease-out);
}
.sf-nav__panel a:hover { background: rgba(26, 36, 63, .07); color: var(--sf-ink); text-decoration: none; }
.sf-nav__panel a:active { background: rgba(26, 36, 63, .12); }
.sf-nav__panel a small {
  display: block;
  margin-top: .12rem;
  color: var(--sf-text-mute);
  font-weight: 400;
  font-size: .78rem;
}

/* --- 3d. Azioni --------------------------------------------------------- */
.sf-header__actions { display: flex; align-items: center; gap: .5rem; flex: none; }

.sf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .6rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 600 .9rem/1 var(--sf-font);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--sf-t-fast) var(--sf-ease-out),
              background var(--sf-t-fast) var(--sf-ease-out),
              box-shadow var(--sf-t-fast) var(--sf-ease-out);
}
.sf-btn:active { transform: scale(.97); }
.sf-btn--accent {
  background: var(--sf-gold);
  color: var(--sf-ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.sf-btn--accent:hover { background: var(--sf-gold-hi); color: var(--sf-ink); text-decoration: none; box-shadow: 0 4px 14px rgba(214, 171, 26, .45); }
.sf-btn--ghost {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .22);
  color: #fff;
}
.sf-btn--ghost:hover { background: rgba(255, 255, 255, .18); color: #fff; text-decoration: none; }

/* Su fondo chiaro il fantasma sparirebbe: qui serve un contorno pieno */
.sf-btn--outline {
  background: transparent;
  border-color: var(--sf-ink);
  color: var(--sf-ink);
}
.sf-btn--outline:hover { background: var(--sf-ink); color: #fff; text-decoration: none; }

.sf-btn--lg { padding: .9rem 1.6rem; font-size: 1rem; }

/* Contorno chiaro, per i fondi scuri */
.sf-btn--outline-light {
  background: transparent;
  border-color: rgba(255, 255, 255, .45);
  color: #fff;
}
.sf-btn--outline-light:hover { background: #fff; border-color: #fff; color: var(--sf-ink); text-decoration: none; }

/* Ricerca a scomparsa */
.sf-search { position: relative; display: flex; align-items: center; }
.sf-search__input {
  width: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: .9rem;
  opacity: 0;
  transition: width var(--sf-t-base) var(--sf-spring),
              padding var(--sf-t-base) var(--sf-spring),
              opacity var(--sf-t-fast) linear;
}
.sf-search.is-open .sf-search__input {
  width: 190px;
  padding: .55rem .9rem;
  border-color: rgba(255, 255, 255, .25);
  opacity: 1;
}
.sf-search__input::placeholder { color: rgba(255, 255, 255, .55); }
.sf-search__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background var(--sf-t-fast) var(--sf-ease-out),
              transform var(--sf-t-fast) var(--sf-ease-out);
}
.sf-search__toggle:hover { background: rgba(255, 255, 255, .14); }
.sf-search__toggle:active { transform: scale(.92); }
.sf-search__toggle svg { width: 18px; height: 18px; }

/* --- 3e. Hamburger e drawer --------------------------------------------- */
.sf-burger {
  display: none;
  width: 42px; height: 42px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  cursor: pointer;
  transition: background var(--sf-t-fast) var(--sf-ease-out),
              transform var(--sf-t-fast) var(--sf-ease-out);
}
.sf-burger:active { transform: scale(.94); }
.sf-burger__box { display: block; width: 20px; height: 14px; margin: 0 auto; position: relative; }
.sf-burger__box i {
  position: absolute;
  left: 0;
  width: 100%; height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--sf-t-base) var(--sf-spring),
              opacity 120ms linear;
}
.sf-burger__box i:nth-child(1) { top: 0; }
.sf-burger__box i:nth-child(2) { top: 6px; }
.sf-burger__box i:nth-child(3) { top: 12px; }
.sf-burger[aria-expanded="true"] .sf-burger__box i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.sf-burger[aria-expanded="true"] .sf-burger__box i:nth-child(2) { opacity: 0; }
.sf-burger[aria-expanded="true"] .sf-burger__box i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.sf-scrim {
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(12, 18, 34, .52);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--sf-t-base) var(--sf-ease-out);
}
.sf-scrim.is-open { opacity: 1; pointer-events: auto; }

.sf-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 1100;
  width: min(88vw, 360px);
  display: flex;
  flex-direction: column;
  background: rgba(26, 36, 63, .96);
  -webkit-backdrop-filter: var(--sf-glass-blur);
  backdrop-filter: var(--sf-glass-blur);
  color: #fff;
  box-shadow: -18px 0 50px rgba(12, 18, 34, .45);
  /* Entra ed esce dallo stesso lato: percorso simmetrico */
  transform: translate3d(100%, 0, 0);
  visibility: hidden;
  transition: transform var(--sf-t-base) var(--sf-spring),
              visibility 0s linear var(--sf-t-base);
  overscroll-behavior: contain;
}
.sf-drawer.is-open {
  transform: translate3d(0, 0, 0);
  visibility: visible;
  transition: transform var(--sf-t-base) var(--sf-spring), visibility 0s;
}
.sf-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--sf-ink-line);
}
.sf-drawer__title { font: 600 .78rem/1 var(--sf-font); letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.sf-drawer__close {
  width: 36px; height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--sf-t-fast) var(--sf-ease-out), transform var(--sf-t-fast) var(--sf-ease-out);
}
.sf-drawer__close:hover { background: rgba(255, 255, 255, .2); }
.sf-drawer__close:active { transform: scale(.9); }
.sf-drawer__body { flex: 1; overflow-y: auto; padding: .75rem .75rem 1.5rem; -webkit-overflow-scrolling: touch; }
.sf-drawer__group + .sf-drawer__group { margin-top: .35rem; }
.sf-drawer__label {
  padding: .9rem .75rem .35rem;
  font: 600 .72rem/1 var(--sf-font);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .45);
}
.sf-drawer a {
  display: block;
  padding: .72rem .75rem;
  border-radius: var(--sf-radius-sm);
  color: rgba(255, 255, 255, .9);
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--sf-t-fast) var(--sf-ease-out), transform var(--sf-t-fast) var(--sf-ease-out);
}
.sf-drawer a:hover { background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
.sf-drawer a:active { transform: scale(.985); background: rgba(255, 255, 255, .16); }
.sf-drawer a.is-current { color: #fff; background: rgba(234, 199, 83, .22); }
.sf-drawer__foot { padding: 1rem 1.25rem 1.4rem; border-top: 1px solid var(--sf-ink-line); display: grid; gap: .6rem; }

@media (max-width: 1180px) {
  .sf-nav, .sf-search { display: none; }
  .sf-burger { display: inline-flex; align-items: center; justify-content: center; }
  .sf-brand__role { display: none; }
  .sf-brand__divider { height: 26px; }
  /* Era la navigazione a spingere i pulsanti a destra: sparita lei, il
     bottone del menu restava appiccicato al marchio. */
  .sf-header__actions { margin-left: auto; }
}
@media (max-width: 560px) {
  .sf-header__utility .sf-shell { min-height: 40px; }
  .sf-utility__hide-sm { display: none; }
  .sf-header__actions .sf-btn--accent { display: none; }
  .sf-brand__name, .sf-brand__divider { display: none; }
  .sf-brand__logo { height: 34px; }
}

/* =========================================================================
   4. FOOTER
   ========================================================================= */
.sf-footer {
  background: var(--sf-ink);
  color: rgba(255, 255, 255, .78);
  font: 400 .9rem/1.65 var(--sf-font);
  padding: 3rem 0 1.75rem;
  border-top: 3px solid var(--sf-gold);
}
.sf-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--sf-ink-line);
}
@media (max-width: 800px) { .sf-footer__grid { grid-template-columns: 1fr; gap: 1.75rem; } }
.sf-footer h4 {
  margin: 0 0 .9rem;
  font: 600 .74rem/1 var(--sf-font);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}
.sf-footer p { margin: 0 0 .5rem; }
.sf-footer ul { list-style: none; margin: 0; padding: 0; }
.sf-footer li { margin-bottom: .45rem; }
.sf-footer a { color: rgba(255, 255, 255, .82); text-decoration: none; transition: color var(--sf-t-fast) var(--sf-ease-out); }
.sf-footer a:hover { color: #fff; text-decoration: underline; }
.sf-footer__brand { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.sf-footer__brand img { width: auto; height: 34px; border-radius: 0; background: none; }
.sf-footer__brand strong { display: block; font-family: var(--sf-font-display); font-size: 1.18rem; font-weight: 700; color: #fff; letter-spacing: -.005em; }
.sf-footer__brand span { font-size: .8rem; color: rgba(255, 255, 255, .6); }
.sf-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  font-size: .82rem;
  color: rgba(255, 255, 255, .55);
}

/* =========================================================================
   5. Accessibilita - tre segnali indipendenti
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .sf-header, .sf-header *, .sf-drawer, .sf-scrim, .sf-nav__panel {
    transition-duration: 120ms !important;
    transition-timing-function: linear !important;
  }
  /* Niente slide o scale: solo dissolvenza */
  .sf-nav__panel { transform: none !important; filter: none !important; }
  .sf-drawer { transition: opacity 160ms linear, visibility 0s !important; transform: none !important; opacity: 0; }
  .sf-drawer.is-open { opacity: 1; }
  .sf-btn:active, .sf-brand:active, .sf-nav__link:active, .sf-burger:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .sf-header, .sf-drawer { background: var(--sf-ink); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .sf-nav__panel { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .sf-scrim { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(12, 18, 34, .74); }
}
@media (prefers-contrast: more) {
  .sf-header { background: #141c33; border-bottom-color: rgba(255, 255, 255, .5); }
  .sf-nav__link { color: #fff; }
  .sf-nav__panel { background: #fff; border: 2px solid var(--sf-ink); }
  .sf-drawer { background: #141c33; }
}

/* Blocco dello scroll quando il drawer e aperto */
html.sf-locked, body.sf-locked { overflow: hidden; }

/* =========================================================================
   6. RICERCA
   Il sito e statico: non c'e un motore di ricerca sul server. L'elenco dei
   titoli viene caricato solo quando si apre il pannello, cosi chi non cerca
   non scarica nulla in piu.
   ========================================================================= */
.sf-cerca { position: relative; display: flex; align-items: center; }

.sf-cerca__lente {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background var(--sf-t-fast) var(--sf-ease-out),
              transform var(--sf-t-fast) var(--sf-ease-out);
}
.sf-cerca__lente:hover { background: rgba(255, 255, 255, .14); }
.sf-cerca__lente:active { transform: scale(.92); }
.sf-cerca__lente svg { width: 19px; height: 19px; }

/* Il pannello: si apre ancorato alla lente che lo ha aperto */
.sf-cerca__pannello {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  width: min(440px, calc(100vw - 2rem));
  border-radius: var(--sf-radius);
  background: rgba(255, 255, 255, .97);
  -webkit-backdrop-filter: var(--sf-glass-blur);
  backdrop-filter: var(--sf-glass-blur);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: var(--sf-shadow-2);
  transform-origin: top right;
  opacity: 0;
  transform: translateY(-8px) scale(.97);
  filter: blur(3px);
  pointer-events: none;
  transition: opacity 180ms var(--sf-ease-out),
              transform var(--sf-t-base) var(--sf-spring),
              filter 180ms var(--sf-ease-out);
}
.sf-cerca.is-open .sf-cerca__pannello {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  pointer-events: auto;
}

.sf-cerca__barra {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--sf-line);
}
.sf-cerca__icona { width: 18px; height: 18px; flex: none; color: var(--sf-text-mute); }
.sf-cerca__campo {
  flex: 1;
  border: 0;
  background: transparent;
  font: 400 1rem/1.4 var(--sf-font);
  color: var(--sf-text);
  outline: none;
  min-width: 0;
}
.sf-cerca__campo::-webkit-search-cancel-button { display: none; }
.sf-cerca__chiudi {
  border: 0;
  background: transparent;
  color: var(--sf-text-mute);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0 .2rem;
  cursor: pointer;
}
.sf-cerca__chiudi:hover { color: var(--sf-text); }

.sf-cerca__esiti { max-height: min(60vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
.sf-cerca__esiti:empty { display: none; }

.sf-esito {
  display: block;
  padding: .7rem .9rem;
  border-bottom: 1px solid rgba(26, 36, 63, .07);
  color: var(--sf-text);
  text-decoration: none;
  transition: background var(--sf-t-fast) var(--sf-ease-out);
}
.sf-esito:last-child { border-bottom: 0; }
.sf-esito:hover,
.sf-esito.is-attivo { background: rgba(26, 36, 63, .06); text-decoration: none; }
.sf-esito__titolo {
  display: block;
  font-family: var(--sf-font-display);
  font-size: .97rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--sf-ink);
}
.sf-esito__titolo mark {
  background: rgba(234, 199, 83, .5);
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}
.sf-esito__somm {
  display: block;
  margin-top: .18rem;
  font-size: .84rem;
  line-height: 1.45;
  color: var(--sf-text-mute);
}
.sf-esito__sez {
  display: inline-block;
  margin-top: .3rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--sf-accent);
}
.sf-cerca__nota {
  padding: 1.1rem .9rem;
  font-size: .9rem;
  color: var(--sf-text-mute);
  text-align: center;
}

/* Su schermo stretto il pannello occupa tutta la larghezza utile */
@media (max-width: 620px) {
  .sf-cerca__pannello {
    position: fixed;
    top: 64px;
    left: 1rem;
    right: 1rem;
    width: auto;
    transform-origin: top center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sf-cerca__pannello { transform: none !important; filter: none !important; }
  .sf-cerca__lente:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .sf-cerca__pannello { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .sf-cerca__pannello { background: #fff; border: 2px solid var(--sf-ink); }
}

/* =========================================================================
   7. CONSENSO AI COOKIE
   Un riquadro in basso, non un velo che copre la pagina: si puo continuare
   a leggere mentre si decide. Le due scelte hanno lo stesso peso visivo,
   come chiedono le linee guida.
   ========================================================================= */
.sf-cookie {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  max-width: 900px;
  margin-inline: auto;
  padding: 1.15rem 1.4rem;
  border-radius: var(--sf-radius);
  background: rgba(255, 255, 255, .97);
  -webkit-backdrop-filter: var(--sf-glass-blur);
  backdrop-filter: var(--sf-glass-blur);
  border: 1px solid rgba(26, 36, 63, .12);
  box-shadow: var(--sf-shadow-2);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 240ms var(--sf-ease-out),
              transform var(--sf-t-base) var(--sf-spring);
}
.sf-cookie.is-open { opacity: 1; transform: translateY(0); }

.sf-cookie__titolo {
  display: block;
  margin-bottom: .3rem;
  font-family: var(--sf-font-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--sf-ink);
}
.sf-cookie__testo p {
  margin: 0;
  font-size: .9rem;
  line-height: 1.55;
  color: var(--sf-text);
}
.sf-cookie__testo a { color: var(--sf-accent); }
.sf-cookie__testo a:hover { color: var(--sf-accent-hi); }

.sf-cookie__scelte {
  display: flex;
  gap: .6rem;
  flex: none;
}
/* Rifiutare dev'essere facile quanto accettare: stessa dimensione, stessa
   evidenza, nessun bottone nascosto in un sottomenu. */
.sf-cookie__scelte .sf-btn { padding: .7rem 1.15rem; white-space: nowrap; }

@media (max-width: 760px) {
  .sf-cookie {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1.1rem 1.2rem;
  }
  .sf-cookie__scelte { flex-direction: column-reverse; }
  .sf-cookie__scelte .sf-btn { justify-content: center; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .sf-cookie { transition: opacity 160ms linear; transform: none; }
  .sf-cookie.is-open { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .sf-cookie { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .sf-cookie { background: #fff; border: 2px solid var(--sf-ink); }
}
@media print { .sf-cookie { display: none !important; } }
