/* =========================================================
   HOME MAP V6E — pulizia sezione "Dove siamo"
   - Rimuove le card ripetitive Dove siamo / Telefono / Email.
   - Mantiene solo testo istituzionale + pulsanti Apri indicazioni / Chiama.
   - Su mobile trasforma il pulsante sopra la mappa in "Usa la mappa".
   - La mappa resta bloccata per lo scroll finché l'utente non la attiva.
   ========================================================= */

/* Le tre card interne ripetono informazioni già presenti: le togliamo. */
html body.path-frontpage .caritas-map-panel__details {
  display: none !important;
}

html body.path-frontpage .caritas-map-panel__info {
  gap: 18px !important;
}

html body.path-frontpage .caritas-map-panel__info-head p {
  max-width: 500px !important;
}

/* Il pulsante sovrapposto alla mappa non deve duplicare "Apri indicazioni" su desktop. */
html body.path-frontpage .caritas-map-panel__fallback {
  display: none !important;
}

/* Con meno contenuti la card informativa deve respirare, non sembrare vuota. */
html body.path-frontpage .caritas-map-panel__actions {
  margin-top: 2px !important;
}

@media (min-width: 1101px) {
  html body.path-frontpage .caritas-map-panel__info {
    justify-content: center !important;
  }

  html body.path-frontpage .caritas-map-panel__actions {
    max-width: 360px !important;
  }
}

@media (max-width: 760px) {
  html body.path-frontpage .caritas-map-panel__info {
    gap: 18px !important;
    padding-bottom: 24px !important;
  }

  html body.path-frontpage .caritas-map-panel__info h3 {
    margin-bottom: 0.62rem !important;
  }

  html body.path-frontpage .caritas-map-panel__info-head p {
    font-size: 0.94rem !important;
    line-height: 1.55 !important;
  }

  /* In mobile il pulsante sulla mappa diventa un comando, non un duplicato. */
  html body.path-frontpage .caritas-map-panel.caritas-map-panel--map-toggle-ready .caritas-map-panel__fallback {
    display: inline-flex !important;
    left: 18px !important;
    right: 18px !important;
    bottom: 16px !important;
    width: auto !important;
    min-height: 42px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    font-size: 0.86rem !important;
    line-height: 1 !important;
    text-align: center !important;
    pointer-events: auto !important;
  }

  html body.path-frontpage .caritas-map-panel.caritas-map-panel--map-active .caritas-map-panel__fallback {
    background: rgba(15, 139, 141, 0.95) !important;
    box-shadow: 0 12px 26px rgba(15, 139, 141, 0.18) !important;
  }

  /* Di base la mappa resta una preview: così lo scroll pagina non viene rubato. */
  html body.path-frontpage .caritas-map-panel:not(.caritas-map-panel--map-active) .caritas-map-panel__canvas,
  html body.path-frontpage .caritas-map-panel:not(.caritas-map-panel--map-active) .caritas-map-panel__canvas .maplibregl-canvas-container,
  html body.path-frontpage .caritas-map-panel:not(.caritas-map-panel--map-active) .caritas-map-panel__canvas .maplibregl-canvas,
  html body.path-frontpage .caritas-map-panel:not(.caritas-map-panel--map-active) .caritas-map-panel__canvas .maplibregl-control-container,
  html body.path-frontpage .caritas-map-panel:not(.caritas-map-panel--map-active) .caritas-map-panel__canvas .maplibregl-marker,
  html body.path-frontpage .caritas-map-panel:not(.caritas-map-panel--map-active) .caritas-map-panel__canvas .maplibregl-popup {
    pointer-events: none !important;
  }

  /* Quando l'utente preme "Usa la mappa", il riquadro diventa interattivo. */
  html body.path-frontpage .caritas-map-panel.caritas-map-panel--map-active .caritas-map-panel__canvas,
  html body.path-frontpage .caritas-map-panel.caritas-map-panel--map-active .caritas-map-panel__canvas .maplibregl-canvas-container,
  html body.path-frontpage .caritas-map-panel.caritas-map-panel--map-active .caritas-map-panel__canvas .maplibregl-canvas,
  html body.path-frontpage .caritas-map-panel.caritas-map-panel--map-active .caritas-map-panel__canvas .maplibregl-control-container,
  html body.path-frontpage .caritas-map-panel.caritas-map-panel--map-active .caritas-map-panel__canvas .maplibregl-marker,
  html body.path-frontpage .caritas-map-panel.caritas-map-panel--map-active .caritas-map-panel__canvas .maplibregl-popup {
    pointer-events: auto !important;
  }

  html body.path-frontpage .caritas-map-panel__actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(92px, 0.58fr) !important;
    width: 100% !important;
    gap: 10px !important;
    align-items: stretch !important;
  }

  html body.path-frontpage .caritas-map-panel__actions > .caritas-map-panel__button,
  html body.path-frontpage .caritas-map-panel__actions > a.caritas-map-panel__button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 42px !important;
    height: 42px !important;
    padding: 0 10px !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-sizing: border-box !important;
    font-size: 0.82rem !important;
  }
}

@media (max-width: 390px) {
  html body.path-frontpage .caritas-map-panel__actions {
    grid-template-columns: minmax(0, 1fr) minmax(78px, 0.55fr) !important;
    gap: 8px !important;
  }

  html body.path-frontpage .caritas-map-panel__actions > .caritas-map-panel__button,
  html body.path-frontpage .caritas-map-panel__actions > a.caritas-map-panel__button {
    font-size: 0.76rem !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}

/* =========================================================
   HOME MAP V13 — correzione definitiva dettagli + mappa bloccata
   - Nasconde le card ripetitive Dove siamo / Telefono / Email.
   - La mappa resta bloccata di default anche su desktop.
   - "Usa la mappa" attiva il riquadro mappa; "Blocca mappa" lo disattiva.
   - Apri indicazioni e Chiama restano sempre nella stessa riga.
   ========================================================= */

/* Nasconde il gruppo dettagli classico, se presente. */
html body.path-frontpage .caritas-public-home .caritas-map-panel .caritas-map-panel__details,
html body.path-frontpage .caritas-public-home .caritas-map-panel .caritas-map-panel__info > .caritas-map-panel__details {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* Nasconde anche eventuali card generate come figli diretti della colonna info. */
html body.path-frontpage .caritas-public-home .caritas-map-panel .caritas-map-panel__info > p:has(.caritas-map-panel__label),
html body.path-frontpage .caritas-public-home .caritas-map-panel .caritas-map-panel__info > div:not(.caritas-map-panel__info-head):not(.caritas-map-panel__actions):has(.caritas-map-panel__label),
html body.path-frontpage .caritas-public-home .caritas-map-panel .caritas-map-panel__info > a:has(.caritas-map-panel__label) {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* La mappa non deve rubare lo scroll finché non viene attivata. Vale desktop e mobile. */
html body.path-frontpage .caritas-public-home .caritas-map-panel:not(.caritas-map-panel--map-active) .caritas-map-panel__canvas,
html body.path-frontpage .caritas-public-home .caritas-map-panel:not(.caritas-map-panel--map-active) .caritas-map-panel__canvas .maplibregl-canvas-container,
html body.path-frontpage .caritas-public-home .caritas-map-panel:not(.caritas-map-panel--map-active) .caritas-map-panel__canvas .maplibregl-canvas,
html body.path-frontpage .caritas-public-home .caritas-map-panel:not(.caritas-map-panel--map-active) .caritas-map-panel__canvas .maplibregl-control-container,
html body.path-frontpage .caritas-public-home .caritas-map-panel:not(.caritas-map-panel--map-active) .caritas-map-panel__canvas .maplibregl-marker,
html body.path-frontpage .caritas-public-home .caritas-map-panel:not(.caritas-map-panel--map-active) .caritas-map-panel__canvas .maplibregl-popup {
  pointer-events: none !important;
}

html body.path-frontpage .caritas-public-home .caritas-map-panel.caritas-map-panel--map-active .caritas-map-panel__canvas,
html body.path-frontpage .caritas-public-home .caritas-map-panel.caritas-map-panel--map-active .caritas-map-panel__canvas .maplibregl-canvas-container,
html body.path-frontpage .caritas-public-home .caritas-map-panel.caritas-map-panel--map-active .caritas-map-panel__canvas .maplibregl-canvas,
html body.path-frontpage .caritas-public-home .caritas-map-panel.caritas-map-panel--map-active .caritas-map-panel__canvas .maplibregl-control-container,
html body.path-frontpage .caritas-public-home .caritas-map-panel.caritas-map-panel--map-active .caritas-map-panel__canvas .maplibregl-marker,
html body.path-frontpage .caritas-public-home .caritas-map-panel.caritas-map-panel--map-active .caritas-map-panel__canvas .maplibregl-popup {
  pointer-events: auto !important;
}

/* Mostra il comando Usa la mappa anche fuori dal mobile, ma senza duplicare Apri indicazioni. */
html body.path-frontpage .caritas-public-home .caritas-map-panel.caritas-map-panel--map-toggle-ready .caritas-map-panel__fallback {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

html body.path-frontpage .caritas-public-home .caritas-map-panel.caritas-map-panel--map-active .caritas-map-panel__fallback {
  background: rgba(15, 139, 141, 0.96) !important;
  box-shadow: 0 12px 26px rgba(15, 139, 141, 0.20) !important;
}

/* Riga finale: due pulsanti sempre affiancati anche su mobile. */
html body.path-frontpage .caritas-public-home .caritas-map-panel .caritas-map-panel__actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(88px, 0.58fr) !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
  align-items: stretch !important;
}

html body.path-frontpage .caritas-public-home .caritas-map-panel .caritas-map-panel__actions .caritas-map-panel__button,
html body.path-frontpage .caritas-public-home .caritas-map-panel .caritas-map-panel__actions a.caritas-map-panel__button {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

@media (max-width: 430px) {
  html body.path-frontpage .caritas-public-home .caritas-map-panel .caritas-map-panel__actions {
    grid-template-columns: minmax(0, 1fr) minmax(76px, 0.56fr) !important;
    gap: 8px !important;
  }

  html body.path-frontpage .caritas-public-home .caritas-map-panel .caritas-map-panel__actions .caritas-map-panel__button,
  html body.path-frontpage .caritas-public-home .caritas-map-panel .caritas-map-panel__actions a.caritas-map-panel__button {
    height: 40px !important;
    min-height: 40px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 0.76rem !important;
  }
}
