/* VIBO Header Styles
 * Following VIBO Coding Guidelines
 * Primary: #13F011 | Secondary: #e0ffe0 | Dark: #152615
 * Typography: Axiforma
 */

@import url("https://fonts.cdnfonts.com/css/axiforma");

/* Box Model Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* CSS Variables */
:root {
  --vibo-primary: #13f011;
  --vibo-secondary: #e0ffe0;
  --vibo-dark: #152615;
  --vibo-z-index: 1;
  --vibo-header-z: 1000;
  --vibo-menu-z: 999;
}

/* Header più sottile e senza bordo */
#vibo-header {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1400px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none;
  border-radius: 16px;
  padding: 10px 30px;
  z-index: var(--vibo-header-z);
  transition: transform 0.4s ease, opacity 0.4s ease;
}

#vibo-header.vibo-header-hidden {
  transform: translateX(-50%) translateY(-150%);
  opacity: 0;
}

.vibo-header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* Logo con max-height fissa e contain per scala corretta */
.vibo-logo-wrapper {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vibo-logo-wrapper a {
  display: flex;
  align-items: center;
  justify-content: center;
}

.vibo-logo {
  height: 40px;
  max-height: 40px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  display: block;
}

.vibo-logo-text {
  font-family: "Axiforma", sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--vibo-dark);
}

/* Hamburger */
.vibo-hamburger-wrapper {
  position: relative;
  z-index: calc(var(--vibo-header-z) + 2);
}

.vibo-hamburger {
  cursor: pointer;
  display: block;
}

.vibo-hamburger:focus {
  outline: none;
}

.vibo-hamburger:focus-visible {
  outline: 2px solid var(--vibo-primary);
  outline-offset: 4px;
  border-radius: 4px;
}

.vibo-menu-toggle {
  display: none;
}

.vibo-hamburger svg {
  height: 2em;
  transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hamburger colore verde primario */
.vibo-line {
  fill: none;
  stroke: var(--vibo-primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  transition: stroke-dasharray 600ms cubic-bezier(0.4, 0, 0.2, 1), stroke-dashoffset 600ms cubic-bezier(0.4, 0, 0.2, 1),
    stroke 0.3s ease;
}

.vibo-line-top-bottom {
  stroke-dasharray: 12 63;
}

.vibo-menu-toggle:checked + svg {
  transform: rotate(-45deg);
}

.vibo-menu-toggle:checked + svg .vibo-line-top-bottom {
  stroke-dasharray: 20 300;
  stroke-dashoffset: -32.42;
}

/* Button Styles - fedele all'originale con colori coerenti */
.vibo-button-wrapper {
  z-index: calc(var(--vibo-header-z) + 2);
}

.vibo-learn-more {
  position: relative;
  display: inline-block;
  cursor: pointer;
  outline: none;
  border: 0;
  vertical-align: middle;
  text-decoration: none;
  background: transparent;
  padding: 0;
  font-size: inherit;
  font-family: "Axiforma", sans-serif;
  width: 10rem;
  height: auto;
}

.vibo-learn-more:focus {
  outline: none;
}

.vibo-learn-more:focus-visible {
  outline: 2px solid var(--vibo-primary);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Cerchio verde primario */
.vibo-circle {
  transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
  position: relative;
  display: block;
  margin: 0;
  width: 3rem;
  height: 3rem;
  background: var(--vibo-primary);
  border-radius: 1.625rem;
}

.vibo-icon {
  transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
  position: absolute;
  top: 0;
  bottom: 0;
  margin: auto;
  background: var(--vibo-dark);
}

/* Freccia scura di default (contrasto su verde) */
.vibo-arrow {
  transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
  left: 0.625rem;
  width: 1.125rem;
  height: 0.125rem;
  background: none;
}

.vibo-arrow::before {
  position: absolute;
  content: "";
  top: -0.29rem;
  right: 0.0625rem;
  width: 0.625rem;
  height: 0.625rem;
  border-top: 0.125rem solid var(--vibo-dark);
  border-right: 0.125rem solid var(--vibo-dark);
  transform: rotate(45deg);
  transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
}

/* Testo posizionato come originale, scuro */
.vibo-button-text {
  transition: all 0.45s cubic-bezier(0.65, 0, 0.076, 1);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.75rem 0;
  margin: 0 0 0 1.85rem;
  color: var(--vibo-dark);
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Hover: cerchio espande, freccia si sposta e diventa scura con linea visibile */
.vibo-learn-more:hover .vibo-circle {
  width: 100%;
}

.vibo-learn-more:hover .vibo-arrow {
  background: var(--vibo-dark);
  transform: translate(1rem, 0);
}

.vibo-learn-more:hover .vibo-button-text {
  color: var(--vibo-dark);
}

/* Fullscreen Menu - sfondo verde secondario */
.vibo-fullscreen-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--vibo-secondary);
  z-index: var(--vibo-menu-z);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.vibo-fullscreen-menu.vibo-active {
  opacity: 1;
  visibility: visible;
}

.vibo-menu-container {
  display: flex;
  width: 100%;
  height: 100%;
  padding-top: 100px;
}

.vibo-menu-content {
  width: 55%;
  padding-left: 5%;
  overflow-y: auto;
  max-height: calc(100vh - 100px);
}

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

.vibo-menu-item-link {
  border-bottom: 1px solid rgba(21, 38, 21, 0.15);
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  transition-delay: calc(var(--item-index) * 0.08s);
}

.vibo-menu-item-link:first-child {
  border-top: 1px solid rgba(21, 38, 21, 0.15);
}

.vibo-fullscreen-menu.vibo-active .vibo-menu-item-link {
  opacity: 1;
  transform: translateX(0);
}

.vibo-menu-item-link a {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 20px 20px 20px 10px;
  text-decoration: none;
  transition: padding-left 0.3s ease, background 0.3s ease;
}

.vibo-menu-item-link a:hover {
  padding-left: 30px;
  background: rgba(19, 240, 17, 0.15);
}

.vibo-menu-item-link a:focus {
  outline: none;
}

.vibo-menu-item-link a:focus-visible {
  outline: 2px solid var(--vibo-dark);
  outline-offset: -2px;
}

.vibo-menu-title {
  font-family: "Axiforma", sans-serif;
  font-weight: 700;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  color: var(--vibo-dark);
  transition: color 0.3s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
}

.vibo-menu-item-link a:hover .vibo-menu-title {
  color: var(--vibo-primary);
}

/* Right preview panel */
.vibo-menu-preview {
  width: 45%;
  padding: 40px 5% 40px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.vibo-menu-preview.vibo-preview-active {
  opacity: 1;
  transform: translateX(0);
}

/* Preview media fills container properly with object-fit cover */
.vibo-preview-media {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 16 / 10;
  background: rgba(21, 38, 21, 0.1);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.vibo-preview-media img,
.vibo-preview-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vibo-preview-text {
  font-family: "Axiforma", sans-serif;
  font-weight: 300;
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  line-height: 1.6;
  color: var(--vibo-dark);
  max-width: 400px;
  margin: 0 0 20px 0;
}

/* Sub-items: rimossi bordi, solo highlight testo da sx a dx */
.vibo-preview-sub-items {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: 400px;
}

.vibo-preview-sub-items li {
  margin: 0;
}

.vibo-preview-sub-items a {
  display: inline-block;
  padding: 8px 0;
  font-family: "Axiforma", sans-serif;
  font-weight: 400;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  color: var(--vibo-dark);
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
}

.vibo-preview-sub-items a::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 6px;
  width: 0;
  height: 2px;
  background: var(--vibo-primary);
  transition: width 0.3s ease;
}

.vibo-preview-sub-items a:hover {
  color: var(--vibo-primary);
}

.vibo-preview-sub-items a:hover::before {
  width: 100%;
}

.vibo-preview-sub-items a:focus {
  outline: none;
}

.vibo-preview-sub-items a:focus-visible {
  outline: 2px solid var(--vibo-dark);
  outline-offset: 2px;
}

/* Menu open state - hamburger scuro, bottone scuro con freccia bianca */
body.vibo-menu-open .vibo-line {
  stroke: var(--vibo-dark);
}

body.vibo-menu-open .vibo-circle {
  background: var(--vibo-dark);
}

body.vibo-menu-open .vibo-arrow::before {
  border-top-color: #fff;
  border-right-color: #fff;
}

body.vibo-menu-open .vibo-button-text {
  color: var(--vibo-dark);
}

body.vibo-menu-open .vibo-learn-more:hover .vibo-arrow {
  background: #fff;
}

body.vibo-menu-open .vibo-learn-more:hover .vibo-button-text {
  color: var(--vibo-primary);
}

/* =============================================
   MOBILE VERSION - Completamente diversa
   ============================================= */

@media (max-width: 768px) {
  /* Header mobile: solo logo a sinistra che scompare con scroll */
  #vibo-header {
    width: auto;
    left: 20px;
    right: auto;
    transform: none;
    padding: 10px 15px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
  }

  #vibo-header.vibo-header-hidden {
    transform: translateY(-150%);
  }

  .vibo-header-nav {
    justify-content: flex-start;
  }

  /* Logo a sinistra su mobile */
  .vibo-logo-wrapper {
    position: relative;
    left: auto;
    transform: none;
  }

  .vibo-logo {
    height: 35px;
    max-height: 35px;
  }

  /* Hamburger sticky: fix allineamento e centratura */
  .vibo-hamburger-wrapper {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: calc(var(--vibo-header-z) + 10);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
  }

  .vibo-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
  }

  .vibo-hamburger svg {
    height: 1.8em;
    display: block;
    margin: 0 auto;
  }

  /* Bottone mobile riscritto da 0 - struttura fedele all'originale ma già espanso */
  .vibo-button-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: calc(var(--vibo-header-z) + 10);
  }

  .vibo-learn-more {
    position: relative;
    display: inline-block;
    cursor: pointer;
    outline: none;
    border: 0;
    vertical-align: middle;
    text-decoration: none;
    background: transparent;
    padding: 0;
    font-size: inherit;
    font-family: "Axiforma", sans-serif;
    width: 9rem;
    height: auto;
  }

  /* Cerchio già espanso al 100% */
  .vibo-circle {
    position: relative;
    display: block;
    margin: 0;
    width: 100%;
    height: 3rem;
    background: var(--vibo-primary);
    border-radius: 1.625rem;
    transition: none;
  }

  /* Freccia posizionata come originale */
  .vibo-icon {
    position: absolute;
    top: 0;
    bottom: 0;
    margin: auto;
    background: var(--vibo-dark);
    transition: none;
  }

  .vibo-arrow {
    left: 0.625rem;
    width: 1.125rem;
    height: 0.125rem;
    background: var(--vibo-dark);
    transform: translate(1rem, 0);
    transition: none;
  }

  .vibo-arrow::before {
    position: absolute;
    content: "";
    top: -0.29rem;
    right: 0.0625rem;
    width: 0.625rem;
    height: 0.625rem;
    border-top: 0.125rem solid var(--vibo-dark);
    border-right: 0.125rem solid var(--vibo-dark);
    transform: rotate(45deg);
    transition: none;
  }

  /* Testo posizionato in absolute come originale, allineato alla freccia */
  .vibo-button-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.75rem 0;
    margin: 0 0 0 2.5rem;
    color: var(--vibo-dark);
    font-weight: 700;
    line-height: 1.6;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    transition: none;
  }

  /* Menu mobile: solo voci principali, senza sottovoci e frecce */
  .vibo-menu-container {
    flex-direction: column;
    padding-top: 80px;
    padding-bottom: 100px;
  }

  .vibo-menu-content {
    width: 100%;
    padding: 0 5%;
  }

  /* Nasconde pannello preview su mobile */
  .vibo-menu-preview {
    display: none !important;
  }

  /* Mobile menu: solo click, no hover effects */
  .vibo-menu-item-link a:hover {
    padding-left: 10px;
    background: transparent;
  }

  .vibo-menu-item-link a:hover .vibo-menu-title {
    color: var(--vibo-dark);
  }

  .vibo-menu-item-link a {
    display: block;
    padding: 20px 10px;
  }

  /* Active state su click per mobile */
  .vibo-menu-item-link a.vibo-mobile-active {
    padding-left: 25px;
    background: rgba(19, 240, 17, 0.15);
  }

  .vibo-menu-item-link a.vibo-mobile-active .vibo-menu-title {
    color: var(--vibo-primary);
  }

  .vibo-menu-title {
    font-size: clamp(1.1rem, 5vw, 1.5rem);
  }

  /* Nascondi tutte le sottovoci su mobile */
  .vibo-mobile-sub-items,
  .vibo-expand-arrow,
  .has-sub-items .vibo-expand-arrow {
    display: none !important;
  }

  /* Menu aperto: hamburger e bottone scuri */
  body.vibo-menu-open .vibo-hamburger-wrapper {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.vibo-menu-open .vibo-circle {
    background: var(--vibo-dark);
  }

  body.vibo-menu-open .vibo-arrow {
    background: #fff;
  }

  body.vibo-menu-open .vibo-arrow::before {
    border-top-color: #fff;
    border-right-color: #fff;
  }

  body.vibo-menu-open .vibo-button-text {
    color: #fff;
  }
}

/* Extra small mobile */
@media (max-width: 480px) {
  #vibo-header {
    left: 15px;
    top: 15px;
  }

  .vibo-hamburger-wrapper {
    top: 15px;
    right: 15px;
    padding: 8px;
    width: 44px;
    height: 44px;
  }

  .vibo-button-wrapper {
    bottom: 15px;
    right: 15px;
  }

  /* Bottone più piccolo ma struttura identica */
  .vibo-learn-more {
    width: 8rem;
  }

  .vibo-circle {
    height: 2.8rem;
    border-radius: 1.4rem;
  }

  .vibo-button-text {
    padding: 0.65rem 0;
    margin-left: 2.3rem;
    font-size: 0.8rem;
  }

  .vibo-logo {
    height: 28px;
    max-height: 28px;
  }

  .vibo-hamburger svg {
    height: 1.5em;
  }

  .vibo-menu-container {
    padding-top: 70px;
    padding-bottom: 90px;
  }

  .vibo-menu-title {
    font-size: clamp(1rem, 5vw, 1.3rem);
  }

  .vibo-mobile-sub-items a {
    padding: 10px 10px 10px 25px;
    font-size: 0.9rem;
  }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
