/* ===================================================================
   ItaliaMeteo — bulletin map
   Palette ispirata a isobare/radar: superfici chiare + ciano atmosferico,
   con ambra usata solo per stati di allerta/hover.
   =================================================================== */

:root {
  --meteo-bg: #f5f8fa;
  --meteo-surface: #ffffff;
  --meteo-surface-alt: #e9f1f4;
  --meteo-border: rgba(15, 35, 45, 0.12);
  --meteo-primary: #0f7a8c;
  --meteo-primary-dim: rgba(15, 122, 140, 0.16);
  --meteo-accent: #b5651d;
  --meteo-text: #16232c;
  --meteo-text-muted: #55707d;
  --font-display: "Titillium Web", sans-serif;
  --font-body: "Titillium Web", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

html, body {
  height: 100%;
  background: var(--meteo-bg);
  color: var(--meteo-text);
  font-family: var(--font-body);
  font-weight: 400;
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

a { color: var(--meteo-primary); }
a:hover { color: #0b5d6b; }

*:focus-visible {
  outline: 2px solid var(--meteo-primary);
  outline-offset: 2px;
}

/* --- Barra lingue ------------------------------------------------- */
.nav-tabs.bg-secondary-subtle {
  background: var(--meteo-surface) !important;
  border-bottom: 1px solid var(--meteo-border);
  padding: 0.35rem 0.75rem 0;
  gap: 0.25rem;
}

.nav-tabs .nav-link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--meteo-text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  padding: 0.6rem 0.9rem;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.nav-tabs .nav-link:hover {
  color: var(--meteo-text);
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--meteo-primary-dim);
}

.nav-tabs .nav-link.active {
  color: var(--meteo-primary);
  background: var(--meteo-surface-alt);
  border-color: var(--meteo-primary);
}

/* --- Divisore a isobare (elemento distintivo) ---------------------- */
.isobar-divider {
  height: 5px;
  width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='6' viewBox='0 0 120 6'%3E%3Cpath d='M0 3 Q 15 0 30 3 T 60 3 T 90 3 T 120 3' fill='none' stroke='%2349c5d6' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 120px 6px;
  opacity: 0.55;
  animation: isobar-drift 16s linear infinite;
}

@keyframes isobar-drift {
  from { background-position-x: 0; }
  to { background-position-x: -120px; }
}

@media (prefers-reduced-motion: reduce) {
  .isobar-divider { animation: none; }
}

/* --- Mappa ---------------------------------------------------------- */
#map {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--meteo-border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  animation: map-fade-in 0.5s ease forwards 0.1s;
}

@keyframes map-fade-in {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  #map { animation: none; opacity: 1; }
}

/* Popup Leaflet: qui riallineati alla palette del sito */
.leaflet-popup-content-wrapper {
  background: var(--meteo-surface-alt);
  color: var(--meteo-text);
  border: 1px solid var(--meteo-border);
  border-radius: 8px;
  font-family: var(--font-body);
}

.leaflet-popup-content { font-size: 0.9rem; margin: 0.7rem 0.9rem; }
.leaflet-popup-tip { background: var(--meteo-surface-alt); }
.leaflet-popup-close-button { color: var(--meteo-text-muted) !important; }
.leaflet-container { font-family: var(--font-body); }

/* --- Pannello laterale ----------------------------------------------- */
.col-lg-4, .col-12 {
  font-family: var(--font-body);
}

/* --- Footer ------------------------------------------------------------ */
footer.bg-secondary-subtle {
  background: var(--meteo-surface) !important;
  border-top: 1px solid var(--meteo-border);
  color: var(--meteo-text-muted);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

footer a { color: var(--meteo-primary); }

/* Dati numerici (versione, coordinate) in monospace per leggibilità */
.font-mono, footer code, .coord {
  font-family: var(--font-mono);
}

@media (max-width: 991.98px) {
  #map { height: 60vh !important; }
}
