/* Custom styles added after leaving Webflow */

/* Real headings (h1/h2/h3) replaced Webflow's styled <div>s for SEO and
   screen readers. Make them render exactly like those divs did: the class
   styles (.header01, .sub01, ...) still apply on top of this. */
h1, h2, h3 {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

/* Text for screen readers and search engines only */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Cookie banner close button */
.cookie-pop-up {
  align-items: center;
}
.cookie-close {
  flex: none;
  margin-left: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #000;
  font-size: 24px;
  line-height: 32px;
  cursor: pointer;
}
.cookie-close:hover,
.cookie-close:focus-visible {
  background: rgba(0, 0, 0, 0.1);
}
.cookie-close:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}
.cookie-ok .cookie-pop-up {
  display: none;
}

/*
  Big headings (.header01 / .header02)

  1. Line spacing: they inherited a fixed 20px line-height from body, so a
     heading that wrapped onto two lines drew its lines on top of each other
     (e.g. "INTERVENTO ABILITATIVO"). Line spacing now scales with font size.

  2. Space below: it used to depend on whatever element came next (each had
     its own top margin: 0, 14, 27, 49, 54, 57 or 83px), so the gap under
     headings ranged from overlapping to very large. Now every heading has the
     same space below it, scaled to its size (~34px desktop, ~19px phone), and
     the element right after a heading adds no top margin of its own.

  3. Space above: unchanged. The top margin is reduced by the extra
     line-height ((0.92em - 20px) / 2) so headings sit where they did before.
*/
/* !important: Webflow sets fixed px values on some variants (.small, .long)
   with more specific selectors, which would otherwise win. */
.header01,
.header02 {
  line-height: 0.92em !important;
  margin-bottom: calc(0.2em + 10px) !important;
}
.header01 + *,
.header02 + *,
.header01 + * > :first-child,
.header02 + * > :first-child {
  margin-top: 0 !important;
}

.header01:not(.small):not(.long),
.header02:not(.small) {
  margin-top: calc(10px - 0.46em);
}
.header02.small {
  margin-top: 0;
}

@media screen and (max-width: 991px) {
  .header02:not(.small) {
    margin-top: calc(21px + 10px - 0.46em);
  }
  .header02.small {
    margin-top: 21px;
  }
}

@media screen and (max-width: 767px) {
  .header01:not(.small):not(.long) {
    margin-top: calc(20px + 10px - 0.46em);
  }
}

/*
  Mobile menu and hover effects (these replace Webflow's webflow.js + jQuery,
  which were ~640 KB of script for these few things)
*/

/* Hamburger button: a real <button>, so reset browser button styles */
.menu-button {
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
}
.menu-button:focus {
  outline: 0;
}
.menu-button:focus-visible {
  outline: 2px solid #1b1b1b;
  outline-offset: -4px;
  border-radius: 6px;
}

/* Hamburger icon (3 bars), turns into an X when the menu is open */
.hamburger {
  position: relative;
  display: block;
  width: 30px;
  height: 25px;
}
.hamburger span {
  position: absolute;
  left: 3px;
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: #1b1b1b;
  transition: transform 0.3s ease, opacity 0.2s ease, top 0.3s ease;
}
.hamburger span:nth-child(1) { top: 1px; }
.hamburger span:nth-child(2) { top: 10px; left: 6px; width: 19px; }
.hamburger span:nth-child(3) { top: 19px; }
.nav-open .hamburger span:nth-child(1) { top: 10px; transform: rotate(45deg); }
.nav-open .hamburger span:nth-child(2) { opacity: 0; }
.nav-open .hamburger span:nth-child(3) { top: 10px; transform: rotate(-45deg); }

/* Open menu: a white panel under the header (the Webflow one was
   semi-transparent, so the links were hard to read over the photos) */
@media screen and (max-width: 991px) {
  .navbar-div.nav-open .nav-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    background: #fff;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.12);
    animation: menu-in 0.3s ease;
  }
  .navbar-div.nav-open .nav-link {
    display: block;
  }
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

/* Chi siamo document links: light orange background on hover */
.linkblockassociazione {
  transition: background-color 0.5s;
}
.linkblockassociazione:hover,
.linkblockassociazione:focus-visible {
  background-color: rgba(251, 152, 56, 0.31);
}

/* "Scopri di più" and download links: slide right on hover */
.hover-slide {
  transition: transform 0.3s ease-in-out;
}
.hover-slide:hover,
.hover-slide:focus-visible {
  transform: translateX(22px);
}

@media (prefers-reduced-motion: reduce) {
  .hamburger span,
  .linkblockassociazione,
  .hover-slide {
    transition: none;
  }
  .navbar-div.nav-open .nav-menu {
    animation: none;
  }
}

/* 404 page */
.notfound {
  padding-top: 140px;
  padding-bottom: 80px;
  text-align: center;
}
.notfound .sub01 {
  margin-bottom: 30px;
}
.notfound .body01 {
  text-align: center;
}
.notfound-links {
  display: inline-block;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
  text-align: left;
  font-family: Lato, sans-serif;
  font-size: 18px;
  line-height: 1.6;
}
.notfound-links a,
.notfound a {
  color: #c25e00;
  font-weight: 700;
}
