/* FONT */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&display=swap');

/* BASE */
html {
    position: relative;
    min-height: 100%;
}

body {

    display: flex;
    flex-direction: column;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.1px;
    font-weight: normal;
    font-style: normal;
    color: #2a2549;
    overflow-x: hidden;

}

body, wrapper {
    min-height: 100vh;
}

.flex-fill {
    flex: 1 1 auto;
}

.no-gutters {
    margin-right: 0;
    margin-left: 0;
}

.no-gutters > .col,
> [class*="col-"] {
    padding-right: 0;
    padding-left: 0;
}

/* LOGO */
nav {
    font-size: 1rem;
    letter-spacing: 1px;
    font-weight: 300;
}
a.nav-link {
  color: #2a2549;
}
.navbar-brand {
    font-size: 2rem;
    color: #2a2549;
    font-weight: 300;
    font-style: italic;
}

span.square {
    color: #fed97c;
    font-weight: 300;
    font-style: italic;
}

/* NAVBAR */

nav.bg-light {
    background: #d3d5e0 !important;
    padding: 0.5vw 3vw 0.5vw 3vw !important;
}

nav.bg-light-submenu {
    background: #a3a5b0 !important;
    padding: 1vw 1vw 1vw 1vw;
}

.nav-link.active {
    background: #f2f2f2 !important;
    border: none;
    border-radius: 0;
    color: #2a2549;
    letter-spacing: 1px;
    font-weight: 300;
    font-style: normal;
    font-size: 1rem;

}

/* DROPDOWN */
.dropdown-menu-vertical {
    border: 2px solid !important;
}

.dropdown-menu {
    background: white;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    color: #2a2549;
}


footer {
    background: #fed97c;
    margin-bottom: 0;
}

.wrapper-top-footer {
    margin: 0;
    padding: 0;
    padding: 40px 70px 20px 70px;
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
    .wrapper-top-footer {
        padding: 30px;
    }
}

@media screen and (min-width: 300px) and (max-width: 768px) {
    .wrapper-top-footer {
        padding: 15px;
    }
}

.mail {
    color: #2a2549;
    vertical-align: middle;
}


a.mail:hover {
    color: #2a2549;
    border-bottom: 1px solid #2a2549;
    text-decoration: none;
}

@media screen and (min-width: 300px) and (max-width: 1024px) {
    .mail {
        margin-top: 20px;
        text-align: center;
    }
}

.social {
    color: #2a2549;
    vertical-align: middle;
}

a.social {
    color: #2a2549;

}

a.social:hover {
    color: #2a2549;
    border-bottom: 1px solid #2a2549;
    text-decoration: none;
}

@media screen and (min-width: 300px) and (max-width: 1024px) {
    .social {
        margin-top: 20px;
        text-align: center;
    }
}

h6.claim {
    color: #2a2549;
    font-size: 24px;
    font-style: italic;
    font-weight: bold;
}

@media screen and (min-width: 300px) and (max-width: 1024px) {
    h6.claim {
        margin-top: 20px;
        text-align: center;
    }
}


.credits {
    font-size: 12px;
    color: #2a2549;
    font-weight: normal;
    text-align: left;
    margin-top: 30px;
}


/* LINK */

a.bottom {
    text-decoration: none;
    color: #2a2549;
}

a.bottom:hover {
    text-decoration: underline;
    text-underline-position: below;
}


/* SUBHEADER */

.sx {
    background: #d3d5e0 !important;
    padding: 3vw !important;
}

.dx {
    padding: 1vw 3vw 2vw 3vw !important;
    border-bottom: 1px solid #d3d5e0;
}

.dx2 {
    padding: 1vw 1vw 1vw 1vw !important;
    border-bottom: 1px solid #d3d5e0;
}

.dx_st {
    padding: 0 3vw 2vw 3vw !important;
}

.dx_breadc {
    padding: 0 3vw 0 3vw !important;
    border-top: 1px solid #d3d5e0;
    border-bottom: 1px solid #d3d5e0;
}

.subtitle {
    color: #9193b1;
}

.subtitle_st {
    color: #9193b1;
    font-style: normal;
    font-size: 1rem;
    word-wrap: break-word;
}

/* */


#mainLayout {
    font-size: 1rem;
}



.param-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.param-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.param-label {
    font-size: .85rem;
    color: rgba(33, 37, 41, 0.75);
}

.fullscreen-right #mapCol {
    display: none;
}

#mainLayout {
    display: flex;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

#mapCol {
    width: 33.333%;
    min-width: 250px;
    max-width: 70%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

#map {
    flex: 1;
    min-height: 0;
}

#resizeHandle {
    width: 6px;
    flex: 0 0 6px;
    cursor: col-resize;
    background: #dee2e6;
}

#resizeHandle:hover,
#resizeHandle.dragging {
    background: #adb5bd;
}

#contentCol {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
}

#chartContainer {
    position: relative;
    min-height: 320px;
    height: 45vh;
}

#chart {
    width: 100% !important;
    height: 100% !important;
}

#tableContainer {
    min-height: 320px;
    height: 45vh;
    display: flex;
    flex-direction: column;
}

#tableContainer .table-responsive {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

#dataTable th, #dataTable td {
    white-space: nowrap;
}

#viewTabs .nav-link {
    cursor: pointer;
}
#periodRadios .form-check {
min-height: 2.5rem;
}
#periodRadios .form-check-input:disabled + label,
#periodRadios .form-check-label.disabled {
    opacity: .5;
}

/* =========================================================
   RESPONSIVE - MOBILE (< 768px)
   =========================================================
   IMPORTANTE: su desktop l'intero layout resta "bloccato" a
   height:100% con overflow:hidden sul body, perché mappa e
   pannello di destra devono occupare tutta l'altezza dello
   schermo con scroll SOLO al loro interno (#contentCol).

   Il bug della versione precedente: su mobile il body restava
   comunque con overflow:hidden e altezza fissa al 100%, quindi
   tutto ciò che non entrava nello schermo (in pratica quasi
   tutto: grafico, tabella...) veniva semplicemente TAGLIATO e
   non mostrato. In più le altezze basate su "vh" (es. 45vh)
   sono inaffidabili sui browser mobili, perché la barra degli
   indirizzi che appare/scompare cambia il valore reale del
   viewport e può far apparire mappa e grafico schiacciati a
   pochi pixel.

   Su mobile quindi: il body torna a scorrere normalmente come
   una pagina web (nessuna altezza fissa, nessun overflow
   bloccato) e ogni sezione ha un'altezza in PIXEL, stabile e
   prevedibile, invece che in vh.
   ========================================================= */
@media (max-width: 767.98px) {

    html, body {
        height: auto;
        min-height: 100%;
    }

    body {
        overflow: visible;
    }

    #mainLayout {
        flex-direction: column;
        height: auto;
        min-height: 0;
        flex: 1 1 auto;
        overflow: visible;
    }

    #mapCol {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        height: 320px;
        flex: 0 0 320px;
        border-right: none !important;
        border-bottom: 1px solid var(--bs-border-color);
        display: none;
    }

    /* Su mobile la mappa è nascosta di default e si apre col bottone
       "Mappa" nella barra in alto, per lasciare più spazio al grafico. */
    #mapCol.mobile-visible {
        display: flex;
    }

    #resizeHandle {
        display: none !important;
    }

    #contentCol {
        overflow-y: visible;
        min-height: 0;
    }

    #chartContainer,
    #tableContainer {
        height: 420px;
        min-height: 420px;
    }

    #tableContainer .table-responsive {
        max-height: 420px;
    }

    .param-value {
        font-size: 1rem;
    }

    /* Il pulsante "Espandi" ha senso solo nel layout desktop a due
       colonne: su mobile la mappa si gestisce già con la barra in alto. */
    #toggleMap {
        display: none !important;
    }
}

@media (min-width: 768px) {
    #mobileTopBar {
        display: none !important;
    }
}
