:root {
  --bg: #f2f5f8;
  --card: #ffffff;
  --ink: #1d2733;
  --muted: #64748b;
  --primary: #0e6ba8;
  --primary-dark: #0a4f7c;
  --accent: #f59e0b;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(15, 40, 70, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 18px 20px;
}

.brand { display: flex; align-items: center; gap: 14px; max-width: 1080px; margin: 0 auto; }
.logo { font-size: 2rem; }
.brand h1 { margin: 0; font-size: 1.5rem; letter-spacing: 0.3px; }
.tagline { margin: 2px 0 0; opacity: 0.85; font-size: 0.9rem; }

.tabs {
  display: flex;
  gap: 6px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px 0;
  flex-wrap: wrap;
}

.tab {
  border: none;
  background: #dde5ee;
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 10px 10px 0 0;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.tab:hover { background: #cbd7e4; }
.tab.active { background: var(--card); color: var(--primary-dark); box-shadow: var(--shadow); }

main { max-width: 1080px; margin: 0 auto; padding: 0 20px 40px; }

.panel { display: none; }
.panel.active { display: block; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 18px;
}

.card h2 { margin-top: 0; }
.card h3 { margin: 18px 0 8px; color: var(--primary-dark); }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: #b91c1c; font-weight: 600; }
.hidden { display: none; }

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

.btn {
  display: inline-block;
  background: #e6eef6;
  color: var(--primary-dark);
  border: 1px solid #c8d8e6;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn:hover { background: #d3e2ef; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 0.85rem; }

.fb-wrap { display: flex; justify-content: center; margin: 16px 0; max-width: 100%; overflow-x: auto; }
.fb-wrap iframe { max-width: 100%; border-radius: 8px; background: #fff; }

.widget-wrap { display: flex; justify-content: center; margin: 14px auto; max-width: 100%; overflow-x: auto; }
.widget-wrap iframe { width: 334px; max-width: 100%; border: 0; border-radius: 8px; background: #fff; }

.video-wrap {
  position: relative;
  width: 100%;
  max-width: 860px;
  aspect-ratio: 16 / 9;
  margin: 0 auto 14px;
}
.video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
  background: #000;
}

.meteox-wrap {
  height: 520px;
  max-width: 600px;
  margin: 0 auto 14px;
  border-radius: 10px;
  border: 1px solid #dfe8f0;
  overflow: hidden;
}

.webcam-img { display: block; width: 100%; max-width: 900px; margin: 0 auto 12px; border-radius: 8px; border: 1px solid #dfe8f0; background: #f4f8fb; }

.linklist { list-style: none; padding: 0; margin: 8px 0; }
.linklist li { padding: 6px 0; border-bottom: 1px dashed #e2e8f0; }
.linklist li:last-child { border-bottom: none; }

.now-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.now-icon { font-size: 4rem; line-height: 1; }
.now-temp { font-size: 3rem; font-weight: 700; }
.now-temp sup { font-size: 1.4rem; }
.now-desc { font-size: 1.15rem; color: var(--primary-dark); font-weight: 600; }
.now-details { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; font-size: 0.95rem; }

.daily-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.day {
  background: #f4f8fb;
  border: 1px solid #dfe8f0;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.day .d-name { font-weight: 700; font-size: 0.9rem; }
.day .d-icon { font-size: 1.8rem; margin: 4px 0; }
.day .d-temp { font-size: 0.95rem; }
.day .d-min { color: var(--muted); }
.day .d-rain { font-size: 0.8rem; color: var(--primary); }

.sat-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }

.map { height: 460px; border-radius: 10px; border: 1px solid #dfe8f0; z-index: 0; }

.train-wrap {
  height: 640px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid #dfe8f0;
  overflow: hidden;
}
.train-wrap iframe { width: 100%; height: 100%; border: 0; }

.map-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 10px; font-size: 0.92rem; color: #34495e; }
.map-legend .lg-icon { margin-right: 6px; }
.poi-icon { font-size: 20px; line-height: 26px; text-align: center; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 20px;
}

@media (max-width: 600px) {
  .tab { padding: 8px 12px; font-size: 0.9rem; }
  .now-temp { font-size: 2.4rem; }
  .map { height: 340px; }
  .train-wrap { height: 480px; }
  .meteox-wrap { height: 380px; }
}

/* ---------- Articles BX1 (onglet Actualités) ---------- */
.newslist { list-style: none; padding: 0; margin: 8px 0; }
.newslist li.bx1-item {
  padding: 10px 4px;
  border-bottom: 1px dashed #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.newslist li.bx1-item:last-child { border-bottom: none; }
.bx1-item a { font-weight: 600; text-decoration: none; }
.bx1-item a:hover { text-decoration: underline; }
.bx1-date { color: var(--muted); font-size: 0.82rem; }

/* ---------- Commutateur de média (BX1 / RTBF / Sud Info) ---------- */
.press-sources .btn { min-width: 90px; text-align: center; }
.press-sources .btn.btn-primary { font-weight: 700; }

/* ===== BE-Alert ===== */
.bealert-map {
  height: 380px;
  border-radius: 10px;
  border: 1px solid #dfe8f0;
  margin: 12px 0;
  z-index: 0;
}
.bealert-item {
  background: #fff7f5;
  border: 1px solid #f3c9c0;
  border-left: 5px solid #c0392b;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
}
.bealert-title { font-weight: 700; font-size: 1.02rem; margin-bottom: 4px; }
.bealert-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
.bealert-chip {
  background: #c0392b;
  color: #fff;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 600;
}
.bealert-desc { margin-top: 6px; line-height: 1.45; }
@media (max-width: 600px) { .bealert-map { height: 280px; } }

/* ===== Popup notification (temporaire) ===== */
.popup {
  position: fixed;
  top: 18px;
  right: 18px;
  max-width: 340px;
  background: #fff;
  border: 1px solid #f0c36d;
  border-left: 6px solid #e67e22;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  padding: 16px 18px;
  z-index: 9999;
  animation: PopupIn 0.35s ease-out;
}
@keyframes PopupIn {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}
.popup-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  color: #888;
  line-height: 1;
  padding: 4px;
}
.popup-close:hover { color: #c0392b; }
.popup-icon { font-size: 1.6rem; margin-bottom: 6px; }
.popup-body strong { display: block; margin-bottom: 4px; color: #b9770e; }
.popup-body p { margin: 0 0 10px; font-size: 0.9rem; line-height: 1.45; }
.popup-btn { display: inline-block; }
@media (max-width: 480px) {
  .popup { left: 12px; right: 12px; max-width: none; }
}