/* Édition inline admin (gate IP, cf. includes/config.php bl_is_admin()) — chargé uniquement sur les pages où bl_is_admin() est vrai */
.bl-editable {
  border: 1px dashed rgba(217, 122, 134, 0.5);
  border-radius: 6px;
  padding: 4px 6px;
  outline: none;
  cursor: text;
  transition: border-color 0.15s, background-color 0.15s;
}
.bl-editable:hover { border-color: #d97a86; background: rgba(217, 122, 134, 0.06); }
.bl-editable:focus { border-color: #d97a86; background: #fff; box-shadow: 0 0 0 2px rgba(217, 122, 134, 0.15); }
.bl-editable:empty::before { content: attr(data-placeholder); color: #b0a89a; font-style: italic; }
.bl-editable.is-saving { opacity: 0.6; }
.bl-editable.is-saved { border-color: #6fa87a; background: rgba(111, 168, 122, 0.1); }
/* Module en-tête P2 : bandeau + fil d'Ariane + description, un seul bloc visuel (révision CM 05/08 v2) */
.bl-sr-header {
  background: #fff;
  border-bottom: 2px solid #d97a86;
  border-radius: 0;
}
/* 31/08/2026 : padding horizontal retiré — s'alignait mal (38px) vs le reste du contenu (18px).
   On calque la vue admin sur la vue vacancier (le .bl-sr-header porte déjà la marge de 18px). */
.bl-breadcrumb--sr { background: none; padding: 4px 0 6px; }
.bl-breadcrumb--sr a { text-decoration: underline; text-underline-offset: 2px; }
.bl-breadcrumb--sr .bl-breadcrumb__sep { font-size: 15px; font-weight: 700; color: rgba(35,31,32,0.55); }
/* 31/08/2026 : ne plus surcharger la typo ici — le style visible (taille/graisse/couleur)
   vient de style.css (.bl-sr-desc = chapô 18px/700). On ne garde que le structurel propre
   à la zone éditable admin (marges/padding de la boîte contenteditable). */
.bl-sr-desc {
  margin: 0;
  padding: 4px 0 8px;
  border-radius: 0;
}
/* Cadre pointillé rose = UI admin uniquement (classe .bl-editable ajoutée seulement si bl_is_admin()), jamais côté public */

/* Bouton "+" ajout photo (cartes POI sans photo, admin uniquement) */
.bl-card__photo--empty { background: #eee3d1; display: flex; align-items: center; justify-content: center; }
.bl-photo-add {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bl-pink, #EC1D78); color: #fff; border: none;
  font-size: 26px; line-height: 1; font-weight: 400;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.15s, background-color 0.15s;
}
.bl-photo-add:hover { background: #c91767; transform: scale(1.06); }
.bl-photo-add:active { transform: scale(0.96); }
.bl-photo-add--brown { background: #8a6f4a; }
.bl-photo-add--brown:hover { background: #705a3a; }

/* Bandeau rubrique (P1) sans image : centrage du bouton au-dessus du gradient/titre */
.bl-hero-bandeau--empty { display: flex; align-items: center; justify-content: center; }
.bl-hero-bandeau--empty .bl-photo-add { position: relative; z-index: 2; }

/* Bandeau réduit sous-rubrique (P2) sans image : même principe */
.bl-bandeau-reduit--empty { display: flex; align-items: center; justify-content: center; }
.bl-bandeau-reduit--empty .bl-photo-add { position: relative; z-index: 2; }

/* Tuile sous-rubrique (P1, grille "Infos pratiques" etc.) sans image : même principe */
.bl-sr-tile--empty { background: #eee3d1; display: flex; align-items: center; justify-content: center; }
.bl-sr-tile--empty .bl-photo-add { position: relative; z-index: 2; }

/* Bandeau existant (rubrique ou sous-rubrique) : clic pour remplacer, admin uniquement */
/* Le dégradé (style.css) est positionné au-dessus de l'image et interceptait le clic — décoratif, doit laisser passer les événements */
.bl-hero-bandeau__gradient, .bl-bandeau-reduit__gradient { pointer-events: none; }
.bl-editable-img { cursor: pointer; }
.bl-hero-bandeau:has(.bl-editable-img)::after,
.bl-bandeau-reduit:has(.bl-editable-img)::after {
  content: "✎ changer l'image";
  position: absolute; bottom: 10px; right: 10px; z-index: 2;
  background: rgba(35,31,32,0.6); color: #fff; font-size: 11px;
  padding: 4px 10px; border-radius: 999px; pointer-events: none;
}

/* Tuile P1 (grille rubrique) avec image déjà posée (11/08, révise le 07/08) : bouton "changer"
   RÉEL en haut à droite, plus un badge décoratif posé sur toute l'image — l'image entière
   interceptait le clic et empêchait la navigation normale vers la sous-rubrique/POI (bug
   remonté par Julien). Le bouton seul porte data-upload-target, l'image redevient un clic
   de navigation classique. */
.bl-sr-tile__gradient { pointer-events: none; }
.bl-tile-change-btn {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(35,31,32,0.6); color: #fff; font-size: 11px;
  padding: 4px 10px; border-radius: 999px; border: none; cursor: pointer;
}
.bl-tile-change-btn:hover { background: rgba(35,31,32,0.8); }

/* Carrousel fiche POI, admin : vide -> "+" seul ; sinon chaque slide garde ses 2 icônes ciblées (changer / supprimer),
   + un slide "+" en bout de carrousel (swipe) pour en ajouter une nouvelle sans toucher aux existantes */
.bl-sheet__carousel--empty { background: #eee3d1; display: flex; align-items: center; justify-content: center; min-height: 220px; }
.bl-sheet__carousel--empty .bl-photo-add { position: relative; z-index: 2; }

.bl-sheet__carousel-slide { position: relative; flex: 0 0 100%; height: 220px; scroll-snap-align: start; overflow: hidden; }
.bl-sheet__carousel-slide .bl-editable-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bl-sheet__carousel-slide::after {
  content: "✎ changer";
  position: absolute; bottom: 10px; right: 10px; z-index: 2;
  background: rgba(35,31,32,0.6); color: #fff; font-size: 11px;
  padding: 4px 10px; border-radius: 999px; pointer-events: none;
}
.bl-photo-delete {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: #e04b4b; color: #fff; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.bl-photo-delete:hover { background: #c93a3a; }

/* Ajout d'un bloc sheet_info (11/08) : "+" centré entre 2 blocs (ou seul si fiche vide), même skin rose que .bl-photo-add */
.bl-sheet-item-add {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: #d97a86; color: #fff; border: none;
  font-size: 20px; line-height: 1; font-weight: 400;
  cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  margin: 4px auto 14px; transition: transform 0.15s, background-color 0.15s;
}
.bl-sheet-item-add:hover { background: #c8626f; transform: scale(1.06); }
.bl-sheet-item-add:active { transform: scale(0.96); }

/* Icône photo (rose) alignée sur la taille de l'icône lien (bleu) dans les items sheet_info (18/08/2026) —
   scope volontairement limité à ce contexte, .bl-photo-add garde ses 44px ailleurs (carrousel POI, bandeaux). */
.bl-sheet-info-item__photos .bl-photo-add { width: 30px; height: 30px; font-size: 18px; }

/* Poignée drag & drop des blocs sheet_info (18/08/2026) : .bl-drag-handle est positionnée en
   absolute (cf. règle générique plus haut) — sans ancre positionnée sur l'item lui-même, elle
   remontait au parent positionné le plus proche (la page entière). Contexte de positionnement +
   marge réservée pour ne pas chevaucher le titre. Scopé à [data-sheet-info-id] (rendu admin
   uniquement, cf. sheet.php) pour ne pas décaler la mise en page côté public. */
[data-sheet-info-id] .bl-sheet-info-item { position: relative; padding-left: 40px; padding-right: 30px; }
[data-sheet-info-id] .bl-sheet-info-item .bl-drag-handle { top: 0; left: 0; }

/* Suppression d'un bloc sheet_info_item (19/08/2026) : même skin que .bl-photo-delete mais en
   plus petit, positionné en haut à droite du bloc (espace réservé par padding-right ci-dessus). */
.bl-sheet-info-item__delete {
  position: absolute; top: 0; right: 0; z-index: 3;
  width: 22px; height: 22px; border-radius: 50%; border: none;
  background: #e04b4b; color: #fff; font-size: 11px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.bl-sheet-info-item__delete:hover { background: #c93a3a; }

/* Vidéo d'item sheet_info (11/08) : YouTube en iframe 16/9, sinon fichier direct en <video> natif */
.bl-sheet-info-item__video { margin: 10px 0 0; border-radius: 10px; overflow: hidden; background: #000; }
.bl-sheet-info-item__video iframe,
.bl-sheet-info-item__video video { display: block; width: 100%; aspect-ratio: 16/9; border: none; }
.bl-sheet-info-item__video-url { margin: 6px 0 0; font-size: 12px; }

/* Items sheet_info (Urgences, Codes, Se déplacer...) : miniatures rondes 48px, croix réduite pour rester proportionnée */
.bl-sheet-info-item__photo-wrap { position: relative; }
.bl-photo-delete--sm { top: -6px; right: -6px; width: 20px; height: 20px; font-size: 10px; }

.bl-sheet__carousel-slide--add { background: #eee3d1; display: flex; align-items: center; justify-content: center; }
.bl-sheet__carousel-slide--add .bl-photo-add { position: relative; z-index: 2; }

/* Bug de marge : le contenu sheet_info (Urgences, Codes...) n'avait pas la marge horizontale du fil d'Ariane/titre au-dessus */
.bl-sheet-info-list { padding: 0 20px; }

/* Rattachement fiche POI sur un item sheet_info : CTA rose plein côté public, "+" + picker côté admin
   Les 3 contrôles (+, En savoir +, ✕) calés sur la même taille que la croix de suppression photo (30px) */
.bl-sheet-info-item__foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 10px; }
.bl-sheet-info-item__cta {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; box-sizing: border-box;
  background: var(--bl-pink, #d97a86); color: #fff; font-weight: 700; font-size: 12px;
  padding: 0 14px; border-radius: 999px; text-decoration: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.bl-poi-link-add {
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: var(--bl-cyan-nav, #39C2E6); color: #fff; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.bl-poi-link-add:hover { background: #2ba8cc; }
.bl-poi-link-remove {
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: #e04b4b; color: #fff; font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.bl-poi-link-remove:hover { background: #c93a3a; }
.bl-poi-link-select { max-width: 220px; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid rgba(217,122,134,0.5); font-size: 12.5px; }

/* Drag & drop tuiles sous-rubrique (P1, admin) : poignée dédiée, ne gêne pas le clic normal sur la tuile */
.bl-drag-handle {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.88); color: #231F20; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  cursor: grab; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  /* La poignée est nichée dans un <a> : sans ça, iOS Safari déclenche son menu contextuel natif
     (aperçu de lien "Ouvrir / Ouvrir dans un nouvel onglet"...) dès l'appui long, avant le JS */
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
/* Filet de sécurité : le geste de peek iOS peut se déclencher sur l'ancêtre <a> même si l'enfant
   (la poignée) le désactive — désactivé aussi sur la carte/tuile entière, n'affecte pas le tap normal */
.bl-sr-tile, .bl-card { -webkit-touch-callout: none; }
.bl-sr-tile--dragging { opacity: 0.4; }

/* Carte P2 (06/08) : poignée sortie du <a>, wrapper neutre autour du lien + de la poignée.
   Cible agrandie, coin haut-droit (le badge distance occupe déjà le haut-gauche de la photo). */
.bl-card-wrap { position: relative; margin-bottom: 14px; }
.bl-card-wrap .bl-card { margin-bottom: 0; }
.bl-drag-handle--card {
  left: auto; right: 8px; top: 8px;
  width: 36px; height: 36px; font-size: 18px;
}

/* Drag & drop cartes POI (P2, liste au sein d'une sous-rubrique, admin) : même poignée */
.bl-card { position: relative; }

/* Description carte P2 (06/08) : troncature visuelle pure CSS (3 lignes ~130-180 car.),
   "..." natif du navigateur, pas d'indicateur "en savoir plus" — le clic vers la fiche
   reste le geste naturel, ajouter une flèche/CTA ici créerait plus de bruit que d'aide.
   Débridé en admin pour ne pas gêner l'édition d'une description longue. */
.bl-card__text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bl-card__text.bl-editable {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* Bouton '+' ajout POI/POI editorial/Info (bas de liste P2, admin uniquement, 14/08) */
.bl-poi-list-add {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 18px auto 24px;
}
.bl-poi-add-fab {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: #d97a86; color: #fff; border: none;
  font-size: 26px; line-height: 1; font-weight: 400;
  cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  transition: transform 0.15s, background-color 0.15s;
}
.bl-poi-add-fab:hover { background: #c8626f; transform: scale(1.06); }
.bl-poi-add-fab:active { transform: scale(0.96); }

.bl-poi-add-modal {
  position: fixed; inset: 0; background: rgba(44,38,32,0.5);
  display: flex; align-items: flex-end; justify-content: center; z-index: 200;
}
.bl-poi-add-modal[hidden] { display: none; }
.bl-poi-add-sheet {
  background: #fff; border-radius: 18px 18px 0 0; width: 100%; max-width: 480px;
  padding: 20px 20px 28px; box-sizing: border-box;
  max-height: 85vh; overflow-y: auto;
}
.bl-poi-add-sheet h3 { margin: 0 0 14px; font-size: 1rem; color: #2c2620; }
.bl-poi-add-types { display: flex; gap: 10px; margin-bottom: 16px; }
.bl-poi-add-type-btn {
  flex: 1; padding: 10px 6px; border-radius: 10px; border: 1px solid #e6ddcc;
  background: #f6f1e9; color: #2c2620; font-size: 0.85rem; cursor: pointer;
}
.bl-poi-add-type-btn.is-active { background: #d97a86; color: #fff; border-color: #d97a86; }
.bl-poi-add-field { margin-bottom: 12px; }
.bl-poi-add-field label { display: block; font-size: 0.8rem; color: #7a7166; margin-bottom: 4px; }
.bl-poi-add-field input, .bl-poi-add-field textarea {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid #e6ddcc;
  font-size: 0.92rem; box-sizing: border-box; font-family: inherit;
}
.bl-poi-add-search-btn, .bl-poi-add-submit-btn {
  padding: 9px 16px; border-radius: 999px; border: none; cursor: pointer;
  font-size: 0.85rem; font-weight: 600;
}
.bl-poi-add-search-btn { background: #eee3d1; color: #2c2620; margin-left: 8px; }
.bl-poi-add-submit-btn { background: #d97a86; color: #fff; width: 100%; margin-top: 6px; padding: 11px; }
.bl-poi-add-results { margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.bl-poi-add-result {
  text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid #e6ddcc;
  background: #f6f1e9; cursor: pointer; font-size: 0.85rem;
}
.bl-poi-add-result:hover { border-color: #d97a86; }
.bl-poi-add-result strong { display: block; font-size: 0.88rem; }
.bl-poi-add-result span { color: #7a7166; font-size: 0.78rem; }
.bl-poi-add-close {
  position: absolute; top: 14px; right: 16px; background: none; border: none;
  font-size: 20px; color: #8a8070; cursor: pointer;
}
.bl-poi-add-sheet { position: relative; }
