/* === SOS: FORCE SINGLE BACKGROUND, use ORIGINAL image === */
:root .site-header::before{ content:none !important; display:none !important; background:none !important; }
:root .site-header{
  position: relative;
  overflow: hidden;
  background-color: #efe7d8 !important;     /* beige del cielo */
  background-repeat: no-repeat !important;
  background-size: cover !important;          /* riempi l'header */
  min-height: 240px !important;               /* desktop */
}
@media (max-width:640px){
  :root .site-header{ min-height: 200px !important; }  /* mobile */
}

/* Desktop: usa l'ORIGINALE, focus a destra e un po' più in basso */
@media (min-width:641px){
  :root .site-header{
    background-image: url("/assets/img/header/header-original.jpg?v=orig1") !important;
    background-position:  88% 54% !important;  /* X=88% (destra), Y=60% (giù) */
  }
}

/* Mobile: stesso originale, focus dedicato */
@media (max-width:640px){
  :root .site-header{
    background-image: url("/assets/img/header/header-original.jpg?v=orig1") !important;
    background-position: 72% 58% !important;
  }
}

/* Subnav: bordi identici al footer */
:root{ --sos-divider:#0c1220; }
nav#mainmenu.subnav{
  border-top:1px solid var(--sos-divider) !important;
  border-bottom:1px solid var(--sos-divider) !important;
}
/* === FOOTER – rifiniture coerenti con subnav === */
.site-footer{
  background:#0f172a !important;     /* sfondo scuro coerente */
  color:#cbd5e1 !important;           /* testo leggibile */
  border-top:1px solid #0c1220 !important; /* riga uguale alla subnav */
  padding: 28px 0 22px !important;
}
.site-footer .footer-grid{
  display:grid !important;
  grid-template-columns: repeat(3, minmax(220px,1fr)) !important;
  gap: 24px !important;
  align-items:start !important;
}
@media (max-width: 900px){
  .site-footer .footer-grid{ grid-template-columns: 1fr !important; }
}
.site-footer h3{
  font-size: 1.05rem !important;
  margin: 0 0 .35rem !important;
  color: #e2e8f0 !important;
}
.site-footer p{ margin: .25rem 0 !important; }
.site-footer a{
  color:#93c5fd !important;
  text-decoration:none !important;
}
.site-footer a:hover,
.site-footer a:focus{
  color:#bfdbfe !important;
  text-decoration:underline !important;
}
.site-footer .meshtastic{
  height:36px !important; width:auto !important; display:inline-block !important;
  vertical-align:middle !important;
}
/* nota: riga sottile in basso per chiudere visivamente */
.site-footer .small{ border-top:1px solid #0c1220 !important; margin-top:16px !important; padding-top:12px !important; }
/* === FOOTER a 5 riquadri === */
.site-footer{ background:#0f172a !important; color:#cbd5e1 !important; border-top:1px solid #0c1220 !important; }
.site-footer .footer-grid{
  display:grid !important;
  grid-template-columns: 1.1fr 1.2fr 0.9fr 2fr 0.8fr !important; /* logo, contatti, social, ACI, powered */
  gap: 24px !important;
  align-items:start !important;
}
@media (max-width: 1200px){
  .site-footer .footer-grid{ grid-template-columns: 1fr 1fr 1fr; }
  .site-footer .aci { grid-column: 1 / -1; }
}
@media (max-width: 780px){
  .site-footer .footer-grid{ grid-template-columns: 1fr; }
}
.site-footer h3{ color:#e2e8f0 !important; font-size:1.05rem !important; margin:.1rem 0 .4rem !important; }
.site-footer p{ margin:.25rem 0 !important; }

/* 1) logo SOS */
.footer-logo{ height:64px !important; width:auto !important; display:block !important; }

/* 3) Social icone */
.social-row{ display:flex; gap:10px; align-items:center; }
.social-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:40px; height:40px; border-radius:999px; background:#0c223a;
  color:#e5f2ff; text-decoration:none; transition:transform .15s ease, filter .15s ease;
}
.social-btn svg{ width:20px; height:20px; }
.social-btn:hover{ transform:translateY(-1px); filter:brightness(1.1); }
.social-btn.fb{ background:#0a66c2; }
.social-btn.wa{ background:#128C7E; }

/* 4) ACI blocco */
.aci-wrap{ display:flex; align-items:flex-start; gap:12px; }
.aci-logo{ height:36px !important; width:auto !important; flex:0 0 auto; }
.aci p a{ color:#93c5fd !important; text-decoration:none !important; }
.aci p a:hover{ text-decoration:underline !important; }

/* 5) Powered by */
.meshtastic{ height:36px !important; width:auto !important; }

/* Riga finale © coerente */
.site-footer .small{ border-top:1px solid #0c1220 !important; margin-top:16px !important; padding-top:12px !important; }
/* SOS-FOOTER-TWEAKS START */

/* Base */
.site-footer{background:#0f172a;color:#cbd5e1;border-top:1px solid #0c1220}
.site-footer a{color:#93c5fd}
.site-footer a:hover{text-decoration:underline}

/* IMPORTANTISSIMO: usa ESATTAMENTE lo stesso .container globale del sito.
   Quindi NON toccare max-width/margini orizzontali: eredita quelli di site.css.
   Aggiungiamo solo padding verticale. */
.site-footer .container{padding-block:28px 16px}

/* Grid desktop: SOS (più spazio), poi Contatti, Social, Powered */
.site-footer .footer-grid{
  display:grid;
  grid-template-columns: 2.8fr 1.7fr 1fr 1fr;
  gap:32px;
  align-items:start;
}
/* evita overflow che può impedire lo stacking su mobile */
.site-footer .footer-grid > *{min-width:0}

.site-footer h3{font-size:1rem;margin:0 0 10px;color:#e2e8f0}
.site-footer p{margin:0 0 8px;line-height:1.55}
.site-footer .muted{color:#94a3b8}
.site-footer .small{border-top:1px solid #0c1220;margin-top:20px;padding-top:12px}

.aci-wrap{display:flex;align-items:flex-start;gap:12px}
.aci-logo{height:36px;width:auto}
.meshtastic{height:36px;width:auto;display:inline-block}

/* Email su una riga */
.nowrap{white-space:nowrap}
.contacts a.nowrap{white-space:nowrap;display:inline-block}

/* Social */
.social-row{display:flex;gap:10px;flex-wrap:wrap}
.social-btn{display:flex;justify-content:center;align-items:center;width:40px;height:40px;border-radius:999px;background:#0a66c2;color:#e5f2ff;text-decoration:none}
.social-btn.wa{background:#128C7E}
.social-btn:focus-visible{outline:2px solid #e2e8f0;outline-offset:2px}

/* Riga finale: logo + copyright centrati */
.foot-bottom p{margin:0;display:flex;align-items:center;justify-content:center;gap:10px}
.footer-logo-mini{height:22px;width:auto;display:inline-block;vertical-align:middle;border-radius:4px}

/* Tablet: riduci gap, SOS ancora prevalente */
@media (max-width:1100px){
  .site-footer .footer-grid{
    grid-template-columns: 2.2fr 1.4fr 1fr 1fr;
    gap:24px;
  }
}

/* Mobile: **FORZA** verticale in 1 colonna.
   !important assicura che eventuali vecchi CSS non sovrascrivano. */
@media (max-width:780px){
  .site-footer .footer-grid{
    grid-template-columns: 1fr !important;
    gap:18px !important;
  }
  .aci-logo,.meshtastic{height:32px}
  .footer-logo-mini{height:20px}
}
/* SOS-FOOTER-TWEAKS END */
/* SOS-FOOTER-DESKTOP-FIX START */
/* SOLO DESKTOP: distribuzione piena + ultima colonna allineata a destra */
@media (min-width: 781px){
  .site-footer .footer-grid{
    width:100%;
    /* fr garantisce uso pieno della larghezza; SOS e Contatti più ampi */
    grid-template-columns: 2.4fr 1.6fr 1.1fr 1.1fr !important;
    column-gap: 48px; /* un po’ più aria tra le colonne */
    justify-content: stretch; /* la griglia occupa tutta la riga */
    align-items: start;
  }

  /* Evita che qualche max-width interno stringa le colonne */
  .site-footer .footer-grid > *{min-width:0; max-width:none}

  /* “Distribuzione visiva”: prima a sinistra, ultima a destra */
  .site-footer .about-sos   { justify-self: start; }
  .site-footer .contacts    { justify-self: stretch; }
  .site-footer .social      { justify-self: center; }
  .site-footer .powered     { justify-self: end; }

  /* Mantieni lettura gradevole su contatti */
  .site-footer .contacts{min-width: 280px}
}
/* SOS-FOOTER-DESKTOP-FIX END */

/* === MAP PUBLIC: titlebar & button === */
.map-titlebar,
.map-toolbar { /* fallback se esiste già .map-toolbar */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 12px 0;
}
.map-titlebar h2 { margin: 0; }

/* stile bottone full screen */
.map-titlebar a[href^="/map/map2"],
.map-toolbar  a[href^="/map/map2"] {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.15);
  background: #ffffffAA;            /* leggermente opaco su sfondo scuro */
  color: #0f172a !important;        /* testo più scuro (slate-900) */
  text-decoration: none;
  font-weight: 600;
  line-height: 1.2;
}
.map-titlebar a[href^="/map/map2"]:hover,
.map-toolbar  a[href^="/map/map2"]:hover {
  filter: brightness(0.96);
  text-decoration: none;
}

/* === MAP PUBLIC: micro-fix allineamento bottone con titolo === */
.map-titlebar {
  align-items: baseline; /* allinea su base testo */
}

.map-titlebar a[href^="/map/map2"] {
  margin-top: 2px;   /* piccolo compenso visivo */
  background: #ffffffcc;
  color: #111827 !important;  /* ancora leggermente più scuro */
  font-weight: 600;
}

/* === MAP PUBLIC: micro-fix allineamento bottone con titolo === */
.map-titlebar { align-items: baseline; } /* allinea alla base del testo */
.map-titlebar a[href^="/map/map2"] { margin-top: 2px; }

/* === MAP PUBLIC: stile brand per bottone Full screen map === */
:root{
  --sos-orange: #ff7a00;     /* arancio brand */
  --sos-orange-600: #e66e00; /* hover */
}
.map-titlebar a[href^="/map/map2"],
.map-toolbar  a[href^="/map/map2"]{
  border: 2px solid var(--sos-orange);
  background: #ffffffee;
  color: #0f172a !important;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .05s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.map-titlebar a[href^="/map/map2"]:hover,
.map-toolbar  a[href^="/map/map2"]:hover{
  background: var(--sos-orange);
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(255,122,0,.25);
}
.map-titlebar a[href^="/map/map2"]:active,
.map-toolbar  a[href^="/map/map2"]:active{
  transform: translateY(1px);
}
/* Focus accessibile (tastiera) */
.map-titlebar a[href^="/map/map2"]:focus-visible,
.map-toolbar  a[href^="/map/map2"]:focus-visible{
  outline: 3px solid rgba(255,122,0,.5);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255,122,0,.25);
}

/* === MAP PUBLIC: brand button + alignment === */
:root {
  --sos-orange: #ff7a00;
  --sos-orange-hover: #e66e00;
}

.map-titlebar,
.map-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 12px 0;
}

.map-titlebar h2 { margin: 0; }

.map-titlebar a[href^="/map/map2"],
.map-toolbar  a[href^="/map/map2"] {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 10px;
  border: 2px solid var(--sos-orange);
  background: #ffffffee;
  color: #0f172a !important;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: all .2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

.map-titlebar a[href^="/map/map2"]:hover,
.map-toolbar  a[href^="/map/map2"]:hover {
  background: var(--sos-orange);
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(255,122,0,.25);
}

.map-titlebar a[href^="/map/map2"]:focus-visible {
  outline: 3px solid rgba(255,122,0,.5);
  outline-offset: 2px;
}

/* === MAP PUBLIC: fix definitivo brand arancio === */
.map-titlebar a[href^="/map/map2"],
.map-toolbar a[href^="/map/map2"] {
  border: 2px solid #ff7a00 !important;
  background: #ffffffee !important;
  color: #0f172a !important;
  font-weight: 600;
  transition: background .25s ease, color .25s ease, box-shadow .25s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

.map-titlebar a[href^="/map/map2"]:hover,
.map-toolbar a[href^="/map/map2"]:hover {
  background: #ff7a00 !important;   /* arancio pieno */
  border-color: #ff7a00 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(255,122,0,.25);
  text-decoration: none;
}

.map-titlebar a[href^="/map/map2"]:focus-visible {
  outline: 3px solid rgba(255,122,0,.6) !important;
  outline-offset: 2px;
}

/* === MAP2: logo SOS Abruzzo === */
#map-logo-sos {
  position: absolute;
  top: 55px;              /* fianco ai tasti zoom */
  left: 12px;
  width: 110px;
  opacity: 0.9;
  z-index: 9999;
  pointer-events: none;   /* non blocca click sui controlli */
  transition: opacity .3s ease;
}
#map-logo-sos:hover {
  opacity: 1;
}

/* === MAP2: logo SOS Abruzzo – tuning v2 === */
#map { position: relative; } /* sicurezza */
body #map-logo-sos{
  position: absolute !important;
  top: 8px !important;       /* più in alto */
  left: 64px !important;     /* a destra dei bottoni zoom (~48px) */
  width: 330px !important;   /* ~3x */
  z-index: 10010 !important;
  pointer-events: none !important;
  opacity: .95;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.15));
}
@media (max-width: 1024px){
  body #map-logo-sos{ width: 240px !important; left: 56px !important; top: 8px !important; }
}
@media (max-width: 640px){
  body #map-logo-sos{ width: 170px !important; left: 52px !important; top: 8px !important; }
}

/* === MAP2: logo size tweak v3 (−1/3) === */
body #map-logo-sos{ width:220px !important; }
@media (max-width:1024px){ body #map-logo-sos{ width:160px !important; } }
@media (max-width:640px){  body #map-logo-sos{ width:120px !important; } }
/* SOS BADGES v1 */
.sos-badges { position: fixed; top: 12px; right: 12px; z-index: 1000; display: flex; gap: 8px; align-items: center; }
.sos-badge { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px; font-size:13px; line-height:1; color:#fff; user-select:none; box-shadow:0 2px 6px rgba(0,0,0,.15); border:1px solid rgba(0,0,0,.15);}
.sos-badge.live { background:#e02424; animation: sosPulse 2.2s ease-in-out infinite; font-weight:600; }
.sos-badge.live::before { content:""; width:8px; height:8px; border-radius:50%; background:#fff; opacity:.9; }
@keyframes sosPulse { 0%,100% { opacity:1 } 50% { opacity:.65 } }
.sos-badge.time { background:#111; font-variant-numeric: tabular-nums; }
@media (max-width:480px){
  .sos-badges{ top:10px; right:10px; gap:6px }
  .sos-badge{ padding:6px 9px; font-size:12px }
}
/* SOS BADGES v1 BEGIN */
.sos-badges { position: fixed; top: 12px; right: 12px; z-index: 1000; display: flex; gap: 8px; align-items: center; }
.sos-badge { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px; font-size:13px; line-height:1; color:#fff; user-select:none; box-shadow:0 2px 6px rgba(0,0,0,.15); border:1px solid rgba(0,0,0,.15); }
.sos-badge.live { background:#e02424; animation: sosPulse 2.2s ease-in-out infinite; font-weight:600; }
.sos-badge.live::before { content:""; width:8px; height:8px; border-radius:50%; background:#fff; opacity:.9; }
@keyframes sosPulse { 0%,100% { opacity:1 } 50% { opacity:.65 } }
.sos-badge.time { background:#111; font-variant-numeric: tabular-nums; }
@media (max-width:480px){
  .sos-badges{ top:10px; right:10px; gap:6px }
  .sos-badge{ padding:6px 9px; font-size:12px }
}
/* SOS BADGES v1 END */
/* SOS BASEMAP CTRL v1 BEGIN */
.leaflet-control-layers.leaflet-control {
  margin: 10px 0 10px 10px; /* spazio dai bordi */
}
.leaflet-control-layers label {
  line-height: 1.2;
}
@media (max-width:480px){
  .leaflet-control-layers.leaflet-control { margin: 8px 0 8px 8px; }
}
/* SOS BASEMAP CTRL v1 END */
/* SOS BASEMAP CTRL v2 BEGIN */
.leaflet-control-layers.leaflet-control { margin: 10px 0 10px 10px; }
@media (max-width:480px){ .leaflet-control-layers.leaflet-control { margin: 8px 0 8px 8px; } }
/* portiamo i controlli sopra eventuali overlay/z-index custom */
.leaflet-top, .leaflet-bottom { z-index: 990; }
/* SOS BASEMAP CTRL v2 END */
/* SOS BASEMAP CTRL v3 BEGIN */
.leaflet-control-layers.leaflet-control { margin: 10px 0 10px 10px; }
@media (max-width:480px){ .leaflet-control-layers.leaflet-control { margin: 8px 0 8px 8px; } }
.leaflet-top, .leaflet-bottom { z-index: 990; }
/* SOS BASEMAP CTRL v3 END */
/* SOS BASEMAP CTRL v4 BEGIN */
.leaflet-control-layers.leaflet-control { margin: 10px 0 10px 10px; }
@media (max-width:480px){ .leaflet-control-layers.leaflet-control { margin: 8px 0 8px 8px; } }
.leaflet-top, .leaflet-bottom { z-index: 990; }
/* Evita che qualcosa lo nasconda */
.leaflet-control-container { pointer-events: auto; }
/* SOS BASEMAP CTRL v4 END */
/* SOS BASEMAP CTRL v5 BEGIN */
.leaflet-control-layers.leaflet-control { margin: 10px 0 10px 10px; }
@media (max-width:480px){ .leaflet-control-layers.leaflet-control { margin: 8px 0 8px 8px; } }
.leaflet-top, .leaflet-bottom { z-index: 990; }
.leaflet-control-container { pointer-events: auto; }
/* SOS BASEMAP CTRL v5 END */
