/* ==========================================================================
   MeteoProject - Modern dashboard stylesheet
   Versione di test per: index2.php + menu2.php + wltab6b2.php
   ========================================================================== */

/* ------------------------------ RESET ----------------------------------- */

:root {
  --bg: #071725;
  --bg-soft: #0b2033;
  --panel: rgba(14, 35, 53, 0.94);
  --panel-soft: rgba(20, 47, 69, 0.82);
  --panel-hover: rgba(26, 59, 83, 0.96);
  --border: rgba(121, 181, 213, 0.22);
  --border-strong: rgba(89, 191, 225, 0.46);
  --text: #eef6fb;
  --muted: #9fb4c4;
  --accent: #34c6ea;
  --accent-soft: rgba(52, 198, 234, 0.16);
  --good: #27c56a;
  --danger: #ff5b5b;
  --warning: #ffc64a;
  --radius: 16px;
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.24);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body.corpo,
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "Exo 2", "Trebuchet MS", Tahoma, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  background:
    linear-gradient(180deg, rgba(3, 14, 24, 0.78) 0%, rgba(5, 21, 34, 0.84) 100%),
    #071725;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

table {
  border-collapse: collapse;
}

/* --------------------------- PAGE BACKGROUND ----------------------------- */

.interno,
.site-page {
  min-height: 100vh;
  background-color: #0a2438;
  background-image:
    linear-gradient(180deg, rgba(7, 24, 40, 0.28), rgba(6, 20, 33, 0.66)),
    url(img/bg.jpg);
  /* Mantiene il fondale continuo anche quando la pagina supera l'altezza dell'immagine originale. */
  background-repeat: no-repeat, no-repeat;
  background-position: center center, center center;
  background-size: cover, cover;
  background-attachment: fixed, fixed;
}

.site-page {
  padding-bottom: 28px;
}

/* ------------------------------ HEADER ---------------------------------- */

.site-header {
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(61, 177, 220, 0.18);
  background: linear-gradient(180deg, rgba(10, 31, 49, 0.78), rgba(7, 24, 39, 0.58));
}

.site-header-inner {
  width: min(1440px, calc(100% - 48px));
  min-height: 104px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.site-branding {
  min-width: 0;
}

.titolo,
.site-branding .titolo {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: "Exo 2", "Trebuchet MS", Tahoma, sans-serif;
  font-size: clamp(25px, 2.1vw, 36px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-align: left;
  text-indent: 0;
  text-shadow: 0 2px 14px rgba(0,0,0,0.30);
}

.sottotitolo,
.sottotitolo1 {
  margin-top: 8px;
  padding: 0;
  color: var(--muted);
  font-family: "Exo 2", "Trebuchet MS", Tahoma, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  text-indent: 0;
  text-shadow: none;
}

/* ------------------------------ SHELL ----------------------------------- */

.site-shell {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
}

.main-content,
.dashboard-content {
  width: 100%;
  min-width: 0;
  padding: 26px 0 0;
}

/* ---------------------------- NAVIGATION -------------------------------- */

.site-navigation {
  margin-top: 18px;
  position: relative;
  z-index: 5;
}

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(8, 29, 46, 0.78);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.nav-item {
  min-height: 58px;
  padding: 9px 16px 9px 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 150px;
  justify-content: center;
  color: #d9e8f1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255,255,255,0.025);
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.nav-item:hover,
.nav-item:focus-visible {
  color: #fff;
  background: var(--accent-soft);
  border-color: rgba(52,198,234,.35);
  box-shadow: 0 8px 18px rgba(0,0,0,.16);
  transform: translateY(-1px);
}

.nav-home {
  background: linear-gradient(135deg, rgba(52,198,234,.18), rgba(52,198,234,.06));
  border-color: rgba(52,198,234,.22);
}

.nav-item img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex: 0 0 auto;
}

/* -------------------------- DASHBOARD HEADER ---------------------------- */

.weather-dashboard {
  width: 100%;
}

.weather-dashboard-meta {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.weather-update-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  color: var(--muted);
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(7, 27, 43, .60);
  box-shadow: var(--shadow-soft);
}

.weather-update-line strong {
  color: var(--text);
}

/* ----------------------------- WEATHER TILES ---------------------------- */

.weather-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.weather-tiles-secondary {
  margin-top: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.weather-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(25, 56, 78, .95), rgba(13, 34, 51, .96));
  box-shadow: var(--shadow-soft);
}

.weather-card-header {
  min-height: 42px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #dcebf3;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(133, 190, 220, .16);
  background: linear-gradient(90deg, rgba(57,120,151,.28), rgba(30,59,83,.20));
}

.weather-card-body {
  min-height: 184px;
  padding: 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.weather-card-body-wind,
.weather-card-body-rain {
  grid-template-columns: minmax(70px, .55fr) minmax(0, 1.6fr);
}

.weather-compact-body {
  min-height: 172px;
  grid-template-columns: minmax(58px, .65fr) minmax(0, 1.45fr);
  gap: 14px;
}

.weather-visual {
  min-width: 0;
  text-align: center;
  align-self: center;
}

.weather-visual img {
  display: block;
  max-height: 122px;
  width: auto;
  margin: 0 auto;
  object-fit: contain;
}

.weather-card-rain .weather-visual img {
  max-height: 150px;
}

.weather-main-value,
.weather-detail {
  min-width: 0;
  text-align: center;
}

.weather-main-value {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.weather-detail {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.weather-detail-wide {
  grid-column: auto;
}

.weather-label {
  display: block;
  width: 100%;
  margin-bottom: 3px;
  color: #93a9b9;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .015em;
}

.weather-status {
  margin-top: 8px;
}

.weather-card-footer {
  min-height: 88px;
  padding: 12px 14px;
  border-top: 1px solid rgba(133, 190, 220, .15);
  background: rgba(4, 19, 31, .24);
}

.weather-split-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}

.weather-split-details > div {
  min-width: 0;
  text-align: center;
}

.weather-split-details > div:nth-child(1) {
  grid-column: 1 / -1;
}

.weather-split-details .weather-label {
  margin-bottom: 2px;
}

/* ------------------------- SECONDARY WEATHER TILES ----------------------- */

/*
   Le tile secondarie hanno una struttura indipendente dalle tile primarie:

   header
   ├─ contenuto principale
   │  ├─ icona
   │  └─ valore principale
   └─ footer
      └─ dati secondari

   Le regole sono volutamente limitate a .weather-card-secondary
   per non modificare Temperatura, Vento e Precipitazioni.
*/

.weather-tiles-secondary .weather-card-secondary {
  display: flex;
  flex-direction: column;
  min-width: 0;
}


/* -------------------------- CONTENUTO PRINCIPALE ------------------------- */

.weather-tiles-secondary .weather-secondary-body {
  min-height: 132px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
}

.weather-tiles-secondary .weather-secondary-main {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(62px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}


/* ------------------------------- ICONA ----------------------------------- */

.weather-tiles-secondary .weather-secondary-main .weather-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
}

.weather-tiles-secondary .weather-secondary-main .weather-visual img {
  display: block;
  width: auto;
  max-width: 76px;
  max-height: 92px;
  margin: 0;
  object-fit: contain;
}


/* -------------------------- VALORE PRINCIPALE ---------------------------- */

.weather-tiles-secondary .weather-secondary-main .weather-main-value {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 4px;
  text-align: left;
}

.weather-tiles-secondary .weather-secondary-main .weather-label {
  width: 100%;
  margin-bottom: 4px;
}


/* -------------------------- FOOTER SECONDARIO ---------------------------- */

.weather-tiles-secondary .weather-secondary-footer {
  min-height: 64px;
  margin-top: auto;
  padding: 10px 12px;

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 10px;

  border-top: 1px solid rgba(133, 190, 220, .15);
  background:
    linear-gradient(
      180deg,
      rgba(3, 15, 25, .42),
      rgba(2, 12, 21, .58)
    );
}

.weather-tiles-secondary .weather-secondary-footer > div {
  min-width: 0;
  text-align: center;
}

.weather-tiles-secondary .weather-secondary-footer > div + div {
  border-left: 1px solid rgba(133, 190, 220, .12);
  padding-left: 10px;
}

.weather-tiles-secondary .weather-secondary-footer .weather-label {
  margin-bottom: 2px;
  font-size: 10px;
}


/* -------------------------- FOOTER CON UN DATO --------------------------- */

/*
   Irraggiamento e UV hanno un solo dato secondario.
   Il contenuto occupa tutta la fascia inferiore.
*/

.weather-card-radiation .weather-secondary-footer,
.weather-card-uv .weather-secondary-footer {
  grid-template-columns: 1fr;
}

.weather-card-radiation .weather-secondary-footer > div,
.weather-card-uv .weather-secondary-footer > div {
  border-left: 0;
  padding-left: 0;
}


/* ------------------------- REGOLAZIONI PER TILE -------------------------- */

/*
   Irraggiamento e UV possono usare immagini leggermente più grandi
   mantenendo invariata l'altezza complessiva.
*/

.weather-card-radiation .weather-secondary-main .weather-visual img,
.weather-card-uv .weather-secondary-main .weather-visual img {
  max-width: 82px;
  max-height: 96px;
}


/* ------------------------------- MOBILE ---------------------------------- */

@media (max-width: 700px) {

  .weather-tiles-secondary .weather-secondary-body {
    min-height: 120px;
  }

  .weather-tiles-secondary .weather-secondary-main {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .weather-tiles-secondary .weather-secondary-footer {
    min-height: 60px;
  }

}

@media (max-width: 460px) {

  .weather-tiles-secondary .weather-secondary-body {
    padding: 14px;
  }

  .weather-tiles-secondary .weather-secondary-main {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
  }

  .weather-tiles-secondary .weather-secondary-main .weather-visual {
    min-width: 58px;
  }

  .weather-tiles-secondary .weather-secondary-main .weather-visual img {
    max-width: 64px;
    max-height: 84px;
  }

  .weather-tiles-secondary .weather-secondary-footer {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .weather-tiles-secondary .weather-secondary-footer > div + div {
    border-left: 0;
    border-top: 1px solid rgba(133, 190, 220, .10);
    padding-top: 8px;
    padding-left: 0;
  }

}

/* --------------------- PRIMARY TILES: DENSER LAYOUT --------------------- */
/*
   The first three tiles contain all the information already present in the PHP.
   Here it is redistributed with CSS Grid only: no PHP values or functions change.
*/
.weather-tiles-primary .weather-card-body {
  min-height: 164px;
  padding: 16px 18px;
}

.weather-card-temperature .weather-card-body {
  grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "visual temperature humidity"
    "visual perceived perceived";
  column-gap: 18px;
  row-gap: 12px;
}

.weather-card-temperature .weather-visual {
  grid-area: visual;
}

.weather-card-temperature .weather-card-body > .weather-main-value:not(.weather-humidity) {
  grid-area: temperature;
}

.weather-card-temperature .weather-humidity {
  grid-area: humidity;
}

.weather-card-temperature .weather-detail-wide {
  grid-area: perceived;
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(133,190,220,.12);
  border-radius: 12px;
  background: rgba(5,20,32,.16);
}

.weather-card-temperature .weather-detail-wide .weather-label {
  width: auto;
  margin: 0;
  white-space: nowrap;
}

.weather-card-temperature .weather-detail-wide .weather-status {
  margin: 0;
  justify-self: end;
}

.weather-card-temperature .weather-card-footer {
  min-height: 100px;
}

.weather-card-temperature .weather-card-footer.weather-split-details {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.weather-card-temperature .weather-card-footer.weather-split-details > div:nth-child(1) {
  grid-column: auto;
}

.weather-card-temperature .weather-card-footer.weather-split-details > div + div {
  border-left: 1px solid rgba(133,190,220,.10);
  padding-left: 10px;
}

/* Wind: icon and main reading share the first row; average and status use the full right area. */
.weather-card-wind .weather-card-body {
  min-height: 164px;
  grid-template-columns: 84px minmax(0, 1fr);
  grid-template-areas:
    "visual speed"
    "visual average";
  column-gap: 18px;
  row-gap: 14px;
}

.weather-card-wind .weather-visual {
  grid-area: visual;
}

.weather-card-wind .weather-main-value.weather-detail-wide {
  grid-area: speed;
}

.weather-card-wind .weather-detail.weather-detail-wide {
  grid-area: average;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(133,190,220,.12);
  border-radius: 12px;
  background: rgba(5,20,32,.16);
}

.weather-card-wind .weather-detail.weather-detail-wide .weather-label {
  width: auto;
  margin: 0;
}

.weather-card-wind .weather-detail.weather-detail-wide .weather-status {
  margin: 0;
  justify-self: end;
}

.weather-card-wind .weather-card-footer {
  min-height: 82px;
  padding: 11px 14px;
}

.weather-card-wind .weather-card-footer.weather-split-details {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.weather-card-wind .weather-card-footer.weather-split-details > div:nth-child(1) {
  grid-column: auto;
}

.weather-card-wind .weather-card-footer.weather-split-details > div + div {
  border-left: 1px solid rgba(133,190,220,.10);
  padding-left: 10px;
}

/* Rain follows the same compact hierarchy as wind. */
.weather-card-rain .weather-card-body {
  min-height: 164px;
  grid-template-columns: 84px minmax(0, 1fr);
  grid-template-areas:
    "visual amount"
    "visual intensity";
  column-gap: 18px;
  row-gap: 14px;
}

.weather-card-rain .weather-visual {
  grid-area: visual;
}

.weather-card-rain .weather-main-value.weather-detail-wide {
  grid-area: amount;
}

.weather-card-rain .weather-detail.weather-detail-wide {
  grid-area: intensity;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(133,190,220,.12);
  border-radius: 12px;
  background: rgba(5,20,32,.16);
}

.weather-card-rain .weather-detail.weather-detail-wide .weather-label {
  width: auto;
  margin: 0;
}

.weather-card-rain .weather-detail.weather-detail-wide .weather-status {
  margin: 0;
  justify-self: end;
}

.weather-card-rain .weather-card-footer {
  min-height: 82px;
  padding: 11px 14px;
}

.weather-card-rain .weather-card-footer.weather-split-details {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.weather-card-rain .weather-card-footer.weather-split-details > div:nth-child(1) {
  grid-column: auto;
}

.weather-card-rain .weather-card-footer.weather-split-details > div + div {
  border-left: 1px solid rgba(133,190,220,.10);
  padding-left: 10px;
}

.weather-tiles-primary .weather-card-footer .weather-label {
  font-size: 10px;
}

/* ----------------------------- TYPOGRAPHY ------------------------------- */

.temp {
  color: #f3f8fb;
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: clamp(28px, 2.25vw, 42px);
  line-height: 1;
  text-shadow: none;
}

.valor2 {
  color: #d5e3ec;
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: clamp(14px, 1.2vw, 20px);
  line-height: 1.1;
  text-shadow: none;
}

.valori,
.valori2,
.valori3 {
  color: #e7f1f6;
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: 14px;
  text-shadow: none;
}

.valori2 {
  font-size: 15px;
}

.max,
.maxpiccolo {
  color: var(--warning);
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: 13px;
  text-shadow: none;
}

.maxpiccolo {
  font-size: 11px;
}

.blu,
.minpiccolo {
  color: #4ed6ff;
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: 13px;
  text-decoration: none;
  text-shadow: none;
}

.minpiccolo {
  font-size: 11px;
}

.scrittine {
  color: #9fb3c1;
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: 11px;
  text-shadow: none;
}

.avvisi {
  color: #17212a;
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: 11px;
  text-shadow: none;
}

.avvisi span {
  display: inline-block;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  box-shadow: none;
}

/* --------------------------- STATION STATUS ----------------------------- */

.weather-bottom-row {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: stretch;
}

.station-status-panel,
.aqi-legend-link {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(12, 33, 49, .84);
  box-shadow: var(--shadow-soft);
}

.station-status-panel {
  min-height: 92px;
  padding: 18px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.station-status-panel .weather-label {
  width: auto;
  margin: 0;
}

.station-status-panel .valori2 > span {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: .04em;
  box-shadow: none;
}

.aqi-legend-link {
  padding: 0;
  overflow: hidden;
  display: block;
}

.aqi-legend-link img {
  display: block;
  height: 92px;
  width: auto;
}

/* --------------------------- GENERIC SECTIONS --------------------------- */

.media-section,
.home-secondary-grid {
  margin-top: 28px;
}

/* ---------------------- MEDIA SECTION SPACING --------------------------- */

/*
   La sezione Webcam è la prima sezione dopo il menu:
   riduce lo spazio superiore, già garantito dal padding del main,
   e crea una separazione equilibrata verso il dashboard meteo.
*/

.media-section {
  margin-top: 8px;
  margin-bottom: 28px;
}

.section-heading {
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  margin: 0;
  color: #eaf4f8;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .01em;
}

.section-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.compact-heading {
  min-height: 44px;
  margin: 0;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(133,190,220,.15);
  background: linear-gradient(90deg, rgba(57,120,151,.25), rgba(30,59,83,.18));
}

.compact-heading h2 {
  width: 100%;
  text-align: center;
  font-size: 14px;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.media-card,
.info-card,
.site-counter-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(12, 33, 49, .90);
  box-shadow: var(--shadow-soft);
}

.media-card h3 {
  margin: 0;
  padding: 13px 18px;
  color: #dcebf3;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-align: center;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(133,190,220,.15);
  background: linear-gradient(90deg, rgba(57,120,151,.25), rgba(30,59,83,.18));
}

.media-card a,
.media-card > img {
  display: block;
  width: 100%;
}

.media-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #071725;
}

.media-card-satellite img {
  object-fit: cover;
}

/* -------------------------- MEDIA CARD FOOTER --------------------------- */

/*
   Le card della sezione webcam diventano colonne flex:
   questo permette al footer di rimanere sempre nella parte inferiore
   e di avere altezza uniforme.
*/

.media-card {
  display: flex;
  flex-direction: column;
}


/* L'immagine continua ad occupare lo spazio principale della card. */

.media-card > a,
.media-card > img {
  flex: 1 1 auto;
}


/* Footer comune alle tre card */

.media-card-footer {
  min-height: 58px;
  padding: 9px 12px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-top: 1px solid rgba(133, 190, 220, .15);

  background:
    linear-gradient(
      180deg,
      rgba(3, 15, 25, .42),
      rgba(2, 12, 21, .58)
    );
}


/*
   Footer vuoto del satellite.

   Rimane volutamente presente per mantenere la stessa
   struttura e altezza delle altre due card.
*/

.media-card-footer-empty {
  pointer-events: none;
}


/* ------------------------- PULSANTE TIMELAPSE --------------------------- */

.media-timelapse-button {
  width: 100%;
  min-height: 38px;

  padding: 8px 14px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  border: 1px solid rgba(52, 198, 234, .55);
  border-radius: 10px;

  color: #eaf7fb;

  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .025em;

  cursor: pointer;

  background:
    linear-gradient(
      135deg,
      rgba(30, 133, 165, .55),
      rgba(24, 77, 108, .60)
    );

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 4px 10px rgba(0,0,0,.16);

  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease,
    box-shadow .18s ease;
}


.media-timelapse-button:hover {
  transform: translateY(-1px);

  border-color: rgba(77, 218, 255, .90);

  background:
    linear-gradient(
      135deg,
      rgba(37, 157, 193, .75),
      rgba(25, 91, 125, .75)
    );

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    0 6px 14px rgba(0,0,0,.22);
}


.media-timelapse-button:active {
  transform: translateY(0);
}


.media-timelapse-icon {
  width: 20px;
  height: 20px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding-left: 1px;

  border-radius: 50%;

  color: #08212f;
  font-size: 9px;

  background: #4ed6ff;

  box-shadow:
    0 0 10px rgba(78, 214, 255, .25);
}


/* -------------------------- MODALE TIMELAPSE ---------------------------- */

.timelapse-modal {
  width: min(92vw, 1100px);

  max-width: 1100px;

  padding: 0;

  overflow: hidden;

  border: 1px solid rgba(78, 214, 255, .38);
  border-radius: var(--radius);

  color: #dcebf3;

  background: rgba(9, 27, 41, .98);

  box-shadow:
    0 20px 70px rgba(0,0,0,.60);
}


.timelapse-modal::backdrop {
  background: rgba(1, 9, 15, .78);

  backdrop-filter: blur(4px);
}


.timelapse-modal-content {
  width: 100%;
}


/* Header della finestrella */

.timelapse-modal-header {
  min-height: 56px;

  padding: 12px 16px 12px 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  border-bottom: 1px solid rgba(133, 190, 220, .16);

  background:
    linear-gradient(
      90deg,
      rgba(57, 120, 151, .35),
      rgba(30, 59, 83, .24)
    );
}


.timelapse-modal-header h2 {
  margin: 0;

  color: #eaf4f8;

  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: 16px;
  font-weight: 800;

  letter-spacing: .04em;
}


/* Pulsante di chiusura */

.timelapse-close-button {
  width: 36px;
  height: 36px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 36px;

  border: 1px solid rgba(133, 190, 220, .20);
  border-radius: 9px;

  color: #dcebf3;

  font-size: 28px;
  line-height: 1;

  cursor: pointer;

  background: rgba(255,255,255,.05);

  transition:
    background .18s ease,
    border-color .18s ease;
}


.timelapse-close-button:hover {
  border-color: rgba(255,255,255,.35);

  background: rgba(255,255,255,.10);
}


/* Video */

.timelapse-video {
  width: 100%;

  max-height: calc(90vh - 56px);

  display: block;

  background: #000;

  object-fit: contain;
}


/* ---------------------------- MOBILE ------------------------------------ */

@media (max-width: 700px) {

  .media-card-footer {
    min-height: 56px;
  }

  .timelapse-modal {
    width: calc(100vw - 20px);

    max-height: calc(100vh - 20px);
  }

  .timelapse-modal-header {
    min-height: 52px;

    padding:
      10px
      12px
      10px
      16px;
  }

  .timelapse-modal-header h2 {
    font-size: 14px;
  }

}

.home-secondary-grid {
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(0, 1.65fr);
  gap: 16px;
  align-items: start;
}

.station-info-list {
  margin: 0;
  padding: 10px 18px 14px;
}

.station-info-list > div {
  min-height: 34px;
  padding: 8px 0;
  display: grid;
  grid-template-columns: minmax(110px, .9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid rgba(133,190,220,.10);
}

.station-info-list > div:last-child {
  border-bottom: 0;
}

.station-info-list dt,
.station-info-list dd {
  margin: 0;
}

.station-info-list dt {
  color: #d9e6ee;
  font-weight: 700;
}

.station-info-list dd {
  color: var(--muted);
}

/* ------------------------------- FORECAST -------------------------------- */

.forecast-card {
  min-width: 0;
}

.forecast-scroll {
  padding: 10px;
  overflow-x: auto;
  scrollbar-color: rgba(52,198,234,.45) transparent;
}

.forecast-scroll table {
  width: 100% !important;
  min-width: 700px;
  border-collapse: separate;
  border-spacing: 0;
}

.forecast-scroll td {
  color: #dceaf2;
  border-bottom: 1px solid rgba(133,190,220,.09);
}

.forecast-scroll tr:last-child td {
  border-bottom: 0;
}

.forecast-scroll .testotitolo {
  color: #eef6fb;
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  text-shadow: none;
}

.forecast-scroll .scrittine {
  color: #91a9b8;
  font-size: 11px;
}

.tempgrassetto {
  color: #edf5f9;
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  text-shadow: none;
}

.tempdecimale {
  color: #b6c8d4;
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: 9px;
  font-weight: 700;
  text-shadow: none;
}

.raingrassetto {
  color: #55d5ff;
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-shadow: none;
}

.raindecimale {
  color: #55d5ff;
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: 9px;
  font-weight: 700;
  text-shadow: none;
}

/* ------------------------------ COUNTER --------------------------------- */

.site-meta-grid {
  margin-top: 22px;
  display: flex;
  justify-content: center;
}

.site-counter-card {
  width: min(100%, 360px);
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.site-meta-label,
.site-meta-text {
  color: var(--muted);
  font-size: 12px;
}

.site-counter-value {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* ------------------------------ FOOTER ---------------------------------- */

.vers {
  width: min(1440px, calc(100% - 48px));
  min-height: 28px;
  margin: 24px auto 0;
  padding: 7px 12px;
  color: #7f98a8;
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: 10px;
  text-align: right;
  line-height: 1.3;
  background: rgba(6, 19, 31, .46);
  border: 1px solid rgba(121,181,213,.12);
  border-radius: 10px;
}

.site-footer {
  width: min(1440px, calc(100% - 48px));
  margin: 18px auto 0;
  padding: 14px 0 0;
  color: #8299a8;
  font-size: 12px;
  line-height: 1.65;
  text-align: center;
}

.piede1 {
  color: #75d9f1;
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: 12px;
  text-decoration: none;
}

.piede1:hover {
  color: #dff8ff;
  text-decoration: underline;
}

/* -------------------------- LEGACY COMPATIBILITY ------------------------ */

.corpo2 {
  display: none;
}

.temperatura {
  position: static;
  width: auto;
  height: auto;
  color: #fff;
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: 30px;
  text-shadow: none;
}

.tabellaext,
.tabellaext2 {
  background: rgba(12, 33, 49, .86);
}

.titolocella {
  background: linear-gradient(90deg, rgba(57,120,151,.28), rgba(30,59,83,.18));
}

.titolotabella {
  color: #dcebf3;
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-shadow: none;
}

.bordotab {
  border: 1px solid var(--border);
}

.bordoalto {
  border-top: 1px solid rgba(52,198,234,.35);
}

.tag2-1,
.tag2-1pic {
  color: #dbe9f1;
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  text-shadow: none;
}

.tag2-1 {
  font-size: 11px;
  line-height: 1.5;
}

.tag2-1pic {
  font-size: 10px;
}

.sfondotag1 {
  background-color: rgba(255,255,255,.05);
}

.sfondotag2 {
  background-color: rgba(0,0,0,.10);
}

.sfondotagmax {
  background-color: rgba(255,91,91,.10);
}

.sfondotagmin {
  background-color: rgba(78,214,255,.10);
}

.testo,
.testotitolo {
  color: #dce8ef;
  font-family: "Exo 2", Tahoma, Arial, sans-serif;
  text-decoration: none;
  text-shadow: none;
}

.testo {
  font-size: 13px;
  line-height: 1.55;
}

.testotitolo {
  font-size: 14px;
  line-height: 1.45;
  font-weight: 800;
}

.loadingst {
  background: url(img/loading.gif) no-repeat center center;
}

.loader {
  width: 70px;
  height: 70px;
  border: 8px solid rgba(255,255,255,.16);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@-webkit-keyframes spin {
  to { -webkit-transform: rotate(360deg); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ------------------------------ RESPONSIVE ------------------------------ */

@media (max-width: 1220px) {
  .site-shell,
  .site-header-inner,
  .vers,
  .site-footer {
    width: min(100% - 32px, 1100px);
  }

  .weather-tiles-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-card-satellite {
    grid-column: 1 / -1;
  }

  .media-card-satellite img {
    max-height: 360px;
    object-fit: cover;
  }
}

@media (max-width: 960px) {
  .weather-tiles {
    grid-template-columns: 1fr;
  }

  .weather-card-body {
    min-height: 0;
  }

  .home-secondary-grid {
    grid-template-columns: 1fr;
  }

  .nav-item {
    flex-basis: 170px;
  }
}

@media (max-width: 700px) {
  .site-shell,
  .site-header-inner,
  .vers,
  .site-footer {
    width: calc(100% - 24px);
  }

  .site-header-inner {
    min-height: 88px;
  }

  .main-content {
    padding-top: 16px;
  }

  .nav-inner {
    gap: 7px;
    padding: 7px;
    border-radius: 14px;
  }

  .nav-item {
    min-height: 48px;
    flex: 1 1 calc(50% - 7px);
    padding: 8px 10px;
    gap: 7px;
    font-size: 12px;
  }

  .nav-item img {
    width: 25px;
    height: 25px;
  }

  .weather-update-line {
    width: 100%;
    justify-content: center;
    text-align: center;
    border-radius: 14px;
  }

  .weather-tiles-secondary,
  .media-grid {
    grid-template-columns: 1fr;
  }

  .media-card-satellite {
    grid-column: auto;
  }

  .weather-card-body,
  .weather-card-body-wind,
  .weather-card-body-rain,
  .weather-compact-body {
    grid-template-columns: minmax(60px, .7fr) minmax(0, 1.3fr);
    min-height: 0;
  }

  .weather-card-temperature .weather-main-value,
  .weather-card-temperature .weather-humidity {
    grid-column: 2;
  }

  .weather-card-temperature .weather-detail-wide {
    grid-column: 1 / -1;
  }

  .weather-detail {
    text-align: left;
  }

  .weather-main-value {
    justify-content: flex-start;
    text-align: left;
  }

  .weather-split-details {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .weather-bottom-row {
    grid-template-columns: 1fr;
  }

  .aqi-legend-link img {
    width: 100%;
    height: auto;
  }

  .station-info-list > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .station-info-list dt {
    font-size: 12px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .forecast-scroll {
    padding: 6px;
  }
}


/* Primary cards collapse their denser desktop layout gracefully. */
@media (max-width: 700px) {
  .weather-card-temperature .weather-card-body,
  .weather-card-wind .weather-card-body,
  .weather-card-rain .weather-card-body {
    grid-template-areas: none;
    display: grid;
  }

  .weather-card-temperature .weather-card-body {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .weather-card-temperature .weather-visual,
  .weather-card-wind .weather-visual,
  .weather-card-rain .weather-visual,
  .weather-card-temperature .weather-main-value:not(.weather-humidity),
  .weather-card-temperature .weather-humidity,
  .weather-card-temperature .weather-detail-wide,
  .weather-card-wind .weather-main-value.weather-detail-wide,
  .weather-card-wind .weather-detail.weather-detail-wide,
  .weather-card-rain .weather-main-value.weather-detail-wide,
  .weather-card-rain .weather-detail.weather-detail-wide {
    grid-area: auto;
  }

  .weather-card-temperature .weather-detail-wide,
  .weather-card-wind .weather-detail.weather-detail-wide,
  .weather-card-rain .weather-detail.weather-detail-wide {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .weather-card-temperature .weather-detail-wide .weather-status,
  .weather-card-wind .weather-detail.weather-detail-wide .weather-status,
  .weather-card-rain .weather-detail.weather-detail-wide .weather-status {
    justify-self: start;
  }

  .weather-card-temperature .weather-card-footer.weather-split-details,
  .weather-card-wind .weather-card-footer.weather-split-details,
  .weather-card-rain .weather-card-footer.weather-split-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weather-card-temperature .weather-card-footer.weather-split-details > div:nth-child(1),
  .weather-card-wind .weather-card-footer.weather-split-details > div:nth-child(1),
  .weather-card-rain .weather-card-footer.weather-split-details > div:nth-child(1) {
    grid-column: 1 / -1;
  }

  .weather-card-temperature .weather-card-footer.weather-split-details > div + div,
  .weather-card-wind .weather-card-footer.weather-split-details > div + div,
  .weather-card-rain .weather-card-footer.weather-split-details > div + div {
    border-left: 0;
    padding-left: 0;
  }
}

@media (max-width: 460px) {
  .site-header-inner {
    width: calc(100% - 20px);
  }

  .site-shell,
  .vers,
  .site-footer {
    width: calc(100% - 20px);
  }

  .titolo,
  .site-branding .titolo {
    font-size: 24px;
  }

  .sottotitolo {
    font-size: 11px;
  }

  .nav-item {
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .weather-card-body,
  .weather-card-body-wind,
  .weather-card-body-rain,
  .weather-compact-body {
    padding: 14px;
  }

  .weather-split-details {
    grid-template-columns: 1fr;
  }

  .weather-split-details > div:nth-child(1) {
    grid-column: auto;
  }

  .weather-visual img {
    max-width: 76px;
  }

  .weather-card-rain .weather-visual img {
    max-height: 120px;
  }

  .temp {
    font-size: 30px;
  }

  .valor2 {
    font-size: 15px;
  }
}

/* ------------------------ ACCESSIBILITY / MOTION ------------------------ */

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}




/* ========================================================================
   MOBILE ONLY – CORREZIONE LAYOUT TILE METEO PRIMARIE
   Attivo esclusivamente fino a 700px.
   Nessuna modifica al layout desktop.
   ======================================================================== */

@media (max-width: 700px) {

  /* ----------------------------------------------------------------------
     TEMPERATURA
     Struttura mobile esplicita per evitare sovrapposizioni:

     [ termometro ] [ temperatura ]
     [ termometro ] [ umidità     ]
     [        percepita           ]
     ---------------------------------------------------------------------- */

  .weather-card-temperature .weather-card-body {
    min-height: 0;
    grid-template-columns: 70px minmax(0, 1fr);
    grid-template-areas:
      "visual temperature"
      "visual humidity"
      "perceived perceived";
    column-gap: 16px;
    row-gap: 14px;
    align-items: center;
  }

  .weather-card-temperature .weather-visual {
    grid-area: visual;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .weather-card-temperature
    .weather-card-body
    > .weather-main-value:not(.weather-humidity) {
    grid-area: temperature;
  }

  .weather-card-temperature .weather-humidity {
    grid-area: humidity;
  }

  .weather-card-temperature .weather-detail-wide {
    grid-area: perceived;
    width: 100%;
    min-width: 0;

    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;

    text-align: center;
  }

  .weather-card-temperature .weather-detail-wide .weather-label {
    width: 100%;
    white-space: normal;
  }

  .weather-card-temperature .weather-detail-wide .weather-status {
    justify-self: center;
  }


  /* ----------------------------------------------------------------------
     VENTO
     Mantiene una struttura esplicita anche su mobile.
     ---------------------------------------------------------------------- */

  .weather-card-wind .weather-card-body {
    min-height: 0;
    grid-template-columns: 70px minmax(0, 1fr);
    grid-template-areas:
      "visual speed"
      "visual average";
    column-gap: 16px;
    row-gap: 14px;
  }

  .weather-card-wind .weather-visual {
    grid-area: visual;
  }

  .weather-card-wind .weather-main-value.weather-detail-wide {
    grid-area: speed;
  }

  .weather-card-wind .weather-detail.weather-detail-wide {
    grid-area: average;
    min-width: 0;
  }


  /* ----------------------------------------------------------------------
     PRECIPITAZIONI
     Mantiene una struttura esplicita anche su mobile.
     ---------------------------------------------------------------------- */

  .weather-card-rain .weather-card-body {
    min-height: 0;
    grid-template-columns: 70px minmax(0, 1fr);
    grid-template-areas:
      "visual amount"
      "visual intensity";
    column-gap: 16px;
    row-gap: 14px;
  }

  .weather-card-rain .weather-visual {
    grid-area: visual;
  }

  .weather-card-rain .weather-main-value.weather-detail-wide {
    grid-area: amount;
  }

  .weather-card-rain .weather-detail.weather-detail-wide {
    grid-area: intensity;
    min-width: 0;
  }


  /* ----------------------------------------------------------------------
     Impedisce che testi o badge larghi escano dalla colonna disponibile.
     ---------------------------------------------------------------------- */

  .weather-card-temperature .weather-main-value,
  .weather-card-wind .weather-main-value,
  .weather-card-rain .weather-main-value,
  .weather-card-temperature .weather-detail,
  .weather-card-wind .weather-detail,
  .weather-card-rain .weather-detail {
    min-width: 0;
  }

}

/* ========================================================================
   AIR QUALITY – INDICATORE AQI
   ======================================================================== */

.weather-card-air .aqi-status-wrapper {
  min-width: 0;
}


/* Badge AQI */

.weather-card-air .aqi-status {
  position: relative;

  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3px 6px;

  max-width: 100%;

  padding: 5px 10px;

  border: 1px solid currentColor;
  border-radius: 999px;

  font-family: "Exo 2", Tahoma, Arial, sans-serif;

  cursor: help;

  outline: none;

  transition:
    transform .18s ease,
    filter .18s ease,
    box-shadow .18s ease;
}


/* Effetto hover/focus */

.weather-card-air .aqi-status:hover,
.weather-card-air .aqi-status:focus {
  transform: translateY(-1px);

  filter: brightness(1.08);

  box-shadow:
    0 5px 14px rgba(0,0,0,.20);
}


/* Nome del livello */

.weather-card-air .aqi-status-name {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .025em;
  text-transform: uppercase;
}


/* Valore numerico AQI */

.weather-card-air .aqi-status-value {
  padding-left: 6px;

  border-left: 1px solid rgba(255,255,255,.30);

  font-size: 10px;
  font-weight: 700;

  opacity: .88;
}


/* ========================================================================
   COLORI AQI
   Versioni pastello della legenda originale
   ======================================================================== */


/* Buono */

.weather-card-air .aqi-status-good {
  color: #a9f3c4;

  background:
    linear-gradient(
      135deg,
      rgba(55, 186, 101, .40),
      rgba(31, 123, 71, .34)
    );

  border-color: rgba(111, 230, 151, .65);
}


/* Moderato */

.weather-card-air .aqi-status-moderate {
  color: #fff3a1;

  background:
    linear-gradient(
      135deg,
      rgba(212, 193, 45, .38),
      rgba(156, 138, 18, .30)
    );

  border-color: rgba(240, 220, 95, .65);
}


/* Poco salutare per gruppi sensibili */

.weather-card-air .aqi-status-sensitive {
  color: #ffd0a0;

  background:
    linear-gradient(
      135deg,
      rgba(222, 126, 51, .42),
      rgba(158, 75, 25, .32)
    );

  border-color: rgba(244, 160, 91, .65);
}


/* Poco salutare */

.weather-card-air .aqi-status-unhealthy {
  color: #ffb3b3;

  background:
    linear-gradient(
      135deg,
      rgba(211, 61, 61, .42),
      rgba(145, 31, 31, .32)
    );

  border-color: rgba(244, 105, 105, .68);
}


/* Malsano */

.weather-card-air .aqi-status-very-unhealthy {
  color: #e1b6f1;

  background:
    linear-gradient(
      135deg,
      rgba(128, 67, 150, .48),
      rgba(78, 36, 97, .34)
    );

  border-color: rgba(190, 124, 215, .68);
}


/* Pericoloso */

.weather-card-air .aqi-status-hazardous {
  color: #f3a5b3;

  background:
    linear-gradient(
      135deg,
      rgba(139, 27, 48, .55),
      rgba(85, 12, 28, .42)
    );

  border-color: rgba(201, 70, 94, .72);
}


/* Non disponibile */

.weather-card-air .aqi-status-unavailable {
  color: #b9c5cc;

  background: rgba(110, 125, 135, .22);

  border-color: rgba(180, 195, 205, .35);
}


/* ========================================================================
   TOOLTIP AQI
   ======================================================================== */

.weather-card-air .aqi-status::after {
  content: attr(data-tooltip);

  position: absolute;

  left: 50%;
  bottom: calc(100% + 12px);

  z-index: 50;

  width: min(280px, 75vw);

  padding: 10px 12px;

  border: 1px solid rgba(121, 181, 213, .32);
  border-radius: 10px;

  color: #eaf4f8;

  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;

  text-align: left;

  background:
    rgba(8, 25, 39, .98);

  box-shadow:
    0 10px 28px rgba(0,0,0,.38);

  opacity: 0;

  pointer-events: none;

  transform:
    translate(-50%, 5px);

  transition:
    opacity .18s ease,
    transform .18s ease;

  visibility: hidden;
}


/* Freccetta del tooltip */

.weather-card-air .aqi-status::before {
  content: "";

  position: absolute;

  left: 50%;
  bottom: calc(100% + 6px);

  z-index: 51;

  width: 10px;
  height: 10px;

  border-right: 1px solid rgba(121, 181, 213, .32);
  border-bottom: 1px solid rgba(121, 181, 213, .32);

  background:
    rgba(8, 25, 39, .98);

  transform:
    translateX(-50%)
    rotate(45deg);

  opacity: 0;

  visibility: hidden;

  transition:
    opacity .18s ease;
}


.weather-card-air .aqi-status:hover::after,
.weather-card-air .aqi-status:hover::before,
.weather-card-air .aqi-status:focus::after,
.weather-card-air .aqi-status:focus::before {
  opacity: 1;

  visibility: visible;
}


.weather-card-air .aqi-status:hover::after,
.weather-card-air .aqi-status:focus::after {
  transform:
    translate(-50%, 0);
}

/* ========================================================================
   AQI TOOLTIP - PREVIENE IL TAGLIO DEL TOOLTIP
   ======================================================================== */

/*
   Le weather-card generiche usano overflow: hidden.
   Per la sola card Qualità dell'aria lo rendiamo visibile,
   così il tooltip può uscire dai confini della tile.
*/

.weather-card.weather-card-air {
  overflow: visible;
  position: relative;
  z-index: 2;
}


/*
   Quando il badge è attivo, portiamo tooltip e card
   sopra gli elementi circostanti.
*/

.weather-card-air .aqi-status:hover,
.weather-card-air .aqi-status:focus {
  z-index: 100;
}


.weather-card-air .aqi-status {
  z-index: 10;
}


/* ========================================================================
   WEATHER BOTTOM ROW
   Ora contiene solamente lo stato della centralina
   ======================================================================== */

.weather-bottom-row {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 700px) {

  .weather-card-air .aqi-status {
    padding: 5px 9px;
  }

  .weather-card-air .aqi-status::after {
    width: min(260px, 82vw);
    font-size: 10px;
  }

}