/**
 * Front-end CSS - Structure et layout
 * Toutes les couleurs utilisent des variables CSS
 * Charger un fichier themes/*.css avant ce fichier
 */

/* ========================================
   Reset global
   ======================================== */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow-x: hidden;
  max-width: 1080px !important;
  margin: 0 auto !important;
}

body {
  margin: 0;
  color: var(--text);
  font: 400 var(--fs-md)/1.5 system-ui, Segoe UI, Roboto, Arial, sans-serif;
  background-color: var(--bg);
  background-image: linear-gradient(
    135deg,
    var(--panel) 0%,
    var(--bg) 25%,
    var(--bg) 50%,
    var(--panel) 75%,
    var(--bg) 100%
  );
  background-size: 400% 400%;
  background-attachment: fixed;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow-x: hidden;
}

body,
.card,
.panel,
.badge,
.pill,
button {
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

/* ========================================
   Layout principal
   ======================================== */
.container {
  min-height: 100dvh;
  display: grid;
  gap: var(--gap);
  padding: var(--gap);
  grid-auto-rows: auto;
  overflow-x: hidden !important;
}

@media (orientation: landscape) {
  .container {
    grid-auto-rows: auto;
  }
}

/* ========================================
   Cards et panels
   ======================================== */
.card, .panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 6px);
  box-shadow: var(--shadow);
  padding: clamp(12px, 1.8vw, 18px);
}

.card {
  border-radius: var(--radius);
  padding-top: clamp(5px, 1.5vw, 5px);
  padding-right: clamp(12px, 1.8vw, 18px);
  padding-bottom: clamp(5px, 1.8vw, 5px);
  padding-left: clamp(12px, 1.8vw, 18px);
  overflow-x: hidden !important;
  overflow-y: hidden !important;
}

.ratp-wrap {
  padding-top: clamp(5px, 1.5vw, 5px);
  padding-right: clamp(5px, 2.2vw, 5px);
  padding-bottom: clamp(5px, 1.8vw, 5px);
  padding-left: clamp(5px, 2.2vw, 5px);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.between {
  justify-content: space-between;
}

.wrap {
  flex-wrap: wrap;
}

/* ========================================
   Zone 1: Date / Heure
   ======================================== */
.row-date-time {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--gap);
  align-items: stretch;
}

.date-box, .time-box {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.date {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.date .weekday {
  font-size: var(--fs-md);
  color: var(--muted);
  letter-spacing: .02em;
}

.date .full-date {
  font-size: var(--fs-lg);
  font-weight: 700;
}

.time {
  display: flex;
  align-items: baseline;
  gap: .25em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.time .hhmm {
  font-size: clamp(48px, 10vw, 120px);
  font-weight: 800;
  letter-spacing: .02em;
}

.time .sec {
  font-size: clamp(18px, 2.2vw, 28px);
  color: var(--muted);
  transform: translateY(8%);
}

/* ========================================
   Titles
   ======================================== */
.title {
  font-size: var(--fs-md);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

/* ========================================
   RATP - Structure générale
   ======================================== */
.rtp {
  display: grid;
  gap: 14px;
}

.rtp-card {
  display: grid;
  gap: 10px;
}

.rtp-title {
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 800;
}

.rtp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 2px 0;
  border-top: 1px solid var(--border);
}

.rtp-row:last-child {
  border-bottom: 1px solid var(--border);
}

/* ========================================
   Chips (temps d'attente)
   ======================================== */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 4px 10px;
  border-radius: 10px;
  background: var(--chip-bg);
  color: var(--chip-text);
  font: 800 65px/1 system-ui;
}

.chip .min {
  font-size: 30px;
}

.chip.chip--rt {
  gap: 6px;
  padding-inline: 10px;
  min-width: 180px;
  justify-content: flex-start;
}

.chip-radar {
  position: relative;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-45deg);
  top: -5px;
  left: -5px;
}

.chip-radar::before,
.chip-radar::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--warning);
  border-color: var(--warning) transparent transparent transparent;
  transform-origin: center bottom;
  animation: radar-arc 2s infinite ease-in-out;
}

.chip-radar::before {
  inset: 1px;
}

.chip-radar::after {
  inset: 5px;
  animation-delay: 0.25s;
}

@keyframes radar-arc {
  0% { transform: scale(0.9); opacity: 0.3; }
  50% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.10); opacity: 0.4; }
}

.chip-text {
  display: inline-flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-width: 90px;
  flex: 1 1 auto;
}

.chip-text .min {
  font-size: 30px;
  line-height: 1;
  margin-left: 0.15em;
}

/* ========================================
   RER - Styles spécifiques
   ======================================== */
.rer-card .hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.rer-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--rer-bg);
  color: var(--rer-text);
  font: 800 15px system-ui;
}

.rer-title {
  font: 800 20px system-ui;
}

.rer-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 900px) {
  .rer-grid {
    grid-template-columns: 1fr;
  }
}

.rer-panel h4 {
  margin: 0 0 8px;
  font: 700 16px system-ui;
  color: var(--table-header-accent);
  border-left: 4px solid var(--table-header-accent);
  padding-left: 8px;
}

.rer-table {
  width: 100%;
  border-collapse: collapse;
}

.rer-table thead th {
  text-align: left;
  font: 700 13px/1.2 system-ui;
  color: var(--table-header-text);
  background: var(--table-header-bg);
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
}

.rer-table thead th:last-child {
  text-align: right;
}

.rer-table tbody td {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 30px;
  font-weight: bold;
}

.rer-mission {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--rer-mission-bg);
  color: var(--rer-mission-text);
  font: 800 12px system-ui;
}

.rer-time {
  display: inline-flex;
  align-items: flex-end;
  justify-content: end;
  min-width: 180px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--rer-time-bg);
  color: var(--rer-time-text);
  font: 800 65px system-ui;
}

.rer-time .val {
  line-height: 1;
}

.rer-time .min {
  font-size: 30px;
  line-height: 1;
}

.rer-muted {
  color: var(--muted);
}

/* ========================================
   Badges de mise à jour
   ======================================== */
.upd-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 12px/1 system-ui;
  color: var(--badge-text);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  padding: 6px 10px;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.upd-badge .progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--badge-progress-start), var(--badge-progress-end));
  transform-origin: left;
}

.upd-badge .progress-bar.animate {
  animation: progress-countdown 15s linear forwards;
}

@keyframes progress-countdown {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.upd-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--badge-dot);
  box-shadow: 0 0 8px var(--badge-dot);
}

/* ========================================
   Météo
   ======================================== */
.meteo-grid {
  display: block;
}

.meteo-hour-pills-row {
  white-space: nowrap;
  scrollbar-width: thin;
}

.meteo-hour-pills-row .pill {
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  .meteo-grid {
    grid-template-columns: 1fr;
  }
}

.meteo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-size: var(--fs-sm);
}

.pill b {
  font-weight: 700;
  letter-spacing: .02em;
}

.pill .pc {
  color: var(--muted);
}

.pill .temp {
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.badge .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--badge-dot);
  box-shadow: 0 0 8px var(--badge-dot);
}

/* Météo compact & carte */
.meteo--compact .panel {
  padding: 12px;
}

.meteo-card {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
  align-items: start;
}

@media (max-width: 900px) {
  .meteo-card {
    grid-template-columns: 1fr;
  }
}

.meteo-left {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 6px;
}

.meteo-top {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.meteo-top .place-tag {
  font: 700 clamp(18px, 2.2vw, 24px)/1.1 system-ui;
  padding: 4px 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.meteo-top .place-tag .pin {
  font-size: 0.9em;
  opacity: 0.75;
  transform: translateY(1px);
}

.meteo-top .temp {
  font-size: clamp(24px, 3.3vw, 36px);
  font-weight: 800;
}

.meteo-top .minmax {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.meteo-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.meteo-kv {
  padding: 6px 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--meteo-kv-bg);
  font-size: 18px;
}

.meteo-kv .k {
  font-size: 12px;
  color: var(--muted);
}

.meteo-kv .v {
  font-weight: 700;
}

.meteo-rainline {
  font-weight: 700;
  color: var(--meteo-text-primary);
  font-size: var(--fs-sm);
  margin-top: 2px;
}

.meteo-rainline--muted {
  color: var(--muted);
}

.meteo-rainline--active {
  background-color: var(--meteo-rainline-active-bg);
  border-left: 3px solid var(--meteo-rainline-active-border);
  padding-left: 8px;
  border-radius: 4px;
}

.meteo-right {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--meteo-bg-gradient);
  padding: 10px;
}

.meteo-right .tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.meteo-right .tab {
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  cursor: default;
}

.meteo-right .unit {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.meteo--compact {
  padding-top: clamp(10px, 1.5vw, 18px);
  padding-right: clamp(14px, 2.2vw, 22px);
  padding-bottom: clamp(5px, 1.8vw, 5px);
  padding-left: clamp(14px, 2.2vw, 22px);
}

/* ========================================
   Graphiques météo (Sparkline)
   ======================================== */
.spark-wrap {
  position: relative;
  height: 140px;
}

.spark-wrap svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.spark-grid line {
  stroke: var(--spark-grid);
  stroke-width: 1;
}

.spark-grid-vert line {
  stroke: var(--spark-grid-vert);
  stroke-width: 1;
}

.spark-dots circle {
  r: 2.6;
  fill: var(--spark-dots);
}

.spark-axis text {
  font-size: 11px;
  fill: var(--spark-text);
  dominant-baseline: hanging;
}

.spark-path {
  fill: var(--spark-fill);
  stroke: var(--spark-line);
  stroke-width: 2;
}

/* ========================================
   Semaine météo
   ======================================== */
.days {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.day {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--day-bg);
  white-space: nowrap;
}

.day h5 {
  margin: 0;
  font: 700 16px/1.2 system-ui;
  min-width: 30px;
  color: var(--day-title);
}

.day .wx {
  font-size: 20px;
}

.day .tt {
  font-size: 14px;
  display: flex;
  gap: 4px;
  font-weight: 600;
}

.day .rain, .day .wind {
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  border: 1px solid transparent;
}

.day .rain {
  background: var(--day-rain-bg);
  color: var(--day-rain-text);
  border-color: var(--day-rain-border);
}

.day .wind {
  background: var(--day-wind-bg);
  color: var(--day-wind-text);
  border-color: var(--day-wind-border);
}

.day .wind .arrow {
  font-weight: 900;
}

/* ========================================
   Alerts
   ======================================== */
.alerts {
  display: grid;
  grid-auto-rows: minmax(56px, auto);
  gap: 12px;
}

.alert {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: calc(var(--radius) - 6px);
  border: 1px dashed var(--border);
  background: var(--alert-bg);
}

.alert .dot {
  inline-size: 14px;
  block-size: 14px;
  border-radius: 999px;
  background: var(--warning);
  box-shadow: 0 0 8px var(--shadow-warning);
  flex: none;
}

.alert--danger .dot {
  background: var(--danger);
  box-shadow: 0 0 8px var(--shadow-danger);
}

/* ========================================
   Mobile - Météo
   ======================================== */
@media (max-width: 600px) {
  .meteo-card {
    grid-template-columns: 1fr;
  }

  .meteo-hour-pills-row {
    white-space: normal;
    overflow-x: visible;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .meteo-hour-pills-row .pill {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }

  .days {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .day {
    flex: 1 1 calc(50% - 8px);
    white-space: normal;
  }

  .meteo-hourline {
    display: flex !important;
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    gap: 6px;
  }

  .meteo-hourline .hitem {
    display: flex !important;
    flex: 0 0 calc(50% - 6px);
    box-sizing: border-box;
    justify-content: flex-start;
  }

  .day {
    flex: 1 1 100%;
  }
}

/* ========================================
   RATP - Structure verticale unifiée
   ======================================== */
.ratp-wrap .title {
  font-size: var(--fs-md);
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 0 0 12px;
}

.ratp-stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.ratp-stack > * {
  min-width: 0;
}

/* Carte commune */
.tcard {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(14px, 2vw, 22px);
  min-width: 0;
  padding-top: clamp(5px, 1.5vw, 5px);
  padding-right: clamp(14px, 2.2vw, 22px);
  padding-bottom: clamp(5px, 1.8vw, 5px);
  padding-left: clamp(14px, 2.2vw, 22px);
}

.tcard .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.tcard .head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tcard .station {
  font: 800 clamp(16px, 2vw, 22px) system-ui;
  letter-spacing: .01em;
}

/* ========================================
   Badge de ligne
   ======================================== */
.line-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font: 800 14px/1 system-ui;
  border: 1px solid var(--border);
  background: var(--panel);
}

.line-badge .round {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: var(--chip-text);
  font: 900 14px system-ui;
}

/* Variantes Bus */
.t-bus .round {
  background: var(--bus-icon-bg);
}

.t-bus .num {
  background: var(--bus-number-bg);
  color: var(--bus-number-text);
  padding: 2px 8px;
  border-radius: 6px;
  border: 2px solid var(--bus-number-border);
  font: 900 16px system-ui;
}

/* Variantes RER */
.t-rer .round {
  background: var(--rer-bg);
}

.t-rer .letter {
  font: 900 14px system-ui;
}

/* ========================================
   Cartouche localisation
   ======================================== */
.place-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--place-border);
  border-radius: 12px;
  background: var(--place-bg);
  color: var(--place-text);
  font: 700 14px/1.1 system-ui;
  box-shadow: var(--shadow);
}

.place-tag .pin {
  font-size: 14px;
  opacity: .7;
}

@media (max-width: 900px) {
  .place-tag {
    padding: 6px 10px;
    font-weight: 700;
  }
}

/* ========================================
   TICKER PRIM - Alertes RER
   ======================================== */
.ticker-simple {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  border-left: 4px solid;
  font-size: 16px;
  line-height: 1.4;
  min-height: 48px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  z-index: 1;
  contain: layout;
}

.ticker-simple * {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.ticker-simple.hidden {
  display: none;
}

.ticker-icon {
  flex-shrink: 0;
  font-size: 18px;
}

.ticker-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  max-width: calc(100% - 100px);
  width: 100%;
}

.ticker-text {
  display: inline-block;
  white-space: nowrap;
  transform: translateX(0);
}

.ticker-badge {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  opacity: 0.9;
}

/* Niveaux de couleur ticker */
.ticker-simple.level-yellow {
  background: var(--ticker-yellow-bg);
  border-color: var(--ticker-yellow-border);
  color: var(--ticker-yellow-text);
}

.ticker-simple.level-orange {
  background: var(--ticker-orange-bg);
  border-color: var(--ticker-orange-border);
  color: var(--ticker-orange-text);
}

.ticker-simple.level-red {
  background: var(--ticker-red-bg);
  border-color: var(--ticker-red-border);
  color: var(--ticker-red-text);
}

/* ========================================
   ANNONCES
   ======================================== */
.ann-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 900px) {
  .ann-wrap {
    grid-template-columns: 1fr;
  }
}

.ann-card {
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--panel);
  box-shadow: var(--ann-shadow);
}

.ann-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ann-border);
}

.ann-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.ann-date {
  font-size: 12px;
  opacity: .7;
}

.ann-body {
  --ann-line-height: 1.35;
  --ann-lines: 3;
  margin-top: 10px;
  font-size: 20px;
  line-height: var(--ann-line-height);
  color: var(--text);
  max-height: calc(var(--ann-line-height) * var(--ann-lines) * 1em);
  overflow: hidden;
  position: relative;
}

.ann-text {
  white-space: normal;
  will-change: transform;
}

/* Badge épinglé */
.ann-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.ann-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  font-size: 12px;
  border-radius: 999px;
  padding: 0 6px;
  background: var(--ann-pin-bg);
}

/* Effet de fondu pour le défilement */
.ann-body.scrolling {
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,1) 5%,
    rgba(0,0,0,1) 95%,
    rgba(0,0,0,0) 100%
  );
  mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,1) 5%,
    rgba(0,0,0,1) 95%,
    rgba(0,0,0,0) 100%
  );
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

/* ========================================
   Grille d'annonces (structure de base)
   Les layouts spécifiques sont dans /layouts/*.css
   ======================================== */
.ann-grid {
  display: grid;
  gap: var(--ann-gap, 16px);
}

/* Fallback si peu d'éléments */
.ann-grid:has(.ann:nth-child(1)):not(:has(.ann:nth-child(3))) {
  grid-template-columns: 1fr;
}

/* Overrides par carte (utilisables avec tous les layouts) */
.ann-grid .ann.span-full {
  grid-column: span 2;
}

.ann-grid .ann.span-row {
  grid-column: 1 / -1;
}

.ann-grid .ann.takeover {
  grid-column: 1 / -1;
}

/* ========================================
   Panel pour les annonces
   ======================================== */
.panel-head {
  margin-bottom: 12px;
}

.panel-body {
  /* Conteneur des annonces */
}

/* ========================================
   Utilitaires
   ======================================== */
.hidden {
  display: none;
}

/* ========================================
   Titres dans les annonces
   ======================================== */
.panel-body article .ann-text h1,
.panel-body article .ann-body .ann-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0.5rem 0;
  padding: 0;
  line-height: 1.3;
}

.panel-body article .ann-text h2,
.panel-body article .ann-body .ann-text h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent-dark);
  margin: 0.4rem 0;
  padding: 0;
  line-height: 1.25;
}

.panel-body article .ann-text h3,
.panel-body article .ann-body .ann-text h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0.3rem 0;
  padding: 0;
  line-height: 1.2;
}

> div.panel-body > div > article > div > div > h1,
> div.panel-body > div > article > div > div > h2,
> div.panel-body > div > article > div > div > h3 {
  max-width: 100%;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Titres en mode sombre */
body[data-theme="dark"] .panel-body article .ann-text h1,
body[data-theme="dark"] .panel-body article .ann-body .ann-text h1 {
  color: var(--accent-light);
  border-bottom-color: var(--border);
}

/* Mobile - titres */
@media (max-width: 768px) {
  .panel-body article .ann-text h1,
  .panel-body article .ann-body .ann-text h1 {
    font-size: 1.3rem;
  }
  
  .panel-body article .ann-text h2,
  .panel-body article .ann-body .ann-text h2 {
    font-size: 1.2rem;
  }
  
  .panel-body article .ann-text h3,
  .panel-body article .ann-body .ann-text h3 {
    font-size: 1.1rem;
  }
}

/* ========================================
   Mobile - Annonces
   ======================================== */
@media (max-width: 600px) {
  #z4-annonces .ann-grid {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
  }

  #z4-annonces .ann-grid .ann {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    grid-column: auto !important;
  }

  body[data-theme] main.container {
    padding: 10px !important;
    gap: 10px !important;
  }

  body[data-theme] section.ratp-wrap {
    padding: 5px !important;
  }

  body[data-theme] section.meteo--compact,
  body[data-theme] section.meteo--compact .panel {
    padding: 5px !important;
  }

  body[data-theme] section.row-date-time .card {
    padding: 5px !important;
  }

  body[data-theme] section#z4-annonces {
    padding: 5px !important;
  }

  /* Lignes bus → RER : layout en 2 colonnes fixes */
  .rtp-row {
    display: grid;
    grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
    column-gap: 8px;
    align-items: center;
    padding: 10px 0;
  }

  .rtp-row > div:first-child {
    font: 700 14px/1.2 system-ui;
  }

  .rtp-row > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
  }

  .t-bus .chip {
    min-width: 52px;
    padding: 6px 8px;
    font-size: 60px;
  }

  .t-bus .chip span.min {
    font-size: 30px;
  }
}

/* ========================================
   Effets smooth pour hot reload
   ======================================== */
#annonces-panel {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

#annonces-panel.ann-fade-out {
  opacity: 0;
  transform: translateY(4px);
}

#annonces-panel.ann-fade-in {
  opacity: 1;
  transform: translateY(0);
}
