/* Eagle Service Roma - centraline meteo (scheda stazione, storico, mappa) */
:root {
  --wx-green: #2e9d5b;
  --wx-red: #d63a2f;
  --wx-purple: #7b2d8b;
  --wx-grey: #7d8b99;
  --wx-amber: #b86e00;
}

.wx-wrap { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .wx-wrap--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; } }

/* impaginazione scheda stazione: due colonne (sotto 900 px una sola, nell'ordine del codice) */
.wx-cols { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
.wx-col { display: grid; gap: var(--gap); align-content: start; min-width: 0; }
.wx-col[hidden], .wx-full[hidden] { display: none; }
.wx-full { margin-top: var(--gap); }
@media (min-width: 900px) {
  .wx-cols { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .wx-cols:has(> .wx-col[hidden]) { grid-template-columns: minmax(0, 1fr); }
}

.wx-panel {
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1.1rem;
  min-width: 0;
}
.wx-panel h2 { font-family: var(--font-head); font-size: 1.15rem; margin: 0 0 .6rem; color: var(--c-navy-900); }
.wx-panel h3 { font-family: var(--font-head); font-size: 1rem; margin: 1rem 0 .4rem; color: var(--c-navy-900); }
.wx-sub { color: var(--c-muted); font-size: .9rem; margin: 0 0 .8rem; }
.wx-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

/* ---- stato / live ---- */
.wx-status { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.wx-badge {
  display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
  color: #fff; background: var(--wx-grey);
}
.wx-badge--online { background: var(--wx-green); }
.wx-badge--late { background: var(--wx-amber); }
.wx-badge--offline { background: #5d6b78; }
.wx-badge--off, .wx-badge--expired { background: #3f4a54; }
.wx-age { color: var(--c-muted); font-size: .9rem; }

.wx-live { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; transition: opacity .2s; }
.wx-live.is-dim { opacity: .6; }
@media (min-width: 520px) { .wx-live { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.wx-rose { text-align: center; }
.wx-rose svg { width: 160px; height: 160px; max-width: 100%; }
.wx-rose__txt { font-family: var(--font-head); font-weight: 600; color: var(--c-navy-900); margin-top: .3rem; }
.wx-gauges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; text-align: center; }
.wx-gauge svg { width: 100%; max-width: 130px; height: auto; }
.wx-gauge__val { font-family: var(--font-head); font-weight: 700; font-size: 1.9rem; line-height: 1; color: var(--c-navy-900); }
.wx-gauge__unit { font-size: .8rem; color: var(--c-muted); }
.wx-gauge__lbl { font-size: .85rem; font-weight: 600; color: var(--c-navy-700); }
.wx-min { grid-column: 1 / -1; color: var(--c-muted); font-size: .9rem; margin: 0; text-align: center; }

.wx-banner {
  background: var(--c-amber-100); border: 1px solid var(--c-amber-400); color: var(--c-navy-800);
  border-radius: var(--radius-sm); padding: .6rem .8rem; margin: 0 0 .8rem; font-size: .9rem;
}
.wx-error { text-align: center; padding: 1.2rem .5rem; color: var(--c-navy-800); }
.wx-error p { margin: 0 0 .8rem; }
.wx-empty { text-align: center; color: var(--c-muted); padding: 2rem .5rem; margin: 0; }
.wx-note { color: var(--c-muted); font-size: .85rem; margin: .8rem 0 0; }

/* ---- skeleton ---- */
.wx-skel { min-height: 160px; border-radius: var(--radius-sm); background: linear-gradient(90deg, #f4ede6 25%, #f6f7f9 50%, #f4ede6 75%); background-size: 200% 100%; animation: wx-sh 1.4s infinite linear; }
@keyframes wx-sh { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .wx-skel { animation: none; } }

/* ---- storico ---- */
.wx-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; align-items: center; }
.wx-tab {
  font: inherit; font-size: .9rem; font-weight: 600; padding: .45rem .85rem; min-height: 40px;
  border-radius: 999px; border: 1px solid var(--c-sky-400); background: #fff; color: var(--c-sky-600); cursor: pointer;
}
.wx-tab[aria-pressed="true"] { background: var(--c-sky-600); border-color: var(--c-sky-600); color: #fff; }
.wx-tab:focus-visible, .wx-input:focus-visible { outline: 3px solid var(--c-blue-500); outline-offset: 2px; }
.wx-input { font: inherit; min-height: 40px; padding: .35rem .6rem; border: 1px solid var(--c-line); border-radius: var(--radius-sm); max-width: 100%; }
.wx-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin: .5rem 0 1rem; }
.wx-stat { background: var(--c-bg-alt); border-radius: var(--radius-sm); padding: .6rem .8rem; }
.wx-stat strong { display: block; font-family: var(--font-head); font-size: 1.15rem; color: var(--c-navy-900); }
.wx-stat span { font-size: .8rem; color: var(--c-muted); }
.wx-chart { width: 100%; min-height: 220px; position: relative; overflow: hidden; }
@media (min-width: 520px) { .wx-chart { min-height: 280px; } }
.wx-chart--dir { min-height: 200px; }
@media (min-width: 520px) { .wx-chart--dir { min-height: 240px; } }
.wx-tip {
  position: absolute; top: 2px; max-width: 190px; background: var(--c-navy-900); color: #fff;
  font-size: .72rem; line-height: 1.3; padding: .3rem .5rem; border-radius: 6px; pointer-events: none; z-index: 2;
}
.wx-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8rem; color: var(--c-muted); margin: .4rem 0 0; }
.wx-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: .3rem; vertical-align: -1px; }
.wx-legend i.sq { border-radius: 2px; }

.wx-attrib { font-size: .8rem; color: var(--c-muted); margin: 1rem 0 0; }
.wx-attrib a { color: var(--c-blue-600); }
.wx-disclaimer { font-size: .85rem; color: var(--c-muted); margin: 1rem 0 0; }
.wx-credit { font-size: .75rem; color: rgba(255, 255, 255, .45); margin: 1rem 0 0; text-align: center; }
.wx-credit a { color: inherit; text-decoration: underline; }

/* ---- mappa ---- */
.wx-toolbar { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin-bottom: .8rem; }
.wx-toolbar label { font-size: .9rem; font-weight: 600; color: var(--c-navy-800); }
.wx-toolbar .wx-input[type="search"] { flex: 1 1 200px; min-width: 0; }
.wx-check { display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; cursor: pointer; }
.wx-check input { width: 20px; height: 20px; }
#mappa { height: 72vh; min-height: 380px; max-height: 640px; width: 100%; border: 1px solid var(--c-line); border-radius: var(--radius); background: #e9edf1; z-index: 0; }
@media (min-width: 900px) { #mappa { height: 78vh; min-height: 520px; max-height: none; } }
.wx-maplegend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; color: var(--c-muted); margin: .6rem 0 0; }
.wx-maplegend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: .3rem; vertical-align: -1px; }
.wx-maplegend i.void { background: rgba(125, 139, 153, .1); border: 1px solid var(--wx-grey); }
.wx-pop h3 { font-family: var(--font-head); font-size: 1rem; margin: 0 0 .3rem; }
.wx-pop p { margin: .15rem 0; font-size: .85rem; }
.wx-pop .btn { margin-top: .5rem; font-size: .85rem; padding: .45rem .8rem; color: #fff; }
.leaflet-container { font-family: var(--font-body); }

/* nessun overflow orizzontale */
.wx-panel, .wx-wrap, .wx-chart { max-width: 100%; }
.wx-pv .pv-table svg { max-width: none; }
.wx-panel img, .wx-panel svg { max-width: 100%; }

/* marker a freccia (direzione verso cui soffia il vento) */
.wx-arrow { background: none; border: 0; display: flex; align-items: center; justify-content: center; }
.wx-arrow svg { filter: drop-shadow(0 1px 1.5px rgba(0,0,0,.45)); }
.wx-arrow--off svg { filter: none; opacity: .85; }
.wx-arrow--esr::before { content: ""; position: absolute; width: 38px; height: 38px; border-radius: 50%; background: rgba(225,90,0,.18); border: 3px solid #e15a00; box-sizing: border-box; }
.wx-arrow--esr svg { position: relative; }
.wx-maplegend svg { display: inline-block; width: 14px; height: 14px; margin-right: .3rem; vertical-align: -2px; }

/* widget Windfinder e AeroXC (solo Norma): nessun riquadro, solo il widget; due colonne uguali se c'e' spazio */
.wx-widgets { max-width: 100%; }
.wx-w[hidden] { display: none; }
.wx-w { min-width: 0; max-width: 100%; overflow: hidden; }
.wx-w--wf { min-height: 320px; }
.wx-w--ax { width: 100%; max-width: 600px; margin: 0 auto; }
.wx-w--ax .ax-days { margin-bottom: .6rem; }
.wx-w--ax .ax-frame { aspect-ratio: 400 / 700; }
.wx-w iframe { display: block; width: 100%; max-width: 100%; border: 0; }
.wx-w--ax iframe { height: 100%; }

/* radar */
.wx-radar__map { width: 100%; height: 340px; border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: #e9edf1; position: relative; z-index: 0; }
@media (min-width: 900px) { .wx-radar__map { height: 450px; } }
.wx-radar__bar { display: flex; align-items: center; gap: .8rem; margin-top: .7rem; }
.wx-radar__btn { min-height: 40px; min-width: 5.2rem; padding: .4rem 1rem; font-size: .9rem; justify-content: center; }
.wx-radar__btn:focus-visible, .wx-radar__range:focus-visible { outline: 3px solid var(--c-blue-500); outline-offset: 2px; }
.wx-radar__btn:disabled, .wx-radar__range:disabled { opacity: .5; cursor: default; }
.wx-radar__range { flex: 1 1 auto; min-width: 0; height: 40px; accent-color: var(--c-sky-600); cursor: pointer; }
.wx-radar__time { flex: none; min-width: 3.4rem; text-align: right; font-family: var(--font-head); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--c-navy-900); }
.wx-radar__legend { display: flex; align-items: center; gap: .5rem; margin: .5rem 0 0; font-size: .8rem; color: var(--c-muted); }
.wx-radar__legend i { flex: 0 1 140px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #7fd4ff, #2a7fff 30%, #2eb84b 50%, #f2e600 68%, #ff7a00 84%, #d00000); }

/* previsione di oggi */
.pv-sun { margin: 0 0 .6rem; font-size: .9rem; color: var(--c-muted); }
.pv-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; border: 1px solid var(--c-line); border-radius: var(--radius-sm); }
.pv-scroll:focus-visible { outline: 3px solid var(--c-blue-500); outline-offset: 2px; }
.pv-table { border-collapse: collapse; width: 100%; font-size: .85rem; text-align: center; white-space: nowrap; }
.pv-table th, .pv-table td { padding: .35rem .5rem; min-width: 46px; }
.pv-table tbody tr + tr > * { border-top: 1px solid var(--c-line); }
.pv-table thead th { background: var(--c-bg-alt); color: var(--c-navy-900); font-family: var(--font-head); font-weight: 600; }
.pv-table th[scope="row"] { position: sticky; left: 0; z-index: 1; background: #fff; text-align: left; font-weight: 600; color: var(--c-navy-800); min-width: 84px; box-shadow: 1px 0 0 var(--c-line); }
.pv-table thead th[scope="row"] { background: var(--c-bg-alt); }
.pv-table th.is-now { background: var(--c-amber-100); }
.pv-table svg { display: block; margin: 0 auto; }
.pv-wind { display: inline-flex; align-items: center; gap: .25rem; }
.pv-arrow { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* pulsante "Tutte le centraline" */
.wx-back { margin-top: 1rem; }
.wx-back .btn { min-height: 48px; font-size: 1.05rem; padding: .8rem 1.6rem; border-color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.wx-back--foot { margin-top: 2rem; text-align: center; }
@media (max-width: 600px) { .wx-back .btn { width: 100%; justify-content: center; } }

/* ---- Banner a rotazione (solo immagini, nessun link) ---- */
.banner-wrap { padding: 1rem 0 1rem; }
.banner-wrap[hidden] { display: none; }
.banner-wrap + .section:not(.wx-map-section) { padding-top: 1rem; }
.banner-fascia { position: relative; width: 100%; max-width: 728px; margin: 0 auto; aspect-ratio: 728 / 90; overflow: hidden; }
.banner-fascia[hidden] { display: none; }
.banner-slide { position: absolute; inset: 0; display: block; opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.banner-slide img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; }
.banner-slide.is-on { opacity: 1; }
a.banner-slide.is-on { pointer-events: auto; cursor: pointer; }
a.banner-slide:focus-visible { outline: 3px solid #ff8f4d; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .banner-slide { transition: none; } }
/* pagina mappa: testata compatta, mappa subito visibile */
.wx-head-compact { padding: 1.1rem 0 1.25rem; }
.wx-head-compact .breadcrumb { margin-bottom: .3rem; }
.wx-head-compact h1 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
.wx-head-compact p { margin-top: .4rem; font-size: .95rem; }
@media (max-width: 600px) { .wx-head-compact p { display: none; } }
.wx-map-section { padding-top: 1.25rem; padding-bottom: 2rem; }
@media (max-width: 899px) { #mappa { height: 62vh; } }

/* ---- METAR e TAF (aeroporto piu' vicino) ---- */
.mt-sub { margin: 0 0 .5rem; font-size: .95rem; color: var(--c-navy-800); font-weight: 600; }
.mt-fb { color: #b34700; }
.mt-catline { margin: 0 0 .7rem; font-size: .9rem; color: var(--c-muted); }
.mt-cat { display: inline-block; margin-left: .3rem; padding: .1rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; color: #fff; background: var(--wx-grey); vertical-align: 1px; }
.mt-cat--vfr { background: #2e9d5b; }
.mt-cat--mvfr { background: #1f6fb2; }
.mt-cat--ifr { background: #d63a2f; }
.mt-cat--lifr { background: #a02ba0; }
.mt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem 1rem; margin: 0; }
@media (min-width: 700px) { .mt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mt-item { min-width: 0; }
.mt-item dt { font-size: .78rem; color: var(--c-muted); }
.mt-item dd { margin: .1rem 0 0; font-size: .92rem; color: var(--c-navy-900); overflow-wrap: anywhere; }
.mt-age { margin: 0; }
.mt-raw { margin: .7rem 0 0; font-size: .75rem; color: var(--c-muted); }
.mt-raw code { font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; user-select: text; }
.mt-tafnote { margin: 0 0 .5rem; }
.mt-table { border-collapse: collapse; width: 100%; font-size: .85rem; text-align: left; }
.mt-table th, .mt-table td { padding: .4rem .6rem; vertical-align: top; }
.mt-table thead th { background: var(--c-bg-alt); color: var(--c-navy-900); font-family: var(--font-head); font-weight: 600; white-space: nowrap; }
.mt-table tbody tr + tr > * { border-top: 1px solid var(--c-line); }
.mt-table td:nth-child(1), .mt-table td:nth-child(2) { white-space: nowrap; }
.mt-table td:nth-child(3) { min-width: 11rem; }
.mt-table td:nth-child(5) { min-width: 11rem; }
.mt-table tr.is-past td { color: var(--c-muted); }
.mt-warn { margin-top: 1rem; font-size: .8rem; }