/* ── Palette ── */
:root {
    --blu-primario:  #1a3a6b;
    --blu-secondario: #2563a8;
    --blu-chiaro:    #e8f0fa;
    --testo-corpo:   #2d2d2d;
    --bordo:         #d0d9e8;
}

/* ── Breadcrumb ── */
.dataclime-breadcrumb {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    color: var(--blu-secondario);
    margin-bottom: 1.5rem;
    text-decoration: none;
}
.dataclime-breadcrumb:hover { color: var(--blu-primario); }

/* ── Titoli hero ── */
.hub-title {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--blu-primario);
    line-height: 1.15;
    margin-bottom: .25rem;
}
.hub-subtitle {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 400;
    color: var(--blu-primario);
    margin-bottom: 2rem;
}

/* ── Testo corpo ── */
.hub-body p {
    color: var(--testo-corpo);
    font-size: .97rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}
.hub-body p strong { color: var(--testo-corpo); }

/* ── Sidebar cards ── */
.sidebar-card {
    background: #fff;
    border: 1.5px solid var(--bordo);
    border-radius: .75rem;
    padding: 1.25rem 1.4rem;
    font-size: .88rem;
    color: var(--testo-corpo);
    line-height: 1.6;
}
.sidebar-card a {
    color: var(--blu-secondario);
}
.sidebar-card .contatti-titolo {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--testo-corpo);
    margin-bottom: .75rem;
    text-align: center;
}
.sidebar-card .mail-icon {
    display: block;
    margin: .75rem auto;
    width: 3rem;
    height: 3rem;
    background: var(--blu-chiaro);
    border: 2px solid var(--blu-secondario);
    border-radius: .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blu-secondario);
    font-size: 1.4rem;
}
.sidebar-card .mail-link {
    display: block;
    text-align: center;
    color: var(--blu-secondario);
    font-weight: 600;
    word-break: break-all;
}

/* ── Footer note ── */
.hub-footer-note {
    font-size: .88rem;
    color: var(--testo-corpo);
    line-height: 1.65;
}
.custom-tabs {
    background-color: #f8f9fa;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}


.custom-tabs .nav-link {
    color: #495057;
    border: none;
    padding: 15px 7px;
    transition: all 0.3s ease;
    font-weight: bold;
}



.custom-tabs .nav-link.active {
    color: #fff;
    background-color: #007bff;
    box-shadow: 0 4px 6px rgba(0, 123, 255, 0.3);
}


.custom-tabs .tab-content {
    padding: 30px;
}


.nav-tab {
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #fff;
    color: #333;
    border: 2px solid #d0d8e4;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: border-color 0.2s;
}

.nav-tab:hover {
    border-color: #1a4f8a;
    color: #333;
}

.nav-tab.active {
    background: #1a4f8a;
    border-color: #1a4f8a;
    color: #fff;
    font-weight: 600;
}

.shadow-top-sides {
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.15);  /* ombra centrata, niente offset-y */
  clip-path: inset(-1.5rem -1.5rem 0 -1.5rem);  /* inset = blur + margine */
}  

.shadow-bottom-sides {
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.15);  /* ombra centrata, niente offset-y */
  clip-path: inset(0 -1.5rem -1.5rem -1.5rem);  /* inset = blur + margine */
}

/* ── Map & satellite visualization ── */
body {
  margin: 0;
  padding: 0;
}

.info-box {
  padding: 10px;
  background: white;
  border-radius: 4px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.legend {
  line-height: 18px;
  color: #555;
  background: white;
  padding: 10px;
  border-radius: 4px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.legend i {
  width: 18px;
  height: 18px;
  float: left;
  margin-right: 8px;
  opacity: 0.7;
}

.no-data {
  color: #666;
  font-style: italic;
}

.zona-link {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 10px;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
}

.zona-link:hover {
  background-color: #0056b3;
}

.date-selector-container {
  margin-bottom: 15px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.date-selector-container label {
  font-weight: bold;
  margin-right: 10px;
}

#date-selector {
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  min-width: 200px;
}

.ts-dropdown .optgroup-header {
  font-size: 1rem;
  font-weight: bold;
  background-color: #cfe9e7;
}

.coords-box {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  background: white;
  padding: 5px 10px;
  border-radius: 4px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  font-family: Arial, sans-serif;
  font-size: 12px;
}

#map-container,
#map {
  padding: 0;
  margin: 0;
  border: none;
}

/* ── Custom tabs ── */
.custom-tabs {
  background-color: #f8f9fa;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.custom-tabs .nav-link {
  color: #495057;
  border: none;
  padding: 15px 25px;
  transition: all 0.3s ease;
  font-weight: bold;
}

.custom-tabs .nav-link.active {
  color: #fff;
  background-color: #007bff;
  box-shadow: 0 4px 6px rgba(0, 123, 255, 0.3);
}

.custom-tabs .tab-content {
  padding: 30px;
}

/* ── Pulsanti dataset della sub-nav (components/climate-hub/dataset-griglia) ──
   Righe sempre piene: 2 pulsanti -> 2; 3 -> 3; 4 -> 2 + 2; 5 -> 3 + 2.
   Da xl la griglia ha 6 colonne: ogni pulsante ne prende 2 (tre per riga)
   o 3 (due per riga) */
.dataset-btns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  width: 100%;
}

@media (min-width: 768px) {
  .dataset-btns { grid-template-columns: repeat(2, 1fr); }
  /* Su due colonne l'ultimo pulsante dispari prende tutta la riga */
  .dataset-btns > .dataset-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (min-width: 1200px) {
  .dataset-btns { grid-template-columns: repeat(6, 1fr); }

  .dataset-btns > .dataset-btn,
  .dataset-btns > .dataset-btn:last-child:nth-child(odd) { grid-column: span 2; }

  /* 2 pulsanti: una riga da due */
  .dataset-btns > .dataset-btn:first-child:nth-last-child(2),
  .dataset-btns > .dataset-btn:first-child:nth-last-child(2) ~ .dataset-btn { grid-column: span 3; }

  /* 4 pulsanti: due righe da due */
  .dataset-btns > .dataset-btn:first-child:nth-last-child(4),
  .dataset-btns > .dataset-btn:first-child:nth-last-child(4) ~ .dataset-btn { grid-column: span 3; }

  /* 5 pulsanti: gli ultimi due formano la seconda riga */
  .dataset-btns > .dataset-btn:first-child:nth-last-child(5) ~ .dataset-btn:nth-child(n+4) { grid-column: span 3; }
}

/* Pulsante: icona a sinistra, tipologia / titolo / sottotitolo a destra */

.dataset-btn {
  display: grid;
  grid-template-columns: 48px 1fr;
  column-gap: 20px;
  align-items: center;
  padding: 20px 24px;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #9aa3ae;
  border-radius: 0;
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s;
}

.dataset-btn:hover,
.dataset-btn:focus-visible {
  color: #1f1f1f;
  border-color: #1a4f8a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

.dataset-btn-icon {
  justify-self: center;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.dataset-btn-tipologia,
.dataset-btn-titolo,
.dataset-btn-sottotitolo {
  display: block;
}

.dataset-btn-tipologia {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.3;
  text-transform: uppercase;
  color: #5b9bf0;
}

.dataset-btn-titolo {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.dataset-btn-sottotitolo {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.dataset-btn.active,
.dataset-btn.active:hover {
  background: #1a4f8a;
  border-color: #1a4f8a;
  color: #fff;
}

.dataset-btn.active .dataset-btn-tipologia {
  color: rgba(255, 255, 255, .75);
}

/* ── Pannello dei dataset in rilievo sul contenuto sottostante ──
   L'ombra cade solo verso il basso (spread negativo) e lo z-index la fa
   disegnare sopra il blocco bianco della mappa, che segue senza stacco. */
.puglia-nav-rilievo {
    position: relative;
    z-index: 1;
    box-shadow: 0 12px 16px -10px rgba(0, 0, 0, .22);
}
