/*
 * El temps a Cubelles
 * Veïns per Cubelles
 */

/* Contenidor de les targetes */
.temps-dies {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0;
}

/* Targeta meteorològica */
.temps-targeta {
    min-width: 0;
    padding: 12px 6px;
    border: 1px solid #ddd;
    border-radius: 10px;
    text-align: center;
    background: #f8fafc;
    transition: box-shadow .2s;
}

.temps-targeta:hover {
    box-shadow: 0 3px 12px #0002;
}

/* Destacar el dia actual */
.temps-avui {
    border: 2px solid #3498db;
    background: #edf6ff;
}

/* Nom del dia */
.temps-dia {
    font-weight: bold;
    text-transform: capitalize;
    margin-bottom: 10px;
}

/* Icona meteorològica */
.temps-icona {
    font-size: 2.5rem;
    line-height: 1.5;
    margin: 8px 0;
}

/* Descripció */
.temps-descripcio {
    font-size: .85rem;
    min-height: 3em;
}

/* Temperatures */
.temps-temperatures {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
    margin: 10px 0;
}

.temps-temperatures strong {
    font-size: 1.5rem;
    color: #d35400;
}

.temps-temperatures span {
    color: #2980b9;
    font-size: 1.1rem;
}

/* Pluja i vent */
.temps-detall {
    font-size: .78rem;
    margin: 6px 0;
}

/* Columnes del gràfic i resum */
.temps-columna {
    min-width: 0;
}

/* Targetes informatives centrades dins de la seva columna. */
.temps-targeta-espai {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.temps-info-targeta {
    width: 100%;
    max-width: 380px;
    padding: 20px;
    border: 1px solid #dce5eb;
    border-radius: 10px;
    background: #fff;
}

.temps-info-targeta-foix {
    max-width: 560px;
}

/* Gràfic Chart.js */
.temps-grafic {
    position: relative;
    width: 100%;
    height: 320px;
}

/* Resum */
#temps-resum {
    padding: 10px;
}

#temps-resum p {
    margin: 12px 0;
}

/* Slider meteorològic */
.temps-slider {
    position: relative;
}

/* Els botons no apareixen en ordinadors */
.temps-navegacio {
    display: none;
}

/* Respectar les targetes ocultes per JavaScript */
.temps-targeta[hidden] {
    display: none !important;
}

/* Giny oficial de Meteocat complet, sense retalls ni desplaçaments. */
.radar-meteocat-container {
    width: 100%;
    max-width: 396px;
    margin: 20px auto;
}

.radar-meteocat-iframe {
    display: block;
    width: 100%;
    height: 412px;
    border: 0;
}

.radar-meteocat-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.radar-meteocat-heading h3 {
    margin: 0;
    min-width: 0;
}

.radar-meteocat-heading > .button {
    flex-shrink: 0;
    margin: 0 0 0 auto;
    min-height: 44px;
}

@media screen and (max-width: 650px) {
    .radar-meteocat-heading {
        align-items: flex-start;
    }

    .radar-meteocat-heading > .button {
        max-width: 55%;
        white-space: normal;
        text-align: center;
    }

}

/* Tableta: cuatro días por fila. */
@media screen and (max-width: 1024px) {
    .temps-dies {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

}

/* Móvil: dos días visibles y navegación del carrusel. */
@media screen and (max-width: 650px) {
    .temps-slider {
        display: flex;
        align-items: center;
        gap: 6px;
        width: 100%;
    }

    .temps-slider .temps-dies {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        flex: 1;
        min-width: 0;
        gap: 8px;
    }

    .temps-navegacio {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 30px;
        width: 30px;
        height: 45px;
        border: none;
        border-radius: 6px;
        background: #247a56;
        color: white;
        font-size: 20px;
        cursor: pointer;
    }

    .temps-navegacio:disabled {
        opacity: .3;
        cursor: not-allowed;
    }

    .temps-dies {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .temps-grafic {
        height: 280px;
    }

    .temps-icona {
        font-size: 2rem;
    }

    .temps-columna {
        flex: 1 1 100%;
        width: 100%;
    }

    .temps-temperatures strong {
        font-size: 1.3rem;
    }

}
