/** BLOC 20 (LOT 4) — Météo & Vigilance Climatique */

.section-weather-dashboard__header {
    margin-bottom: var(--space-5);
}
.section-weather-dashboard__title {
    font-size: clamp(1.5rem, 2.4vw, 2.25rem);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    margin: 0 0 var(--space-2);
    color: inherit;
}
.section-weather-dashboard__description {
    font-size: var(--font-size-body);
    line-height: 1.5;
    margin: 0 0 var(--space-2);
    color: var(--color-text-light, #6b7280);
}
.section-weather-dashboard__separator {
    display: block;
    width: 88px;
    height: 2px;
    background-color: var(--color-primary, #003399);
    margin: 0;
}
.section--bg-blue .section-weather-dashboard__separator { background-color: var(--color-white); }

.section-weather-dashboard__sub-title {
    font-size: 22px;
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    margin: var(--space-5) 0 var(--space-3);
    color: inherit;
}

.section-weather-dashboard__error {
    padding: var(--space-3);
    background-color: var(--color-grey-100, #f3f4f6);
    border-radius: var(--radius-md);
    color: var(--color-text-light);
    text-align: center;
}

/* ===== Bloc principal : carte météo + carte département ===== */
.section-weather-dashboard__main {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    align-items: start; /* card prend sa hauteur naturelle */
}
@media (max-width: 768px) { .section-weather-dashboard__main { grid-template-columns: 1fr; align-items: stretch; } }

.section-weather-dashboard__main-card {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.section-weather-dashboard__main-temp {
    font-size: 56px;
    font-weight: var(--font-weight-bold);
    line-height: 1;
}
.section-weather-dashboard__main-condition {
    font-size: 16px;
    opacity: 0.9;
}
.section-weather-dashboard__main-location {
    font-size: 14px;
    opacity: 0.85;
}
.section-weather-dashboard__main-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.section-weather-dashboard__main-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.section-weather-dashboard__main-stat-label {
    font-size: 11px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.section-weather-dashboard__main-stat-value {
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
}
.section-weather-dashboard__main-suntimes {
    display: flex;
    gap: var(--space-3);
    font-size: 12px;
    opacity: 0.85;
    margin-top: var(--space-1);
}

.section-weather-dashboard__main-map {
    background-color: var(--color-grey-100, #f3f4f6);
    border-radius: var(--radius-md);
    min-height: 320px;
    height: 320px;
    overflow: hidden;
    z-index: 0;
}
.section-weather-dashboard__main-map .leaflet-container {
    height: 100%;
    width: 100%;
    border-radius: var(--radius-md);
}
.meteo-map-popup__temp { font-weight: 700; color: var(--color-primary, #003399); }

/* ===== Prévisions sur 4 jours (cards plates avec border) ===== */
.section-weather-dashboard__forecast-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
}
@media (max-width: 640px) { .section-weather-dashboard__forecast-grid { grid-template-columns: repeat(2, 1fr); } }

.section-weather-dashboard__forecast-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-100, #e5e7eb);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.section-weather-dashboard__forecast-icon {
    width: 36px;
    height: 36px;
    color: var(--color-primary, #003399);
}
.section-weather-dashboard__forecast-icon svg { display: block; }
.section-weather-dashboard__forecast-day {
    font-size: 11px;
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.section-weather-dashboard__forecast-day span {
    color: var(--color-text-light, #6b7280);
    font-weight: var(--font-weight-regular);
    margin-left: 4px;
}
.section-weather-dashboard__forecast-temps {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.section-weather-dashboard__forecast-temps strong {
    font-size: 24px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
}
.section-weather-dashboard__forecast-temps span {
    font-size: 14px;
    color: var(--color-text-light, #6b7280);
}
.section-weather-dashboard__forecast-cond {
    font-size: 13px;
    color: var(--color-text-light, #6b7280);
    line-height: 1.3;
}

/* ===== Vigilance risques climatiques ===== */
.section-weather-dashboard__vigilance-banner {
    padding: var(--space-3);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: var(--space-3);
    border: 1px solid transparent;
}
.section-weather-dashboard__vigilance-banner--vert {
    background-color: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}
.section-weather-dashboard__vigilance-banner--alert {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
.section-weather-dashboard__vigilance-banner strong { font-size: 16px; }
.section-weather-dashboard__vigilance-banner span { font-size: 14px; opacity: 0.9; }

.section-weather-dashboard__vigilance-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
}
@media (max-width: 768px) { .section-weather-dashboard__vigilance-grid { grid-template-columns: repeat(2, 1fr); } }

.section-weather-dashboard__vigilance-card {
    padding: var(--space-3);
    border-radius: var(--radius-md);
    text-align: center;
    background-color: var(--color-white);
    box-shadow: 0 4px 27.7px 0 rgba(0, 12, 36, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 2px solid transparent;
}
.section-weather-dashboard__vigilance-icon { width: 32px; height: 32px; margin: 0 auto; color: var(--color-primary); }
.section-weather-dashboard__vigilance-icon svg { width: 100%; height: 100%; display: block; }
.section-weather-dashboard__vigilance-card--jaune  .section-weather-dashboard__vigilance-icon { color: #d97706; }
.section-weather-dashboard__vigilance-card--orange .section-weather-dashboard__vigilance-icon { color: #ea580c; }
.section-weather-dashboard__vigilance-card--rouge  .section-weather-dashboard__vigilance-icon { color: #dc2626; }
.section-weather-dashboard__vigilance-label {
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}
.section-weather-dashboard__vigilance-level {
    font-size: 12px;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    display: inline-block;
    margin: 0 auto;
}

/* Couleurs des niveaux Météo France */
.section-weather-dashboard__vigilance-card--vert .section-weather-dashboard__vigilance-level   { background-color: #d1fae5; color: #065f46; }
.section-weather-dashboard__vigilance-card--jaune .section-weather-dashboard__vigilance-level  { background-color: #fef3c7; color: #92400e; }
.section-weather-dashboard__vigilance-card--orange .section-weather-dashboard__vigilance-level { background-color: #fed7aa; color: #9a3412; }
.section-weather-dashboard__vigilance-card--rouge .section-weather-dashboard__vigilance-level  { background-color: #fee2e2; color: #991b1b; }

.section-weather-dashboard__vigilance-card--jaune  { border-color: #fcd34d; }
.section-weather-dashboard__vigilance-card--orange { border-color: #fb923c; }
.section-weather-dashboard__vigilance-card--rouge  { border-color: #ef4444; }

/* ===== Détails météorologiques : 4 cards 1ère ligne, 2 cards 2e ligne (style maquette) ===== */
.section-weather-dashboard__details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
}
@media (max-width: 1024px) { .section-weather-dashboard__details-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .section-weather-dashboard__details-grid { grid-template-columns: 1fr; } }

.section-weather-dashboard__details-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-100, #e5e7eb);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}
.section-weather-dashboard__details-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 4px;
    color: var(--color-text-light, #6b7280);
}
.section-weather-dashboard__details-icon svg { width: 100%; height: 100%; display: block; }
.section-weather-dashboard__details-label {
    font-size: 11px;
    color: var(--color-text-light, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: var(--font-weight-bold);
}
.section-weather-dashboard__details-value {
    font-size: 24px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    line-height: 1.1;
}
.section-weather-dashboard__details-sub {
    font-size: 12px;
    color: var(--color-text-light, #6b7280);
}

/* Couleurs distinctes par type de détail (matche maquette) */
.section-weather-dashboard__details-card--temperature .section-weather-dashboard__details-icon { color: #ef4444; } /* rouge thermomètre */
.section-weather-dashboard__details-card--humidity    .section-weather-dashboard__details-icon { color: #3b82f6; } /* bleu goutte */
.section-weather-dashboard__details-card--wind        .section-weather-dashboard__details-icon { color: #6b7280; } /* gris vent */
.section-weather-dashboard__details-card--pressure    .section-weather-dashboard__details-icon { color: #003399; } /* bleu primary jauge */
.section-weather-dashboard__details-card--uv          .section-weather-dashboard__details-icon { color: #f59e0b; } /* orange UV */
.section-weather-dashboard__details-card--sun         .section-weather-dashboard__details-icon { color: #fbbf24; } /* jaune soleil */

/* Icône dans la colonne Conditions du tableau Prévisions détaillées */
.section-weather-dashboard__table-cond {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-primary, #003399);
}
.section-weather-dashboard__table-cond svg { flex-shrink: 0; }

/* ===== Tableau prévisions détaillées sur 7 jours ===== */
.section-weather-dashboard__forecast-table { margin-top: 0; }
.section-weather-dashboard__table-wrapper {
    overflow-x: auto;
    background-color: var(--color-white);
    border: 1px solid var(--color-grey-100, #e5e7eb);
    border-radius: var(--radius-md);
}
.section-weather-dashboard__table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}
.section-weather-dashboard__table th {
    text-align: left;
    padding: 14px 18px;
    font-size: 11px;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-light, #6b7280);
    background-color: var(--color-grey-100, #f9fafb);
    border-bottom: 1px solid var(--color-grey-100, #e5e7eb);
}
.section-weather-dashboard__table td {
    padding: 14px 18px;
    font-size: 14px;
    color: var(--color-text);
}
/* Alternance zebra : lignes paires en gris très pâle */
.section-weather-dashboard__table tbody tr:nth-child(even) td {
    background-color: #f9fafb;
}
/* Colonnes Jour (1) et Temp (3) en bleu primary */
.section-weather-dashboard__table tbody td:first-child,
.section-weather-dashboard__table tbody td:nth-child(3) {
    color: var(--color-primary, #003399);
    font-weight: var(--font-weight-semibold);
}

.section-weather-dashboard__footer {
    margin-top: var(--space-4);
    text-align: center;
    color: var(--color-text-light);
}
.section-weather-dashboard__footer a {
    color: var(--color-primary);
    text-decoration: none;
}

/* Variante fond bleu : inverser les cards (blanches sur fond bleu) */
.section--bg-blue .section-weather-dashboard__title,
.section--bg-blue .section-weather-dashboard__sub-title { color: var(--color-white); }
.section--bg-blue .section-weather-dashboard__description { color: rgba(255, 255, 255, 0.85); }
.section--bg-blue .section-weather-dashboard__main-card {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.section--bg-blue .section-weather-dashboard__footer { color: rgba(255, 255, 255, 0.7); }
.section--bg-blue .section-weather-dashboard__footer a { color: var(--color-accent); }
