/* ════════════════════════════════════════════════════════════════════
   item_nav.css — Navigation inter-articles
   Martinique A Nu · Bootstrap 5.0.2
   Corrections :
   - Chrome : suppression des !important sur le jumbotron qui cachaient le contenu
   - Safari iOS : env(safe-area-inset-bottom) pour la barre de gestes iPhone
   ════════════════════════════════════════════════════════════════════ */

/* ── 1. BARRE DE PROGRESSION ─────────────────────────────────────── */
.man-read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 9999;
  pointer-events: none;
}

.man-read-progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(
    90deg,
    var(--jaune-bouton, #fcb900),
    var(--rouge-caraibe, #c0231c)
  );
  border-radius: 0 2px 2px 0;
  transition: width 0.1s linear;
}

/* ── 2. SWITCHER DE CATÉGORIES ────────────────────────────────────── */
.man-cat-switcher {
  margin: 1.25rem 0 0.5rem;
}

.man-cat-switcher__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0 8px;
}

.man-cat-switcher__inner::-webkit-scrollbar { display: none; }

.man-cat-switcher__label {
  color: var(--vert-default, #144d47);
  font-size: 0.85rem;
  flex-shrink: 0;
  opacity: 0.6;
}

.man-cat-pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid rgba(20, 77, 71, 0.28);
  color: var(--vert-default, #144d47);
  background: transparent;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.man-cat-pill:hover {
  background: var(--vert-default, #144d47);
  color: #fff;
  border-color: var(--vert-default, #144d47);
  text-decoration: none;
}

.man-cat-pill.is-active {
  background: var(--vert-default, #144d47);
  color: #fff;
  border-color: var(--vert-default, #144d47);
}

/* ── 3. BARRE FIXE BAS ────────────────────────────────────────────── */

/*
 * Safari iOS : env(safe-area-inset-bottom) pousse la barre au-dessus
 * de la barre de gestes iPhone (home indicator).
 * Chrome Android : padding-bottom: 0 car pas de safe area.
 * La syntaxe "max()" gère les deux automatiquement.
 */
.man-item-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1040;
  display: flex;
  align-items: center;
  height: 64px;
  /* Safe area iOS — la barre se positionne au-dessus du home indicator */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  /* Hauteur adaptée avec safe area */
  min-height: calc(64px + env(safe-area-inset-bottom, 0px));
  background: rgba(20, 77, 71, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.22);
  padding-left: 6px;
  padding-right: 6px;
  gap: 4px;
}

.man-item-nav__btn {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.88);
  transition: background 0.18s ease;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.man-item-nav__btn:hover,
.man-item-nav__btn:focus {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
}

.man-item-nav__btn--prev { justify-content: flex-start; }
.man-item-nav__btn--next { justify-content: flex-end; }

.man-item-nav__btn--ghost {
  flex: 0 0 44px;
  pointer-events: none;
}

.man-item-nav__thumb {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
}

.man-item-nav__name {
  font-size: 0.76rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
  line-height: 1.3;
}

.man-item-nav__btn i {
  font-size: 0.7rem;
  opacity: 0.65;
  flex-shrink: 0;
}

.man-item-nav__pos {
  display: flex;
  align-items: baseline;
  gap: 2px;
  flex-shrink: 0;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 54px;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
}

.man-item-nav__pos-n {
  color: var(--jaune-bouton, #fcb900);
  font-size: 0.9rem;
}

.man-item-nav__pos-sep {
  opacity: 0.45;
  font-size: 0.7rem;
  margin: 0 1px;
}

@keyframes swipeLeft  { 50% { transform: translateX(-10px); } }
@keyframes swipeRight { 50% { transform: translateX(10px); } }

.man-item-nav.is-swiping-next { animation: swipeLeft  0.25s ease; }
.man-item-nav.is-swiping-prev { animation: swipeRight 0.25s ease; }

/* ── 4. TOAST WRAP-AROUND ─────────────────────────────────────────── */
.man-wrap-toast {
  position: fixed;
  /* Au-dessus de la barre nav + safe area */
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 20px;
  white-space: nowrap;
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.man-wrap-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.man-wrap-toast i {
  color: var(--jaune-bouton, #fcb900);
}

/* ── 5. BOUTONS INLINE DESKTOP ────────────────────────────────────── */
.man-inline-nav {
  display: none;
}

/* ── 6. CARDS AUTRES ARTICLES ─────────────────────────────────────── */
.man-other-card {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e8e8e8;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: #fff;
}

.man-other-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.man-other-card .card-img-top {
  height: 110px;
  object-fit: cover;
}

.man-other-card .card-title {
  font-size: 0.76rem;
  color: #2d3748;
  line-height: 1.35;
}

/* ── 7. CONTENU ARTICLE ───────────────────────────────────────────── */
.man-article-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #2d3748;
}

.man-article-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--vert-default, #144d47);
  border-left: 4px solid var(--jaune-bouton, #fcb900);
  padding-left: 12px;
}

.man-article-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

/* ── 8. ESPACE POUR LA BARRE FIXE BAS ────────────────────────────── */
/*
 * Le padding-bottom de main doit tenir compte de la safe area iOS.
 * Sur Chrome Android : env(...) vaut 0, donc padding-bottom = 72px.
 * Sur Safari iPhone : env(...) ajoute la hauteur du home indicator.
 */
main {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

/* ── 9. MOBILE (<768px) ───────────────────────────────────────────── */
@media (max-width: 767px) {

  /*
   * ── CORRECTION CHROME : contenu caché ──────────────────────
   *
   * AVANT (problème) : on écrasait les paddings Bootstrap avec
   * !important, ce qui faisait démarrer le contenu trop haut,
   * derrière la navbar fixe.
   *
   * MAINTENANT : on ne touche plus aux paddings des .container.
   * On réduit uniquement les paddings verticaux du jumbotron
   * sans aucun !important horizontal.
   */

  /* Jumbotron : réduire l'espace vertical UNIQUEMENT */
  .jumbotrom {
    margin-top: 0.5rem;
    padding-top: 0;
    padding-bottom: 0;
  }

  .jumbotron-arrow {
    /* padding vertical réduit, horizontal inchangé (Bootstrap gère) */
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    min-height: auto;
  }

  /* Titre h1 moins imposant sur petit écran */
  .jumbotron-arrow h1.display-5 {
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
  }

  .jumbotron-arrow .slogan {
    font-size: 0.88rem;
    margin-bottom: 0;
  }

  /* Breadcrumb compact */
  .breadcrumb {
    font-size: 0.73rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
  }

  /* Cards 2 colonnes */
  .row-cols-2 > .col {
    padding: 4px;
  }

  .man-other-card .card-img-top {
    height: 85px;
  }

  .man-item-nav__name {
    max-width: 88px;
    font-size: 0.7rem;
  }

  .man-article-content {
    font-size: 1rem;
  }
}

/* ── 10. ULTRA PETIT ÉCRAN (<380px) ──────────────────────────────── */
@media (max-width: 380px) {
  .man-item-nav__name { display: none; }
  .man-item-nav {
    padding-left: 4px;
    padding-right: 4px;
  }
  .man-item-nav__thumb { width: 36px; height: 36px; min-width: 36px; }
}

/* ── 11. DESKTOP (≥992px) ─────────────────────────────────────────── */
@media (min-width: 992px) {

  .man-item-nav {
    height: 66px;
    min-height: 66px;
    padding-left: 32px;
    padding-right: 32px;
    padding-bottom: 0; /* pas de safe area sur desktop */
    gap: 16px;
  }

  .man-item-nav__name {
    max-width: 220px;
    font-size: 0.88rem;
  }

  .man-item-nav__thumb {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .man-item-nav__btn {
    padding: 10px 14px;
    gap: 10px;
  }

  .man-item-nav__btn i { font-size: 0.85rem; }

  .man-item-nav__pos {
    font-size: 0.82rem;
    padding: 8px 14px;
    min-width: 64px;
  }

  .man-item-nav__pos-n { font-size: 1rem; }

  /* Boutons inline desktop */
  .man-inline-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 2rem 0 1rem;
    padding: 16px 20px;
    background: linear-gradient(
      135deg,
      rgba(20, 77, 71, 0.06) 0%,
      rgba(252, 185, 0, 0.06) 100%
    );
    border-radius: 12px;
    border: 1px solid rgba(20, 77, 71, 0.12);
  }

  .man-inline-nav__btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--vert-default, #144d47);
    background: #fff;
    border: 1.5px solid rgba(20, 77, 71, 0.2);
    transition: all 0.2s ease;
    max-width: 46%;
    overflow: hidden;
    font-weight: 600;
  }

  .man-inline-nav__btn:hover {
    background: var(--vert-default, #144d47);
    color: #fff;
    border-color: var(--vert-default, #144d47);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 77, 71, 0.2);
  }

  .man-inline-nav__btn--prev { justify-content: flex-start; }
  .man-inline-nav__btn--next { justify-content: flex-end; }

  .man-inline-nav__thumb {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(20, 77, 71, 0.15);
    flex-shrink: 0;
  }

  .man-inline-nav__btn:hover .man-inline-nav__thumb {
    border-color: rgba(255, 255, 255, 0.4);
  }

  .man-inline-nav__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
  }

  .man-inline-nav__label {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .man-inline-nav__name {
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .man-inline-nav__center {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(20, 77, 71, 0.5);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
  }

  .man-other-card .card-img-top { height: 150px; }
  .man-other-card .card-title   { font-size: 0.84rem; }

  main {
    padding-bottom: 80px; /* desktop : pas de safe area */
  }
}