.weathergrid {
    --wg-bg: #061a3a;
    --wg-text: #ffffff;
    --wg-muted: rgba(255, 255, 255, .72);
    --wg-border: rgba(255, 255, 255, .14);
    --wg-surface: rgba(255, 255, 255, .06);
    --wg-surface-hover: rgba(255, 255, 255, .10);
    --wg-input-bg: #ffffff;
    --wg-input-text: #061a3a;
    --wg-accent: #93c5fd;
    --wg-radius: 30px;
    --wg-gap: 18px;


    /* Typographie */
    --wg-size-heading: 1.75rem;
    --wg-size-subheading: 1.125rem;
    --wg-size-body: 1rem;
    --wg-size-temperature: clamp(3.4rem, 9vw, 6.5rem);

    /* Pictogrammes */
    --wg-size-icon-current: clamp(4.8rem, 10vw, 7.5rem);
    --wg-size-icon-current-mobile: 4.6rem;
    --wg-size-icon-hour: 2.4rem;
    --wg-size-icon-day: 2.4rem;
    --wg-size-icon-bulletin: 1.8rem;
    --wg-size-icon-flag: 1.1rem;
	--wg-size-icon-day-secondary: 1.5rem;

    box-sizing: border-box;
    width: 100%;
    padding: 26px;
    background: var(--wg-bg);
    color: var(--wg-text);
    font-size: var(--wg-size-body);
    border: 1px solid var(--wg-border);
    border-radius: var(--wg-radius);
    box-shadow: 0 4px 18px rgba(20, 30, 45, .06);
    overflow: hidden;
    margin-bottom: 10px;
}

.weathergrid *,
.weathergrid *::before,
.weathergrid *::after {
    box-sizing: border-box;
}

.weathergrid [hidden] {
    display: none !important;
}


/* =========================================================
   EN-TÊTE / ACCUEIL
   ========================================================= */

.weathergrid__eyebrow {
    margin: 0 0 8px;
    color: var(--wg-accent);
    font-size: var(--wg-size-body);
    font-weight: 700;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.weathergrid__title,
.weathergrid__section h3 {
    font-size: var(--wg-size-subheading);
    color: var(--wg-text);
}

.weathergrid__title {
    font-size: var(--wg-size-heading);
    margin: 0;
    color: var(--wg-text);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.025em;
}

.weathergrid__lead {
    max-width: 650px;
    margin: 10px 0 22px;
    color: var(--wg-muted);
    font-size: var(--wg-size-body);
    line-height: 1.55;
}


/* =========================================================
   RECHERCHE
   ========================================================= */

.weathergrid__search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--wg-border);
    border-radius: 10px;
    background: var(--wg-surface);
}

.weathergrid__search-input,
.weathergrid__search-button,
.weathergrid__change,
.weathergrid__result {
    font: inherit;
}

.weathergrid__search-input {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: #ffffff !important;
    color: var(--wg-input-text);
    outline: none;
    font-size: var(--wg-size-body);
    box-shadow: 0 1px 3px rgba(20, 30, 45, .04);
    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.weathergrid__search-input:focus {
    border-color: var(--wg-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

.weathergrid__search-button,
.weathergrid__change {
    cursor: pointer;
}

.weathergrid__search-button {
    min-height: 52px;
    padding: 0 24px;
    border: 0;
    border-radius: 7px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    transition:
        opacity .2s ease,
        transform .1s ease;
}

.weathergrid__search-button:hover {
    opacity: .9;
}

.weathergrid__search-button:active {
    transform: translateY(1px);
}


/* =========================================================
   RÉSULTATS DE RECHERCHE
   ========================================================= */

.weathergrid__results {
    margin-top: 10px;
    border: 1px solid var(--wg-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--wg-bg);
    box-shadow: 0 5px 16px rgba(20, 30, 45, .06);
}

.weathergrid__result {
    display: flex;
    width: 100%;
    padding: 13px 15px;
    border: 0;
    border-bottom: 1px solid var(--wg-border);
    background: var(--wg-surface);
    color: var(--wg-text);
    text-align: left;
    cursor: pointer;
    transition: background .15s ease;
}

.weathergrid__result:last-child {
    border-bottom: 0;
}

.weathergrid__result:hover {
    background: var(--wg-surface-hover);
}

.weathergrid__result strong {
    min-width: 28%;
}

.weathergrid__result span {
    color: var(--wg-muted);
}

.weathergrid__status {
    min-height: 1.3em;
    margin-top: 10px;
    color: var(--wg-muted);
    font-size: var(--wg-size-body);
}


/* =========================================================
   LOCALITÉ
   ========================================================= */

.weathergrid__topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.weathergrid__place {
    font-size: var(--wg-size-heading);
    color: var(--wg-text);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.02em;
}

.weathergrid__place-meta {
    margin-top: 5px;
    color: var(--wg-muted);
}

.weathergrid__change {
    padding: 8px 12px;
    border: 1px solid var(--wg-border);
    border-radius: 8px;
    background: var(--wg-surface);
    color: var(--wg-text);
    transition:
        background .15s ease,
        border-color .15s ease;
}

.weathergrid__change:hover {
    background: var(--wg-surface-hover);
    border-color: #cbd3dc;
}


/* =========================================================
   MÉTÉO ACTUELLE
   ========================================================= */

.weathergrid__current {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 26px 0 22px;
}

.weathergrid__current-emoji {
    flex: 0 0 auto;
    font-size: var(--wg-size-icon-current);
    line-height: 1;
}

.weathergrid__current-temp {
    color: var(--wg-text);
    font-size: var(--wg-size-temperature);
    font-weight: 800;
    letter-spacing: -.06em;
    line-height: .9;
}

.weathergrid__current-text {
    margin-top: 9px;
    color: var(--wg-muted);
    font-size: var(--wg-size-body);
}

.weathergrid__current-apparent {
    margin-top: 3px;
    color: var(--wg-muted);
    font-size: var(--wg-size-body);
}

.weathergrid__local-time {
    color: var(--wg-muted);
    font-size: var(--wg-size-body);
}


/* =========================================================
   INFORMATIONS MÉTÉO
   ========================================================= */

.weathergrid__meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 4px;
    border: 0;
}

.weathergrid__meta-grid > div {
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--wg-border);
    border-radius: 8px;
    background: var(--wg-surface);
}

.weathergrid__meta-grid span {
    display: block;
    margin-bottom: 5px;
    color: var(--wg-muted);
    font-size: var(--wg-size-body);
    font-weight: 500;
    line-height: 1.25;
}

.weathergrid__meta-grid strong {
    display: block;
    color: var(--wg-text);
    font-size: var(--wg-size-body);
    font-weight: 700;
    line-height: 1.25;
}


/* =========================================================
   SECTIONS
   ========================================================= */

.weathergrid__section {
    padding-top: 28px;
}

.weathergrid__section h3 {
    font-size: var(--wg-size-subheading);
    margin: 0 0 12px;
    color: var(--wg-text);
    font-weight: 700;
}


/* =========================================================
   PRÉVISIONS HORAIRES
   ========================================================= */

.weathergrid__hours {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    border: 0;
}

.weathergrid__hour-card {
    min-width: 0;
    padding: 15px 10px;
    border: 1px solid var(--wg-border);
    border-radius: 8px;
    background: var(--wg-surface);
    text-align: center;
    overflow: hidden;
}


/* =========================================================
   PRÉVISIONS JOURNALIÈRES
   ========================================================= */

.weathergrid__days {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    border: 0;
}

.weathergrid__day-card {
    min-width: 0;
    padding: 16px 10px;
    border: 1px solid var(--wg-border);
    border-radius: 8px;
    background: var(--wg-surface);
    text-align: center;
    overflow: hidden;
}

.weathergrid__hour-label,
.weathergrid__day-name {
    font-size: var(--wg-size-subheading);
    color: var(--wg-text);
    font-weight: 700;
}

.weathergrid__hour-label {
    font-size: var(--wg-size-subheading);
}


.weathergrid__hour-emoji {
    margin: 8px 0 4px;
    font-size: var(--wg-size-icon-hour);
    line-height: 1.1;
}

.weathergrid__day-emoji {
    margin: 8px 0 4px;
    font-size: var(--wg-size-icon-day);
    line-height: 1.1;
}

.weathergrid__hour-text,
.weathergrid__day-text {
    min-height: 2.7em;
    color: var(--wg-muted);
    font-size: var(--wg-size-body);
    line-height: 1.3;
    text-align: center;
}

.weathergrid__day-text {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
}

.weathergrid__hour-text {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
}

.weathergrid__temperatures {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    color: var(--wg-text);
    font-size: var(--wg-size-body);
    font-weight: 700;
}

.weathergrid__temperatures span {
    color: var(--wg-muted);
    font-size: var(--wg-size-body);
}

.weathergrid__day-secondary {
    margin-top: 5px;
    color: var(--wg-muted);
    font-size: var(--wg-size-body);
    line-height: 1.25;
}

.weathergrid__day-secondary > span[aria-hidden="true"] {
    font-size: var(--wg-size-icon-day-secondary);
	 display: block;
}

.weathergrid .weathergrid__day-secondary > span[aria-hidden="true"] > img {
    width: var(--wg-size-icon-day-secondary) !important;
    height: var(--wg-size-icon-day-secondary) !important;
}


/* =========================================================
   BULLETIN
   ========================================================= */

.weathergrid__bulletin {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    margin-top: 28px;
    padding: 18px 20px;
    border: 0;
    border-left: 3px solid var(--wg-accent);
    border-radius: 0 8px 8px 0;
    background: var(--wg-surface);
}

.weathergrid__bulletin-icon {
    font-size: var(--wg-size-icon-bulletin);
    line-height: 1;
}

.weathergrid__bulletin h3 {
    font-size: var(--wg-size-subheading);
    margin: 0 0 7px;
    color: var(--wg-text);
    font-weight: 600;
}

.weathergrid__bulletin p {
    margin: 0;
    color: var(--wg-text);
    font-size: var(--wg-size-body);
    line-height: 1.55;
}

.weathergrid__bulletin-time {
    margin-top: 10px;
    color: var(--wg-muted);
    font-size: var(--wg-size-body);
    line-height: 1.4;
    opacity: .95;
    font-style: italic;
}


/* =========================================================
   RECHERCHES RÉCENTES
   ========================================================= */

.weathergrid__recent {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--wg-border);
}

.weathergrid__recent[hidden] {
    display: none !important;
}

.weathergrid__recent-title {
    font-size: var(--wg-size-subheading);
    margin: 0 0 4px;
    color: var(--wg-text);
    font-weight: 700;
}

.weathergrid__recent-lead {
    margin: 0 0 12px;
    color: var(--wg-muted);
    font-size: var(--wg-size-body);
}

.weathergrid__recent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.weathergrid__recent-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border: 1px solid var(--wg-border);
    border-radius: 7px;
    background: var(--wg-surface);
    color: var(--wg-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        background .15s ease,
        border-color .15s ease,
        transform .1s ease;
}

.weathergrid__recent-item:hover {
    background: var(--wg-surface-hover);
    border-color: #cbd3dc;
}

.weathergrid__recent-item:active {
    transform: translateY(1px);
}

.weathergrid__recent-flag {
    flex: 0 0 auto;
    font-size: var(--wg-size-icon-flag);
}

.weathergrid__recent-place {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.weathergrid__recent-place strong {
    color: inherit;
    font-size: var(--wg-size-body);
    line-height: 1.2;
}

.weathergrid__recent-place small {
    color: var(--wg-muted);
    font-size: var(--wg-size-body);
    line-height: 1.2;
}

.weathergrid__recent-weather {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    color: inherit;
}

.weathergrid__recent-weather strong {
    color: inherit;
    font-size: var(--wg-size-body);
}


/* =========================================================
   SOURCE
   ========================================================= */

.weathergrid__source {
    margin-top: 20px;
    color: var(--wg-muted);
    font-size: var(--wg-size-body);
}

.weathergrid .weathergrid__source a {
    color: var(--wg-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.weathergrid .weathergrid__source a:hover {
    color: var(--wg-accent);
}


/* =========================================================
   TABLETTE / MOBILE
   ========================================================= */

@media (max-width: 760px) {

    .weathergrid {
        padding: 18px;
        --wg-gap: 12px;
    }

    .weathergrid__search-row {
        grid-template-columns: 1fr;
        padding: 7px;
    }

    .weathergrid__search-button {
        width: 100%;
    }

    .weathergrid__result {
        display: block;
    }

    .weathergrid__result strong,
    .weathergrid__result span {
        display: block;
    }

    .weathergrid__result span {
        margin-top: 3px;
    }

    .weathergrid__topbar {
        display: block;
    }

    .weathergrid__change {
        margin-top: 12px;
    }

    .weathergrid__current {
        gap: 12px;
    }

    .weathergrid__current-emoji {
        font-size: var(--wg-size-icon-current-mobile);
    }

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

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

    .weathergrid__days {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .weathergrid__recent-item {
        width: 100%;
    }
}


/* =========================================================
   PETITS ÉCRANS
   ========================================================= */

@media (max-width: 420px) {

    .weathergrid {
        padding: 14px;
        border-radius: 10px;
    }


    .weathergrid__lead {
        margin-bottom: 18px;
    }

    .weathergrid__search-row {
        padding: 6px;
    }

    .weathergrid__search-input,
    .weathergrid__search-button {
        min-height: 50px;
    }

    .weathergrid__meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .weathergrid__meta-grid > div {
        padding: 12px;
    }

    .weathergrid__hours,
    .weathergrid__days {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .weathergrid__hour-card,
    .weathergrid__day-card {
        padding: 14px 8px;
    }

    .weathergrid__bulletin {
        grid-template-columns: 1fr;
        padding: 15px;
    }
}
