/* Header Very Hosting (desktop + mobile drawer) - lighter weights + radius 10 + smaller text/padding + logo sizing */

:root{
  --vh-header-bg: #000;
  --vh-header-fg: #fff;
  --vh-header-muted: rgba(255,255,255,.72);
  --vh-blue: #0b36c6;
  --vh-blue-hover: #0a2fae;

  --vh-radius: 10px;
  --vh-shadow: 0 14px 30px rgba(0,0,0,.25);

  /* dimensioni logo */
  --vh-logo-size: 52px;
  --vh-logo-size-sm: 46px;
  --vh-logo-img-max-h: 40px;
  --vh-logo-img-max-h-sm: 36px;
}

/* blocco scroll quando drawer aperto */
html.vh-lock, body.vh-lock { overflow: hidden; }
html, body{ scroll-behavior: smooth;scroll-padding-top: 75px; }

/* Header sempre visibile (fixed) */
.vh-site-header{
  background: var(--vh-header-bg);
  color: var(--vh-header-fg);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
}

/* Compensa altezza header così il contenuto non va sotto */
body{
  padding-top: 0px;
}

.vh-header__inner{
  height: 74px;
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 14px;
}

.vh-link{
    text-decoration:none !important;
}

a.vh-btn.vh-btn--primary {
    text-decoration: none !important;
}

nav.vh-nav.vh-nav--mobile {
    overflow-x: hidden;
}
.vh-menu--desktop a:hover{
  background: linear-gradient(90deg, #ffffff 0%, #0b36c6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.vh-menu--desktop a{
  transition: color .15s ease, background .15s ease;
}

/* =========================
   Logo (custom logo + fallback testo)
   ========================= */
.vh-logo{
  display: inline-flex;
  align-items: center;
  justify-content: start;
  margin-left:-5px;
  width: var(--vh-logo-size);
  height: var(--vh-logo-size);
  border-radius: 999px;
  text-decoration: none;
  gap: 10px;
}

/* WP output: the_custom_logo() stampa <a class="custom-logo-link"><img class="custom-logo"></a> */
.vh-logo .custom-logo-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.vh-logo .custom-logo{
  display: block;
  width: auto;
  height: auto;
  max-height: var(--vh-logo-img-max-h);
  max-width: 180px;
}

/* fallback testo (nome sito) */
.vh-logo__text{
  color: #fff;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: -0.2px;
  line-height: 1.1;
  white-space: nowrap;
}

/* eventuale fallback "mark" (se lo usi ancora altrove) */
.vh-logo__mark{
  width: var(--vh-logo-size);
  height: var(--vh-logo-size);
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 500;
  font-size: 20px;
  letter-spacing: .3px;
  background: radial-gradient(circle at 30% 30%, #2c5bff, #1536a0 65%, #0b0f1e 100%);
  color: #fff;
  text-transform: none;
}

/* variante small (drawer) */
.vh-logo--small{
  width: var(--vh-logo-size-sm);
  height: var(--vh-logo-size-sm);
}
.vh-logo--small .custom-logo{
  max-height: var(--vh-logo-img-max-h-sm);
  max-width: 180px;
}
.vh-logo--small .vh-logo__text{
  color: #000; /* drawer bianco */
  font-size: 14px;
  font-weight: 400;
}
.vh-logo--small .vh-logo__mark{
  width: var(--vh-logo-size-sm);
  height: var(--vh-logo-size-sm);
  font-size: 18px;
}

/* =========================
   Desktop nav
   ========================= */
.vh-nav--desktop{ display:flex; justify-content:center; }

.vh-menu{
  list-style: none;
  margin: 0;
  padding: 0;
}

.vh-menu--desktop{
  display: flex;
  align-items: center;
  gap: 26px;
}

.vh-menu--desktop li{ position: relative; }

.vh-menu--desktop a{
  color: #fff;
  text-decoration: none;
  font-weight: 400;
  font-size: 14px;
  line-height: 1;
  padding: 8px 2px;
  display:inline-flex;
  align-items:center;
  gap: 7px;
}

/* Desktop chevron “bella” (giù) */
.vh-menu--desktop .menu-item-has-children > a{
  position: relative;
  padding-right: 18px;
}
.vh-menu--desktop .menu-item-has-children > a::after{
  content:"";
  position:absolute;
  right: 2px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(255,255,255,.85);
  border-bottom: 2px solid rgba(255,255,255,.85);
  transform: translateY(-55%) rotate(45deg);
}

/* submenu desktop: più piccolo + stabile */
.vh-menu--desktop .sub-menu{
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  max-width: 360px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
  display: none;
  z-index: 9999;
  margin-top: 10px;
}

/* “ponte” invisibile per non perdere hover */
.vh-menu--desktop .sub-menu::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:-14px;
  height:14px;
  background:transparent;
}

.vh-menu--desktop li:hover > .sub-menu,
.vh-menu--desktop li:focus-within > .sub-menu{
  display:block;
}

.vh-menu--desktop .sub-menu a{
  width: 100%;
  display:block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration:none;
  color: rgba(0,0,0,.72);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  line-height: 1.15;
}
/* SUBMENU DESKTOP: gradiente testo in hover + pill leggero */
.vh-menu--desktop .sub-menu a{
  position: relative;
  isolation: isolate; /* permette al ::before di stare “dietro” */
  transition: background-color .15s ease, color .15s ease, background-image .15s ease;
}

.vh-menu--desktop .sub-menu a::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: 10px;
  background: rgba(0,0,0,.04);
  opacity: 0;
  transition: opacity .15s ease;
  z-index: -1;
}

.vh-menu--desktop .sub-menu a:hover,
.vh-menu--desktop .sub-menu a:focus-visible{
  /* gradiente sul testo (più leggibile su sfondo bianco rispetto a bianco->blu) */
  background-image: linear-gradient(90deg, #000 0%, var(--vh-blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.vh-menu--desktop .sub-menu a:hover::before,
.vh-menu--desktop .sub-menu a:focus-visible::before{
  opacity: 1; /* mantiene anche il “pill” leggero sotto */
}

/* =========================
   Right actions
   ========================= */
.vh-header__right{
  display:flex;
  align-items:center;
  gap: 12px;
}

.vh-link{
  color: #fff;
  text-decoration: none;
  font-weight: 400;
  font-size: 14px;
}
.vh-link:hover{ opacity: .9; }

/* CTA button */
.vh-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  font-weight: 400;
  border-radius: var(--vh-radius);
  padding: 10px 14px;
  border: 1px solid transparent;
  line-height: 1;
  white-space: nowrap;
  font-size: 14px;
}

.vh-btn--primary{
  background: var(--vh-blue);
  color: #fff;
}
.vh-btn--primary:hover{
  background: var(--vh-blue-hover);
}

/* Burger */
.vh-burger{
  display:none;
  width: 48px;
  height: 48px;
  border-radius: var(--vh-radius);
  border: 1px solid rgba(255,255,255,.12);
  background: transparent;
  cursor: pointer;
}
.vh-burger__lines{
  width: 20px;
  height: 2px;
  display:block;
  margin: 0 auto;
  background: #fff;
  position: relative;
}
.vh-burger__lines::before,
.vh-burger__lines::after{
  content:"";
  width: 20px;
  height: 2px;
  background:#fff;
  position:absolute;
  left:0;
}
.vh-burger__lines::before{ top: -6px; }
.vh-burger__lines::after{ top: 6px; }

/* =========================
   Drawer
   ========================= */
.vh-drawer{
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}
.vh-drawer.is-open{
  opacity: 1;
  pointer-events: auto;
}

.vh-drawer__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.35);
}

.vh-drawer__panel{
  position:absolute;
  inset: 0;
  background: #fff;
  color: #000;
  transform: translateY(10px);
  transition: transform .2s ease;
}
.vh-drawer.is-open .vh-drawer__panel{
  transform: translateY(0);
}

.vh-drawer__top{
  height: 82px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 14px 14px;
}

.vh-drawer__close{
  width: 48px;
  height: 48px;
  border-radius: var(--vh-radius);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 40px;
  line-height: 1;
}

/* Mobile nav wrapper */
.vh-nav--mobile{
  padding: 10px 14px 104px;
}

/* Mobile menu base */
.vh-menu--mobile{
  list-style:none;
  margin: 0;
  padding: 0;
}

.vh-menu--mobile > li{
  padding: 14px 0;
  border-bottom: 1px solid #eee;
}

.vh-menu--mobile a{
  width: 100%;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 14px;
  text-decoration:none;
  color:#000;
  font-weight: 400;
  font-size: 34px;
  letter-spacing: -0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile chevron “bella” (destra) + rotazione quando “open” (per feedback) */
.vh-menu--mobile .menu-item-has-children > a{
  position: relative;
  padding-right: 22px;
}
.vh-menu--mobile .menu-item-has-children > a::after{
  content:"";
  position:absolute;
  right: 0;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(0,0,0,.35);
  border-top: 2px solid rgba(0,0,0,.35);
  transform: translateY(-50%) rotate(45deg);
  transition: transform .18s ease;
}
.vh-menu--mobile li.is-sub-open > a::after{
  transform: translateY(-50%) rotate(135deg); /* “giù” */
}

/* IMPORTANT: il sub-menu nel menu principale (mobile) resta nascosto:
   lo mostriamo dentro la "pagina nuova" (vh-subpanel) via JS (clone) */
.vh-menu--mobile .sub-menu{
  display: none;
}

/* Bottom sticky CTA (drawer) */
.vh-drawer__bottom{
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  background: transparent;
  z-index: 20;
  display: flex;
  align-items: stretch;
}

/* bottone nel drawer: 100% + gradiente + più padding */
.vh-drawer__bottom .vh-btn{
  flex: 1 1 auto;
  width: 100% !important;
  display: flex !important;
  justify-content: center;

  padding-left: 16px;
  padding-right: 16px;
  padding-bottom:5px;
  padding-top: 5px;
  font-size: 20px;

  background: linear-gradient(90deg, #000 0%, #2626dd 100%) !important;
  border-color: transparent !important;
  color: #fff !important;
  opacity: 1;
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
}
.vh-drawer__bottom .vh-btn:hover{
  background: linear-gradient(90deg, #000 0%, #1f1fc4 100%) !important;
}

/* =========================
   Responsive behavior
   ========================= */
@media (max-width: 1024px){
  .vh-nav--desktop{ display:none; }
  .vh-link{ display:none; }
  .vh-burger{ display:inline-flex; align-items:center; justify-content:center; }

  .vh-header__inner{
    grid-template-columns: 64px 1fr auto;
  }

  .vh-header__right{
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  /* bottone in header (NON drawer): resta “fit-content” */
  .vh-site-header .vh-header__right > .vh-btn{
    width: auto !important;
    flex: 0 0 auto;
    min-width: 0;
  }

  /* HEADER CTA (mobile): gradiente come desktop */
  .vh-site-header .vh-header__right a.vh-btn.vh-btn--primary,
  .vh-site-header .vh-header__right .vh-btn.vh-btn--primary{
    background: linear-gradient(90deg, #000 0%, #0b36c6 100%) !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;

    background-color: transparent !important;
    background-image: linear-gradient(90deg, #000 0%, #0b36c6 100%) !important;
    background-clip: padding-box !important;
    filter: none !important;
    color: #fff !important;
  }
  .vh-site-header .vh-header__right a.vh-btn.vh-btn--primary:hover,
  .vh-site-header .vh-header__right .vh-btn.vh-btn--primary:hover{
    background-image: linear-gradient(90deg, #000 0%, #0a2fae 100%) !important;
  }
  .vh-site-header .vh-header__right a.vh-btn.vh-btn--primary:focus-visible,
  .vh-site-header .vh-header__right .vh-btn.vh-btn--primary:focus-visible{
    outline: 2px solid rgba(11,54,198,.55) !important;
    outline-offset: 2px !important;
  }

  /* wrapper header: togliamo max-width/margini (se vh-wrap è un container) */
  .vh-wrap{
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    gap: 0;
  }

  /* TOP del drawer: meno spazio */
  .vh-drawer__top{
    height: 68px;
    padding: 10px 14px;
  }

  /* menu principale mobile: compatto + scroll + spazio CTA */
  .vh-nav--mobile{
    padding: 0 !important;
    padding-top: 0 !important;
    height: calc(100vh - 68px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 140px;
    position: relative;
  }

  .vh-menu--mobile{
    display:flex !important;
    flex-direction: column !important;
    padding: 6px 18px 140px !important;
    gap: 0 !important;
  }

  .vh-menu--mobile > li{
    padding: 0 !important;
    border-bottom: 0 !important;
  }

  .vh-menu--mobile > li > a{
    font-size: 28px !important;
    font-weight: 800 !important;
    line-height: 1.12 !important;
    padding: 12px 0 !important;
  }

  /* ==========================================================
     DRILLDOWN: sub-menu (overlay pannello) - RIPRISTINATO
     ========================================================== */

  .vh-nav--mobile.vh-subpanel-open .vh-menu--mobile{
    opacity: 0;
    pointer-events: none;
  }

  .vh-subpanel{
    position: absolute;
    inset: 0;
    background: #fff;
    z-index: 15;
    transform: translateX(100%);
    transition: transform .22s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px 18px 140px;
  }
  .vh-subpanel.is-open{
    transform: translateX(0);
  }

  .vh-subpanel__top{
    position: sticky;
    top: 0;
    background: #fff;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
    z-index: 2;
  }

  /* FRECCIA BACK: più piccola, grigia, leggermente più a sinistra */
  .vh-subpanel__back{
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: rgba(0,0,0,.55);
    margin-left: -6px;
    margin-right: -6px;
    padding: 0;
  }

  .vh-subpanel__title{
    font-size: 14px;
    letter-spacing: 3px;
    font-weight: 800;
    color: rgba(0,0,0,.55);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .vh-subpanel__body{
    padding-top: 6px;
  }

  .vh-subpanel__menu{
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .vh-subpanel__menu > li{
    margin: 0;
    padding: 0;
  }

  .vh-subpanel__menu > li > a{
    display: block;
    width: 100%;
    font-size: 26px;
    font-weight: 850;
    line-height: 1.12;
    padding: 12px 0;
    color: #000;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* SUBPANEL: CTA più compatta (quando il pannello è aperto) */
  .vh-nav--mobile.vh-subpanel-open ~ .vh-drawer__bottom .vh-btn{
    
    font-size: 18px !important;
  }
}

@media (max-width: 520px){
  :root{
    --vh-logo-size: 50px;
    --vh-logo-size-sm: 46px;
    --vh-logo-img-max-h: 40px;
    --vh-logo-img-max-h-sm: 36px;
  }

  .vh-header__inner{ height: 66px; }
  body{ padding-top: 66px; }

  /* bottone header */
  .vh-site-header .vh-btn--primary{
    padding: 9px 10px;
    font-size: 13px;
  }

  /* burger uguale al bottone (contenitore + icona) */
  .vh-burger{
    width: 34px;
    height: 34px;
    border-radius: var(--vh-radius);
  }
  .vh-burger__lines{
    width: 16px;
    height: 2px;
  }
  .vh-burger__lines::before,
  .vh-burger__lines::after{
    width: 16px;
    height: 2px;
  }
  .vh-burger__lines::before{ top: -5px; }
  .vh-burger__lines::after{ top: 5px; }

  .vh-menu--mobile > li > a{
    font-size: 26px !important;
    padding: 10px 0 !important;
  }

  .vh-menu--mobile{
    margin-top: -15px;
  }

  .vh-subpanel{
    padding: 0 20px 140px;
  }

  .vh-subpanel__menu > li > a{
    font-size: 24px;
    padding: 10px 0;
  }

  .vh-drawer__bottom .vh-btn{
    font-size: 18px;
    
  }
}

/* CTA header desktop: sempre gradiente nero -> blu */
@media (min-width: 1025px){
  /* HEADER CTA: gradiente pulito, niente bordi/ombre/outline */
  .vh-site-header .vh-header__right a.vh-btn.vh-btn--primary{
    background: linear-gradient(90deg, #000 0%, #0b36c6 100%) !important;

    /* elimina la riga blu: spesso è border o inset shadow */
    border: 0 !important;
    box-shadow: none !important;
    outline: 0 !important;

    /* elimina eventuali layer strani */
    background-color: transparent !important;
    background-image: linear-gradient(90deg, #000 0%, #0b36c6 100%) !important;
    background-clip: padding-box !important;

    /* safety */
    filter: none !important;
  }

  .vh-site-header .vh-header__right a.vh-btn.vh-btn--primary:hover{
    background-image: linear-gradient(90deg, #000 0%, #0a2fae 100%) !important;
  }

  /* focus accessibile ma senza “riga dentro” */
  .vh-site-header .vh-header__right a.vh-btn.vh-btn--primary:focus-visible{
    outline: 2px solid rgba(11,54,198,.55) !important;
    outline-offset: 2px !important;
  }
}
/* Submenu top: avvicina titolo alla freccia */
.vh-subpanel__top{
  display: flex;
  align-items: center;
  gap: 2px;               /* ↓ era più alto: riduci qui */
}

/* Bottone freccia: togli “aria” attorno */
.vh-subpanel__back{
  padding: 0px;       /* ↓ riduci padding */
  line-height: 1;
  margin: 0;              /* sicurezza */
  flex: 0 0 auto;
}

/* Titolo: niente margini e allineamento */
.vh-subpanel__title{
  margin-left: -20px;
  margin-bottom:-3px;
  padding: 0;
  line-height: 1.1;
}



/* SOLO submenu nel pannello mobile (clonato): 1 voce per riga */
.vh-subpanel__body > ul.vh-subpanel__menu{
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  gap: 0 !important; /* se non vuoi spazio extra tra voci */
}

/* ogni item occupa tutta la riga */
.vh-subpanel__body > ul.vh-subpanel__menu > li{
  width: 100% !important;
  flex: 0 0 100% !important;
}

/* link a tutta larghezza (così non si affiancano mai) */
.vh-subpanel__body > ul.vh-subpanel__menu > li > a{
  display: block !important;
  width: 100% !important;
}
button.vh-drawer__close {
    padding: 0px;
    margin-right: -14px;
}