/* ── Page Actualités Environnementales ─────────────────────── */

.news-layout {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* ── Sections ───────────────────────────────────────────────── */
.news-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--forest-dark);
    margin: 0;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--border);
}

.section-subtitle {
    font-size: .82rem;
    color: var(--sage);
    margin: -.5rem 0 0;
}

/* ── Carte biodiversité ─────────────────────────────────────── */
.bio-map-controls {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1.25rem;
    background: var(--forest-dark);
    border-radius: var(--radius-lg);
    color: #fff;
}

.bio-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .75rem;
    border: 1.5px solid rgba(255,255,255,.25);
    border-radius: 20px;
    background: transparent;
    color: rgba(255,255,255,.8);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}
.bio-filter-btn:hover  { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.5); }
.bio-filter-btn.active { background: rgba(255,255,255,.15); border-color: #fff; color: #fff; }

.bio-map-wrapper {
    position: relative;
    height: 420px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

#bio-map {
    width: 100%;
    height: 100%;
    isolation: isolate;
    z-index: 0;
}

.subsection-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--forest-dark);
    margin: .5rem 0 0;
}

/* ── Grille actus biodiversité ──────────────────────────────── */
.bio-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.bio-news-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--sage);
    font-size: .85rem;
}

.bio-news-card {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: box-shadow .2s, border-color .2s;
}
.bio-news-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    border-color: var(--sage);
}

.bio-news-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.bio-news-source {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .15rem .5rem;
    border-radius: 10px;
    background: var(--forest-dark);
    color: #fff;
    white-space: nowrap;
}

.bio-news-date {
    font-size: .7rem;
    color: var(--sage);
    white-space: nowrap;
}

.bio-news-card h3 {
    font-size: .88rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
}
.bio-news-card h3 a {
    color: var(--forest-dark);
    text-decoration: none;
}
.bio-news-card h3 a:hover { text-decoration: underline; color: var(--sage); }

.bio-news-excerpt {
    font-size: .78rem;
    color: var(--text-body);
    line-height: 1.5;
    flex: 1;
}

.bio-news-lang {
    font-size: .65rem;
    color: var(--sage);
    opacity: .7;
    align-self: flex-end;
}

@media (max-width: 900px) { .bio-news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .bio-news-grid { grid-template-columns: 1fr; } }

/* ── Contrôles ─────────────────────────────────────────────── */
.map-controls {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--forest-dark);
    border-radius: var(--radius-lg);
    color: #fff;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.filter-group label {
    font-size: .8rem;
    font-weight: 700;
    color: rgba(255,255,255,.6);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-right: .25rem;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .75rem;
    border: 1.5px solid rgba(255,255,255,.25);
    border-radius: 20px;
    background: transparent;
    color: rgba(255,255,255,.8);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}

.filter-btn:hover   { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.5); }
.filter-btn.active  { background: rgba(255,255,255,.15); border-color: #fff; color: #fff; }

.filter-btn .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.time-group {
    display: flex;
    gap: .4rem;
}

.time-btn {
    padding: .3rem .65rem;
    border: 1.5px solid rgba(255,255,255,.25);
    border-radius: var(--radius);
    background: transparent;
    color: rgba(255,255,255,.7);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}

.time-btn:hover  { background: rgba(255,255,255,.1); }
.time-btn.active { background: var(--sage); border-color: var(--sage); color: #fff; }

/* ── Wrapper carte + sidebar ────────────────────────────────── */
.map-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1rem;
    height: 520px;
}

#climate-map {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    isolation: isolate;
    z-index: 0;
}

/* ── Sidebar événements ─────────────────────────────────────── */
.events-sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.events-sidebar-header {
    padding: .75rem 1rem;
    background: var(--forest-dark);
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.events-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    list-style: none;
}

.events-list::-webkit-scrollbar { width: 4px; }
.events-list::-webkit-scrollbar-track { background: var(--cream); }
.events-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.event-item {
    padding: .7rem 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .15s;
}
.event-item:hover { background: var(--cream); }
.event-item:last-child { border-bottom: none; }

.event-item-header {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: .25rem;
}

.event-icon { font-size: 1rem; flex-shrink: 0; margin-top: .05rem; }

.event-title {
    font-size: .82rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
}

.event-meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .72rem;
    color: var(--sage);
}

.severity-badge {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.severity-badge.red    { background: #e53e3e; }
.severity-badge.orange { background: #dd6b20; }
.severity-badge.green  { background: #38a169; }

.events-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--sage);
    font-size: .85rem;
}

/* ── Popup Leaflet custom ───────────────────────────────────── */
.climate-popup { min-width: 240px; max-width: 320px; }
.climate-popup h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-bottom: .4rem;
    color: var(--forest-dark);
}
.climate-popup .popup-meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .75rem;
    color: var(--sage);
    margin-bottom: .5rem;
}
.climate-popup .popup-body {
    font-size: .82rem;
    line-height: 1.55;
    color: var(--text-body);
    margin-bottom: .5rem;
}
.climate-popup .popup-link {
    font-size: .75rem;
    color: var(--sage);
    font-weight: 700;
}

/* ── Bilan humain (morts / blessés / déplacés) ─────────────── */
.popup-human-toll {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .6rem;
    padding: .5rem .6rem;
    background: #fff3cd;
    border-left: 3px solid #e53e3e;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.popup-human-toll span {
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}
.toll-deaths   { color: #c53030; }
.toll-injured  { color: #c05621; }
.toll-displaced{ color: #744210; }
.toll-affected { color: var(--forest-dark); font-weight: 600; }

/* ── Marqueurs custom ───────────────────────────────────────── */
.climate-marker {
    width: 28px; height: 28px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(0,0,0,.2);
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.climate-marker .marker-icon {
    transform: rotate(45deg);
    font-size: .85rem;
    line-height: 1;
}
.climate-marker.severity-red    { background: #e53e3e; }
.climate-marker.severity-orange { background: #dd6b20; }
.climate-marker.severity-green  { background: #38a169; }

/* ── Compteur ───────────────────────────────────────────────── */
.map-counter {
    font-size: .8rem;
    color: rgba(255,255,255,.7);
    flex-shrink: 0;
}
#event-count { font-weight: 700; color: #fff; }

/* ── Frise chronologique ────────────────────────────────────── */
.timeline-section {
    background: var(--forest-dark);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    color: #fff;
}

.timeline-section h2 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: .25rem;
}

.timeline-subtitle {
    font-size: .8rem;
    color: rgba(255,255,255,.6);
    margin-bottom: 1.25rem;
}

.chart-container {
    position: relative;
    height: 260px;
}

.timeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.5rem;
    margin-top: 1rem;
    font-size: .78rem;
    color: rgba(255,255,255,.75);
}
.timeline-legend span {
    display: flex;
    align-items: center;
    gap: .4rem;
}
.legend-dot {
    width: 10px; height: 10px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}

/* ── Source note ────────────────────────────────────────────── */
.source-note {
    font-size: .75rem;
    color: var(--sage);
    text-align: right;
    margin-top: .5rem;
}
.source-note a { color: var(--sage); text-decoration: underline; }

/* ── Loading ────────────────────────────────────────────────── */
.map-loading {
    position: absolute;
    inset: 0;
    background: rgba(250,249,246,.85);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-size: .9rem;
    color: var(--forest-dark);
    font-weight: 600;
    z-index: 1000;
    pointer-events: none;
}
.map-loading.hidden { display: none; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
    .map-wrapper {
        grid-template-columns: 1fr;
        height: auto;
    }
    #climate-map { height: 420px; }
    .events-sidebar { height: 300px; }
}

@media (max-width: 600px) {
    .map-controls { flex-direction: column; align-items: flex-start; }
    #climate-map  { height: 320px; }
}
