/* =============================================
   PRECIPITACIONS.CSS — requereix plantilla.css
   ============================================= */

.cos_interior {
    display: flex;
    gap: clamp(20px, 2.5vw, 40px);
    height: 100%;
    overflow: hidden;
}

/* ——— ESQUERRA ——— */
.esquerra {
    flex: 1;
    align-self: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: clamp(10px, 1.5vh, 18px) clamp(6px, 1vh, 10px);
    margin: clamp(10px, 1.8vh, 20px) 0;
    max-height: 90vh;
    border: 1px solid #e5e0d8;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.15);
}

.titol_interior {
    font-size: clamp(0.86rem, 0.94vw, 1.01rem);
    font-weight: bold;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #000000;
    text-align: center;
    padding: 10px;
    background: #f7f1eb;
    border: 1px solid #e5e0d8;
    border-radius: 4px;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.15);
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.caixa-text {
    font-size: clamp(0.78rem, 0.82vw, 0.92rem);
    line-height: 1.6;
    color: #555;
    background: #fdfcfb;
    padding: clamp(10px, 1.2vh, 15px);
    border: 1px solid #e5e0d8;
    border-radius: 4px;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.15);
    overflow-y: auto;
    flex: none;
    min-height: 4vh;
    max-height: 40vh;
    text-align: justify;
    text-indent: 1.5em;
}

.caixa-text strong { color: #3a1b05; }
.caixa-text p + p { margin-top: 0.5em; }

/* ——— CAIXA INDICADORS ——— */
.caixa-indicadors {
    font-size: clamp(0.78rem, 0.82vw, 0.92rem);
    background: #fdfcfb;
    border: 1px solid #e5e0d8;
    border-radius: 4px;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.15);
    overflow: hidden;
    flex-shrink: 0;
}

.ind-titol {
    background: #f7f1eb;
    border-bottom: 1px solid #e5e0d8;
    padding: 6px 10px;
    font-size: clamp(0.72rem, 0.78vw, 0.84rem);
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #555;
}

/* ——— STATS (línies compactes) ——— */
.ind-global { padding: 4px 0; }

.stat-linia {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 10px;
}

.stat-linia + .stat-linia { border-top: 1px solid #f0ece6; }
.stat-linia-mitja { background: #faf7f3; }

.sl-lbl {
    font-size: clamp(0.68rem, 0.72vw, 0.78rem);
    color: #aaa;
    min-width: 62px;
    flex-shrink: 0;
}

.sl-any {
    font-size: clamp(0.80rem, 0.84vw, 0.90rem);
    color: #5d2e0a;
    font-weight: bold;
    flex: 1;
}

.sl-val {
    font-size: clamp(0.70rem, 0.74vw, 0.80rem);
    color: #888;
    text-align: right;
}

/* ——— INDICADORS VS MITJANA ——— */
.vs-sobre { color: #2e7d4a; }
.vs-sota  { color: #b85000; }

/* ——— BOTONS ——— */
.botons {
    margin-top: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.botons a {
    display: block;
    text-align: center;
    padding: clamp(6px, 0.8vh, 8px) 10px;
    border: 1px solid #d5c9b8;
    border-radius: 4px;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.15);
    background-color: #f0ece6;
    color: #555;
    text-decoration: none;
    font-size: clamp(0.70rem, 0.72vw, 0.80rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: all 0.25s ease;
}

.botons a:hover {
    background-color: #e5ddd4;
    border-color: #b8ac9e;
    color: #333;
}

/* ——— DRETA: GRÀFICS ——— */
.dreta {
    flex: 3;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    padding-right: 4px;
}

.dreta::-webkit-scrollbar { width: 5px; }
.dreta::-webkit-scrollbar-thumb { background: #d5c9b8; border-radius: 3px; }

.grafics-contenidor {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 0 8px;
    height: 100%;
}

.grafic-bloc {
    background: #fff;
    border: 1px solid #e5ddd2;
    border-radius: 6px;
    padding: 12px 16px 14px;
    box-shadow: 4px 4px 12px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 0;
}

.grafic-titol {
    font-size: clamp(0.76rem, 0.82vw, 0.88rem);
    color: #4a2408;
    letter-spacing: 0.02em;
    border-bottom: 1px solid #ede5d8;
    padding-bottom: 7px;
    flex-shrink: 0;
}

.grafic-titol strong { color: #5d2e0a; }

.unitat {
    font-size: 0.72rem;
    color: #bbb;
    font-style: italic;
}

.grafic-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
    cursor: pointer;
}

.grafic-wrap-mes {
    cursor: default;
}

/* ——— NAVEGACIÓ ANY MENSUAL ——— */
.nav-any {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.nav-any .grafic-titol {
    flex: 1;
    border-bottom: none;
    padding-bottom: 0;
    text-align: center;
}

.btn-nav-any {
    background: #ede5d8;
    border: 2px solid #a08060;
    border-radius: 4px;
    color: #5d2e0a;
    cursor: pointer;
    padding: 3px 12px;
    font-size: 1rem;
    font-weight: bold;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.btn-nav-any:hover {
    background: #d5c9b8;
    border-color: #6b3a1f;
    color: #3a1b05;
}

/* ——— RESPONSIVE ——— */
@media (max-width: 768px) {
    .cos_interior {
        flex-direction: column;
        height: auto;
        overflow: visible;
        padding: 20px 0;
    }

    .esquerra {
        flex: none;
        width: 100%;
        overflow: visible;
    }

    .dreta {
        height: auto;
        overflow: visible;
    }

    .grafics-contenidor { height: auto; }

    .grafic-bloc { flex: none; }

    .grafic-wrap { height: 220px; }
    .grafic-wrap-mes { height: 200px; }
}
