/* drought.css — monitoraggio siccità TITANO100.
   Usa i token di app.css: la pagina deve stare accanto alle altre, non accanto
   a se stessa. */

.dr-main { max-width: 1100px; margin: 0 auto; padding: 1rem 1rem 4rem; }

.dr-intro h1 {
  font-family: var(--font-display, inherit);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin: .4rem 0 .2rem;
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
}
.dr-badge {
  font-family: var(--font-body, inherit);
  font-size: var(--font-size-xs, .75rem);
  font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: var(--bg-tertiary); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 999px; padding: .2rem .6rem;
}
/* La misura del testo resta leggibile senza lasciare mezza pagina vuota:
   il limite vale sul paragrafo, non sul contenitore. */
.dr-lede { max-width: 68ch; color: var(--text-secondary); line-height: 1.55; }

.dr-gate {
  margin-top: 1rem; padding: 1.2rem; border: 1px solid var(--border);
  border-radius: var(--radius, 12px); background: var(--bg-secondary);
}
.dr-gate h2 { margin: 0 0 .3rem; font-size: 1.1rem; }
.dr-gate p { margin: 0 0 .8rem; color: var(--text-secondary); }
.dr-btn {
  background: var(--primary); color: #fff; border: 0; cursor: pointer;
  border-radius: var(--radius, 10px); padding: .6rem 1.1rem; font-weight: 600;
  font-family: inherit; font-size: 1rem;
}
.dr-btn:hover { background: var(--primary-dark, var(--primary)); }

.dr-panel {
  margin-top: 1.6rem; padding: 1rem; border: 1px solid var(--border);
  border-radius: var(--radius, 12px); background: var(--bg-secondary);
}
.dr-panel h2 { margin: 0 0 .6rem; font-size: 1.15rem; }
.dr-panel h3 { margin: 1rem 0 .4rem; font-size: 1rem; }
.dr-note { color: var(--text-secondary); font-size: var(--font-size-sm, .875rem);
           margin: .6rem 0 0; max-width: 68ch; line-height: 1.5; }

.dr-cards { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.dr-card {
  border: 1px solid var(--border); border-radius: var(--radius, 10px);
  padding: .8rem; background: var(--bg-primary);
}
.dr-card__label { font-size: var(--font-size-xs, .75rem); text-transform: uppercase;
                  letter-spacing: .04em; color: var(--text-secondary); }
.dr-card__value { font-family: var(--font-display, inherit); font-size: 1.9rem;
                  line-height: 1.1; margin: .2rem 0; font-variant-numeric: tabular-nums; }
.dr-card__class { font-size: var(--font-size-sm, .875rem); font-weight: 600; }
.dr-card--dry   .dr-card__class { color: #a6611a; }
.dr-card--severe .dr-card__class { color: #8c2d04; }
.dr-card--wet   .dr-card__class { color: #01665e; }

.dr-toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .7rem; }
.dr-toolbar label { font-size: var(--font-size-sm, .875rem); color: var(--text-secondary); }
.dr-toolbar select {
  font: inherit; padding: .35rem .5rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-primary); color: var(--text-primary);
}
.dr-layer-desc { font-size: var(--font-size-sm, .875rem); color: var(--text-secondary); flex: 1 1 16ch; }

.dr-map { width: 100%; aspect-ratio: 13 / 8; min-height: 260px; max-height: 62vh;
          border-radius: var(--radius, 10px); overflow: hidden; }
.dr-chart { width: 100%; height: 340px; }

.dr-legend { display: flex; flex-wrap: wrap; gap: .1rem; margin-top: .7rem; }
.dr-legend__item { display: flex; flex-direction: column; align-items: center; flex: 1 1 0; min-width: 42px; }
.dr-legend__swatch { width: 100%; height: 12px; }
.dr-legend__label { font-size: 10px; color: var(--text-secondary); margin-top: .2rem;
                    font-variant-numeric: tabular-nums; }

.dr-fc { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.dr-fc th, .dr-fc td { text-align: right; padding: .45rem .5rem; border-bottom: 1px solid var(--border-light, var(--border)); }
.dr-fc th:first-child, .dr-fc td:first-child { text-align: left; }
.dr-fc thead th { font-size: var(--font-size-xs, .75rem); text-transform: uppercase;
                  letter-spacing: .03em; color: var(--text-secondary); }
.dr-fc tbody tr:last-child td { border-bottom: 0; }
.dr-fc__name { font-weight: 600; }

.dr-caveats, .dr-method ul { color: var(--text-secondary); font-size: var(--font-size-sm, .875rem);
                             line-height: 1.5; max-width: 72ch; padding-left: 1.1rem; }
.dr-caveats li, .dr-method li { margin: .25rem 0; }
.dr-method dt { font-weight: 600; margin-top: .5rem; }
.dr-method dd { margin: 0 0 .3rem; color: var(--text-secondary);
                font-size: var(--font-size-sm, .875rem); line-height: 1.5; max-width: 72ch; }

@media (max-width: 640px) {
  .dr-main { padding: .6rem .7rem 3rem; }
  .dr-panel { padding: .8rem; }
  .dr-chart { height: 280px; }
}
