/* scripts/_partials/favoris.css — favoris lecteur (vit-S780, v2 vit-S781).
   Chargé en <link> par inject_fav.py sur les contenus articles / fiches / guides G-U,
   et par generate_content.py sur le listing /articles/.
   v2 (vit-S781, config b validée Rémy) : bouton d'en-tête restylé (variante A ambre),
   reprise épinglée en tête de .toc-rail (PRIORITAIRE ≥1280px : l'en-tête se masque),
   bouton flottant qui rejoint #nav-buttons (ou conteneur autonome #mb-fav-float),
   barre de fin d'article avant .related-section, ☆ sur les cartes du listing.
   Règles dark mode : dark-mode.css §101 — jamais dupliquées ici. */

/* ── Bouton d'en-tête (variante A — ambre, cohérent avec l'état ★) ── */
.mb-fav-slot { margin: 14px 0 4px; }
.mb-fav-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid #B45309; background: rgba(180,83,9,.06); border-radius: 999px;
  padding: 8px 17px; font-size: 14px; font-weight: 600; font-family: inherit;
  color: #B45309; cursor: pointer; box-shadow: 0 1px 4px rgba(180,83,9,.13);
  transition: border-color .15s, color .15s, background .15s;
}
.mb-fav-btn:hover { background: rgba(180,83,9,.13); }
.mb-fav-btn.is-on { background: #B45309; color: #fff; }
.mb-fav-btn:disabled { opacity: .55; cursor: default; }

/* ── Reprise en tête de sommaire (config b) ── */
.mb-fav-rail {
  display: flex; align-items: center; gap: 7px; width: 100%; box-sizing: border-box;
  border: 1px solid rgba(180,83,9,.5); background: rgba(180,83,9,.05);
  color: #B45309; border-radius: 9px; padding: 7px 10px; margin: 0 0 12px;
  font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s;
}
.mb-fav-rail:hover { background: rgba(180,83,9,.12); }
.mb-fav-rail.is-on { background: #B45309; color: #fff; border-color: #B45309; }
.mb-fav-rail:disabled { opacity: .55; cursor: default; }
@media (min-width: 1280px) {
  /* Rail rendu : un seul emplacement visible — l'en-tête et le flottant se retirent. */
  html.mb-has-rail .mb-fav-slot { display: none; }
  html.mb-has-rail .mb-fav-fab { display: none; }
}

/* ── Bouton flottant (rejoint #nav-buttons, gabarit .btn-nav-scroll-top) ── */
.mb-fav-fab {
  width: 42px; height: 42px; border-radius: 50%; padding: 0;
  background: #fff; color: #B45309; border: 1.5px solid #B45309;
  font-size: 19px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(6,23,45,.18); flex-shrink: 0;
  transition: background .15s, color .15s;
}
.mb-fav-fab:hover { background: rgba(180,83,9,.1); }
.mb-fav-fab.is-on { background: #B45309; color: #fff; }
.mb-fav-fab:disabled { opacity: .55; cursor: default; }
/* Conteneur autonome pour les pages sans #nav-buttons — mêmes position et seuil. */
#mb-fav-float { position: fixed; bottom: 24px; right: 24px; display: none; z-index: 199; }
#mb-fav-float.is-visible { display: flex; }
@media (max-width: 640px) { #mb-fav-float { right: 14px; } }

/* ── Barre de fin d'article (avant .related-section) ── */
.mb-fav-endbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; border: 1.5px dashed rgba(180,83,9,.45);
  background: rgba(180,83,9,.05); border-radius: 12px;
  padding: 14px 18px; margin: 26px 0;
}
.mb-fav-endbar p { margin: 0; font-size: 14px; }
.mb-fav-endbar .mb-fav-btn { box-shadow: none; white-space: nowrap; }

/* ── ☆ des cartes du listing /articles/ ── */
.article-item { position: relative; }
/* Le badge de niveau et la date sont plaqués à droite de .article-tags-row :
   sur les cartes décorées, tout le corps cède la colonne du ☆ (constat Rémy
   post-deploy vit-S781 : le ☆ chevauchait le badge). */
.article-item.mb-has-fav .article-body { padding-right: 46px; }
.mb-fav-card {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; padding: 0;
  border: 1px solid rgba(6,23,45,.18); background: #fff; color: rgba(6,23,45,.55);
  font-size: 16px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, color .15s, background .15s;
}
.mb-fav-card:hover { border-color: #B45309; color: #B45309; }
.mb-fav-card.is-on { background: #B45309; border-color: #B45309; color: #fff; }
.mb-fav-card:disabled { opacity: .55; cursor: default; }

/* ── Toast de confirmation / invite connexion (listing) ── */
#mb-fav-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 300; background: #06172D; color: #fff; border-radius: 10px;
  padding: 11px 16px; font-size: 13.5px; box-shadow: 0 4px 16px rgba(6,23,45,.3);
  max-width: min(92vw, 480px); display: flex; align-items: center; gap: 10px;
}
#mb-fav-toast a { color: #ffd9ab; font-weight: 600; }
/* [hidden] perd contre display:flex déclaré plus bas (L3990) — verrou explicite. */
#mb-fav-toast[hidden] { display: none !important; }
