/**
 * MÉTÉO — commune de Grosseto-Prugna / Porticcio
 * Feuille dédiée (chargée uniquement sur la page meteo).
 * Thème clair, sur le fond crème de la page (#ececec).
 */

.meteo {
    --m-card: #ffffff;
    --m-border: rgba(0, 0, 0, 0.1);
    --m-sun: #e2a33c;
    --m-rain: #4f86b3;
    --m-now: #f4efe9;
    color: var(--dark-gray-color);
}

/* Couleur des icônes météo selon le type (classe wxi-<key>) */
.meteo .wxi { color: var(--m-sun); }
.meteo .wxi-moon,
.meteo .wxi-cloud-moon { color: #5a5a5a; }
.meteo .wxi-cloud,
.meteo .wxi-fog { color: #8a8a8a; }
.meteo .wxi-rain,
.meteo .wxi-drizzle { color: var(--m-rain); }
.meteo .wxi-snow { color: #6aa0c4; }
.meteo .wxi-thunder { color: #d98a2b; }

/* ------------------------------------------------------------------
 * CONDITIONS ACTUELLES
 * ------------------------------------------------------------------ */
.meteo-current {
    display: grid;
    grid-template-columns: minmax(300px, 0.9fr) 1.6fr;
    gap: 10px;
}

.meteo-current__hero {
    display: flex;
    flex-direction: column;
    padding: 42px 44px;
    background: var(--main-color);
    color: var(--white-color);
}

.meteo-current__hero .loc {
    font-family: var(--main-font-family);
    font-weight: bold;
    font-size: 30px;
    line-height: 1;
}

.meteo-current__hero .sub {
    margin-top: 8px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.82);
}

.meteo-current__hero .upd {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.65);
}

.meteo-current__hero .upd svg {
    width: 14px;
    height: 14px;
}

.meteo-current__hero .t {
    margin-top: auto;
    padding-top: 34px;
    font-family: var(--main-font-family);
    font-weight: bold;
    font-size: 84px;
    line-height: 0.9;
    color: var(--white-color);
}

.meteo-current__hero .t .unit {
    margin-left: 3px;
    font-size: 28px;
    vertical-align: top;
}

.meteo-current__hero .cond {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 12px;
    font-family: var(--main-font-family);
    font-size: 24px;
    line-height: 1.1;
    color: var(--secondary-color);
}

.meteo-current__hero .cond .wxi-cond {
    width: 26px;
    height: 26px;
    color: var(--secondary-color);
}

.meteo-current__hero .feels {
    margin-top: 5px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.82);
}

/* Grille des indicateurs */
.meteo-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: 10px;
}

.meteo-stat {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 24px 26px;
    background: var(--m-card);
    border: 1px solid var(--m-border);
}

.meteo-stat__top {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.meteo-stat__top .ic svg {
    width: 18px;
    height: 18px;
    color: var(--main-color);
}

.meteo-stat__top .k {
    font-family: var(--secondary-font-family);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--light-paragraph-color);
}

.meteo-stat__val {
    font-family: var(--main-font-family);
    font-weight: bold;
    font-size: 30px;
    line-height: 1;
    color: var(--dark-gray-color);
}

.meteo-stat__val small {
    font-family: var(--secondary-font-family);
    font-size: 13px;
    font-weight: 600;
    color: var(--light-paragraph-color);
}

.meteo-stat__sub {
    min-height: 15px;
    font-size: 12.5px;
    color: var(--light-paragraph-color);
}

/* ------------------------------------------------------------------
 * EN-TÊTES DE SECTION (œil-de-bœuf + titre)
 * ------------------------------------------------------------------ */
.meteo-block {
    margin-top: 46px;
}

.meteo-head {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 22px;
}

.meteo-eyebrow {
    display: inline-flex;
    align-items: center;
    font-family: var(--secondary-font-family);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--main-color);
}

.meteo-eyebrow:before {
    content: '';
    width: 26px;
    height: 2px;
    margin-right: 12px;
    background: var(--main-color);
}

.meteo-h2 {
    margin: 0;
    font-family: var(--main-font-family);
    font-weight: bold;
    font-size: 28px;
    line-height: 1;
    color: var(--dark-gray-color);
}

/* ------------------------------------------------------------------
 * HEURE PAR HEURE
 * ------------------------------------------------------------------ */
.meteo-hourly {
    display: flex;
    overflow-x: auto;
    border: 1px solid var(--m-border);
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #b9b1a8 #e7e1d9;
}

.meteo-hourly::-webkit-scrollbar {
    height: 10px;
}

.meteo-hourly::-webkit-scrollbar-track {
    background: #e7e1d9;
}

.meteo-hourly::-webkit-scrollbar-thumb {
    background: #b9b1a8;
    border-radius: 10px;
}

.meteo-hour {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    width: 88px;
    padding: 18px 8px;
    background: var(--m-card);
    border-right: 1px solid var(--m-border);
}

.meteo-hour:last-child {
    border-right: 0;
}

.meteo-hour.is-now {
    background: var(--m-now);
}

.meteo-hour .h {
    font-family: var(--secondary-font-family);
    font-size: 13px;
    font-weight: 600;
    color: var(--paragraph-color);
}

.meteo-hour .wxi {
    width: 30px;
    height: 30px;
}

.meteo-hour .t {
    font-family: var(--main-font-family);
    font-weight: bold;
    font-size: 20px;
    color: var(--dark-gray-color);
}

.meteo-hour .p {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--light-paragraph-color);
}

.meteo-hour .p svg {
    width: 13px;
    height: 13px;
    color: var(--main-color);
}

.meteo-hourly-nav {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.meteo-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    background: var(--m-card);
    border: 1px solid var(--m-border);
    color: var(--dark-gray-color);
    cursor: pointer;
    transition: 0.2s;
}

.meteo-arrow:hover {
    background: var(--main-color);
    border-color: var(--main-color);
    color: var(--white-color);
}

.meteo-arrow svg {
    width: 18px;
    height: 18px;
}

/* ------------------------------------------------------------------
 * PRÉVISIONS 7 JOURS
 * ------------------------------------------------------------------ */
.meteo-daily {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid var(--m-border);
}

.meteo-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 24px 12px 22px 12px;
    background: var(--m-card);
    border-right: 1px solid var(--m-border);
    transition: 0.2s;
}

.meteo-day:last-child {
    border-right: 0;
}

.meteo-day:hover {
    background: #fbf9f6;
}

.meteo-day.is-today {
    background: #faf7f3;
    box-shadow: inset 0 3px 0 0 var(--main-color);
}

.meteo-day .d {
    font-family: var(--main-font-family);
    font-weight: bold;
    font-size: 17px;
    color: var(--dark-gray-color);
}

.meteo-day .dd {
    font-size: 12px;
    color: var(--light-paragraph-color);
}

.meteo-day .ic .wxi {
    width: 42px;
    height: 42px;
    margin: 4px 0;
}

.meteo-day .cond {
    min-height: 30px;
    font-size: 12px;
    line-height: 1.3;
    color: var(--light-paragraph-color);
}

.meteo-day .temps {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 2px;
}

.meteo-day .temps .max {
    font-family: var(--main-font-family);
    font-weight: bold;
    font-size: 22px;
    color: var(--dark-gray-color);
}

.meteo-day .temps .min {
    font-family: var(--main-font-family);
    font-size: 18px;
    color: var(--light-paragraph-color);
}

.meteo-day .meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    padding-top: 12px;
    width: 100%;
    border-top: 1px solid var(--m-border);
}

.meteo-day .meta .p,
.meteo-day .meta .w {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: var(--light-paragraph-color);
}

.meteo-day .meta svg {
    width: 14px;
    height: 14px;
}

.meteo-day .meta .p svg {
    color: var(--main-color);
}

.meteo-day .meta .w svg {
    color: var(--light-paragraph-color);
}

/* ------------------------------------------------------------------
 * DIVERS
 * ------------------------------------------------------------------ */
/* Texte regroupé dans un <span> : en flex, chaque morceau (texte, lien) devenait un élément séparé, éclaté sur mobile */
.meteo-source {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 26px;
    font-size: 13px;
    line-height: 1.5;
    color: #595959;
}

/* Prend le pas sur la justification des paragraphes de contenu */
.custom-content-container .meteo-source {
    text-align: left;
}

.meteo-source svg {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    margin-top: 2px;
    color: var(--light-paragraph-color);
}

.meteo-source a {
    color: var(--main-color);
    text-decoration: none;
    font-weight: 600;
}

.meteo-source a:hover {
    text-decoration: underline;
}

.meteo-error {
    padding: 50px 30px;
    text-align: center;
    background: var(--m-card);
    border: 1px solid var(--m-border);
    color: var(--paragraph-color);
}

/* ------------------------------------------------------------------
 * RESPONSIVE
 * ------------------------------------------------------------------ */
@media only screen and (max-width: 1199px) {
    .meteo-current {
        grid-template-columns: 1fr;
    }

    .meteo-daily {
        grid-template-columns: repeat(4, 1fr);
    }

    .meteo-day:nth-child(4) {
        border-right: 0;
    }

    .meteo-day:nth-child(n + 5) {
        border-top: 1px solid var(--m-border);
    }

    /* 7 jours sur 4 colonnes : le dernier occupe 2 cases (plus de case vide en bas à droite) */
    .meteo-day:last-child {
        grid-column: span 2;
    }
}

@media only screen and (max-width: 767px) {
    .meteo-current__hero {
        padding: 34px 30px;
    }

    .meteo-current__hero .t {
        font-size: 72px;
        padding-top: 24px;
    }

    .meteo-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .meteo-daily {
        grid-template-columns: repeat(2, 1fr);
    }

    .meteo-day:nth-child(4) {
        border-right: 1px solid var(--m-border);
    }

    .meteo-day:nth-child(even) {
        border-right: 0;
    }

    /* 7 jours sur 2 colonnes : le dernier sur toute la largeur */
    .meteo-day:last-child {
        grid-column: 1 / -1;
        border-top: 1px solid var(--m-border);
    }
}

@media only screen and (max-width: 479px) {
    .meteo-stats {
        grid-template-columns: 1fr;
    }
}
