/*
Theme Name: Divi Child DSA
Description: Child theme for dsa.cbpt.org \u2014 UX + performance
Template: Divi
Version: 1.1
*/

/* ============================================================
   1. BASE RESET + BACKGROUND
   ============================================================ */
html { font-size: 100%; -webkit-text-size-adjust: 100%; background-color: #FFFDF9 !important; }
body { max-width: 100%; overflow-x: hidden; word-wrap: break-word; background-color: #FFFDF9 !important; line-height: 1.6; }
* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }

/* ============================================================
   2. FONT ICON FIX — rimosso override ETmodules (interferiva con icone Divi)
   ============================================================ */
.fa, .fas, .far, .fab { font-family: inherit !important; }

/* ============================================================
   3. ANTI-CLS
   ============================================================ */
.et_pb_section, .et_pb_row, .et_pb_column { min-height: 1px; }
.et_pb_button:after, .et_pb_button:before { will-change: transform; }
/* Hero image \u2014 riserva spazio */
.home .et_pb_section_0 .et_pb_image img,
.et_pb_section_0 img[src*="Hero-page-resize"] {
  width: 100% !important;
  height: auto !important;
  display: block;
  aspect-ratio: 461 / 308;
}
@media (max-width: 767px)  { .home .et_pb_section_0 { min-height: 220px; } }
@media (min-width: 768px) and (max-width: 980px) { .home .et_pb_section_0 { min-height: 260px; } }


/* ============================================================
   2b. HEADER Z-INDEX — fix menu hamburger homepage
   Root cause: .et_pb_section_0 ha margin-top:-38px (Divi builder),
   si sovrappone al header. Header e sezione sono entrambi
   position:relative; la sezione (DOM order dopo) finisce sopra e
   intercetta i click sull'hamburger mobile.
   Fix: z-index:100 garantisce header sempre sopra il contenuto.
   ============================================================ */
header.et-l.et-l--header,
.et-l.et-l--header {
  position: relative !important;
  z-index: 100 !important;
}

/* ============================================================
   4. STICKY MOBILE CTA \u2014 bottone fisso in basso
   ============================================================ */
.dsa-sticky-cta {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #1e73be;
  color: #fff !important;
  text-align: center;
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 700;
  z-index: 99999;
  text-decoration: none !important;
  display: block;
  letter-spacing: 0.02em;
  box-shadow: 0 -3px 12px rgba(0,0,0,0.2);
  transition: background 0.2s ease;
}
.dsa-sticky-cta:hover, .dsa-sticky-cta:focus { background: #155a96 !important; color: #fff !important; }
body.dsa-has-sticky-cta { padding-bottom: 58px !important; }

/* ============================================================
   5. PULSANTI CTA \u2014 prominence
   ============================================================ */
/* Pulse sul bottone primario hero */
@keyframes dsa-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(30,115,190,0.40); }
  50%      { box-shadow: 0 0 0 10px rgba(30,115,190,0); }
}
/* Target: primo bottone della sezione hero */
.et_pb_section_0 .et_pb_button,
.et_pb_section_0 .et_pb_button_0 {
  animation: dsa-pulse 2.5s ease-in-out infinite;
}
.et_pb_section_0 .et_pb_button:hover { animation: none; }

/* Bottone secondario \u2014 "Prenota una Call Gratuita" nell'header */
.et_pb_menu .et_pb_button {
  border-radius: 999px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
  transition: all 0.25s ease !important;
}

/* ============================================================
   6. SEZIONE SERVIZI \u2014 card con hover
   ============================================================ */
/* Le card di servizio (Valutazione, Certificazione, Intervento\u2026) */
.et_pb_blurb, .et_pb_image_container {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.et_pb_blurb:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}

/* ============================================================
   7. TYPOGRAPHY \u2014 leggibilit\u00e0
   ============================================================ */
.et_pb_text_inner p { line-height: 1.75; margin-bottom: 1em; }
.et_pb_text_inner h2 { margin-bottom: 0.6em; line-height: 1.25; }
.et_pb_text_inner h3 { margin-bottom: 0.5em; }
/* Corregge spaziatura tra titoli e testo */
.et_pb_module.et_pb_text { margin-bottom: 20px; }

/* ============================================================
   8. FORM CONTATTI \u2014 miglioramenti visivi
   ============================================================ */
.et_pb_contact_form input,
.et_pb_contact_form textarea,
.et_pb_contact_form select {
  border-radius: 6px !important;
  border: 1px solid #ccc !important;
  font-size: 15px !important;
  padding: 10px 14px !important;
  transition: border-color 0.2s ease !important;
}
.et_pb_contact_form input:focus,
.et_pb_contact_form textarea:focus {
  border-color: #1e73be !important;
  outline: 2px solid rgba(30,115,190,0.2) !important;
}
/* Bottone submit */
.et_pb_contact_form .et_pb_contact_submit {
  border-radius: 999px !important;
  font-weight: 700 !important;
  padding: 12px 32px !important;
  letter-spacing: 0.05em !important;
}

/* ============================================================
   9. MENU MOBILE \u2014 fix corretto
   ============================================================ */
ul.et_mobile_menu .menu-item-has-children > .sub-menu { display: none; visibility: hidden; }
ul.et_mobile_menu .menu-item-has-children.dt-open > .sub-menu { display: block !important; visibility: visible !important; }

/* ============================================================
   10. TRUST BADGE / SOCIAL PROOF \u2014 classi per Marco
   Quando Marco aggiunge la classe CSS "dsa-trust-bar" in Divi
   ============================================================ */
.dsa-trust-bar {
  background: #f0f6ff;
  border-top: 3px solid #1e73be;
  padding: 14px 5%;
  text-align: center;
  font-size: 14px;
  color: #333;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.dsa-trust-bar strong { color: #1e73be; font-size: 18px; }

/* ============================================================
   11. SCROLL SHRINK HEADER
   ============================================================ */
@media (min-width: 981px) {
  .dsa-scrolled {
    box-shadow: 0 2px 12px rgba(0,0,0,0.09) !important;
    transition: box-shadow 0.3s ease;
  }
  .dsa-scrolled .et_pb_image img {
    max-height: 32px !important;
    transition: max-height 0.25s ease;
  }
}

/* ============================================================
   12. FOOTER \u2014 piccoli fix
   ============================================================ */
.et_pb_footer_container a { transition: color 0.2s ease; }
.et_pb_footer_container a:hover { color: #1e73be !important; }

/* ============================================================
   13. ACCESSIBILITA' \u2014 focus visible
   ============================================================ */
:focus-visible {
  outline: 3px solid #1e73be;
  outline-offset: 3px;
}
a:focus-visible, button:focus-visible { outline: 3px solid #1e73be; }

/* ============================================================
   14. FIX et_animated BLURB IMAGES — trattamento-dsa
   ============================================================ */
/* Divi animation observer non scatta su alcune pagine —
   forza visibilità delle immagini nei moduli Blurb */
.et_pb_blurb .et_pb_main_blurb_image.et_animated {
  opacity: 1 !important;
  animation: none !important;
}

/* ============================================================
   15. TRUST BAR — versione aggiornata (due sedi, 1000 famiglie)
   ============================================================ */
.dsa-trust-bar-v2 {
  background: #f8f9fc;
  border-top: 3px solid #1e73be;
  border-bottom: 1px solid #e0e6f0;
  padding: 14px 20px !important;
  text-align: center;
}
.dsa-trust-bar-v2 .et_pb_text_inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 20px;
  font-size: 15px;
  line-height: 1.5;
}
.dsa-trust-bar-v2 .star-rating { color: #f5a623; font-size: 18px; letter-spacing: 2px; }
.dsa-trust-bar-v2 .trust-divider { color: #1e73be; font-weight: bold; }
@media (max-width: 767px) {
  .dsa-trust-bar-v2 .et_pb_text_inner { flex-direction: column; gap: 4px; font-size: 14px; }
}
