/**
 * Front-end CSS - Styles unifiés pour le panneau d'information
 * Préserve toutes les fonctionnalités existantes
 */

/* ========================================
   Variables CSS et reset global
   ======================================== */
:root {
  --bg: #f0f4f9;
  --panel: #fff;
  --panel-2: #f3f6fa;
  --text: #0a0f1a;
  --muted: #374151;
  --accent: #0284c7;
  --warning: #f59e0b;
  --danger: #dc2626;
  --border: #d6dde6;
  --shadow: 0 6px 26px rgba(0,0,0,.08);
  --radius: 18px;
  --gap:5px;
  --fs-xl: clamp(28px,4.4vw,56px);
  --fs-lg: clamp(22px,3.3vw,36px);
  --fs-md: clamp(16px,2.2vw,22px);
  --fs-sm: clamp(14px,1.6vw,18px);
}

* {
  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: clamp(14px, 2.2vw, 22px);*/
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{
  /* Contrôle individuel de chaque côté */
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);
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 4px 10px;
  border-radius: 10px;
  background: #111;
  color: #fff;
  font: 800 65px/1 system-ui;
}
.chip .min{
  font-size: 30px;
}
/* Radar temps réel sur les pills bus */
/* Radar temps réel sur les pills bus */
.chip.chip--rt {
  gap: 6px;
  padding-inline: 10px;
  min-width: 180px;
  justify-content: flex-start;   /* radar + texte alignés à gauche */
}

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

/* Les arcs du radar, animés directement */
.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;
}

/* arc externe */
.chip-radar::before {
  inset: 1px;
}

/* arc interne, léger décalage pour l'effet */
.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;
  }
}

/* Zone texte "X mn" */
.chip-text {
  display: inline-flex;
  align-items: flex-end;
  justify-content: flex-end;     /* le texte se cale à droite dans sa boîte */
  min-width: 90px;               /* largeur fixe à ajuster selon ton feeling */
   flex: 1 1 auto;                /* prend tout l’espace restant dans la chip */
}
.chip-text .min {
  font-size: 30px;
  line-height: 1;
  margin-left: 0.15em;           /* petit espace propre entre nombre et mn */
}

/* Radar temps réel sur les pills bus */


/* ========================================
   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: #f71300;
  color: #fff;
  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: #0b3a66;
  border-left: 4px solid #0b3a66;
  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: #334155;
  background: #eef3fb;
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
}

.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: #113;
  color: #fff;
  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: #0a0a0a;
  color: #fff;
  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);
}

.upd-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 12px/1 system-ui;
  color: #0b3a66;
  background: #eef7ff;
  border: 1px solid #cfe3fb;
  padding: 6px 10px;
  border-radius: 999px;
}

.upd-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0ea5e9;
  box-shadow: 0 0 8px rgba(14, 165, 233, .55);
}

/* ========================================
   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; /* empêche le shrink */
}

@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: #fff;
  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: #eef7ff;
  color: #0b3a66;
  border: 1px solid #cfe3fb;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.badge .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0ea5e9;
  box-shadow: 0 0 8px rgba(14, 165, 233, .6);
}

/* 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;
}

/* Bulle commune pour la localisation */
.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: #fff;
  font-size: 18px;
}

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

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

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

.meteo-rainline--muted {
  color: var(--muted);
}
.meteo-rainline--active {
  background-color: rgba(0, 102, 204, 0.15);
  border-left: 3px solid #06c;
  padding-left: 8px;
  border-radius: 4px;
}
.meteo-right {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  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: #fff;
  cursor: default;
}

.meteo-right .unit {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}
 .meteo--compact {
  /* Contrôle individuel de chaque côté */
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);
}
.spark-wrap {
  position: relative;
  height: 140px;
}

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

.spark-grid line {
  stroke: #e8eef6;
  stroke-width: 1;
}

.spark-grid-vert line {
  stroke: #eef2f7;
  stroke-width: 1;
}

.spark-dots circle {
  r: 2.6;
  fill: #0284c7;
}

.spark-axis text {
  font-size: 11px;
  fill: #64748b;
  dominant-baseline: hanging;
}

/* Sparkline couleurs (ligne + aplat) */
.spark-path {
  fill: rgba(2, 132, 199, .06);  /* aplat bleu très léger */
  stroke: #0284c7;               /* trait bleu */
  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: #fff;
  white-space: nowrap;
}

.day h5 {
  margin: 0;
  font: 700 16px/1.2 system-ui;
  min-width: 30px;
  color: #0b3a66;
}

.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: #e6f4ff;
  color: #005fa3;
  border-color: #bfe3ff;
}

.day .wind {
  background: #fff2d9;
  color: #995c00;
  border-color: #ffe3b5;
}

.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: #fff;
}

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

.alert--danger .dot {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(220, 38, 38, .6);
}

/* =======================
   Météo – version mobile
   Empilage sans scroll horizontal
   ======================= */
@media (max-width: 600px) {


  /* La carte passe déjà en 1 colonne à 900px,
     on renforce pour les petits écrans */
  .meteo-card {
    grid-template-columns: 1fr;
  }

  /* Pills horaires : on wrap et on met 2 par ligne */
  .meteo-hour-pills-row {
    white-space: normal;      /* plus de nowrap */
    overflow-x: visible;      /* plus de scroll interne */
    display: flex;            /* au cas où */
    flex-wrap: wrap;
    gap: 8px;
  }

  .meteo-hour-pills-row .pill {
    flex: 1 1 calc(50% - 8px); /* ≈ 2 pills par ligne */
    min-width: 0;
  }

  /* Pills "Cette semaine" : idem, on wrap */
  .days {
    flex-wrap: wrap;         /* au lieu de nowrap */
    overflow-x: visible;     /* plus de scroll */
  }

  .day {
    flex: 1 1 calc(50% - 8px); /* 2 jours par ligne si ça tient */
    white-space: normal;       /* autorise le retour à la ligne dans le texte */
  }
}
/* =======================
   Météo – version mobile
   Empilage sans scroll horizontal
   ======================= */
@media (max-width: 600px) {

  .meteo-card {
    grid-template-columns: 1fr;
  }

 /* === Heures : 2 pills par ligne, sans scroll horizontal === */
  .meteo-hourline {
    display: flex !important;          /* on garde flex mais on force le wrap */
    flex-wrap: wrap !important;
    overflow-x: visible !important;    /* casse le overflow-x:auto inline */
    gap: 6px;
  }

  .meteo-hourline .hitem {
    display: flex !important;          /* remplace inline-flex inline */
    flex: 0 0 calc(50% - 6px);         /* ≈ 2 par ligne */
    box-sizing: border-box;
    justify-content: flex-start;
  }


  /* Pills "Cette semaine" : OK comme tu as déjà */
  .days {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .day {
    flex: 1 1 100%;
    white-space: normal;
  }
}


/* ========================================
   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;
}

.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;
}
.tcard {
  /* Contrôle individuel de chaque côté */
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);
}



/* 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: #fff;
}

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

/* Variantes */
.t-bus .round {
  background: #111;
}

.t-bus .num {
  background: #d9d818;
  color: #111;
  padding: 2px 8px;
  border-radius: 6px;
  border: 2px solid #111;
  font: 900 16px system-ui;
}

.t-rer .round {
  background: #f71300;
}

.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(--border);
  border-radius: 12px;
  background: #f6f8fb;
  color: #0b3a66;
  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 - Approche propre
   ======================================== */
.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;
  
  /* 🔥 CONTRÔLE STRICT de la largeur */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden; /* Force le masquage */
    position: relative;
  z-index: 1;
  contain: layout; /* Empêche les débordements d'affecter le parent */
}
.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; /* Permet au flex de rétrécir sous sa taille naturelle */
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  
  /* 🔥 LARGEUR FORCÉE - empêche le débordement */
  max-width: calc(100% - 100px); /* Reserve space for icon + badge */
  width: 100%;
}

.ticker-text {
  display: inline-block;
  white-space: nowrap;
  /* Position initiale pour défilement */
  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-simple.level-yellow {
  background: #fef9c3;
  border-color: #eab308;
  color: #713f12;
}

.ticker-simple.level-orange {
  background: #ffedd5;
  border-color: #f97316;
  color: #9a3412;
}

.ticker-simple.level-red {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}


/* ========================================
   ANNONCES
   ======================================== */
.ann-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 colonnes sur écran large */
  gap: 12px;
}

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

.ann-card {
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--panel, #fff);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}

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

.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, #0a0f1a);
  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: rgba(0, 0, 0, .08);
}

/* Effet de fondu pour le défilement */
.ann-body.scrolling {
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,   /* totalement transparent en haut */
    rgba(0,0,0,1) 5%,  /* devient opaque */
    rgba(0,0,0,1) 95%,  /* opaque sur toute la zone centrale */
    rgba(0,0,0,0) 100%  /* redevient transparent en bas */
  );
  mask-image: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,   /* totalement transparent en haut */
    rgba(0,0,0,1) 5%,  /* devient opaque */
    rgba(0,0,0,1) 95%,  /* opaque sur toute la zone centrale */
    rgba(0,0,0,0) 100%  /* redevient transparent en bas */
  );
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

/* ========================================
   Grille d'annonces (scopée au widget)
   ======================================== */
.ann-grid {
  display: grid;
  gap: var(--ann-gap, 16px);
}

/* Fallbacks intelligents si peu d'éléments */
.ann-grid:has(.ann:nth-child(1)):not(:has(.ann:nth-child(3))) {
  grid-template-columns: 1fr;  /* 1 ou 2 cartes → 1 colonne */
}

@supports not(selector(:has(*))) {
  /* Fallback si :has non supporté */
}

/* Templates */
/* 2x2 (défaut) */
.ann-grid.layout-grid-2x2 {
  grid-template-columns: repeat(2, 1fr);
}

/* 3 + 3 (défaut) */
.ann-grid.layout-grid-3plus3 {
  grid-template-columns: repeat(3, 1fr);
}

/* 1 plus 2 */
.ann-grid.layout-grid-1plus2 {
  grid-template-columns: repeat(2, 1fr);
}

.ann-grid.layout-grid-1plus2 .ann:nth-child(1) {
  grid-column: 1 / span 2;
}

/* 2 plus 1 */
.ann-grid.layout-grid-2plus1 {
  grid-template-columns: repeat(2, 1fr);
}

.ann-grid.layout-grid-2plus1 .ann:nth-last-child(1) {
  grid-column: 1 / span 2;
}

/* 1 plus 3 */
.ann-grid.layout-grid-1plus3 {
  grid-template-columns: repeat(3, 1fr);
}

.ann-grid.layout-grid-1plus3 .ann:nth-child(1) {
  grid-column: 1 / -1;
}

/* 3 plus 1 */
.ann-grid.layout-grid-3plus1 {
  grid-template-columns: repeat(3, 1fr);
}

.ann-grid.layout-grid-3plus1 .ann:nth-last-child(1) {
  grid-column: 1 / -1;
}

/* Full */
.ann-grid.layout-grid-full {
  grid-template-columns: 1fr;
}

/* Overrides par carte */
.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;
}

/* Styles pour les titres dans les annonces */

/* Ciblage général de tous les 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, #0066cc);
    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, #0055aa);
    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, #333333);
    margin: 0.3rem 0;
    padding: 0;
    line-height: 1.2;
}

/* Version plus spécifique selon votre sélecteur */
> div.panel-body > div > article > div > div > h1,
> div.panel-body > div > article > div > div > h2,
> div.panel-body > div > article > div > div > h3 {
    /* Ces styles s'ajoutent aux précédents pour les cas spécifiques */
    max-width: 100%;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Styles supplémentaires pour les titres en mode sombre si nécessaire */
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, #4d8bdd);
    border-bottom-color: var(--border, #444);
}

/* Ajustement pour mobile */
@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;
    }
}
/* =======================
   Annonces – version mobile
   ======================= */
@media (max-width: 600px) {

  /* On force un layout en colonne pour toutes les grilles */
  #z4-annonces .ann-grid {
    display: flex !important;          /* on casse le grid du widget */
    flex-direction: column;
    gap: 12px;                         /* espace entre les annonces */
  }

  #z4-annonces .ann-grid .ann {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    grid-column: auto !important;      /* neutralise les span 2 / full, etc. */
  }
}

@media (max-width: 600px) {
  body[data-theme] main.container {
    padding: 10px !important;
    gap: 10px !important;
  }


body[data-theme] article.card, body[data-theme] article.panel, body[data-theme] article.tcard{
    padding: 5px !important;
    gap: 10px !important;
    background-color: red!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 de correspondance bus → RER */
 /* 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;
  }

  /* Colonne destination (texte) */
  .rtp-row > div:first-child {
    font: 700 14px/1.2 system-ui; /* un peu plus compact */
  }

  /* Colonne minutes (pills) */
  .rtp-row > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
  }

  /* Pills un peu compactes dans cette zone */
  .t-bus .chip {
    min-width: 52px;
    padding: 6px 8px;
    font-size: 60px;
  }
  .t-bus .chip span.min{
    font-size: 30px;
  }

}

/* Effet smooth pour la zone annonces lors du 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);
}

