/* =====================================================================
   Enneigement Samoëns v2 — Widget CSS
   ===================================================================== */

.ens-widget {
    --ens-primary: #1a6bb5;
    --ens-accent:  #378ADD;
    --ens-radius:  12px;
    --ens-border:  rgba(0,0,0,.08);
    --ens-bg:      #ffffff;
    --ens-bg2:     #f8f9fa;
    --ens-text:    #202124;
    --ens-muted:   #5f6368;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ens-text);
    max-width: 860px;
    margin: 0 auto;
}

/* ── Titre ─────────────────────────────────────────────────────── */
.ens-widget-title {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--ens-muted);
    margin: 0 0 .6rem;
}

/* ── Montagne ───────────────────────────────────────────────────── */
.ens-mountain-wrap {
    border-radius: var(--ens-radius);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(20,50,110,.14);
    margin-bottom: .75rem;
    background: #1a6bb5;
}

.ens-mountain-wrap svg {
    display: block;
    width: 100%;
    height: auto;
}

/* ── Dernière chute ─────────────────────────────────────────────── */
.ens-last-snow {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--ens-bg);
    border: .5px solid var(--ens-border);
    border-radius: var(--ens-radius);
    padding: 14px 18px;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}

.ens-ls-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.ens-ls-body {
    flex: 1;
    min-width: 150px;
}

.ens-ls-label {
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ens-muted);
    margin-bottom: 2px;
}

.ens-ls-date {
    font-size: 1rem;
    font-weight: 500;
    color: #042C53;
}

.ens-ls-detail {
    font-size: .76rem;
    color: var(--ens-muted);
    margin-top: 2px;
}

.ens-ls-badge {
    background: #e6f1fb;
    color: #0c447c;
    font-size: .7rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Graphiques ─────────────────────────────────────────────────── */
.ens-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-bottom: .75rem;
}

.ens-chart-card,
.ens-cumuls-card {
    background: var(--ens-bg);
    border: .5px solid var(--ens-border);
    border-radius: var(--ens-radius);
    padding: 14px 16px;
}

.ens-cumuls-card {
    margin-bottom: .75rem;
}

.ens-chart-title {
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--ens-muted);
    margin-bottom: 8px;
}

/* Légende */
.ens-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ens-legend span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    color: var(--ens-muted);
}

.ens-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.ens-dashed {
    display: inline-block;
    width: 18px;
    height: 0;
    border-top: 2px dashed;
    flex-shrink: 0;
}

/* Canvas */
.ens-canvas-wrap {
    position: relative;
    width: 100%;
    height: 140px;
}

.ens-canvas-wrap canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

/* ── Cumuls ─────────────────────────────────────────────────────── */
.ens-gauge {
    margin-bottom: 10px;
}

.ens-gauge:last-child { margin-bottom: 0; }

.ens-gauge-labels {
    display: flex;
    justify-content: space-between;
    font-size: .78rem;
    margin-bottom: 4px;
    color: var(--ens-muted);
}

.ens-gauge-labels span:last-child {
    font-weight: 500;
    color: #042C53;
}

.ens-gauge-track {
    height: 8px;
    background: #e8eaed;
    border-radius: 4px;
    overflow: hidden;
}

.ens-gauge-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--ens-accent);
    transition: width .5s ease;
}

/* ── Note bas de widget ─────────────────────────────────────────── */
.ens-note {
    font-size: .66rem;
    color: #9aa0a6;
    text-align: right;
    margin: .4rem 0 0;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

@media (max-width: 580px) {
    .ens-charts-row {
        grid-template-columns: 1fr;
    }

    .ens-canvas-wrap {
        height: 120px;
    }

    .ens-last-snow {
        gap: 10px;
        padding: 12px 14px;
    }

    .ens-ls-icon {
        font-size: 1.5rem;
    }

    .ens-ls-date {
        font-size: .9rem;
    }

    .ens-ls-badge {
        width: 100%;
        text-align: center;
    }

    .ens-mountain-wrap {
        border-radius: 8px;
    }
}

/* ══════════════════════════════════════════
   DARK MODE
   ══════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
    .ens-widget {
        --ens-bg:    #1e2433;
        --ens-bg2:   #252d3d;
        --ens-border: rgba(255,255,255,.1);
        --ens-text:  #e8eaed;
        --ens-muted: #9aa0a6;
    }

    .ens-gauge-track {
        background: rgba(255,255,255,.1);
    }

    .ens-gauge-labels span:last-child,
    .ens-ls-date {
        color: #e8f0fa;
    }

    .ens-ls-badge {
        background: rgba(26,107,181,.3);
        color: #7ab8e8;
    }
}
