/* =========================================================
   Schilo – Fil d’Ariane Thématique (STB)
   ========================================================= */

/* -------------------------
   Base bar placement
-------------------------- */
.stb-bar{
  position: fixed;
  left: 0;
  right: 0;
  z-index: 999999;

  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 14px;

  background: rgba(20,20,20,.92);
  color: #fff;
  backdrop-filter: blur(6px);
}

.stb-top{ top: 0; }
.stb-bottom{ bottom: 0; }

/* -------------------------
   Layout
-------------------------- */
.stb-inner{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
}

.stb-left{
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 140px;
}

.stb-title{ font-weight: 700; }
.stb-sub{ opacity: .85; font-size: 12px; }

/* -------------------------
   Toggle (Afficher/Masquer) – style "badge" comme .stb-prefix
-------------------------- */
.stb-linkbtn{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .25);
  /*border: 0;*/
 /* background: rgba(255,255,255,.12);*/
  background: transparent;
  color: #fff;

  font-size: 12px;
  font-weight: 600;
  line-height: 1;

  cursor: pointer;
  text-decoration: none;
  opacity: .95;

  transition: background .15s ease, opacity .15s ease, transform .05s ease;
}

.stb-linkbtn:hover{
  /*background: rgba(255,255,255,.18);*/
  background: #00b4cc;
  opacity: 1;
}

.stb-linkbtn:active{
  transform: translateY(1px);
}

.stb-linkbtn:focus-visible{
  outline: 2px solid rgba(255,255,255,.35);
  outline-offset: 2px;
}

/* -------------------------
   Trail
-------------------------- */
.stb-trail{
  flex: 1;
  overflow: auto;
  white-space: nowrap;
}

.stb-item{
  color: #fff !important;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 10px;

  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.stb-item:hover{
  background: rgba(255,255,255,.10);
  color: #00b4cc !important;
}

.stb-prefix{
  font-size: 12px;
  opacity: .9;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
}

.stb-text{
  display: inline-block;
  max-width: 20ch;          /* ≈ 20 caractères */
  white-space: normal;      /* autorise les retours à la ligne */
  overflow-wrap: anywhere;  /* coupe même sans espaces si besoin */
  word-break: break-word;   /* fallback */
  line-height: 1.2;

  opacity: .95;
  font-size: .8rem;
}

.stb-sep{ margin: 0 6px; opacity: .80; }

/* -------------------------
   Actions (droite)
-------------------------- */
.stb-actions{ display: flex; gap: 8px; }

.stb-btn{
  border: 1px solid rgba(255,255,255,.25);
  background: transparent;
  color: #fff;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.stb-btn:hover{ 
  /*background: rgba(255,255,255,.10); */
  background: #00b4cc;
}

.stb-empty,
.stb-loading{ opacity: .8; }

/* =========================================================
   MODE BAS : hauteur fixe + scroll interne
   ========================================================= */
.stb-bar.stb-bottom{
  height: 110px;
  max-height: 110px;
}

.stb-bar.stb-bottom .stb-inner{
  align-items: flex-start;
}

/* Zone du fil scrollable */
.stb-bar.stb-bottom .stb-trail{
  max-height: 78px;
  overflow-y: auto;
  white-space: normal;
  padding-right: 6px;
}

/* Mode agrandi */
.stb-bar.stb-bottom.is-expanded{
  height: 260px;
  max-height: 260px;
}

.stb-bar.stb-bottom.is-expanded .stb-trail{
  max-height: 228px;
}

/* =========================================================
   MODE FIL MASQUÉ : mini-bloc à gauche (pas full width)
   -> Ne montrer que Navigation + bouton toggle
   ========================================================= */
.stb-bar.is-trail-hidden{
  right: auto !important;          /* annule le full width */
  width: fit-content !important;   /* largeur = contenu */
  max-width: calc(100vw - 24px);

  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  background: rgba(20,20,20,.95);

  height: auto !important;
  max-height: none !important;
}

/* Placement du mini-bloc */
.stb-bar.stb-bottom.is-trail-hidden{
  left: 12px !important;
  bottom: 12px !important;
}

.stb-bar.stb-top.is-trail-hidden{
  left: 12px !important;
  top: 12px !important;
}

/* Compact */
.stb-bar.is-trail-hidden .stb-inner{
  padding: 10px 12px !important;
  gap: 8px;
  align-items: center;
}

/* On masque tout sauf la colonne gauche */
.stb-bar.is-trail-hidden .stb-trail,
.stb-bar.is-trail-hidden .stb-actions,
.stb-bar.is-trail-hidden .stb-loading{
  display: none !important;
}

/* =========================
   Mobile : désactiver complètement le fil d'ariane
   ========================= */
@media (max-width: 768px){
  #stb-bar{
    display: none !important;
  }

  /* au cas où ton JS met un paddingTop en mode top */
  body{
    padding-top: 0 !important;
  }
}