/* Solo area di accesso soci: nessuna modifica alla grafica generale. */
.mg-auth { position:relative; flex-shrink:0; font-family:inherit; }
.mg-auth-trigger, .mg-auth-active {display:flex;align-items:center;gap:7px;padding:8px 10px;border:1px solid #c9dcea;border-radius:9px;background:#eff7fd;color:#123c69;font-size:12px;font-weight:800;line-height:1.3}
.mg-auth-trigger {cursor:pointer;list-style:none}
.mg-auth-trigger::-webkit-details-marker {display:none}
.mg-auth-trigger::marker {content:""}
.mg-auth-trigger:focus-visible,.mg-auth-submit:focus-visible,.mg-auth-logout:focus-visible {outline:3px solid #71b9ed;outline-offset:2px}
.mg-auth-icon {font-size:15px;line-height:1}
.mg-auth-open {color:#176a9e;font-weight:700}
.mg-auth-active {background:#eff9f2;border-color:#b8dec5;color:#166335}
.mg-auth-member {display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.mg-auth-name {font-size:11px;font-weight:500;color:#365a48}
.mg-auth-logout-form {margin:0}
.mg-auth-logout {cursor:pointer;border:1px solid #b8dec5;border-radius:7px;background:#fff;color:#166335;padding:5px 8px;font:inherit;font-size:11px;font-weight:800}
.mg-auth-panel {position:absolute;right:0;top:calc(100% + 9px);z-index:1000;width:310px;max-width:calc(100vw - 32px);padding:18px;border:1px solid #d5e3ed;border-radius:12px;background:#fff;color:#17324d;box-shadow:0 12px 30px rgba(11,47,78,.18);font-size:13px;line-height:1.45}
.mg-auth-panel strong {display:block;margin-bottom:12px;font-size:15px}
.mg-auth-panel label {display:block;margin:11px 0;font-size:12px;font-weight:700}
.mg-auth-panel input[type="email"],.mg-auth-panel input[type="password"] {display:block;width:100%;margin-top:5px;padding:10px;border:1px solid #b9cbd9;border-radius:7px;background:#fff;font:inherit;color:#17324d}
.mg-auth-submit {width:100%;padding:10px;margin-top:4px;cursor:pointer;border:0;border-radius:7px;background:#167fbe;color:#fff;font:inherit;font-weight:800}
.mg-auth-error {margin:0 0 9px;color:#a22020;font-weight:700}
@media(max-width:900px){.mg-auth {width:100%;margin-top:7px}.mg-auth-trigger {width:fit-content;max-width:100%}.mg-auth-panel {position:static;width:min(310px,100%);max-width:100%;margin-top:8px}}
.mg-footer-admin {display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border:1px solid #c6d7e8;border-radius:8px;background:#eef5fc;color:#123c69!important;font-size:12px;font-weight:700;text-decoration:none;white-space:nowrap}
.mg-footer-admin:hover,.mg-footer-admin:focus-visible {background:#dcecf9;outline:2px solid #7ca9d0;outline-offset:2px}

/* Stili condivisi per pagine che non caricano assets/style.css della Home */
.mg-shared-bar.top {position:sticky;top:0;z-index:1100;display:flex;align-items:center;gap:12px;padding:8px 18px;background:#fff;border-bottom:1px solid #dbe6ee;font-family:Arial,sans-serif}
.mg-shared-bar .brand {display:flex;align-items:center;gap:10px;text-decoration:none;color:#123c69}
.mg-shared-bar .brand>div {display:flex;flex-direction:column}
.mg-shared-bar .brand span {font-size:11px}
.mg-shared-bar nav {display:flex;align-items:center;gap:12px;margin-left:auto;flex-wrap:wrap}
.mg-shared-bar nav>a {font-size:13px;color:#123c69;text-decoration:none;font-weight:700}
.mg-shared-bar .menuBtn {display:none}
@media(max-width:1100px){.mg-shared-bar {flex-wrap:wrap}.mg-shared-bar .menuBtn {display:block;margin-left:auto}.mg-shared-bar nav {display:none;flex-basis:100%;flex-direction:column;align-items:stretch}.mg-shared-bar nav.mg-open {display:flex}}

/* Logo e pulsanti Meteogruppo */
.mg-shared-bar .mg-official-logo {display:block;width:110px;height:62px;max-width:110px;object-fit:contain;flex-shrink:0}
.mg-shared-bar .brand {flex-shrink:0;min-width:0}
.mg-shared-bar .mg-join-btn {display:inline-flex;align-items:center;justify-content:center;padding:9px 12px;background:#d62828;color:#fff;border-radius:8px;font-size:12px;font-weight:800;text-decoration:none;white-space:nowrap}
@media(max-width:600px){.mg-shared-bar .mg-official-logo {width:85px;height:48px}}
.mg-shared-bar .mg-auth-active {background:#e7f6eb!important;border:1px solid #a8d8b5!important;color:#166534!important;border-radius:9px}
.mg-shared-bar .mg-auth-active span {color:#166534!important;font-weight:800}
.mg-shared-bar .mg-auth-name {color:#166534!important}
.mg-shared-bar .mg-home-btn {display:inline-flex!important;align-items:center;justify-content:center;min-height:40px;padding:9px 15px;background:#155d98!important;color:#fff!important;border:1px solid #155d98!important;border-radius:9px;font-size:12px;font-weight:800;text-decoration:none!important;white-space:nowrap;transition:background .2s}
.mg-shared-bar .mg-home-btn:hover {background:#0d416e!important;color:#fff!important}
@media(max-width:600px){.mg-shared-bar .mg-home-btn {min-height:36px;padding:8px 10px;font-size:11px}}

/* Solo pagine Risorse Meteo: non modifica la Home.
   Le sottopagine e l'indice utilizzano main.container. */
@media (min-width: 1451px) {
  body:has(> main.container) > .mg-shared-bar.top {flex-wrap:nowrap!important;justify-content:flex-start;column-gap:7px;padding-left:10px;padding-right:10px}
  body:has(> main.container) > .mg-shared-bar .brand {gap:5px;flex:0 0 auto}
  body:has(> main.container) > .mg-shared-bar .brand strong {font-size:15px}
  body:has(> main.container) > .mg-shared-bar .brand span {font-size:10px}
  body:has(> main.container) > .mg-shared-bar .mg-join-btn {padding:8px 9px;font-size:11px}
  body:has(> main.container) > .mg-shared-bar .mg-home-btn {padding:8px 10px;font-size:11px}
  body:has(> main.container) > .mg-shared-bar #mainNav {display:flex;flex:1 1 auto;min-width:0;width:auto;flex-basis:auto;flex-direction:row;align-items:center;justify-content:flex-end;flex-wrap:nowrap!important;column-gap:7px;margin-left:auto}
  body:has(> main.container) > .mg-shared-bar #mainNav > a {font-size:11px;white-space:nowrap;flex-shrink:0}
  body:has(> main.container) > .mg-shared-bar .mg-forecast-menu {flex:0 0 auto;white-space:nowrap;font-size:11px}
  body:has(> main.container) > .mg-shared-bar .mg-auth {flex:0 0 auto;width:auto;margin:0;white-space:nowrap}
  body:has(> main.container) > .mg-shared-bar .mg-auth-trigger,
  body:has(> main.container) > .mg-shared-bar .mg-auth-active {font-size:11px;padding:7px}
}
/* Quando il menu intero non entra, usare quello compatto anziché spezzarlo. */
@media (min-width: 901px) and (max-width: 1450px) {
  body:has(> main.container) > .mg-shared-bar.top {flex-wrap:nowrap;gap:10px}
  body:has(> main.container) > .mg-shared-bar .menuBtn {display:block;margin-left:auto}
  body:has(> main.container) > .mg-shared-bar #mainNav {display:none;position:absolute;top:100%;left:0;right:0;margin:0;padding:16px 20px;background:#fff;border-bottom:1px solid #dbe6ee;box-shadow:0 8px 18px rgba(18,55,85,.10);flex-direction:column;align-items:stretch;gap:13px;max-height:calc(100vh - 95px);overflow-y:auto}
  body:has(> main.container) > .mg-shared-bar #mainNav.is-open,
  body:has(> main.container) > .mg-shared-bar #mainNav.mg-open {display:flex}
  body:has(> main.container) > .mg-shared-bar .mg-auth {width:auto;margin:0}
}

/* Torna alle Risorse Meteo: link nel contenuto delle sottopagine. */
body main a[href="/risorse-meteo/"],body main a[href="https://www.meteogruppo.eu/risorse-meteo/"],body > a[href="/risorse-meteo/"],body > a[href="https://www.meteogruppo.eu/risorse-meteo/"] {display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:7px!important;width:max-content;max-width:100%;padding:11px 18px!important;margin:0 0 14px!important;background:#155d98!important;color:#fff!important;border:1px solid #155d98!important;border-radius:9px!important;box-shadow:0 2px 6px rgba(15,64,108,.15);font-family:Arial,Helvetica,sans-serif;font-size:14px!important;font-weight:800!important;line-height:1.35!important;text-decoration:none!important;white-space:normal;cursor:pointer}
body main a[href="/risorse-meteo/"]:hover,body main a[href="https://www.meteogruppo.eu/risorse-meteo/"]:hover,body > a[href="/risorse-meteo/"]:hover,body > a[href="https://www.meteogruppo.eu/risorse-meteo/"]:hover {background:#0d416e!important;color:#fff!important}
body main a[href="/risorse-meteo/"]:focus-visible,body main a[href="https://www.meteogruppo.eu/risorse-meteo/"]:focus-visible {outline:3px solid #75b6e6;outline-offset:3px}
body:has(.mg-risorse-return-wrap) main a[href="/risorse-meteo/"],body:has(.mg-risorse-return-wrap) main a[href="/risorse-meteo/index.php"],body:has(.mg-risorse-return-wrap) main a[href="https://www.meteogruppo.eu/risorse-meteo/"] {display:none!important}

/* =========================================================
   FIX RESPONSIVE METEOGRUPPO — SOLO SMARTPHONE (<= 600px)
   Desktop e tablet restano invariati.
   Prima riga: logo/nome a sinistra e menu a destra.
   Seconda riga: pulsanti associativi e di ritorno.
   Terza riga (solo quando aperto): navigazione.
   ========================================================= */
@media (max-width:600px) {
  .mg-shared-bar.top {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-rows:auto auto auto;
    gap:8px 10px;
    align-items:center;
    padding:8px 12px!important;
    min-height:0;
    width:100%;
    max-width:100%;
  }
  .mg-shared-bar .brand {
    grid-column:1;grid-row:1;
    min-width:0;max-width:100%;gap:7px;
    overflow:hidden;
  }
  .mg-shared-bar .mg-official-logo {width:65px;height:46px;max-width:65px}
  .mg-shared-bar .brand>div {min-width:0;overflow:hidden}
  .mg-shared-bar .brand strong {font-size:15px;line-height:1.2;white-space:nowrap}
  .mg-shared-bar .brand span {font-size:10px;line-height:1.2;white-space:normal}
  .mg-shared-bar .menuBtn {
    display:flex!important;grid-column:2;grid-row:1;
    align-items:center;justify-content:center;
    margin:0!important;padding:4px 8px;
    min-width:42px;min-height:42px;
    cursor:pointer;
  }
  .mg-shared-bar .mg-join-btn {
    grid-column:1;grid-row:2;
    min-width:0;min-height:38px;
    padding:9px 7px;font-size:11px;
    text-align:center;
  }
  .mg-shared-bar .mg-home-btn {
    grid-column:2;grid-row:2;
    max-width:100%;min-height:38px;
    padding:7px 9px;font-size:11px;
    white-space:normal;text-align:center;
  }
  .mg-shared-bar .mg-join-btn:not(:has(+ .mg-home-btn)) {grid-column:1 / -1}
  .mg-shared-bar #mainNav {
    grid-column:1 / -1;grid-row:3;
    display:none!important;
    position:static!important;
    width:100%;max-width:100%;min-width:0;
    margin:0!important;padding:12px 4px!important;
    border-top:1px solid #dbe6ee;
    border-bottom:0;box-shadow:none;
    flex-direction:column;align-items:stretch;
    gap:12px;
    max-height:calc(100dvh - 160px);
    overflow-y:auto;overscroll-behavior:contain;
  }
  .mg-shared-bar #mainNav.mg-open,
  .mg-shared-bar #mainNav.is-open {display:flex!important}
  .mg-shared-bar #mainNav > a {min-height:38px;display:flex;align-items:center}
  .mg-shared-bar .mg-forecast-submenu {max-width:100%;box-sizing:border-box}
  .mg-shared-bar .mg-auth {width:100%;min-width:0}
}
@media (max-width:350px) {
  .mg-shared-bar.top {padding:8px!important;gap:6px}
  .mg-shared-bar .mg-official-logo {width:54px;max-width:54px;height:40px}
  .mg-shared-bar .brand strong {font-size:13px}
  .mg-shared-bar .brand span {font-size:9px}
  .mg-shared-bar .mg-join-btn,.mg-shared-bar .mg-home-btn {font-size:10px}
}


/* Intestazione Meteogruppo — revisione 30 ottobre 2026.
   Logo a sinistra, CTA e navigazione al centro, Facebook e soci a destra. */
.mg-shared-bar.top{box-sizing:border-box;width:100%;}
.mg-shared-bar .mg-action-buttons{display:flex;gap:8px;align-items:center;justify-content:center;min-width:0;}
.mg-shared-bar .mg-action-buttons .mg-action{box-sizing:border-box;display:flex;align-items:center;justify-content:center;min-height:46px;padding:9px 12px;border-radius:8px;color:#fff!important;text-decoration:none!important;text-align:center;font:800 12px/1.3 Arial,sans-serif;white-space:normal;}
.mg-shared-bar .mg-action-red{background:#e11d25!important;}
.mg-shared-bar .mg-action-blue{background:#075590!important;}
.mg-shared-bar .mg-action-green{background:#078136!important;}
.mg-shared-bar .mg-action:hover{filter:brightness(.92);}
.mg-shared-bar .mg-action:focus-visible{outline:3px solid #80b8ef;outline-offset:2px;}
.mg-shared-bar .mg-menu-utilities{display:flex;align-items:center;justify-content:flex-end;gap:9px;min-width:0;}
.mg-shared-bar .mg-menu-utilities .mg-facebook-link{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;flex:0 0 34px;border-radius:4px;background:#1877f2;}
.mg-shared-bar .mg-menu-utilities .mg-facebook-link svg{display:block;width:23px;height:23px;fill:white;}
.mg-shared-bar #mainNav>a,.mg-shared-bar #mainNav .mg-forecast-menu>summary{font-weight:800!important;color:#123c69!important;}
@media(min-width:1101px){
  .mg-shared-bar.top{display:grid!important;grid-template-columns:minmax(180px,auto) minmax(0,1fr) minmax(140px,auto)!important;grid-template-rows:auto auto!important;column-gap:12px;row-gap:6px;align-items:center;padding:8px 18px!important;}
  .mg-shared-bar .brand{grid-column:1;grid-row:1 / 3;align-self:center;}
  .mg-shared-bar .mg-action-buttons{grid-column:2;grid-row:1;justify-self:center;width:100%;max-width:770px;}
  .mg-shared-bar .mg-action-buttons .mg-action{flex:1 1 0;min-width:0;max-width:255px;}
  .mg-shared-bar .mg-menu-utilities{grid-column:3;grid-row:1 / 3;justify-self:end;align-self:center;}
  .mg-shared-bar .mg-menu-utilities .mg-auth{display:block!important;position:relative!important;right:auto!important;top:auto!important;width:auto!important;margin:0!important;}
  .mg-shared-bar .menuBtn{display:none!important;}
  .mg-shared-bar #mainNav{grid-column:2;grid-row:2;display:flex!important;position:static!important;flex-direction:row!important;justify-content:center!important;align-items:center!important;flex-wrap:wrap!important;gap:7px 13px!important;min-width:0;width:100%!important;margin:0!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible!important;max-height:none!important;}
  .mg-shared-bar #mainNav>a{white-space:nowrap!important;font-size:12px!important;}
  .mg-shared-bar #mainNav .mg-forecast-menu{font-size:12px!important;}
  .mg-shared-bar #mainNav .mg-home-btn{display:inline-flex!important;font-size:11px!important;min-height:30px;padding:5px 9px!important;}
  /* Evita le vecchie regole specifiche per Risorse Meteo. */
  body:has(> main.container) > .mg-shared-bar.top{display:grid!important;grid-template-columns:minmax(180px,auto) minmax(0,1fr) minmax(140px,auto)!important;flex-wrap:initial!important;}
  body:has(> main.container) > .mg-shared-bar #mainNav{display:flex!important;flex-wrap:wrap!important;justify-content:center!important;gap:7px 13px!important;width:100%!important;}
  body:has(> main.container) > .mg-shared-bar #mainNav>a{font-size:12px!important;}
}
@media(min-width:601px) and (max-width:1100px){
  .mg-shared-bar.top{display:flex!important;flex-wrap:wrap!important;gap:10px;}
  .mg-shared-bar .brand{order:1;}
  .mg-shared-bar .mg-action-buttons{order:3;flex:1 1 100%;justify-content:center;}
  .mg-shared-bar .mg-action-buttons .mg-action{flex:0 1 230px;}
  .mg-shared-bar .mg-menu-utilities{order:2;margin-left:auto;}
  .mg-shared-bar .menuBtn{display:flex!important;}
  .mg-shared-bar .mg-menu-utilities .mg-auth{display:none!important;}
  .mg-shared-bar #mainNav{order:4;flex-basis:100%;display:none!important;}
  .mg-shared-bar #mainNav.mg-open,.mg-shared-bar #mainNav.is-open{display:flex!important;}
  .mg-shared-bar #mainNav .mg-home-btn{display:inline-flex!important;}
}
@media(max-width:600px){
  .mg-shared-bar.top{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;grid-template-rows:auto auto auto!important;gap:8px 9px!important;padding:8px 12px!important;}
  .mg-shared-bar .brand{grid-column:1;grid-row:1;min-width:0;}
  .mg-shared-bar .mg-menu-utilities{grid-column:2;grid-row:1;gap:4px;}
  .mg-shared-bar .mg-menu-utilities .mg-auth{display:none!important;}
  .mg-shared-bar .mg-menu-utilities .mg-facebook-link{display:none!important;}
  .mg-shared-bar .menuBtn{display:flex!important;margin:0!important;}
  .mg-shared-bar .mg-action-buttons{grid-column:1 / -1;grid-row:2;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:7px;}
  .mg-shared-bar .mg-action-buttons .mg-action{width:100%;max-width:none;min-width:0;min-height:46px;padding:7px 4px;font-size:10px;}
  .mg-shared-bar .mg-action-buttons .mg-action-blue{grid-column:1;grid-row:1;}
  .mg-shared-bar .mg-action-buttons .mg-action-red{grid-column:2;grid-row:1;}
  .mg-shared-bar .mg-action-buttons .mg-action-green{display:none!important;}
  .mg-shared-bar #mainNav{grid-column:1 / -1;grid-row:3;display:none!important;}
  .mg-shared-bar #mainNav.mg-open,.mg-shared-bar #mainNav.is-open{display:flex!important;}
  .mg-shared-bar #mainNav .mg-home-btn{display:inline-flex!important;width:max-content;}
}

/* Testo sempre bianco sul pulsante di ritorno, anche dopo la visita. */
.mg-shared-bar a.mg-home-btn,
.mg-shared-bar a.mg-home-btn:link,
.mg-shared-bar a.mg-home-btn:visited,
.mg-shared-bar a.mg-home-btn:hover,
.mg-shared-bar a.mg-home-btn:focus,
.mg-shared-bar a.mg-home-btn:focus-visible {
  color: #ffffff !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}

/* FIX 30-10-2026: prevale sul colore generale dei link di #mainNav. */
.mg-shared-bar #mainNav > a.mg-home-btn,
.mg-shared-bar #mainNav > a.mg-home-btn:link,
.mg-shared-bar #mainNav > a.mg-home-btn:visited,
.mg-shared-bar #mainNav > a.mg-home-btn:hover,
.mg-shared-bar #mainNav > a.mg-home-btn:focus-visible {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 800 !important;
}
