/* Personalizzazioni sopra al CSS originale di Divi (caricato per ultimo). */

/* ---------- Lente di ricerca: icona sottile al posto del glifo Divi ---------- */
.et_pb_divimenus_flex_item_6_tb_header .dd-icon-content,
.et_pb_menu_5_tb_header.et_pb_menu .et_pb_menu__search-button {
  font-size: 0 !important;
  width: 22px; height: 22px; display: inline-block; vertical-align: middle;
  background-color: currentColor;
  -webkit-mask: url(/img/cerca.svg) center / contain no-repeat;
          mask: url(/img/cerca.svg) center / contain no-repeat;
}
.et_pb_divimenus_flex_item_6_tb_header .dd-icon-content::before,
.et_pb_menu_5_tb_header.et_pb_menu .et_pb_menu__search-button::after,
.et_pb_menu_5_tb_header.et_pb_menu .et_pb_menu__search-button::before { content: none !important; }

/* ---------- Menu mobile nuovo ---------- */
@media (max-width: 980px) {
  .et_pb_menu_5_tb_header.et_pb_menu .et_mobile_menu { display: none !important; }
}
.mm[hidden] { display: none; }
.mm { position: fixed; inset: 0; z-index: 100000; font-family: Inter, Helvetica, Arial, sans-serif; }
.mm-velo { position: absolute; inset: 0; background: rgba(10, 14, 28, .45); opacity: 0; transition: opacity .3s; backdrop-filter: blur(2px); }
.mm-pannello {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(100%, 440px);
  background: #171d32; color: #fff; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .38s cubic-bezier(.22, .8, .24, 1);
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 0 0 calc(24px + env(safe-area-inset-bottom));
}
.mm-pannello::before { content: ""; position: sticky; top: 0; display: block; height: 4px; flex: none; z-index: 2;
  background: linear-gradient(90deg, #61b456, #00abca); }
.mm.aperto .mm-velo { opacity: 1; }
.mm.aperto .mm-pannello { transform: none; }

.mm-testa { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px 22px; }
.mm-logo img { height: 38px; width: auto; display: block; }
.mm-chiudi { width: 48px; height: 48px; display: grid; place-items: center; border: 0; background: transparent; color: #fff; cursor: pointer; border-radius: 50%; }
.mm-chiudi:active { background: rgba(255,255,255,.08); }
.mm svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.mm-cerca { position: relative; margin: 10px 22px 14px; }
.mm-cerca svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; opacity: .7; }
.mm-cerca input { width: 100%; box-sizing: border-box; height: 48px; padding: 0 16px 0 44px; border-radius: 24px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #fff; font: 300 16px Inter, sans-serif; -webkit-appearance: none; }
.mm-cerca input::placeholder { color: rgba(255,255,255,.6); }
.mm-cerca input:focus { outline: none; border-color: #00abca; background: rgba(255,255,255,.1); }

.mm-lista, .mm-sotto, .mm-sotto2 { list-style: none; margin: 0; padding: 0; }
.mm-lista { padding: 0 10px; }
.mm-voce { border-bottom: 1px solid rgba(255,255,255,.08); opacity: 0; transform: translateX(16px);
  transition: opacity .35s ease, transform .35s ease; transition-delay: calc(var(--i) * 35ms + 120ms); }
.mm.aperto .mm-voce { opacity: 1; transform: none; }
.mm-riga { display: flex; align-items: center; }
.mm-riga > a { flex: 1; display: block; padding: 16px 12px; color: #fff; font-size: 21px; font-weight: 400; letter-spacing: -.01em; text-decoration: none; }
.mm-attivo > .mm-riga > a, .mm a[aria-current="page"] { color: #7ccf6e; }
.mm-apri { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border: 0; background: transparent; color: #fff; cursor: pointer; border-radius: 50%; }
.mm-apri svg { transition: transform .25s; }
.mm-apri[aria-expanded="true"] svg { transform: rotate(180deg); }
.mm-apri:active { background: rgba(255,255,255,.08); }

.mm-sotto { padding: 0 12px 12px; }
.mm-sotto > li > a { display: block; padding: 10px 0 10px 14px; border-left: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.82); font-size: 16px; font-weight: 300; text-decoration: none; }
.mm-sotto > li > a[aria-current="page"] { border-left-color: #7ccf6e; }
.mm-sotto2 { padding-left: 14px; border-left: 1px solid rgba(255,255,255,.15); }
.mm-sotto2 a { display: block; padding: 7px 0 7px 16px; color: rgba(255,255,255,.62); font-size: 15px; font-weight: 300; text-decoration: none; }

.mm-piede { margin-top: auto; padding: 26px 22px 0; display: grid; gap: 10px; }
.mm-azione { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-size: 15px; font-weight: 300; padding: 6px 0; }
.mm-azione svg { width: 20px; height: 20px; opacity: .8; }
.mm-social { display: flex; gap: 10px; margin-top: 6px; }
.mm-social a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #171d32;
  font: 700 15px/1 Inter, sans-serif; text-decoration: none; }

body.mm-bloccato { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .mm-velo, .mm-pannello, .mm-voce, .mm-apri svg { transition: none !important; }
}

/* ---------- Header nelle news: stesso fondo sfumato delle altre pagine (prima era grigio chiaro su bianco) ---------- */
body.single-post .et_pb_section_0_tb_header,
body.single-post .et_pb_section_7_tb_header {
  background-image: linear-gradient(rgba(0,0,0,.23), rgba(0,0,0,.23)), linear-gradient(90deg, #61b456 0%, #00abca 100%) !important;
}

/* ---------- Header mobile: allineamento pulito + icone sottili ---------- */
@media (max-width: 980px) {
  .et_pb_menu_5_tb_header.et_pb_menu .et_pb_menu_inner_container {
    display: flex !important; align-items: center; justify-content: space-between;
    min-height: 40px; padding: 0 8px 0 16px; box-sizing: border-box; /* altezza come l'originale (40px) */
  }
  .et_pb_menu_5_tb_header.et_pb_menu .et_pb_menu__logo-wrap { flex: 0 1 auto; margin: 0 !important; padding: 0 !important; display: flex; align-items: center; }
  .et_pb_menu_5_tb_header.et_pb_menu .et_pb_menu__logo { margin: 0 !important; padding: 0 !important; }
  .et_pb_menu_5_tb_header.et_pb_menu .et_pb_menu__logo img,
  .et_pb_menu_5_tb_header.et_pb_menu > div > div > div > a > img { padding-left: 0 !important; height: 40px !important; width: auto !important; max-height: none !important; display: block; }
  .et_pb_menu_5_tb_header.et_pb_menu .et_pb_menu__wrap { flex: 0 0 auto; display: flex !important; align-items: center; gap: 0; margin: 0 0 0 auto !important; }
  .et_pb_menu_5_tb_header.et_pb_menu .et_pb_menu_inner_container::before, .et_pb_menu_5_tb_header.et_pb_menu .et_pb_menu_inner_container::after { display: none !important; }
  .et_pb_menu_5_tb_header.et_pb_menu > div > div > div { margin-right: 0 !important; }
  .et_pb_menu_5_tb_header.et_pb_menu .et_pb_menu__search-button,
  .et_pb_menu_5_tb_header.et_pb_menu .mobile_menu_bar {
    width: 40px !important; height: 40px !important; padding: 0 !important; margin: 0 !important;
    -webkit-mask-size: 24px 24px !important; mask-size: 24px 24px !important;
    -webkit-mask-position: center !important; mask-position: center !important;
  }
  .et_pb_menu_5_tb_header.et_pb_menu .et_mobile_nav_menu, .et_pb_menu_5_tb_header.et_pb_menu .mobile_nav { margin: 0 !important; padding: 0 !important; display: flex; align-items: center; }
  .et_pb_menu_5_tb_header.et_pb_menu .mobile_menu_bar {
    display: block !important; position: relative; cursor: pointer; background-color: #fff;
    -webkit-mask: url(/img/menu.svg) center / 26px 26px no-repeat; mask: url(/img/menu.svg) center / 26px 26px no-repeat;
  }
  .et_pb_menu_5_tb_header.et_pb_menu .mobile_menu_bar::before, .et_pb_menu_5_tb_header.et_pb_menu .mobile_menu_bar::after { content: none !important; display: none !important; }
  .et_pb_menu_5_tb_header.et_pb_menu .et_pb_menu__search-button { color: #fff; }
}
/* header mobile "sticky" (fondo bianco dopo lo scroll): icone scure */
@media (max-width: 980px) {
  .et_pb_sticky .et_pb_menu_5_tb_header.et_pb_menu .mobile_menu_bar,
  .et_pb_sticky .et_pb_menu_5_tb_header.et_pb_menu .et_pb_menu__search-button,
  .et_pb_menu_5_tb_header.et_pb_menu.et_pb_sticky .mobile_menu_bar,
  .et_pb_menu_5_tb_header.et_pb_menu.et_pb_sticky .et_pb_menu__search-button { background-color: #171d32 !important; color: #171d32 !important; }
}
/* header mobile "sticky" (fondo bianco dopo lo scroll): icone scure */
@media (max-width: 980px) {
  .et_pb_sticky .et_pb_menu_5_tb_header.et_pb_menu .mobile_menu_bar,
  .et_pb_sticky .et_pb_menu_5_tb_header.et_pb_menu .et_pb_menu__search-button,
  .et_pb_menu_5_tb_header.et_pb_menu.et_pb_sticky .mobile_menu_bar,
  .et_pb_menu_5_tb_header.et_pb_menu.et_pb_sticky .et_pb_menu__search-button { background-color: #171d32 !important; color: #171d32 !important; }
}

/* testo solo per motori di ricerca e screen reader */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* titoli declassati da H1 (SEO): stesse proprietà di base dei titoli Divi */
/* (nessuna regola di base: lo stile viene copiato dalle regole h1 originali) */
div.ex-h1 { display: block; }

/* Home: banner TMB prima del footer (era 77px, richiesto da Marco) */
body.home #main-content .et_pb_text_5 .et_pb_text_inner h2 { font-size: clamp(28px, 3.3vw, 48px) !important; line-height: 1.2em !important; }
/* (tolte uniformità tipografica e larghezze fisse: le pagine restano come l'originale) */

/* ---------- Pagina Contatti (solo contenuti originali, filetti grigi) ---------- */
.ct { font-family: Inter, Helvetica, Arial, sans-serif; color: #000; }
.ct-blocco { padding: 70px 0; }
.ct-grigio { background: #e7eaec; }
.ct-in { width: 86%; max-width: 1240px; margin: 0 auto; }
.ct-due { display: grid; grid-template-columns: 1fr 2fr; gap: 0 60px; align-items: start; }
.ct-testo h3 { font: 400 clamp(26px, 2.6vw, 38px)/1.2 Inter, sans-serif !important; color: #000; padding: 0 0 10px !important; }
.ct-testo p { font-size: 20px; line-height: 1.5; font-weight: 500; padding: 0; }
.ct-dati { border-top: 1px solid #d3d6d9; border-bottom: 1px solid #d3d6d9; padding: 22px 0; }
.ct-etichetta p { font-weight: 500; font-size: 20px; padding: 0 0 10px; }
.ct-dati p { font-size: 20px; line-height: 1.65; font-weight: 300; padding: 0; }
.ct-dati a, .ct-sede a { color: inherit; }
.ct-campi { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 30px; }
.ct-campi label { display: grid; gap: 2px; }
.ct-campi label span { font-size: 13px; color: #5d6670; letter-spacing: .02em; }
.ct-largo { grid-column: 1 / -1; }
.ct-campi input, .ct-campi textarea { width: 100%; box-sizing: border-box; border: 0; border-bottom: 1px solid #b9bec3; border-radius: 0; background: transparent;
  padding: 10px 0 12px; font: 300 17px Inter, sans-serif; color: #000; transition: border-color .2s; }
.ct-campi textarea { resize: vertical; }
.ct-campi input:focus, .ct-campi textarea:focus { outline: none; border-bottom-color: #00abca; }
.ct-invia { margin-top: 24px; display: flex; justify-content: flex-end; }
.ct-btn { background: linear-gradient(90deg, #61b456, #00abca) !important; color: #fff !important; border: 0 !important; border-radius: 0 !important;
  padding: 10px 34px !important; font: 500 16px Inter, sans-serif !important; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.ct-btn::after { display: none !important; }
.ct-sedi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.ct-sede-img { aspect-ratio: 16 / 9; overflow: hidden; margin-bottom: 18px; }
.ct-sede-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ct-sede h3 { font: 500 18px/1.3 Inter, sans-serif !important; color: #000; padding: 0 0 10px !important; border-bottom: 1px solid #d3d6d9; margin-bottom: 10px; }
.ct-sede-txt p { font-size: 18px; line-height: 1.5; font-weight: 300; padding: 0; }
.form-esito p { font-size: 17px; }
@media (max-width: 980px) {
  .ct-due { grid-template-columns: 1fr; gap: 24px; }
  .ct-sedi { grid-template-columns: 1fr; gap: 34px; }
  .ct-blocco { padding: 48px 0; }
}
@media (max-width: 600px) { .ct-campi { grid-template-columns: 1fr; } .ct-invia .ct-btn { width: 100%; } }

/* ---------- Animazioni ---------- */
.anim-pronto .anim { opacity: 0; translate: 0 28px; }
.anim-pronto .anim.visto { opacity: 1; translate: none; transition: opacity .7s ease, translate .7s cubic-bezier(.2, .7, .2, 1); }
/* schede e card: piccolo sollevamento al passaggio del mouse */
#main-content .et_pb_blurb, .et_pb_blog_grid article, .dsm-blog-carousel-item .dsm-grid-post-holder-inner { transition: translate .3s ease, box-shadow .3s ease; }
#main-content .et_pb_blurb:hover, .et_pb_blog_grid article:hover { translate: 0 -4px; }
.et_pb_blog_grid article:hover { box-shadow: 0 14px 34px rgba(23, 29, 50, .12) !important; }
.et_pb_blog_grid .et_pb_image_container, .dsm-entry-thumbnail { overflow: clip; } /* clip: non blocca il collasso dei margini (hidden allungava le card) */
.et_pb_blog_grid .et_pb_image_container img, .dsm-entry-thumbnail img { transition: scale .6s ease; }
.et_pb_blog_grid article:hover .et_pb_image_container img, .dsm-blog-carousel-item:hover .dsm-entry-thumbnail img { scale: 1.05; }
@media (prefers-reduced-motion: reduce) {
  .anim-pronto .anim { opacity: 1 !important; translate: none !important; }
  #main-content .et_pb_blurb:hover, .et_pb_blog_grid article:hover { translate: none; }
}

/* ---------- Home: filetto del titolo nello slider allineato al logo e al box "In evidenza" ---------- */
@media (min-width: 981px) {
  /* fasce dell'header a tutta larghezza: i filetti arrivano ai bordi; logo e icone restano allineati al contenuto */
  header .et_pb_row_1_tb_header:not(.et_pb_sticky), header .et_pb_row_0_tb_header:not(.et_pb_sticky) {
    width: 100% !important; max-width: none !important; margin-left: 0 !important; margin-right: 0 !important;
    padding-left: calc(1vw + 80px) !important; padding-right: calc(1vw + 80px) !important; box-sizing: border-box !important;
  }
  body.home .dsm_blog_carousel_0 .dsm-entry-wrapper { left: calc(1vw + 80px) !important; }
  body.home #main-content .et_pb_row_4 { width: 98% !important; max-width: none !important; }
  body.home #main-content .et_pb_row_4 > .et_pb_column > .et_pb_module { margin-left: 80px !important; margin-right: 80px !important; width: auto !important; }
}

/* ---------- Footer: stessa struttura di prima, allineamenti sistemati ---------- */
@media (min-width: 981px) {
  footer.et-l--footer .et_pb_text_0_tb_footer p::first-line, footer.et-l--footer .et_pb_text_1_tb_footer p::first-line,
  footer.et-l--footer .et_pb_text_2_tb_footer p::first-line, footer.et-l--footer .et_pb_text_3_tb_footer p::first-line,
  footer.et-l--footer .et_pb_text_4_tb_footer p::first-line { font-weight: 500; }
  /* link legali: stessa altezza di "INFORMAZIONI", leggibili, su una riga */
  footer.et-l--footer .et_pb_text_5_tb_footer, footer.et-l--footer .et_pb_text_6_tb_footer, footer.et-l--footer .et_pb_text_7_tb_footer {
    margin-top: 0 !important; padding-top: 0 !important; width: auto !important; margin-right: 22px !important; margin-bottom: 0 !important;
  }
  footer.et-l--footer .et_pb_text_5_tb_footer p, footer.et-l--footer .et_pb_text_6_tb_footer p, footer.et-l--footer .et_pb_text_7_tb_footer p {
    font-size: 12px !important; line-height: 19px !important; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; padding: 0 !important;
  }
  footer.et-l--footer .et_pb_text_5_tb_footer:hover p, footer.et-l--footer .et_pb_text_6_tb_footer:hover p, footer.et-l--footer .et_pb_text_7_tb_footer:hover p { color: #7ccf6e !important; }
  footer.et-l--footer .et_pb_row_inner_1_tb_footer .et_pb_column { display: flex; flex-wrap: wrap; align-items: flex-start; }
}
@media (max-width: 980px) {
  footer.et-l--footer .et_pb_text_0_tb_footer p::first-line, footer.et-l--footer .et_pb_text_1_tb_footer p::first-line,
  footer.et-l--footer .et_pb_text_2_tb_footer p::first-line, footer.et-l--footer .et_pb_text_3_tb_footer p::first-line,
  footer.et-l--footer .et_pb_text_4_tb_footer p::first-line { font-weight: 500; }
  footer.et-l--footer .et_pb_text_0_tb_footer p, footer.et-l--footer .et_pb_text_1_tb_footer p, footer.et-l--footer .et_pb_text_2_tb_footer p,
  footer.et-l--footer .et_pb_text_3_tb_footer p, footer.et-l--footer .et_pb_text_4_tb_footer p { font-size: 16px !important; line-height: 1.5 !important; }
  footer.et-l--footer .et_pb_text_5_tb_footer, footer.et-l--footer .et_pb_text_6_tb_footer, footer.et-l--footer .et_pb_text_7_tb_footer { margin-bottom: 4px !important; }
  footer.et-l--footer .et_pb_text_5_tb_footer p, footer.et-l--footer .et_pb_text_6_tb_footer p, footer.et-l--footer .et_pb_text_7_tb_footer p { font-size: 13px !important; line-height: 2 !important; letter-spacing: .05em; }
  footer.et-l--footer .et_pb_text_9_tb_footer p, footer.et-l--footer .et_pb_text_8_tb_footer p { font-size: 13px !important; line-height: 1.6 !important; }
}

/* Footer −20% e link legali in fila con spazi uguali */
@media (min-width: 981px) {
  footer.et-l--footer .et_pb_text_0_tb_footer p, footer.et-l--footer .et_pb_text_1_tb_footer p, footer.et-l--footer .et_pb_text_2_tb_footer p,
  footer.et-l--footer .et_pb_text_3_tb_footer p, footer.et-l--footer .et_pb_text_4_tb_footer p { font-size: 16px !important; line-height: 19px !important; }
  footer.et-l--footer .et_pb_text_8_tb_footer p { font-size: 13px !important; line-height: 27px !important; }
  footer.et-l--footer .et_pb_code_0_tb_footer .et_pb_code_inner { transform: scale(.8); transform-origin: 50% 0; }
  footer.et-l--footer .et_pb_social_icon a { width: 29px !important; height: 29px !important; }
  footer.et-l--footer .et_pb_social_icon a.icon:before { font-size: 13px !important; line-height: 29px !important; width: 29px !important; height: 29px !important; }
  footer.et-l--footer .et_pb_section_0_tb_footer { padding-top: 32px !important; padding-bottom: 32px !important; }
  footer.et-l--footer .et_pb_row_inner_1_tb_footer .et_pb_column:nth-child(2) { width: auto !important; margin-right: 0 !important; }
  footer.et-l--footer .et_pb_row_inner_1_tb_footer .et_pb_column:nth-child(3) { width: auto !important; }
  footer.et-l--footer .et_pb_text_5_tb_footer, footer.et-l--footer .et_pb_text_6_tb_footer, footer.et-l--footer .et_pb_text_7_tb_footer { margin-right: 28px !important; }
}

/* Header "sticky" (bianco dopo lo scroll): le due fasce arrivano fino ai bordi dello schermo */
.et_pb_row_0_tb_header.et_pb_sticky, .et_pb_row_1_tb_header.et_pb_sticky {
  width: 100% !important; max-width: none !important; left: 0 !important; right: 0 !important;
  margin-left: 0 !important; margin-right: 0 !important; box-sizing: border-box !important;
}
@media (min-width: 981px) { header .et_pb_row_0_tb_header:not(.et_pb_sticky) { padding-right: calc(1vw + 86px) !important; } }
