/* ===== Base générale ===== */
h1 a {
    color: inherit;
    text-decoration: none;
}

h1 a:hover,
h1 a:focus,
h1 a:visited,
h1 a:active {
    color: inherit;
    text-decoration: none;
}


:root {
    --bleu: #1769aa;
    --bleu-fonce: #12466f;
    --bleu-clair: #eaf5ff;
    --fond: #f3f7fb;
    --texte: #243447;
    --secondaire: #64748b;
    --blanc: #ffffff;
    --bordure: #e3ebf3;
    --ombre: 0 5px 20px rgba(29, 78, 121, 0.07);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 24px;
    background: var(--fond);
    color: var(--texte);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

.page {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    margin: 0 0 6px;
    color: var(--bleu-fonce);
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 750;
    letter-spacing: -1px;
}

h2 {
    margin: 0 0 14px;
    color: var(--bleu-fonce);
    font-size: 22px;
}

h3 {
    margin: 28px 0 12px;
    color: var(--bleu-fonce);
    font-size: 21px;
}

p {
    margin: 8px 0;
}

/* ===== Recherche de ville ===== */
.recherche {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
    margin: 22px 0;
    padding: 18px;
    background: var(--blanc);
    border: 1px solid var(--bordure);
    border-radius: 18px;
    box-shadow: var(--ombre);
}

.recherche label {
    display: block;
    width: 100%;
    color: var(--secondaire);
    font-weight: 600;
}

.recherche input[type="text"] {
    flex: 1 1 220px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #ccd9e6;
    border-radius: 10px;
    background: #fbfdff;
    color: var(--texte);
    font: inherit;
}

.recherche input[type="submit"] {
    padding: 12px 20px;
    border: 0;
    border-radius: 10px;
    background: var(--bleu);
    color: white;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.recherche input[type="submit"]:hover {
    background: var(--bleu-fonce);
    transform: translateY(-1px);
}

input:focus-visible {
    outline: 3px solid #a8d6ff;
    outline-offset: 2px;
}

/* ===== Cartes météo ===== */
.carte {
    margin: 16px 0;
    padding: 22px;
    background: var(--blanc);
    border: 1px solid var(--bordure);
    border-radius: 18px;
    box-shadow: var(--ombre);
}

.carte h2 {
    display: flex;
    align-items: center;
    gap: 9px;
}

.icone-rubrique {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    background: var(--bleu-clair);
    font-size: 20px;
}

.meteo-texte {
    color: var(--secondaire);
    font-size: 14px;
}

.valeur-principale {
    color: var(--bleu-fonce);
    font-size: clamp(30px, 5vw, 44px);
    font-weight: 750;
    letter-spacing: -1px;
}

.grille-meteo {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.indicateur {
    padding: 14px;
    background: #f6faff;
    border: 1px solid var(--bordure);
    border-radius: 12px;
}

.indicateur .libelle {
    display: block;
    color: var(--secondaire);
    font-size: 13px;
}

.indicateur .valeur {
    display: block;
    margin-top: 4px;
    color: var(--bleu-fonce);
    font-size: 19px;
    font-weight: 700;
}

/* ===== Tableaux ===== */
.table-conteneur {
    width: 100%;
    margin: 12px 0 24px;
    overflow-x: auto;
    background: var(--blanc);
    border: 1px solid var(--bordure);
    border-radius: 14px;
    box-shadow: var(--ombre);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    padding: 13px 12px;
    background: var(--bleu-fonce);
    color: var(--blanc);
    font-weight: 650;
    text-align: left;
    white-space: nowrap;
}

td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--bordure);
    text-align: left;
}


.table-conteneur tbody tr td {
    background-color: inherit;
}


tr:last-child td {
    border-bottom: 0;
}

/* ===== Couleurs et pied de page ===== */
.temp-min {
    color: #2675bd;
    font-weight: 700;
}

.temp-max {
    color: #e06b36;
    font-weight: 700;
}

.pied-page {
    padding: 24px 0 8px;
    color: var(--secondaire);
    font-size: 12px;
    text-align: center;
}

/* ===== Téléphones ===== */
@media (max-width: 600px) {
    body {
        padding: 12px;
        font-size: 14px;
    }

    .recherche,
    .carte {
        padding: 16px;
        border-radius: 14px;
    }

    .recherche input[type="text"],
    .recherche input[type="submit"] {
        width: 100%;
        flex-basis: 100%;
    }

    .grille-meteo {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .indicateur {
        padding: 11px;
    }

    .indicateur .valeur {
        font-size: 17px;
    }

    h3 {
        font-size: 19px;
    }

    table {
        font-size: 13px;
    }

    th,
    td {
        padding: 9px;
    }
}

/* En-tête de tableau fixe */
.table-conteneur {
    max-height: 450px;
    overflow: auto;
    position: relative;
}

.table-conteneur table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-conteneur thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #edf5fb;
    color: #17496f;
    box-shadow: 0 1px 0 #d5e3ee;
}

/* ===== Pluvieux ===== */

.pluie-defilement {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 2px 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.pluie-item {
    flex: 0 0 85px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 5px;
    border-radius: 10px;
    background: rgba(100, 149, 237, 0.12);
    border: 1px solid rgba(100, 149, 237, 0.25);
    scroll-snap-align: start;
    box-sizing: border-box;
    text-align: center;
}

.ville-item {
    flex: 0 0 100px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 5px;
    border-radius: 10px;
    background: rgba(100, 149, 237, 0.12);
    border: 1px solid rgba(100, 149, 237, 0.25);
    scroll-snap-align: start;
    box-sizing: border-box;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
    /* Compatibilité Safari */
    cursor: pointer;
}

.pluie-heure {
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.pluie-desc {
    font-size: 12px;
    overflow-wrap: anywhere;
}


.bouton-tenue {
    display: inline-block;
    padding: 12px 18px;
    background: #1769aa;
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 10px;
}

.bouton-tenue:hover {
    background: #105184;
}

#ageTenue {
    width: 100%;
    height: 36px;
    cursor: move;
    accent-color: #2878c8;
}

.icone-meteo {
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
}