/* =====================================================================
   MENU DEL SITO (assets/css/menu.css)  -  pari pari a al-folio
   Si abbina a _includes/masthead.html e assets/js/menu.js.
   I colori NON sono scritti qui: arrivano da _data/tema.json tramite le variabili
   --t-nav-bg, --t-nav-text, --t-nav-hover, --t-accent, --t-font, --t-radius
   (definite in _includes/head/custom.html). Cambia il tema, cambia il menu.

   PUNTO CRITICO - IL BREAKPOINT: sotto 768px compare l'hamburger. Il numero sta in UN
   solo punto: la riga "@media (max-width: 767.98px)" piu' in basso. Per far scattare
   l'hamburger prima (es. con tante voci) alza il numero (es. 900px -> 899.98px).
   Le classi iniziano con "nv" per non scontrarsi con quelle del tema (greedy-nav, masthead).
   ===================================================================== */

.nv-header { position: sticky; top: 0; z-index: 1000; background: var(--t-nav-bg, #fff); border-bottom: 1px solid #e8e8e8; font-family: var(--t-font, inherit); }
.nv__inner { max-width: 1280px; margin: 0 auto; padding: .35rem 1rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.nv__brand { font-weight: 700; font-size: 1.15rem; color: var(--t-nav-text, #111); text-decoration: none; padding: .5rem 0; }
.nv__brand:hover { color: var(--t-nav-hover, #555); }

/* ---- DESKTOP: pannello e lista in riga ---- */
.nv__toggle { display: none; }
.nv__panel { display: flex; flex: 1 1 auto; justify-content: flex-end; }
.nv__list { display: flex; align-items: center; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.nv__item { position: relative; margin: 0; padding: 0; }
.nv__link { display: block; padding: .5rem .75rem; margin: 0; background: none; border: 0; border-radius: 0; font: inherit; font-size: .95rem; color: var(--t-nav-text, #111); text-decoration: none; cursor: pointer; line-height: 1.4; }
.nv__link:hover, .nv__link:focus-visible { color: var(--t-nav-hover, #555); text-decoration: none; }
.nv__item.active > .nv__link { font-weight: 700; color: var(--t-accent, #d9480f); }

/* freccetta accanto al padre della tendina (solo CSS, non va scritta nell'HTML) */
.nv__link--dd::after { content: ""; display: inline-block; margin-left: .4em; vertical-align: .18em; border: .3em solid transparent; border-top-color: currentColor; border-bottom: 0; }

/* tendina: nascosta finche' l'<li> non riceve la classe .show (la mette menu.js) */
.nv__dd { display: none; position: absolute; top: 100%; left: 0; min-width: 14rem; padding: .35rem 0; background: var(--t-nav-bg, #fff); border: 1px solid #e8e8e8; border-radius: var(--t-radius, 8px); box-shadow: 0 8px 24px rgba(0,0,0,.08); z-index: 1001; }
.nv__item.show > .nv__dd { display: block; }
/* le ultime voci aprono la tendina verso sinistra, cosi' non esce dallo schermo */
.nv__item:nth-last-child(-n+3) > .nv__dd { left: auto; right: 0; }
.nv__dd-item { display: block; padding: .45rem 1rem; white-space: nowrap; font-size: .92rem; color: var(--t-nav-text, #111); text-decoration: none; }
.nv__dd-item:hover { color: var(--t-nav-hover, #555); background: rgba(0,0,0,.04); text-decoration: none; }
.nv__dd-item.active { background: var(--t-accent, #d9480f); color: #fff; }
.nv__divider { height: 1px; margin: .35rem 0; background: #e8e8e8; }
/* sicurezza: una tendina non e' mai piu' alta dello schermo, se serve scorre */
.nv__dd { max-height: calc(100vh - 5rem); overflow-y: auto; }
/* TENDINA LARGA (classe messa da masthead.html quando ha piu' di 8 voci): 2 colonne, ancorata a destra
   della barra (non sotto il padre), cosi' sta sempre dentro lo schermo e si legge tutta senza scorrere */
.nv__inner { position: relative; }
.nv__item--wide { position: static; }
.nv__dd--wide { left: auto; right: 1rem; width: min(44rem, calc(100vw - 2rem)); columns: 2; column-gap: 0; }
.nv__dd--wide .nv__dd-item { white-space: normal; break-inside: avoid; }
.nv__dd--wide .nv__divider { column-span: all; }

/* strumenti (lente + carrello) */
.nv__tools { display: flex; align-items: center; gap: .35rem; padding-left: .35rem; }
.nv__tools .search__toggle { background: none; border: 0; padding: .5rem; margin: 0; height: auto; cursor: pointer; color: var(--t-nav-text, #111); font-size: 1rem; }
.nv__tools .search__toggle:hover { color: var(--t-accent, #d9480f); }

/* ---- hamburger a 3 lineette (diventa una X quando e' aperto) ---- */
.nv__toggle { padding: .6rem .5rem; margin-left: auto; background: none; border: 0; cursor: pointer; }
.nv__bar { display: block; width: 22px; height: 2px; margin-bottom: 4px; background: var(--t-nav-text, #111); border-radius: 1px; transition: all .2s; }
.nv__bar--top { transform: rotate(45deg); transform-origin: 10% 10%; }
.nv__bar--mid { opacity: 0; }
.nv__bar--bot { transform: rotate(-45deg); transform-origin: 10% 90%; margin-bottom: 0; }
.nv__toggle.collapsed .nv__bar--top, .nv__toggle.collapsed .nv__bar--bot { transform: rotate(0); }
.nv__toggle.collapsed .nv__bar--mid { opacity: 1; }

/* ---- MOBILE / FINESTRA STRETTA: tutto dentro il pannello a scomparsa ---- */
@media (max-width: 767.98px) {
  .nv__toggle { display: block; }
  .nv__panel { display: none; flex-basis: 100%; justify-content: flex-start; max-height: calc(100vh - 4rem); overflow-y: auto; }
  .nv__panel.show { display: block; }
  .nv__list { flex-direction: column; align-items: stretch; gap: 0; width: 100%; padding-bottom: .5rem; }
  .nv__link { width: 100%; text-align: left; padding: .7rem .25rem; }
  .nv__link--dd { display: flex; justify-content: space-between; align-items: center; }
  /* la tendina non e' piu' sospesa: si apre in colonna sotto il padre */
  .nv__dd { position: static; min-width: 0; box-shadow: none; border: 0; border-left: 2px solid #e8e8e8; border-radius: 0; margin: 0 0 .35rem .5rem; padding: 0; }
  .nv__item:nth-last-child(-n+3) > .nv__dd { left: auto; right: auto; }
  .nv__dd-item { white-space: normal; padding: .55rem .9rem; }
  .nv__dd--wide { width: auto; columns: 1; right: auto; max-height: none; }
  .nv__item--wide { position: relative; }
  .nv__tools { padding: .25rem 0; }
}
@media (prefers-reduced-motion: reduce) { .nv__bar { transition: none; } }

/* =====================================================================
   COLORI MENU - palette arancio acido (15/10/2026)
   PERCHE': le voci-link visitate diventavano celestine (a:visited del tema Minimal Mistakes ha
   specificita' 0,1,1 e batteva .nv__link 0,1,0), mentre i <button> restavano neri.
   QUI: "a.nv__link" + :visited/:focus hanno specificita' piu' alta, quindi link e bottoni
   sono SEMPRE dello stesso colore (--t-nav-text). Hover/attivo = arancio scuro (--t-accent) con
   barretta arancio vivo #ff8a1f sotto (testo acido su bianco non si leggerebbe).
   I colori base si cambiano in _data/tema.json, l'acido e' scritto solo qui.
   ===================================================================== */
a.nv__brand, a.nv__brand:visited, a.nv__link, a.nv__link:visited, a.nv__link:focus, a.nv__link:active { color: var(--t-nav-text, #15191d); }
a.nv__brand:hover, a.nv__link:hover, a.nv__link:focus-visible, .nv__link:hover, .nv__link:focus-visible { color: var(--t-accent, #d9480f); }
.nv__link { box-shadow: inset 0 -3px 0 transparent; transition: box-shadow .15s, color .15s; }
.nv__link:hover, .nv__link:focus-visible, .nv__item.show > .nv__link { box-shadow: inset 0 -3px 0 #ff8a1f; }
.nv__item.active > a.nv__link, .nv__item.active > a.nv__link:visited, .nv__item.active > .nv__link { color: var(--t-accent, #d9480f); font-weight: 700; box-shadow: inset 0 -3px 0 #ff8a1f; }
a.nv__dd-item, a.nv__dd-item:visited, a.nv__dd-item:focus { color: var(--t-nav-text, #15191d); }
a.nv__dd-item:hover, a.nv__dd-item:focus-visible { color: var(--t-accent, #d9480f); background: #fbf3ea; box-shadow: inset 3px 0 0 #ff8a1f; }
a.nv__dd-item.active, a.nv__dd-item.active:visited, a.nv__dd-item.active:hover { background: #ff8a1f; color: #15191d; box-shadow: none; }
@media (max-width: 767.98px) { .nv__link, .nv__item.active > .nv__link { box-shadow: none; } .nv__item.active > .nv__link { border-left: 3px solid #ff8a1f; padding-left: .6rem; } }