/**
 * Météo Sevy — Page Dashboard (page-meteo-pro.php)
 *
 * Styles spécifiques à la page d'accueil station :
 * - Hero avec données overlay (T° + métriques)
 * - Section Tendances
 * - Charts grid (graphes 7/30/90 jours)
 * - Widgets (records, moyennes mensuelles)
 * - Cartes prévisions J+1/J+2
 *
 * Charge meteo-base.css en amont (palette, hero, subnav, ticker, modale).
 *
 * Pour modifier la mise en page du dashboard → c'est ici.
 */

/* ========================================
   HERO — Température + métriques (data overlay)
   ======================================== */
.current-temp {
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
    margin: 0;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    min-width: 0;
}
.temp-value {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(5rem, 11vw, 9rem);
    line-height: 0.85;
    color: var(--color-text);
    letter-spacing: -0.04em;
    text-shadow: 0 4px 30px rgba(0,0,0,0.5);
    flex-shrink: 0;
}
.current-weather-icon {
    font-size: 3.2rem;
    line-height: 1;
    flex: 0 0 auto;
    align-self: center;
    text-shadow: 0 4px 20px rgba(0,0,0,0.6);
    margin-bottom: 0.4rem;
}
.temp-feels {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    padding-left: 1.25rem;
    border-left: 1px solid var(--color-border-strong);
    padding-bottom: 0.6rem;
    align-self: stretch;
    display: flex;
    align-items: flex-end;
}
.temp-feels span { color: var(--color-text); font-weight: 700; }
.temp-trend {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-primary);
    align-self: flex-end;
    padding-bottom: 0.6rem;
    animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.6; }
}

/* Badge « il pleut » — affiché uniquement quand la station mesure de la pluie en cours */
.rain-now-badge {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: rgba(56, 132, 220, 0.85);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(56, 132, 220, 0.35);
    animation: pulse 2.5s ease-in-out infinite;
}
.rain-now-badge[hidden] { display: none; }

/* Bannière « orage à proximité » (Blitzortung) — visible seulement si orage ≤ 10 km */
.storm-banner {
    display: block;
    margin: 0 0 1rem;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(221,107,32,0.95), rgba(192,57,43,0.95));
    color: #fff;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    text-align: center;
    box-shadow: 0 4px 16px rgba(192,57,43,0.4);
    animation: pulse 2s ease-in-out infinite;
}
.storm-banner[hidden] { display: none; }
/* Orage en approche (10–30 km) : ambre (au lieu du rouge ≤ 10 km) */
.storm-banner--approach {
    background: linear-gradient(135deg, rgba(236,201,75,0.95), rgba(221,107,32,0.95));
    box-shadow: 0 4px 16px rgba(221,107,32,0.4);
}

/* ========================================
   STRIP DE MESURES (humidité, vent, pression, pluie)
   - Desktop : intégré DANS le hero, à droite, avec backdrop-blur
   - Mobile  : SORT du hero pour rester visible (overflow + repositionnement)
   ======================================== */
.hero-widgets {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    padding: 0.85rem 0;
    background: rgba(10, 10, 11, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--color-border-strong);
    border-bottom: 1px solid var(--color-border-strong);
    border-radius: 2px;
    align-self: end;
    min-width: min(420px, 95%);
}
.hero-widget {
    padding: 0 1.1rem;
    border-right: 1px solid var(--color-border);
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    transition: none;
    border-radius: 0;
}
.hero-widget:last-child { border-right: none; }
.hero-widget:nth-child(3) .widget-value { color: var(--color-primary); }
.widget-icon { display: none; }
.widget-data {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
}
.widget-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    order: -1;
}
.widget-value {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.55rem;
    line-height: 1;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

/* Alerte critique sous le hero */
.meteo-alerts {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: rgba(201, 74, 30, 0.12);
    border-left: 3px solid var(--color-critical);
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-text);
    animation: slideDown 0.4s var(--transition-smooth);
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========================================
   DASHBOARD CONTAINER
   ======================================== */
.meteo-dashboard {
    padding: 3rem 0;
    position: relative;
    z-index: 1;
}

/* Titres de section */
.forecast-section h2,
.meteo-dashboard > .meteo-container > h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.6rem;
    color: var(--color-text);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.01em;
}
.forecast-section {
    margin-bottom: 1rem;
}
.forecast-section::before {
    content: 'TENDANCES · DERNIÈRES 48 HEURES';
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}
.forecast-section h2 { display: none; }

/* ========================================
   FORECAST CARDS / TENDANCES
   ======================================== */
.forecast-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}
.forecast-card {
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 1.5rem 1.6rem 1.4rem;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    overflow: hidden;
    position: relative;
    transition: border-color var(--transition-fast);
}
/* Filet doré signature */
.forecast-card::before,
.chart-card::before,
.widget-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(245, 184, 46, 0.5), transparent);
    z-index: 1;
}
.forecast-card:hover,
.chart-card:hover,
.widget-card:hover {
    border-color: var(--color-border-strong);
}
.forecast-card canvas {
    display: block;
    width: 100% !important;
    max-width: 100%;
}
.forecast-card h3 {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--color-text-secondary);
    margin-bottom: 1.2rem;
    font-weight: 400;
}
.mini-chart-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
}

/* Cartes prévisions J+1 / J+2 (injectées par JS) */
.meteo-forecast-cards {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
}
.meteo-forecast-card {
    padding: 0.85rem 1rem;
    border-radius: 3px;
    border: 1px solid var(--color-border);
    background: var(--color-surface-2);
    min-width: 0;
    box-sizing: border-box;
}
.meteo-forecast-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}
.meteo-forecast-icon {
    font-size: 1.8rem;
    line-height: 1;
    flex: 0 0 auto;
}
.meteo-forecast-meta {
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
}
.meteo-forecast-title {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--color-primary);
    overflow-wrap: anywhere;
    letter-spacing: 0.05em;
}
.meteo-forecast-sub {
    font-family: var(--font-mono);
    color: var(--color-text);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

/* ========================================
   CHARTS (Températures 7-30-90j, Pluie 30j)
   ======================================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.chart-card {
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 1.5rem 1.6rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: relative;
    transition: border-color var(--transition-fast);
}
.chart-card canvas {
    display: block;
    width: 100% !important;
    max-width: 100%;
}
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.2rem;
    gap: 1rem;
}
.chart-header h3 {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--color-text-secondary);
    font-weight: 400;
}
.chart-controls {
    display: flex;
    gap: 0;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    overflow: hidden;
}
.chart-period-btn {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    padding: 0.35rem 0.7rem;
    background: transparent;
    border: none;
    border-right: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.chart-period-btn:last-child { border-right: none; }
.chart-period-btn.active {
    background: var(--color-primary);
    color: var(--color-bg);
    font-weight: 700;
}
.chart-period-btn:hover:not(.active) {
    color: var(--color-text);
}

/* ========================================
   WIDGETS GRID (Records + Mois)
   ======================================== */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.widget-card {
    background: var(--gradient-card);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 1.5rem 1.6rem;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    overflow: hidden;
    position: relative;
    transition: border-color var(--transition-fast);
}
.widget-card h3 {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--color-text-secondary);
    font-weight: 400;
    margin-bottom: 1.2rem;
}

/* ========================================
   RECORDS WIDGET
   ======================================== */
.records-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 2px;
    overflow: hidden;
    border: none;
}
.record-item {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.95rem 0;
    background: transparent;
    border-bottom: 1px solid var(--color-border);
    border-left: none;
    transition: background var(--transition-fast);
    min-width: 0;
}
.record-item:last-child { border-bottom: none; }
.record-item:hover { background: rgba(245, 184, 46, 0.04); }

.record-icon {
    font-size: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}
.record-item:nth-child(1) .record-icon { color: var(--color-temp-hot);  border-color: rgba(184, 85, 58, 0.3); }
.record-item:nth-child(2) .record-icon { color: var(--color-temp-cold); border-color: rgba(107, 163, 214, 0.3); }
.record-item:nth-child(3) .record-icon { color: var(--color-sage);      border-color: rgba(136, 168, 120, 0.3); }
.record-item:nth-child(4) .record-icon { color: var(--color-primary);   border-color: rgba(245, 184, 46, 0.3); }

.record-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.record-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.record-value {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--color-text);
    white-space: nowrap;
    line-height: 1.1;
    letter-spacing: -0.01em;
}
.record-date {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--color-text-dim);
    white-space: nowrap;
    letter-spacing: 0.05em;
}

/* ========================================
   MONTH STATS WIDGET (Moyennes du mois)
   ======================================== */
.month-stat,
.stat-value,
.stat-comparison { min-width: 0; }

.month-stats {
    display: grid;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}
.month-stat {
    padding: var(--spacing-sm) 0;
    background: transparent;
    border-radius: 0;
    border-bottom: 1px solid var(--color-border);
}
.month-stat:last-child { border-bottom: none; }

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin-bottom: 0.35rem;
}
.stat-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--color-text);
    line-height: 1;
    letter-spacing: -0.01em;
}
.stat-comparison {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--color-sage);
    margin-top: 0.4rem;
    letter-spacing: 0.04em;
}
.stat-comparison.down { color: var(--color-temp-hot); }

/* Pressure gauge legacy */
.pressure-gauge {
    position: relative;
    width: 176px;
    height: 176px;
    margin: var(--spacing-md) auto;
}

@media (max-width: 480px) {
    .meteo-forecast-cards { grid-template-columns: 1fr; }
    .meteo-forecast-row   { align-items: flex-start; }
    .meteo-forecast-icon  { font-size: 1.6rem; }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1200px) {
    .charts-grid    { grid-template-columns: 1fr; }
    .forecast-grid  { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
    .hero-widgets { grid-template-columns: repeat(5, 1fr); width: 100%; min-width: 0; }
    .current-temp { flex-wrap: wrap; }
}

@media (max-width: 768px) {
    /* ============================================================
       MOBILE — Layout direct sans flexbox/grid imbriqué
       Hero = boîte 520px positionnée relative ; chaque élément est
       absolument placé par rapport au hero lui-même.
       ============================================================ */
    .meteo-hero {
        aspect-ratio: auto;
        min-height: 520px;
        max-height: 620px;
        overflow: hidden;
        position: relative;
    }
    /* Container : juste un cadre transparent, ne contraint plus la layout */
    .meteo-hero .meteo-container {
        position: static;
        padding: 0;
        display: block;
        height: auto;
        overflow: visible;
    }
    .hero-grid {
        display: block;
        height: auto;
        min-height: 0;
        position: static;
    }

    /* Station-title — bandeau ID en haut */
    .station-title {
        position: absolute;
        top: 1rem;
        left: 1rem;
        right: 1rem;
        z-index: 3;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    /* hero-main : devient transparent (just wrapper), on positionne
       les enfants directement par rapport au hero. */
    .hero-main {
        display: contents;
    }

    /* Température centrée H+V via top/left + transform */
    .current-temp {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.45rem;
        flex-wrap: nowrap;
        z-index: 2;
        margin: 0;
        padding: 0;
    }
    .temp-value {
        font-size: 5.5rem;
        line-height: 0.9;
        text-align: center;
    }
    .current-weather-icon {
        font-size: 2.8rem;
        margin: 0;
        align-self: center;
    }
    .temp-feels {
        border-left: none;
        padding-left: 0;
        padding-bottom: 0;
        font-size: 0.7rem;
        text-align: center;
        align-self: center;
    }
    .temp-trend {
        align-self: center;
        padding-bottom: 0;
    }

    /* Widgets au pied du hero, à l'intérieur, pleine largeur */
    .hero-widgets {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        align-self: auto;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0;
        padding: 0.7rem 0.5rem;
        background: rgba(10, 10, 11, 0.55);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--color-border-strong);
        border-bottom: none;
        border-radius: 0;
        min-width: 0;
        z-index: 4;
    }
    .hero-widget { padding: 0 0.4rem; }
    .widget-label { font-size: 0.55rem; letter-spacing: 0.1em; }
    .widget-value { font-size: 0.95rem; }

    .widgets-grid   { grid-template-columns: 1fr; }
    .charts-grid    { grid-template-columns: 1fr; }
    .forecast-grid  { grid-template-columns: 1fr; }

    .widget-card    { padding: 1.2rem 1.2rem; }
    .stat-value     { font-size: 1.5rem; }
    .forecast-card  { padding: 1.2rem 1.2rem; }
    .chart-card     { padding: 1.2rem 1.2rem; }

    .forecast-card canvas,
    .chart-card canvas { height: 220px !important; }

    .chart-header {
        gap: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
    }
    .chart-controls { flex-wrap: wrap; }

    .meteo-dashboard { padding: 1.5rem 0; }
    .forecast-section h2,
    .meteo-dashboard > .meteo-container > h2 { font-size: 1.25rem; }
    .forecast-section::before { font-size: 0.62rem; }

    .chart-card { padding: 1rem; border-radius: 3px; }
    .chart-header h3 { font-size: 0.68rem; }
    .chart-period-btn { padding: 0.3rem 0.55rem; font-size: 0.65rem; }
}

/* ============================================================
   TABLETTE (iPad portrait, 769–1024 px) — même logique « sûre »
   que le mobile : hero à hauteur fixe, température centrée et
   visible, mesures en bas. Évite que l'aspect-ratio desktop ne
   rende le hero trop court et ne COUPE la température.
   ============================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    .meteo-hero {
        aspect-ratio: auto;
        min-height: 560px;
        max-height: 700px;
        overflow: hidden;
        position: relative;
    }
    .meteo-hero .meteo-container {
        position: static;
        padding: 0;
        display: block;
        height: auto;
        overflow: visible;
    }
    .hero-grid { display: block; height: auto; min-height: 0; position: static; }
    .station-title {
        position: absolute;
        top: 1.2rem;
        left: 1.5rem;
        right: 1.5rem;
        z-index: 3;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    .hero-main { display: contents; }
    .current-temp {
        position: absolute;
        top: 48%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.5rem;
        flex-wrap: nowrap;
        z-index: 2;
        margin: 0;
        padding: 0;
    }
    .temp-value { font-size: 6.5rem; line-height: 0.9; text-align: center; }
    .current-weather-icon { font-size: 3.2rem; margin: 0; align-self: center; }
    .temp-feels {
        border-left: none;
        padding-left: 0;
        padding-bottom: 0;
        text-align: center;
        align-self: center;
    }
    .temp-trend { align-self: center; padding-bottom: 0; }
    .hero-widgets {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        align-self: auto;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0;
        padding: 0.85rem 0.9rem;
        background: rgba(10, 10, 11, 0.55);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--color-border-strong);
        border-bottom: none;
        border-radius: 0;
        min-width: 0;
        z-index: 4;
    }
    .hero-widget { padding: 0 0.7rem; }
}

@media (max-width: 480px) {
    .meteo-hero { min-height: 560px; max-height: 660px; }
    .temp-value { font-size: 4.8rem; }
    .current-weather-icon { font-size: 2.4rem; }
    .temp-feels { font-size: 0.65rem; padding-left: 0; }

    /* Widgets en 2x2 lignes pour plus de respiration sur petit écran */
    .hero-widgets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0;
        padding: 0.55rem 0;
    }
    .hero-widget {
        padding: 0.5rem 0.85rem;
        border-right: 1px solid var(--color-border);
        border-bottom: 1px solid var(--color-border);
    }
    .hero-widget:nth-child(2n) { border-right: none; }
    .hero-widget:nth-last-child(-n+2) { border-bottom: none; }
    .widget-label { font-size: 0.6rem; }
    .widget-value { font-size: 1.05rem; }

    .chart-card canvas { height: 200px !important; }

    .record-value { font-size: 1.15rem; }
    .record-icon { font-size: 0.9rem; width: 32px; height: 32px; }
}

/* ========================================
   Point de rosée (bouton info + explication) & Rose des vents
   ======================================== */
.dewpoint-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    margin-left: 4px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
}
.dewpoint-info-btn:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.dewpoint-explain {
    margin-top: 0.7rem;
    padding: 0.7rem 0.9rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}
.dewpoint-explain em {
    color: var(--color-primary);
    font-style: normal;
    font-weight: 600;
}
.windrose-legend {
    margin-top: 0.5rem;
    font-size: 0.72rem;
    line-height: 1.4;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* ========================================
   Carte Indice UV (dangerosité peau) + rayonnement solaire
   ======================================== */
.uv-card {
    margin: 1rem 0 0; /* le bloc suivant (aq-card) porte déjà son margin-top via insights/uv ; bas géré par margin-bottom uniforme */
    margin-bottom: 1rem;
    padding: 0.9rem 1.1rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
}
.uv-card__head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.uv-card__title { font-weight: 700; color: rgba(255, 255, 255, 0.9); }
.uv-card__value { font-size: 1.5rem; font-weight: 800; color: #fff; line-height: 1; }
.uv-card__cat   { font-weight: 700; }
.uv-card__solar { color: rgba(255, 255, 255, 0.55); font-size: 0.85rem; margin-left: auto; }
.uv-bar {
    position: relative;
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(90deg,
        #2ecc40 0%, #2ecc40 18%,
        #f1c40f 27%, #f1c40f 45%,
        #ff851b 55%, #ff851b 64%,
        #ff4136 73%, #ff4136 91%,
        #b10dc9 100%);
}
.uv-bar__marker {
    position: absolute;
    top: -3px;
    left: 0;
    width: 4px;
    height: 20px;
    background: #fff;
    border: 2px solid #fff;
    border-radius: 3px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45);
    transform: translateX(-50%);
    transition: left 0.4s ease;
}
.uv-bar__scale {
    display: flex;
    justify-content: space-between;
    margin-top: 3px;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.45);
}
.uv-card__advice {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.82);
}
.uv-card__src {
    margin-top: 0.35rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ===== Carte « Ciel en direct » (crop ciel) ===== */
.webcam-card {
    margin: 1rem 0;
    padding: 0.9rem 1.1rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
}
.webcam-card__head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; }
.webcam-card__title { font-weight: 700; color: rgba(255, 255, 255, 0.9); }
.webcam-card__cover { margin-left: auto; font-weight: 700; color: #fff; }
.webcam-card__imgwrap { position: relative; border-radius: 10px; overflow: hidden; line-height: 0; }
.webcam-card__img { display: block; width: 100%; height: auto; object-fit: cover; background: rgba(255, 255, 255, 0.06); }
.webcam-card__time {
    position: absolute; right: 0.5rem; bottom: 0.5rem;
    padding: 0.15rem 0.5rem; border-radius: 6px;
    background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 0.75rem; font-weight: 600;
}

/* ================================================================== */
/* Qualité de l'air — card dashboard                                   */
/* ================================================================== */
.aq-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1rem;
}
.aq-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}
.aq-head__icon { font-size: 1.35rem; line-height: 1; }
.aq-head__title { font-weight: 700; font-size: 0.9rem; color: #fff; }
.aq-head__src   { font-size: 0.7rem; color: rgba(255,255,255,0.4); margin-top: 1px; }
.aq-badge {
    margin-left: auto;
    flex-shrink: 0;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    transition: background 0.4s;
}
.aq-bar-wrap {
    height: 5px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    margin-bottom: 0.45rem;
    overflow: hidden;
}
.aq-bar-fill {
    height: 100%;
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease, background 0.5s ease;
}
.aq-label-text {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.65);
    margin-bottom: 0.6rem;
}
.aq-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    font-size: 0.75rem;
}
.aq-stat { text-align: center; }
.aq-stat span   { display: block; color: rgba(255,255,255,0.45); margin-bottom: 2px; font-size: 0.68rem; }
.aq-stat strong { font-weight: 600; color: #fff; }

@media (max-width: 480px) {
    .aq-stats { grid-template-columns: repeat(2, 1fr); }
}
