nav {
  background-color: var(--bianco);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9;
  border-bottom: 1px solid var(--grigio);
  height: 80px;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  
  img {
    width: 140px;
    height: auto;
    margin-left: 2rem;
  }

  .elements {
    gap: 2.5rem;
    margin: 0;
    margin-right: 2rem;
    padding: 0;
    align-items: center;
    list-style: none;
    
    li {
      padding: 0;
      margin: 0;
      white-space: nowrap;
    }

    li a {
      display: flex;
      justify-content: center;
      text-decoration: none;
      color: var(--colore-primario);
      width: auto;
    }
    
    li:last-child {
      margin-left: 1rem;
      
      a {
          display: flex;
          align-items: center;
          justify-content: center;
          color: var(--bianco) !important;
          background-color: var(--colore-primario);
          border-radius: 5px;
          padding: 0.5rem 1.5rem;
          box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); 
          transition: all 0.3s ease;
      }
      
      a:hover {
          background-color: var(--colore-primario-hover);
          transform: translateY(-1px);
          box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); 
      }
    }
  }
}


nav li:not(:last-child) a span {
  font-weight: 400;
  transition: font-weight 0.3s ease;
  position: relative;
  display: inline-block;
}

nav li:not(:last-child) a span::before {
  content: attr(data-text);
  visibility: hidden;
  height: 0;
  overflow: hidden;
  display: block;
  font-weight: 700;
  pointer-events: none;
}

nav li:not(:last-child) a:hover {
  color: var(--colore-primario-hover);
}

nav li:not(:last-child) a:hover span {
  font-weight: 700;
}


#dropdownMenuButton {
  background-color: var(--bianco);
  color: var(--colore-primario);
  text-transform: capitalize;
}


.header-wrapper {
  color: var(--colore-primario);
  margin-bottom: 55px;
}

.leoclub-container {
  display: flex;
  align-items: center;
  height: 80vh !important;
  h1 {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.2;
  }
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-custom-row {
  /* Use the small viewport unit and safe-area insets so mobile browser bars don't cover content */
  --header-height: 80px;
  min-height: calc(100svh - var(--header-height) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  /* Fallbacks for browsers without svh/support */
  min-height: calc(100dvh - var(--header-height));
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: stretch;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.hero-left {
  flex: 0 0 66.666%;
  max-width: 66.666%;
  padding-left: 10rem;
  padding-right: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
.hero-title {
  color: #ff0000;
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.1;
}
.hero-btn-red {
  background: #ff0000;
  color: #fff;
  border-radius: 18px;
  min-width: 270px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  border: none;
  box-shadow: none;
  transition: background 0.2s, color 0.2s;
  padding: 0;
}
.hero-btn-red:hover {
  background: white;
  color: red;
  border: 3px solid #ff0000;
}
.hero-btn-outline {
  border: 3px solid #ff0000;
  color: #ff0000;
  border-radius: 18px;
  min-width: 270px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  background: #fff;
  box-shadow: none;
  transition: background 0.2s, color 0.2s, border 0.2s;
  padding: 0;
}
.hero-btn-outline:hover {
  background: #ff0000;
  color: #fff;
  border-color: #ff0000;
}
.hero-right {
  flex: 0 0 33.333%;
  max-width: 33.333%;
  background: #f7f7f7;
  position: relative;
  padding-left: 2rem;
  padding-right: 10rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
}
.hero-date {
  color: #ff0000;
  font-size: 2rem;
  font-weight: 700;
  position: absolute;
  bottom: 7%;
  text-align: right;
}
@media (max-width: 991px) {
  .hero-custom-row {
    flex-direction: column;
    /* on small screens make hero fill remaining viewport but account for header and safe areas */
    height: 80vh;
    background-position: center top;
  }
  .hero-left, .hero-right {
    max-width: 100%;
    flex: 1 1 100%;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  .hero-date {
    margin-top: 2rem;
    text-align: right;
  }
  #scrollIndicator{
    display: none;
  }
}

/* Mobile-specific tuning: reduce oversized hero elements so content fits under browser chrome */
@media (max-width: 600px) {
  nav {
    height: 64px; /* slightly smaller header on small screens */
    padding: 0 1rem;
  }
  .hero-custom-row {
    align-items: center;
    justify-content: center;
  }
  .hero-left {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .hero-title {
    font-size: 2.4rem;
    line-height: 1.05;
  }
  .hero-btn-red, .hero-btn-outline {
    min-width: 180px;
    height: 48px;
    font-size: 1rem;
  }
  .hero-date {
    font-size: 1.4rem;
    bottom: 6%;
  }
  .hero-right {
    padding: 25%;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .scroll-indicator {
    bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .hero-date{
   padding-bottom: 30%;
  }
}


.green {
  color: var(--verde);
}

@media screen and (max-width: 1399px) {
  .leoclub-container h1 {
    font-size: 2.75rem;
  }
}

@media screen and (max-width: 1192px) {
  .leoclub-container h1 {
    font-size: 2.5rem;
  }
}

@media screen and (max-width: 992px) {
  .leoclub-container h1 {
    font-size: 2rem;
  }
  .undertitle {
    font-size: 2.188rem;
  }
}

@media screen and (min-width: 769px) {
  footer .reserved {
    text-align: center;
  }
}


/* Dropdown navigation menu - stile V3_impl */
.dropdown-nav {
  position: relative;
}

.dropdown-submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bianco);
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  min-width: max-content;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  z-index: 10;
  white-space: nowrap;
}

.dropdown-nav:hover .dropdown-submenu {
  display: block;
}

.dropdown-submenu li {
  padding: 0;
  width: 100%;
}

.dropdown-submenu li a {
  display: block;
  padding: 0.5rem 1.5rem;
  color: red;
  text-decoration: none;
  transition: background-color 0.2s;
  width: 100%;
}

.dropdown-submenu li a:hover {
  background-color: #f8f9fa;
}

/* Mobile: apply V3_impl style to current .dropdown-menu markup and show when .show is present */
@media (max-width: 991px) {
  .dropdown-menu.d-lg-none {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0 auto;
    width: 96vw;
    max-width: 640px;
    background: #fff;
    box-shadow: 0 18px 60px rgba(0,0,0,0.22);
    border-radius: 18px;
    /* increased bottom padding to create larger white area under texts */
    padding: 12px 0 44px;
    z-index: 1200;
    display: none;
    box-sizing: border-box;
  }

  .dropdown-menu.d-lg-none.show {
    display: block;
  }

  .dropdown-menu.d-lg-none li {
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  .dropdown-menu.d-lg-none .dropdown-item {
    display: block;
    width: 100%;
    color: #222;
    font-size: 1.7rem;
    font-weight: 400;
    padding: 22px 32px;
    line-height: 1.2;
    text-align: left;
    background: none;
    border: none;
    box-sizing: border-box;
  }

  .dropdown-menu.d-lg-none .dropdown-item:not(:last-child) {
    border-bottom: 1px solid #ececec;
  }

  .dropdown-menu.d-lg-none .dropdown-item:hover {
    background: #f8f9fa;
    color: var(--colore-primario);
  }

  /* CTA style for last item if using .cta-mobile */
  .dropdown-menu.d-lg-none .dropdown-item.cta-mobile {
    background: var(--colore-primario);
    color: #fff;
    font-weight: 800;
    font-size: 1.5rem;
    border-radius: 12px;
    /* center and ensure it fits inside rounded container */
    margin: 18px auto 16px auto;
    padding: 14px 20px;
    text-align: center;
    box-shadow: 0 10px 28px rgba(255,0,0,0.16);
    display: block;
    width: calc(100% - 40px);
    box-sizing: border-box;
  }

  /* Full-screen overlay behind the mobile dropdown menu */
  .mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.48);
    z-index: 1150;
    display: none;
    opacity: 0;
    transition: opacity 220ms ease-in-out;
  }

  .mobile-menu-overlay.show {
    display: block;
    opacity: 1;
  }
}
