/*
 * Barre d'horaires et panneau déroulant (sous le bandeau d'alerte).
 * Couleurs du site : bleu #00428F, bleu clair #D6ECEE / #87CEE0, vert #0AA459.
 * Titres en 'elkwood' (police des titres du thème), texte en Josefin Sans.
 */

.bm-horaires {
  position: relative;
  z-index: 98;
  background: #D6ECEE;
  color: #00428F;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Même largeur que .wrap du thème et que le bandeau d'alerte */
.bm-horaires__container {
  box-sizing: border-box;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

.bm-horaires__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.bm-horaires__left,
.bm-horaires__right {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.bm-horaires__right { gap: 22px; flex-shrink: 0; }

.bm-horaires a { color: inherit; text-decoration: none; }
.bm-horaires a:hover { text-decoration: underline; }

/* Bouton : badge + horaires du jour + « Horaires et contact » */
.bm-horaires__toggle {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.bm-horaires__badge[hidden],
.bm-horaires__today[hidden] { display: none; }

.bm-horaires__today,
.bm-horaires__toggle-label { white-space: nowrap; }

.bm-horaires__badge {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  background: #0AA459;
  color: #FFFFFF;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.bm-horaires__badge.is-ferme { background: #C4161C; }
.bm-horaires__badge-short { display: none; }

.bm-horaires__toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.bm-horaires__toggle-text {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.bm-horaires__toggle .bm-horaires__icon--chevron {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  transition: transform 0.15s;
}

.bm-horaires.is-open .bm-horaires__icon--chevron { transform: rotate(180deg); }

.bm-horaires__icon { flex-shrink: 0; }

.bm-horaires__tel {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.bm-horaires__facebook {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.bm-horaires__facebook svg { display: block; }

.bm-horaires__signaler {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 22px;
  background: #0AA459;
  color: #FFFFFF !important;
  font-size: 1.6rem;
  font-weight: 700;
  white-space: nowrap;
}

.bm-horaires__signaler:hover { background: #088a4b; text-decoration: none !important; }

/* Panneau déroulant */
.bm-horaires__panel[hidden] { display: none; }

.bm-horaires__panel {
  box-sizing: border-box;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  gap: 48px;
  padding: 32px 36px 36px;
  background: #FFFFFF;
  border-top: 4px solid #00428F;
  box-shadow: 0 28px 56px rgba(0, 30, 70, 0.28);
  color: #1A181C;
  font-size: 1.6rem;
  font-weight: 400;
}

.bm-horaires__col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bm-horaires__title {
  position: relative;
  margin: 0 0 4px;
  padding: 0 0 18px;
  color: #1A181C;
  font-family: 'elkwood', sans-serif;
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-transform: uppercase;
}

.bm-horaires__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 42px;
  height: 4px;
  background: #0AA459;
}

.bm-horaires__jours,
.bm-horaires__contact {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bm-horaires__jours li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 10px 14px;
  color: #00428F;
  font-weight: 600;
}

.bm-horaires__jours li.is-today { background: #D6ECEE; font-weight: 700; }

/* Fermetures à venir (exceptions et jours fériés), remplies par horaires.js */
.bm-horaires__exceptions[hidden] { display: none; }

.bm-horaires__exceptions {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bm-horaires__exceptions li {
  margin: 0;
  padding: 8px 14px;
  background: #FFF4B8;
  color: #00428F;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.35;
}

.bm-horaires__note {
  margin: 0;
  padding: 0 14px;
  color: #5B5F66;
  font-size: 1.6rem;
}

.bm-horaires__texte { color: #5B5F66; }
.bm-horaires__texte > *:first-child { margin-top: 0; }
.bm-horaires__texte > *:last-child { margin-bottom: 0; }
.bm-horaires__texte p { margin: 0 0 8px; }

.bm-horaires__lien {
  align-self: flex-start;
  color: #00428F !important;
  font-weight: 700;
  text-decoration: underline !important;
  text-underline-offset: 0.2em;
}

.bm-horaires__contact li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
}

.bm-horaires__contact li.is-strong { font-weight: 700; }
.bm-horaires__contact .bm-horaires__icon { width: 22px; height: 22px; margin-top: 1px; color: #00428F; }
.bm-horaires__contact .is-urgence .bm-horaires__icon { color: #C4161C; }

.bm-horaires__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

/* Boutons Appeler / Itinéraire : même gabarit, seule la couleur change */
.bm-horaires__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 48px;
  padding: 0 26px;
  font-family: 'elkwood', sans-serif;
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none !important;
}

.bm-horaires__btn--appeler {
  background: #0AA459;
  color: #FFFFFF !important;
}

.bm-horaires__btn--appeler:hover { background: #088a4b; }

.bm-horaires__btn--itineraire {
  background: #00428F;
  color: #FFFFFF !important;
}

.bm-horaires__btn--itineraire:hover { background: #003370; }

/* Libellé réservé aux lecteurs d'écran */
.bm-horaires__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.bm-horaires a:focus-visible,
.bm-horaires button:focus-visible {
  outline: 3px solid #FFDD00;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #00428F;
}

@media (min-width: 761px) {
  .bm-horaires__container { position: relative; }
}

@media (min-width: 1025px) {
  .bm-horaires__container { width: 1024px; padding: 0; }
  /* 1024 px : on resserre pour tout loger sur une ligne */
  .bm-horaires__toggle { gap: 12px; }
  .bm-horaires__right { gap: 12px; }
  .bm-horaires__signaler { padding: 0 14px; font-size: 1.4rem; }
}

@media (min-width: 1400px) {
  .bm-horaires__container { width: 1200px; }
  .bm-horaires__toggle { gap: 20px; }
  .bm-horaires__right { gap: 22px; }
  .bm-horaires__signaler { padding: 0 22px; font-size: 1.6rem; }
}

/* Tablette et mobile : badge court + « Signaler », panneau pleine largeur sur une colonne */
@media (max-width: 1024px) {
  .bm-horaires__today { display: none !important; }
  .bm-horaires__tel span {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .bm-horaires__bar { flex-wrap: wrap; min-height: 0; padding: 8px 0; gap: 8px 10px; }
  .bm-horaires__toggle { gap: 8px; }
  .bm-horaires__badge { padding: 0 9px; font-size: 1.2rem; }
  .bm-horaires__badge-long { display: none; }
  .bm-horaires__badge-short { display: inline; }
  .bm-horaires__tel,
  .bm-horaires__facebook { display: none; }
  .bm-horaires__signaler { padding: 0 16px; font-size: 1.5rem; }
  .bm-horaires__signaler .bm-horaires__icon { width: 20px; height: 20px; }

  .bm-horaires__panel {
    flex-direction: column;
    align-items: stretch;
    gap: 28px;
    padding: 20px 16px 24px;
  }
  .bm-horaires__col { flex: 0 0 auto; }
  .bm-horaires__btn { flex: 1 1 0; }
}
