:root {
  --primary: #0A4C9C;
  --accent: #FF8000;
  --bg: #F3F4F6;
  --text: #222; 
  --red: #ff0026;
  --radius: 12px;
  --shadow: 0 4px 14px rgba(0,0,0,0.08);
  --header-height: 190px; /* MISURA REALE */
}  
a:visited { color: #0000EE; }
a:hover   { color: #ff0022; }
.main-nav a:hover { color: #ff0022; }

.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }

.html {
  height: 100%;  
  margin:0;
}

body {
  display: flex; 
  flex-direction: column;  
  font-family: "Inter", Arial, sans-serif;
  background: var(--bg);
  min-height: 100vh;  
}

.container {
  max-width: 1300px;
  padding: 0 20px;
  margin: auto;
}

.topbar {
  background-image: url("../images/nubi.gif");
  background-size: cover;     /* Copre tutta l’area mantenendo le proporzioni */
  background-repeat: no-repeat;
  box-shadow: var(--shadow);
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  height: var(--header-height);
  padding: 5px 5px 5px 0; 
  max-width: 100%;
  overflow-x: hidden;   /* 🔒 niente debordi */
  box-sizing: border-box;

}

/* container sempre dentro viewport */
header.topbar .container {
  max-width: 1200px;   /* oppure 100%  */
  margin: 0 auto;
  padding: 0 10px;
  box-sizing: border-box;
}

/* blocco logo + titolo */
header.topbar .container.flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
}

/* LOGHI */
header.topbar img {
  max-width: 100%;
  height: auto;
  display: block;
}

.logo-left,
.logo-right {
  max-height: 80px;
  flex-shrink: 0;      /* non si deformano */
  color: var(--primary);
}

/* TITOLO */
header.topbar .titolo {
  flex: 1 1 auto;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;     /* 🔒 mai su due righe */
  overflow: hidden;
  text-overflow: ellipsis; /* sicurezza */
}

/* BADGE */
.anniversary-badge {
  position: absolute;
  top: 20px;
  right: 0px;
  background: linear-gradient(135deg, #facc15, #f12f0d);
  color: #fafbfc;
  font-size: 0.22em;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.titolo {
  position: relative;
  font-size: 60px;
  font-weight: bolder;
  color: #4242fd;
  text-decoration: none;
  text-shadow: 2px 2px 6px rgba(10, 0, 0, 0.83);
}

/* MENU testata */
.main-nav {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

#data-ora {
    font-size: clamp(16px, 2vw, 20px);
    margin-top: 5px;
    text-align: center;
    background: linear-gradient(
    to right,
    transparent 0%,  
    transparent 30%,
    rgba(255,255,255,0.8) 40%, 
    rgb(255, 255, 255) 50%,  
    rgba(255,255,255,0.8) 60%,
    transparent 70%,
    transparent 100%
    );
}
.ora {
    color: red;
}
 
.hero {
  background: linear-gradient(135deg, #0A4C9C, #1976D2);
  color: white;
  padding: 40px 0; 
}

.hero h1 {
  margin: auto;
  font-size: 42px;
  align-items: center;
  text-align: center;    
}

/* valori meteo */
.valore {
  font-size: 1.5em;      /* ingrandisci */
  font-weight: bold;     /* grassetto */
  color: var(--red);     /* colore  */
}

/* valori oremin */
.valoreOM {
  font-size: 1em;      /* ingrandisci */
  font-weight: bold;   /* grassetto */
  color: black;        /* colore  */
}

.full-layout {
    display: grid;
    gap: 20px;
    align-items: stretch; /* ⬅️ fa sì che destra e sinistra abbiano la stessa altezza */
    overflow: hidden; /* sicurezza */
  }
.full-layout iframe {
    width: 100%;
    aspect-ratio: 3 / 4;   /* altezza proporzionata */
    border: none;
    border-radius: 8px;
    display: block;
}
.full-layout img {
  max-width: 100%;
  height: auto;
  display: block;
}

.satellite-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: stretch; /* ⬅️ fa sì che destra e sinistra abbiano la stessa altezza */
}
.pari-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch; /* ⬅️ fa sì che destra e sinistra abbiano la stessa altezza */
}
.pari-layout iframe {
    width: 100%;
    aspect-ratio: 3 / 4;   /* altezza proporzionata */
    border: none;
    border-radius: 8px;
    display: block;
}
/* Colonna destra */
.pari-layout .right-small {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.pari-layout .small-box img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}
/* Titoli e font */
.pari-layout .img-title {
    text-align: center;
    font-weight: 600;
    color: var(--primary);
}
/* -- -----------------------------------------  */
/* --          TABELLE                           */
/* -- -----------------------------------------  */
table {
  width: 100%;
  border-collapse: collapse;
}

table thead {
  background: #eee;
}

table th, table td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

table tr:hover {
  background: #f5f5f5;
}
/* Tabella European Index */
.aq-index table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    margin: 2px auto;
}

.aq-index th, .aq-index td {
    padding: 8px;
    border: 1px solid #ccc;
    font-size: 0.85rem;
}
.radiation-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radiation-table .row {
    display: grid;
    grid-template-columns: 1fr 2fr; /* dose - effetto */
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 12px;
    background: #f7f7f7;
}

.radiation-table .dose {
    font-weight: bold;
}

.radiation-table .effect {
    font-size: 0.95rem;
    line-height: 1.4;
}
/* --- TABELLONE CENTRALE RESPONSIVE --- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.eq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.eq-table th {
  background: #0A4C9C;
  color: white;
  padding: 10px;
}

.eq-table td {
  padding: 10px;
  border-bottom: 1px solid #ccc;
}

.eq-table tr:nth-child(even) {
  background: #eee;
}

/*                      */
/* --- Contenitore che permette scroll su mobile --- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* --- Tabella base --- */
.eq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.eq-table th {
  background: #0A4C9C;
  color: white;
  padding: 10px;
  text-align: left;
}

.eq-table td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

/* Alternanza righe */
.eq-table tr:nth-child(even) {
  background: #f4f4f4;
}

/*      */

/* TABELLA RESPONSIVA */
.table-responsive {
  display: grid;
  gap: 10px;
  width: 100%;
}

/* HEADER */
.table-header {
  display: grid;
  grid-template-columns: 1fr 1fr 60px 1fr 1fr;
  background: #dce4ff;
  padding: 10px;
  border-radius: 8px;
  font-weight: bold;
}

/* RIGHE */
.table-row {
  display: grid;
  grid-template-columns: 1fr 1fr 80px 1fr 1fr;
  background: #f4f4f4;
  padding: 10px;
  border-radius: 8px;
}

.table-row:nth-child(even) {
  background: #eaeaea;
}
/* TABELLA LEGENDA */

.legend-table {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    margin-top: 20px;
}

.legend-row {
    display: grid;
    grid-template-columns: 30px 120px auto;
    gap: 10px;
    align-items: center;
    background: #fbfafa;
    padding: 10px;
    border-radius: 6px;
    border-left: 5px solid transparent;
}

.legend-color {
    display: block;
    width: 24px;
    height: 24px;
    border-radius: 4px;
}
.table-fog-responsive {
  overflow-x: auto;      /* mobile safe */
  margin-top: 15px;
}

.fog-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;      /* evita schiacciamenti */
}

.fog-table th,
.fog-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.fog-table th {
  background: #0A4C9C;
  color: white;
  font-weight: 600;
}

/* colori zone */
.fog-white        { background: #ffffff; }
.fog-yellow       { background: #f4e37b; }
.fog-dark-yellow  { background: #d6c34a; }
.fog-grey         { background: #d0d0d0; }

.allerta-table table {
  width: 100%;
  border-collapse: collapse;
}

.allerta-table td,
.allerta-table th {
  padding: 8px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
}
.alert-col {
  font-weight: bold;
  text-align: center;
}

/* colori ARPA */
.alert-col.gialla {background: #f6f205;}

.alert-col.arancione {background: #f7980a;}

.alert-col.rossa {background: #f30303;}

/*  TABELLA NUBI. */

.table-container {
max-width: 900px;
margin: auto;
overflow-x: auto;
}

table.prettytable {
width: 100%;
border-collapse: collapse;
background: #ffffff;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 8px 20px rgba(0,0,0,0.08);
margin: 1em 0;
}

table.prettytable caption {
font-size: 1.2rem;
font-weight: bold;
padding: 12px;
text-align: center;
background: #4f46e5;
color: #ffffff;
}

table.prettytable th, table.prettytable td {
padding: 12px 16px;
text-align: left;
}

table.prettytable th {
background: #3b82f6;
color: #ffffff;
text-transform: uppercase;
font-size: 0.95rem;
}

table.prettytable tbody tr:nth-child(even) {
background: #f9fafb;
}

table.prettytable tbody tr:hover {
background: #eef2ff;
}

/*-------------------  */
/* BOX GRIGIO */
.heat-box {
  background: #c7c7c7;
  border-radius: 12px;
  padding: 20px;
  max-width: 900px;
  margin: 20px auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* GRIGLIA RESPONSIVA */
.heat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 15px;
}

/* CAMPI */
.field {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

.field label {
  margin-bottom: 4px;
  font-weight: 600;
}

.field input {
  padding: 8px;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #bbb;
}

/* RISULTATO */
.field.result input {
  background: #fff8dc;
  font-weight: bold;
}

/* BOTTONE */
.field input[type="button"] {
  background: #0A4C9C;
  color: white;
  border: none;
  cursor: pointer;
}

.field input[type="button"]:hover {
  background: #083b78;
}

/* SELECT coerente con input */
.field select {
  padding: 8px;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #bbb;
}

/* Titoli nel box */
.heat-box h1 {
  font-size: 20px;
  margin-bottom: 5px;
}

.heat-box h2 {
  font-size: 15px;
  font-weight: normal;
  margin-bottom: 15px;
  color: #555;
}

/* Fonte */
.heat-box .fonte {
  margin-top: 15px;
  font-size: 13px;
  color: #444;
}

.colore-semi {
    padding: 18px 10px 10px 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}
/* Stile dei numeri */
.RadiaN {
    font-size: 45px;
    font-weight: bold;
    color: red;
    display: inline-block;
    padding-left: 20px;
    text-align: center;
}
.Radia24 {
    font-size: 35px;
    font-weight: bold;
    color: red;
    display: inline-block;
    padding-left: 20px;
    text-align: center;
}
.RadiaNData {
    font-weight: bold;
    display: inline-block;
    font-size: 25px;
    text-align: center;
}

/* IMMAGINE */
.big-image  {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
/* IMMAGINE */
.small-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* BOX DELLE IMMAGINI PICCOLE */
.small-box {
    flex: 1;           /* ⬅️ fa sì che le 2 immagini abbiano stessa altezza */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* TITOLO SOTTO LE IMMAGINI */
.img-title {
    margin-top: 2px;
    text-align: center;
    font-size: 14px;
    font-weight: normal;
    color: var(--primary);
}
.fonte {
    font-style: italic;
    font-size: 1rem;
}

.fonte a {
    color: inherit;          /* usa il colore del testo */
    text-decoration: underline; /* sottolineato (opzionale) */
    font-style: inherit;     /* mantiene l'italic */
    font-size: inherit;      /* mantiene la dimensione più piccola */
}
/* BOX DI DIVISIONE CAPITOLI */

.box-blu.fullcover {
    background: #0A4C9C;
    color: white;
    padding-left: 80px;                 /* margine interno */
    margin: 0;                  /* nessun margine esterno */
    width: 100%;
    height: 100%;               /* riempie la card */
    display: flex;              /* centra testo verticalmente */
    align-items: center;
    font-size: clamp(14px, 4vw, 24px);
    border-radius: inherit;     /* usa lo stesso radius della card */
    box-sizing: border-box;
}
.box-blu.fullcover.light {
    background: #77b7ef;
    color: white;
    padding-left: 80px;                 /* margine interno */
    margin: 0;                  /* nessun margine esterno */
    width: 100%;
    height: 100%;               /* riempie la card */             
    justify-content: left;
    text-align-last: left;
    font-size: clamp(10px, 2vw, 20px);
    border-radius: inherit;     /* usa lo stesso radius della card */
    box-sizing: border-box;
}
/* ------------------  */
/*       CARDS         */
/* ------------------  */
.card {
  background: white;
  padding: 5px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  margin-top: 20px;
}
.card-title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--primary);
}
.card-subtitle {
  grid-column: 1 / -1;    /*si estende su tutta la card*/
  font-size: 1rem;
  font-weight: normal;
  margin: 4px 0 10px 0;
  line-height: 1.3;
  color: var(--text);
} 

.card.no-padding {
  padding: 0;
  height: 50px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.image-right {
  display: flex;
  gap: 5px;
  flex-direction: row;
}

/* METEO */
.temp { font-size: 48px; font-weight: bold; }
.icon-big { width: 90px; }

.actual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.actual-grid h3 {
  background: #f4f4f4;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  margin: 0;
}

/* SIDEBAR */
.news-list {
  padding: 0;
  list-style: none;
}
.news-list li {
  margin-bottom: 10px;
}
.news-list a {
  text-decoration: none;
  color: var(--primary);
}
/* ----------------------------------  */
/*       AIR QUALITY                   */
/* ----------------------------------  */
.air-quality-dashboard {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    margin: 20px 0;
}

.air-quality-dashboard h2 {
    text-align: center;
    margin-bottom: 20px;
}
/* Riquadri valori attuali e previsione */
.aq-values, .aq-forecast {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.aq-box {
    flex: 1 1 100px;
    text-align: center;
    background: #0A4C9C;
    color: white;
    padding: 16px 12px;
    border-radius: 12px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.aq-box .aq-label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.aq-box .aq-value {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Ultimo aggiornamento */
.aq-update {
    text-align: center;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.buono { background: #66FF00; }
.discreto { background: #FFFF00; }
.moderato { background: #FF9900; }
.cattivo { background: #FF0000; }
.molto-cattivo { background: #CC33CC; }
.pessimo { background: #660099; color: #fff; }

.air-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.air-box {
    background: #ddd;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    font-weight: bold;
}

.pm-value {
    font-size: 1.5em;
    margin-top: 5px;
    padding: 10px;
    border-radius: 8px;
}

.three-windows-layout {
    display: grid;
    grid-template-columns: 0.5fr 2fr 0.5fr;
    gap: 15px;
}

.window {
    background: #f4f4f4;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.window img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 8px;
}

.window h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.window p {
    margin: 0;
    font-size: 14px;
    color: #333;
}
.small-window {
    /* Stile per le finestre laterali */
    background: #f8f8f8;
}

.large-window {
    /* Stile per la finestra centrale */
    background: #eef6ff;
    font-size: 1.1em;
    padding-top: 1.5em;
}


/*.    */
/* --- CARD PRINCIPALE A 3 COLONNE --- */
.three-window-card {
  display: grid;
  grid-template-columns: 25% 50% 25%;
  gap: 20px;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
}

/* --- Finestre interne --- */
.win {
  background: #f8f8f8;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.win h3 {
  margin-top: 0;
  font-size: 1.2rem;
  text-align: center;
}

/* --- Colonne laterali più piccole --- */
.win-left,
.win-right {
  font-size: 0.95rem;
}

.updated-time {
  margin-top: 15px;
  font-size: 14px;
  color: #333;
}
/* ------------------  */
/*       FOOTER        */
/* ------------------  */
.app-footer-fixed {
    text-align: center;
    margin-top: auto;  /* SPINGE IL FOOTER IN BASSO */
    width: 100%;
    background: linear-gradient(135deg, #0A4C9C, #1976D2);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
/*    z-index: 1000;  */
    border-top: 1px solid #333;
    color: white;
    position: relative;
}

.footer .footer-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
}

.footer-item {
    color: #bbb;
    text-decoration: none;
    font-size: 16px;
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: center; 
    gap: 10px;
    padding-inline: 20px;
}

.footer-item:link,
.footer-item:visited {
  color: #bbb;
}

.footer-item:link svg,
.footer-item:visited svg {
  color: #bbb;
}

.footer-item:hover,
.footer-item:hover svg {
  color: white;
}

.qr {
    width: 44px;
    height: 44px;
    border-radius: 4px;
    margin-top: -2px;
}
/* Colori legenda */
.white { background: #ccc; }
.green { background: #00a000; }
.yellow { background: #fff200; }
.orange { background: #ff7f00; }
.red { background: #d60000; }

.legend-title {
    font-weight: bold;
    font-size: 15px;
}

.legend-text {
    font-size: 14px;
}

/* Layout desktop: immagine sx + testo + immagine dx */
.text-layout-center {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding-left: 10px;
  padding-right: 10px;
  flex-wrap: wrap;  /* permette il wrap su mobile */
}

/* Immagine sinistra e destra */
.img-wrap-l, .img-wrap-r {
  flex: 0 0 166px;            /* larghezza fissa */
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  padding: 5px 5px 5px 5px;
}

.img-wrap-l img,
.img-wrap-r img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

/* Testo centrale */
.text-content {
  flex: 1;                    /* occupa spazio rimanente */
}

/* Paragrafi */
.text-content p {
  margin-bottom: 15px;
  line-height: 1.6;
}

.img-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.img-grid img {
  width: 100%;
  border-radius: 8px;
}
/* ------------------  */
/*      BOX IMPORTANTE */
/* ------------------  */
.important-box {
  background: #eff18a;
  border-radius: 12px;
  margin-top: 5px;
  margin-bottom:10px;
  text-align: center;
  width: auto;  
  padding: 5px;
/*  margin: 5px auto;  */
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.link-important {
  position: relative;
  font-weight: 700;
  color: #0A4C9C;
  text-decoration: none;
}

.link-important::before {
  content: "➜";
  display: inline-block;   /* NECESSARIO per transform */
  font-size: 1.5em;
  margin-right: 15px;
  margin-left: 15px;
  color: #ff0000;
  animation: pulse-right 0.8s infinite;
}
.link-important::after {
  content: "➜";
  display: inline-block;   /* NECESSARIO per transform */
  font-size: 1.5em;
  margin-right: 15px;
  margin-left: 15px;
  transform: rotate(180deg);
  color: #ff0000;
  animation: pulse-left 0.8s infinite;
}
/* ------------------  */
/*      ALLERTA BOX    */
/* ------------------  */
.allerta-box {
  position: relative;
  display: flex;
  gap: 20px;
  padding: 20px 25px;
  background: #fff8d6;
  margin: 30px 0;
  align-items: flex-start;

  /* lati verticali */
  border-left: 10px solid #c90000;
  border-right: 10px solid #c90000;

  /* ANGOLI ARROTONDATI */
  border-radius: 14px;

  animation: borderBlink 1.2s infinite;
}

.allerta-icon {
  font-size: 48px;
  animation: pulse 1.4s infinite;
}

.allerta-content h3 {
  margin-top: 0;
  color: #000;
}
/* ------------------  */
/*        animazioni   */
/* ------------------  */
@keyframes pulse-right {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

@keyframes pulse-left {
  0%, 100% { transform: translateX(0) rotate(180deg); }
  50% { transform: translateX(-6px) rotate(180deg); }
}

/* lampeggio rosso */
@keyframes borderBlink {
  0%, 100% {
    border-left-color: #c90000;
    border-right-color: #c90000;
  }
  50% {
    border-left-color: #ff4d4d;
    border-right-color: #ff4d4d;
  }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes pulse-right {
  0%,100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

@keyframes highlight {
  from { background: #fff3cd; }
  to   { background: white; }
}
@keyframes float {
  0%, 100% {
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  }
  50% {
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
  }
  50% {
    transform: translateY(0px);
  }
}

/* ------------------  */
/* --DIDATTICA ------- */
/* ------------------  */
section {
  scroll-margin-top: var(--header-height);
}
section[id] {
  scroll-margin-top: var(--header-height);
}
.sommario ul {
  list-style: none;
  padding: 0 20px 30px 0;
  margin: 0;
}
section:target {
  outline: 3px solid var(--accent);
  border-radius: 12px;
  animation: highlight 1.2s ease;
}

.sommario {
  background: #f4f4f4;
  padding: 15px 20px;
  border-radius: 10px;
  margin-bottom: 30px;
}
.sommario a::before {
  content: "➜";
  position: absolute;
  left: 0;
  color: var(--accent);
  animation: pulse-right 1s infinite;
}

.sommario ol {
  padding-left: 136px;
  list-style: none;       /* 🔴 niente numeri/pallini */
}

.sommario li {
  margin: 6px 0;
  padding: 0 20px 0px 20px;
}

.sommario ol ol {
  margin-top: 6px;
  padding-left: 20px;
  font-size: 0.95em;
  list-style: none;       /* 🔴 niente numeri/pallini */
}

.sommario a {
  text-decoration: none;
  font-weight: 600;
  color: var(--primary);
  position: relative;
  padding-left: 40px;
}

.sommario a:hover {
  text-decoration: underline;
}
/* -----------------------  */
/*  IMMAGINI E TESTO ------ */
/* -----------------------  */
/* Immagine con testo che la circonda */
.img-float-left {
  float: left;
  width: 50%;              /* 50% della card */
  max-width: 260px;        /* limite su schermi grandi */
  margin: 0 20px 15px 0;   /* spazio dal testo */
  border-radius: 10px;
  box-shadow: var(--shadow);
}

/* Clear float (chiude correttamente la card) */
.clear {
  clear: both;
}

.img-float-right {
  float: right;
  width: 50%;
  max-width: 260px;
  margin: 0 0 15px 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
/* -----------------------  */
/*    FRECCIA VERSO ALTO.   */
/* -----------------------  */
.back-to-top {
  position: fixed;
  bottom: 24px;
  /* CENTRATO ORIZZONTALMENTE */
  left: 20%;
  transform: translateX(-50%);
  width: 90px;
  height: 90px;
  background: rgba(29, 21, 241, 0.85);
  backdrop-filter: blur(6px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(85, 81, 81, 0.903);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  animation: float 3s ease-in-out infinite;
  transition: opacity 0.4s ease, transform 0.3s ease;
  z-index: 9999;
}
.card-wrapper {
  position: relative;
}

.back-to-top:hover {
  transform: translateY(0px) scale(1.05);
}

.arrow-icon {
  width: 40px;
  height: 40px;
}

.back-to-top:hover {
  transform: scale(1.1);
}

.main-menu {
  display: flex;
  flex-wrap: wrap;      /* 🔑 */
  gap: 8px 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.main-menu li {
  white-space: nowrap;
}
/* ======================================================
   RESPONSIVE — DESKTOP (≥768px)
   ====================================================== */
@media (min-width: 768px) {
    /* hide toggle on desktop */
    .main-toggle { display: none; }
     #main { 
       flex: 1;  
       padding-top: var(--header-height); 
    }

    /* il contenitore diventa "inline" nella header: non più collapse */
    .double-menu {
        display: flex;
        flex-direction: column;      /* i due <ul> affiancati */
        gap: 5px;
        padding: 5px;
        background: transparent;
        opacity: 1;
        pointer-events: auto;
        overflow: visible;
        position: static;
        box-shadow: none;
    }

    /* ogni <ul> diventa orizzontale (voci affiancate) */
    .main-menu {
        display: flex;
        flex-direction: row;
        row-gap: 2px;
        align-items: center;
    }
    .main-nav ul li { 
    display: inline-block; 
    padding: 0;
    margin: 0 5px;  
    }
    .main-nav ul li a { padding: 0 10px; }
}
/* ======================================================
   RESPONSIVE — TABLET (≤768px)
   ====================================================== */
@media (max-width: 768px) {
  .image-right {
    flex-direction: column;
    direction: ltr; /* reset */
  }
  /* logo dx via */
  .logo-right {
    display: none;
  }

  /* titolo più piccolo 
  header.topbar .titolo {
    font-size: 1.1rem;
  }*/

  .three-windows-layout,
  .three-window-card,
  .img-grid,
  .heat-grid {
    grid-template-columns: 1fr 1fr;
  }

  header.topbar {
    padding: 8px 0;
  }

  .topbar .titolo {
    font-size: 2.1rem;
  }

  .topbar .logo-right { 
    display: none;
  }
  #data-ora { 
    display: none;
  }

  .hero h1 {
    font-size: 32px;
  }
  #main { 
   flex: 1;  
  }

}
/* =========================
   RESPONSIVE SOTTO I 600px
   ========================= *

@media (max-width: 600px) {
*/
  /* header NON fisso 
  header.topbar {
    position: relative;
  }*/

  /* layout verticale 
  header.topbar .container.flex {
    flex-direction: column;
    gap: 6px;
  }*/
/* ======================================================
   RESPONSIVE — SMARTPHONE (≤600px) — fallback semplice
   ====================================================== */
@media (max-width: 600px) 
 {
  /* HEADER */
  header.topbar {
    padding: 6px 0;
    position: relative;
    height: auto;
  }
  /* NASCONDE COMPLETAMENTE I MENU */
  .double-menu {
    display: none;
  } 
  #data-ora { 
    display: none;
  }
  #main {
    padding-top: 0;
  }
  .topbar .titolo {
    font-size: 0.95rem;
    line-height: 1.1;
  }

  .topbar .logo-left .logo-right {
    max-height: 10px;
    max-width: 10px;
  }
    /* menu centrato */
  .main-menu {
    justify-content: center;
  }
  /* badge nascosto */
  .anniversary-badge {
    display: none;
  }

  /* LAYOUT */
  .aq-values,
  .aq-forecast,
  .allerta-box,
  .app-footer-fixed,
  .text-layout-center {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .three-windows-layout,
  .three-window-card,
  .img-grid,
  .heat-grid {
    grid-template-columns: 1fr;
  }

  .double-menu.open {
    display: flex ;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
  }

  /* TABELLE → CARD */
  .eq-table thead,
  table.prettytable thead {
    display: none;
  }

  .eq-table tr,
  table.prettytable tr {
    display: block;
    margin-bottom: 12px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
  }

  .eq-table td,
  table.prettytable td {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #ddd;
  }

  .eq-table td:last-child,
  table.prettytable td:last-child {
    border-bottom: none;
  }

  .eq-table td::before,
  table.prettytable td::before {
    content: attr(data-label);
    font-weight: 600;
  }

  /* HERO */
  .hero {
    padding: 25px 0;
    margin-top: 5px; 
  }

  .hero h1 {
    font-size: 26px;
  }

  /* FOOTER */
  .app-footer-fixed {
    padding: 10px;
    gap: 10px;
  }

  .app-footer-fixed .footer-item {
    font-size: 0.85rem;
  }
}
/* ======================================================
   SMARTPHONE PICCOLI (≤480px)
   ====================================================== */
@media (max-width: 480px) 
  {

  body {
    font-size: 14px;
  }
  .topbar {
    padding: 0;
  }
  .topbar .logo-left {
    max-height: 50px;
    max-width: 50px;
  }

  .topbar .titolo {
    font-size: 1.2rem;
    line-height: 1.1;
  }
  /* badge nascosto */
  .anniversary-badge {
    display: none;
  }

  .hero h1 {
    font-size: 22px;
  }
  #data-ora { 
    display: none;
  }

  .back-to-top {
    display: none;
  }
  .topbar .logo-left .logo-right {
    display: none;
  }

}