@font-face {
  font-family: droid;
  src: url("../fonts/DroidKufi-Regular-j2cGvqw.woff2") format("woff2"),
       url("../fonts/DroidKufi-Regular-majfOwu.woff") format("woff"),
       url("../fonts/DroidKufi-Regular-uvwx9a8.ttf") format("truetype");
}

html {
  overflow-y: hidden;
  background-color: #000000;
}

body {
  margin: 0;
  padding: 0.2%;
  font-family: Arial, sans-serif;
  overflow: hidden;
}

/* Layout */
#ecran {
  display: table;
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.ecran-spacer {
  display: table-cell;
  width: 0.5%;
}

#ecran .clear {
  display: none;
}

div#sysdate-date {
  display: table-cell;
  vertical-align: top;
  width: 51%;
  padding: 0.5%;
  background: #0a1905;
}

div#horaires {
  display: table-cell;
  vertical-align: top;
  color: #ffffff;
  background: #101032;
  padding: 0.5%;
}

div#breaking-news {
  background: #05061d;
  margin-top: 0.5%;
  height: 20vw;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

/* Jours blancs — titre + 3 lignes de jours, tout dans .jours-blancs-liste.
   Padding latéral pour resserrer la zone de contenu et donner un effet "centré"
   (le bloc reste pleine largeur de #sysdate-date). */
#jours-blancs-ecran {
  padding: 0.3vw 5%;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

#jours-blancs-ecran .jours-blancs-liste {
  display: flex;
  flex-direction: column;
  align-items: center; /* centre titre + items horizontalement */
  /* pas de gap flex (Chromium 74) → margin-bottom sur les enfants si besoin */
}

/* Item = 2 colonnes (FR gauche / AR droite). Largeur 100% du parent .jours-blancs-liste.
   line-height: 1 → compresse la hauteur de chaque ligne sans toucher à la taille du texte. */
.jour-blanc-item {
  display: flex;
  align-items: center;
  width: 100%;
  color: #ffffff;
  font-size: 1.9vw;
  line-height: 1;
}

.jour-blanc-col {
  flex: 1;
}

.jour-blanc-col-fr {
  text-align: left;
}

.jour-blanc-col-ar {
  text-align: right;
  direction: rtl; /* fait couler day_ar → num → month_ar de droite à gauche */
  font-family: droid, Arial, sans-serif;
}

/* Largeurs fixes sur les noms de jours pour que les éléments suivants (num, mois)
   restent alignés verticalement entre les 3 lignes de jours blancs. */
.jour-blanc-day-fr {
  display: inline-block;
  width: 9vw;
  color: #ffffff;
}

.jour-blanc-num-gr {
  font-size: 2vw;
  margin: 0 0.4vw;
}

.jour-blanc-day-ar {
  display: inline-block;
  min-width: 6vw;
  font-size: 1.7vw;
  color: #ffffff;
}

.jour-blanc-num {
  font-size: 2vw;
  font-weight: bold;
  color: #e8e8e8;
  margin: 0 0.5vw;
}

.jour-blanc-month-ar {
  font-size: 1.7vw;
  color: #ffffff;
}

/* Titre "Jours blancs - الأيام البيض" : une seule ligne, au-dessus des 3 jours, centré.
   Couleur dorée/bronze (#d4af37) pour le distinguer du blanc des items et du gold vif (#ffd700)
   réservé au "today". Marges verticales pour aérer du border-top et des items. */
.jours-blancs-titre {
  text-align: center;
  line-height: 1.2;
  margin: 1.1vw;
  white-space: nowrap;
}

.jours-blancs-titre-fr {
  color: #d4af37;
  font-size: 1.9vw;
  font-weight: bold;
}

.jours-blancs-titre-sep {
  color: #d4af37;
  font-size: 1.9vw;
  margin: 0 0.5vw;
  font-weight: bold;
}

.jours-blancs-titre-ar {
  color: #d4af37;
  font-size: 1.9vw;
  font-weight: bold;
  font-family: droid, Arial, sans-serif;
  direction: rtl;
}

/* Phase lunaire : affichée à droite du bloc date (sous l'horloge), dans .date-jour-row.
   Compat Chromium 74 → margin-left (pas de gap dans flex avant Chrome 84). */
#jours-blancs-moon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 1vw;
  flex-shrink: 0;
}

#jours-blancs-moon svg {
  width: 7.5vw;
  height: 7.5vw;
}

/* Wrapper flex row : date à gauche (flex:1, garde son centrage texte interne), lune à droite. */
.date-jour-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1%;
}

#ecran-date-jour {
  flex: 1;
}

.jour-blanc-today .jour-blanc-num,
.jour-blanc-today .jour-blanc-day-fr,
.jour-blanc-today .jour-blanc-num-gr,
.jour-blanc-today .jour-blanc-month-fr,
.jour-blanc-today .jour-blanc-month-ar,
.jour-blanc-today .jour-blanc-day-ar {
  color: #ffd700;
}

/* Ecran date/heure */
#ecran-date-heure .ecran-date-ar {
  font-size: 2.5vw;
  color: #ffffff;
  text-align: center;
  font-family: droid, Arial, sans-serif;
  direction: rtl;
}

#ecran-date-heure .ecran-date-fr {
  font-size: 3vw;
  color: #ffffff;
  text-align: center;
}

#ecran-date-heure .ecran-heure {
  background: #ffffff;
  font-size: 7vw;
  font-weight: bold;
  color: #000000;
  text-align: center;
  border-radius: 15px;
  display: flex;
  align-items: center;
  padding: 0 1vw;
}

#ecran-date-heure .ecran-heure span[data-ecran-prieres-target="heure"] {
  flex: 1;
}

.ecran-countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}

.countdown-time {
  font-size: 2.9vw;
  font-weight: bold;
  color: #000000;
  white-space: nowrap;
}

.countdown-label {
  font-size: 2vw;
  font-weight: normal;
  color: #000000;
  white-space: nowrap;
}

#ecran-date-heure .seconds {
  color: #ccc;
}

/* Horaires */
#horaires .horaire {
  display: flex;
  width: 100%;
  align-items: center;
  border-bottom: 1px dashed #ccc;
}

#horaires .warning {
  background: #3cea0a;
  color: #000;
}

#horaires .next-prayer {
  background: #1a3a5c;
  border-left: 2px solid #4a9fff;
  color: #ffffff;
}

.ecran_label_ar {
  position: relative;
}


.ecran_label,
.ecran_label_ar,
.ecran_heure,
.ecran_heure_khotba {
  display: block;
}

.ecran_label {
  width: 33%;
  text-align: left;
  padding-left: 1%;
  font-size: 2.5vw;
}

.ecran_label_ar {
  width: 33%;
  text-align: right;
  font-size: 2.2vw;
  padding-right: 1%;
  font-family: droid, poppins, Arial, sans-serif;
}

.ecran_heure,
.ecran_heure_khotba {
  width: 34%;
  text-align: center;
  font-size: 3.5vw;
}

/* Délai d'iqama affiché à droite de l'heure (ex: "06h45 +10") — purement informatif.
   min-width réserve la place du plus large (+10) → toutes les lignes restent alignées
   verticalement quelle que soit la valeur (+0 / +7 / +10).
   margin-left = gap entre l'heure et le badge. */
.ecran_iqama {
  display: inline-block;
  min-width: 3.5vw;
  text-align: left;
  margin-left: 1vw;
  font-size: 1.7vw;
  font-style: italic;
  color: #ffffff;
  font-weight: normal;
  vertical-align: middle;
}

div#horaires-vendredi {
  background: #192423 !important;
}

div#horaires-nb {
  background: #192423 !important;
  text-align: center;
  font-size: 1.8vw;
  color: #ffffff;
  font-family: droid, poppins, Arial, sans-serif;
}

/* Ticker / breaking news */
.ticker-content {
  margin: 0;
  padding: 0.5% 0 0.2% 0;
  color: #ffffff;
  overflow: hidden;
  font-size: 3vw;
  text-align: center;
  font-family: droid, poppins, Arial, sans-serif;
}

.ticker-content.big {
  font-size: 5.5vw !important;
}

#ticker-assalate {
  position: relative;
  height: 100%;
  text-align: center;
}

/* Flex (Chrome 29+, OK Chromium 74) plutôt que table/table-cell : le rendu
   table-cell ne remplit pas la table sur le build Chromium 92 Raspbian (armhf)
   → la news se réduisait à son contenu (RTL = collée à droite). Le flex centre
   l'annonce pleine largeur, comme la dua (#duaa-adhan/#duaa-salat) qui marche déjà. */
#ticker-news {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: droid, poppins, Arial, sans-serif;
}

/* .news-item : masquée par défaut, le JS la passe en display:block (et non plus
   table-cell). width:100% + text-align:center → pleine largeur centrée dans le flex.
   color/font-size/padding/text-align sont aussi réutilisés par la dua via cette classe. */
.news-item {
  display: none;
  color: #ffffff;
  font-size: 3vw;
  padding: 1%;
  width: 100%;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  overflow: hidden;
  text-align: center;
}

.news-item p {
  margin: 0;
  font-size: inherit;
  color: inherit;
  text-align: center;
}

/* Dua adhan / Dua salat : injectés dans #ticker-assalate via _showTicker().
   Réutilisent .news-item pour l'apparence (color, font-size, padding, text-align...)
   mais .news-item a display:none + vertical-align:middle (qui ne marche qu'en table-cell).
   #ticker-assalate étant en display:block (et height:100%), on bascule en flex pour
   obtenir le même centrage vertical que les news-items dans #ticker-news. */
#duaa-adhan,
#duaa-salat {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1%;
  /* !important nécessaire car .arabic (app.scss) impose font-family: droid, poppins !important */
  font-family: droid, poppins, Arial, sans-serif !important;
}

/* Branding après breaking-news */
#ecran-branding {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3% 1%;
  color: #ffffff;
  font-size: 1.9vw;
  font-family: monospace;
  overflow: hidden;
  white-space: nowrap;
}

.ecran-branding-link {
  display: flex;
  align-items: center;
  gap: 0.5vw;
  color: #ffffff;
  text-decoration: none;
  font-size: 1.9vw;
}

.ecran-branding-logo {
  height: 2.5vw;
  width: auto;
}

#ecran-back-btn {
  display: none;
  -webkit-box-align: center;
  align-items: center;
  gap: 0.4vw;
  margin-right: 1vw;
  padding: 0.3vw 0.8vw;
  color: #ffffff;
  text-decoration: none;
  font-size: 1.9vw;
  border: 0.15vw solid rgba(255,255,255,0.6);
  border-radius: 2vw;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
}


.ecran-back-icon {
  width: 2.5vw;
  height: 2.5vw;
}

#ecran-debug-url {
  font-size: 1.9vw;
  opacity: 0.8;
  margin-left: 1vw;
}

/* Barre de debug : URL + date — diagnostic Raspberry Pi */
#ecran-debug {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 0.8vw;
  padding: 2px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 99999;
  font-family: monospace;
  line-height: 1.2;
  text-align: center;
}

.phone-alert {
  display: -webkit-box;
  display: flex;
  -webkit-box-orient: horizontal;
  flex-direction: row;
  -webkit-box-align: center;
  align-items: center;
  -webkit-box-pack: center;
  justify-content: center;
  padding: 0 0 0.5vw 0;
  /* Pas de `gap` flex : non supporté avant Chromium 84 (cf. ECRAN_PRIERES_RASPBERRY.md).
     Inutile ici puisque .phone-alert n'a plus qu'un seul enfant (.phone-alert-text). */
}

.phone-alert-text {
  display: flex;
  flex-direction: column;
}

.phone-alert-line1 {
  margin-bottom: 0.4vw;
}

.phone-alert-line2 {
  text-align: center;
}

.phone-alert-icon {
  width: 6.96vw;
  height: 6.96vw;
  -webkit-flex-shrink: 0;
  flex-shrink: 0;
  -webkit-align-self: center;
  align-self: center;
}

/* Icône téléphone silencieux : sortie de #phone-alert et positionnée en absolute
   à droite de #ticker-assalate (parent en position:relative), centrée verticalement. */
#sound-phone-svg {
  position: absolute;
  right: 1vw;
  top: 50%;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  width: 15vw;
  height: 20vw;
}

.phone-alert-ar {
  color: #ffc857;
  font-size: 2.2vw;
  font-family: droid, Arial, sans-serif;
  direction: rtl;
}

.phone-alert-fr {
  color: #ffc857;
  font-size: 2vw;
}

/* Border radius utility */
.border-radius {
  border-radius: 15px;
  border: 1px solid #ffffff;
}
