/* ==========================================================================
   contatti.css — Sezione Contatti (#contatti) di index.php — "La mappa"
   Origine: variante 4 di prova_contatti.php (stili .mp-*). JS: layout/js/contatti.js
   ========================================================================== */

#contatti { padding: var(--section-pad); background: #fff; overflow: hidden; }
.contatti-testa { margin-bottom: 30px; }
.contatti-testa .section-title { margin-bottom: 10px; }
.contatti-lead { color: var(--color-text-light); font-size: 1.05rem; max-width: 560px; margin: 0; }
.contatti-noscript { list-style: none; padding: 0; line-height: 2; }
#contatti-mappa svg:not(.mp-svg) { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ==========================================================================
   4 — LA MAPPA
   ========================================================================== */
.mp-mappa { position: relative; }
.mp-quadro { position: relative; aspect-ratio: 1000 / 560; border-radius: 22px; overflow: hidden; border: 1px solid #e3e9f1; box-shadow: 0 30px 60px rgba(11,30,61,.12); }
.mp-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mp-colli ellipse { fill: #eef4ea; }
.mp-fiume { fill: none; stroke: #c4dcf3; stroke-width: 16; stroke-linecap: round; }
.mp-alberi circle { fill: #d3e6c7; }
.mp-strada-bordo, .mp-strada, .mp-mezzeria { fill: none; stroke-linecap: round; }
.mp-strada-bordo { stroke: #c9d3df; stroke-width: 24; }
.mp-strada { stroke: #fff; stroke-width: 17; }
.mp-strada-bordo, .mp-strada { stroke-dasharray: var(--L); stroke-dashoffset: var(--L); transition: stroke-dashoffset 1.3s cubic-bezier(.5,0,.3,1); }
.mp-mappa.disegna .mp-strada-bordo, .mp-mappa.disegna .mp-strada { stroke-dashoffset: 0; }
.mp-mezzeria { stroke: #f2b134; stroke-width: 2.5; stroke-dasharray: 10 12; opacity: 0; transition: opacity .6s 1.2s; }
.mp-mappa.disegna .mp-mezzeria { opacity: 1; }
.mp-paese { opacity: 0; transition: opacity .5s .6s; }
.mp-mappa.disegna .mp-paese { opacity: 1; }
.mp-paese circle { fill: var(--color-primary); stroke: #fff; stroke-width: 3; }
.mp-paese text { font: 800 19px var(--font-heading); fill: var(--color-primary); text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 6px; stroke-linejoin: round; }
.mp-onda { fill: none; stroke: var(--color-accent); stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; }
.mp-mappa.arrivato .mp-onda { animation: mp-onda 2.2s ease-out infinite; }
.mp-mappa.arrivato .mp-onda.b { animation-delay: 1.1s; }
@keyframes mp-onda { from { transform: scale(1); opacity: .9; } to { transform: scale(5); opacity: 0; } }
.mp-pallone { opacity: 0; transition: opacity .2s; }
.mp-pallone.on { opacity: 1; }
.mp-pallone circle { fill: #f7c21b; stroke: var(--color-primary); stroke-width: 2.5; }
.mp-pallone path { fill: none; stroke: var(--color-primary); stroke-width: 2; }
.mp-spilla { position: absolute; width: 0; height: 0; z-index: 3; }
.mp-testa-spilla {
  position: absolute; left: -27px; top: -70px; width: 54px; height: 54px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--color-accent); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 20px rgba(227,15,41,.35); opacity: 0;
}
.mp-testa-spilla svg { transform: rotate(45deg); width: 26px; height: 26px; }
.mp-mappa.arrivato .mp-testa-spilla { animation: mp-cade .8s cubic-bezier(.3,1.5,.5,1) forwards; }
@keyframes mp-cade { from { opacity: 0; translate: 0 -240px; } 30% { opacity: 1; } to { opacity: 1; translate: 0 0; } }
.mp-arrivo-card {
  position: absolute; z-index: 4; transform: translate(34px, -115%) scale(.85); transform-origin: 0 100%; opacity: 0;
  background: #fff; border-radius: 16px; padding: 14px 18px; min-width: 250px; box-shadow: 0 20px 40px rgba(11,30,61,.2);
  display: flex; flex-direction: column; gap: 2px; transition: opacity .4s .5s, transform .5s .5s cubic-bezier(.3,1.5,.5,1);
}
.mp-mappa.arrivato .mp-arrivo-card { opacity: 1; transform: translate(34px, -115%) scale(1); }
.mp-arrivo-card small { font: 800 .62rem/1.2 var(--font-heading); letter-spacing: .15em; text-transform: uppercase; color: var(--color-accent); }
.mp-arrivo-card b { font: 800 1.05rem/1.2 var(--font-heading); color: var(--color-primary); }
.mp-arrivo-card span { font-size: .85rem; color: var(--color-text-light); }
.mp-vai { margin-top: 8px; align-self: flex-start; background: var(--color-primary); color: #fff; text-decoration: none; padding: 9px 14px; border-radius: 30px; font: 700 .78rem/1 var(--font-heading); transition: background .25s; }
.mp-vai:hover { background: var(--color-accent); color: #fff; }
.mp-scala { position: absolute; right: 14px; bottom: 10px; font: italic 500 .72rem/1 var(--font-body); color: #9aa8ba; }
.mp-cartelli { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 1000 / 560; pointer-events: none; }
.mp-cartello {
  position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; pointer-events: auto; text-decoration: none;
  transform: translate(-50%, -100%) scale(0) rotate(-25deg); transform-origin: 50% 100%;
  transition: transform .6s cubic-bezier(.3,1.7,.5,1) calc(var(--i) * .16s);
}
.mp-mappa.cartelli .mp-cartello { transform: translate(-50%, -100%) scale(1) rotate(0); }
.mp-mappa.cartelli .mp-cartello:hover { animation: mp-dondola .6s ease; }
@keyframes mp-dondola { 25% { rotate: -6deg; } 60% { rotate: 4deg; } }
.mp-tabella {
  order: 1; display: flex; align-items: center; gap: 8px; color: #fff; padding: 8px 12px; border-radius: 8px;
  border: 3px solid #fff; font: 700 .82rem/1.15 var(--font-heading); box-shadow: 0 8px 16px rgba(0,0,0,.2); white-space: nowrap;
}
.mp-tabella small { display: block; font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.mp-palo { order: 2; width: 6px; height: 34px; background: linear-gradient(90deg, #7b8796, #b3bdc9, #7b8796); }
.mp-cartello.blu .mp-tabella { background: #1d5fb4; outline: 2px solid #1d5fb4; }
.mp-cartello.verde .mp-tabella { background: #178a4c; outline: 2px solid #178a4c; }
.mp-cartello.marrone .mp-tabella { background: #7a4a24; outline: 2px solid #7a4a24; }
.mp-partite { display: flex; align-items: center; gap: 8px; color: var(--color-text-light); margin: 18px 0 0; }
.mp-partite svg { color: var(--color-accent); }
.mp-partite b { color: var(--color-primary); }

@media (max-width: 760px) {
  .mp-cartelli { position: static; aspect-ratio: auto; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; pointer-events: auto; }
  .mp-cartello { position: static; transform: scale(0) rotate(-25deg); transform-origin: 50% 100%; }
  .mp-mappa.cartelli .mp-cartello { transform: none; }
  .mp-tabella { white-space: normal; }
  .mp-palo { height: 14px; }
  .mp-arrivo-card { transform: translate(-50%, 16px) scale(.85); transform-origin: 50% 0; min-width: 200px; padding: 10px 12px; }
  .mp-mappa.arrivato .mp-arrivo-card { transform: translate(-50%, 16px) scale(1); }
  .mp-paese text { font-size: 26px; }
  .mp-quadro { overflow: visible; margin-bottom: 50px; }
}
