/* ============================================================
   OSEP — Tour Page (visite guidée)
   Surcouche du moteur OsepTour (assets/js/tour/OsepTour.js)
   ============================================================ */

/* Lock du scroll quand un tour est actif */
body.osep-tour-lock {
  overflow: hidden !important;
}

/* Overlay sombre + spotlight (clip-path géré par JS) */
.osep-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.62);
  pointer-events: auto;
  transition: clip-path .25s cubic-bezier(.4, 0, .2, 1);
  -webkit-tap-highlight-color: transparent;
}

/* Tooltip : carte OSEP avec bandeau tricolore */
.osep-tour-tooltip {
  position: fixed;
  z-index: 10001;
  width: 360px;
  max-width: calc(100vw - 28px);
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 50px -16px rgba(15, 23, 42, 0.45),
              0 8px 18px -8px rgba(15, 23, 42, 0.20);
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  color: var(--osep-ink-900, #0F172A);
  animation: osep-tour-pop 0.22s cubic-bezier(.4, 0, .2, 1);
}

/* Bandeau tricolore + accent or */
.osep-tour-tooltip::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg,
    var(--osep-sn-green, #00853F) 0 33.33%,
    var(--osep-sn-yellow, #FDEF42) 33.33% 66.66%,
    var(--osep-sn-red, #E31B23) 66.66% 100%);
  z-index: 1;
  pointer-events: none;
}

/* Flèche pointant vers la cible */
.osep-tour-tooltip::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: #ffffff;
  transform: rotate(45deg);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
}
.osep-tour-tooltip[data-placement="top"]::after    { top: -6px; left: 50%; margin-left: -6px; }
.osep-tour-tooltip[data-placement="bottom"]::after { bottom: -6px; left: 50%; margin-left: -6px; }
.osep-tour-tooltip[data-placement="left"]::after   { left: -6px; top: 50%; margin-top: -6px; }
.osep-tour-tooltip[data-placement="right"]::after  { right: -6px; top: 50%; margin-top: -6px; }
.osep-tour-tooltip[data-placement="none"]::after   { display: none; }

@keyframes osep-tour-pop {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* Bouton de fermeture */
.osep-tour-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--osep-ink-500, #64748B);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  z-index: 2;
  transition: background-color .12s ease, color .12s ease;
}
.osep-tour-close:hover {
  background: var(--osep-line-soft, #EEF2F7);
  color: var(--osep-navy-900, #0A2A52);
}

/* Compteur d'étape */
.osep-tour-step-counter {
  margin: 14px 22px 4px 22px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--osep-gold-500, #C9A659);
}

/* Titre */
.osep-tour-title {
  margin: 0 22px 8px 22px;
  font-size: 17px;
  font-weight: 800;
  color: var(--osep-navy-900, #0A2A52);
  letter-spacing: -0.01em;
  line-height: 1.3;
  padding-right: 28px;
}

/* Corps */
.osep-tour-body {
  margin: 0 22px 16px 22px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--osep-ink-700, #334155);
}
.osep-tour-body p { margin: 0 0 8px 0; }
.osep-tour-body p:last-child { margin: 0; }
.osep-tour-body strong { color: var(--osep-navy-900, #0A2A52); font-weight: 700; }
.osep-tour-body code {
  background: var(--osep-bg, #F8FAFC);
  border: 1px solid var(--osep-line-soft, #EEF2F7);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  color: var(--osep-navy-700, #163E78);
}
.osep-tour-body ul, .osep-tour-body ol {
  margin: 0 0 8px 0;
  padding-left: 20px;
}
.osep-tour-body li { margin-bottom: 3px; }

/* Actions (footer) */
.osep-tour-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px 14px 16px;
  background: linear-gradient(180deg, transparent 0%, var(--osep-bg, #F8FAFC) 100%);
  border-top: 1px solid var(--osep-line-soft, #EEF2F7);
}
.osep-tour-actions .spacer { flex: 1; }

.osep-tour-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  border: 1px solid var(--osep-line, #E2E8F0);
  background: #ffffff;
  color: var(--osep-ink-700, #334155);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 6px;
  cursor: pointer;
  transition: all .12s ease;
  font-family: inherit;
}
.osep-tour-btn:hover {
  border-color: var(--osep-navy-900, #0A2A52);
  color: var(--osep-navy-900, #0A2A52);
  background: var(--osep-navy-50, #EEF3FB);
}
.osep-tour-btn i { font-size: 14px; }

.osep-tour-btn.primary {
  background: var(--osep-navy-900, #0A2A52);
  color: #ffffff;
  border-color: var(--osep-navy-900, #0A2A52);
  box-shadow: inset 0 0 0 1.5px var(--osep-gold-500, #C9A659);
}
.osep-tour-btn.primary:hover {
  background: var(--osep-navy-700, #163E78);
  border-color: var(--osep-navy-700, #163E78);
  color: #ffffff;
}
.osep-tour-btn.primary i { color: var(--osep-gold-300, #E2C887); }

.osep-tour-btn.osep-tour-skip {
  border-color: transparent;
  background: transparent;
  color: var(--osep-ink-500, #64748B);
  font-weight: 600;
}
.osep-tour-btn.osep-tour-skip:hover {
  background: var(--osep-line-soft, #EEF2F7);
  color: var(--osep-ink-700, #334155);
}

/* Bouton "Lancer la visite" du topbar */
.osep-tour-launcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--osep-line, #E2E8F0);
  background: linear-gradient(135deg, #ffffff 0%, var(--osep-navy-50, #EEF3FB) 100%);
  color: var(--osep-navy-900, #0A2A52);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  cursor: pointer;
  transition: all .12s ease;
}
.osep-tour-launcher:hover {
  border-color: var(--osep-gold-500, #C9A659);
  background: linear-gradient(135deg, #FFF7E0 0%, #ffffff 100%);
  box-shadow: 0 2px 6px -2px rgba(201, 166, 89, 0.45);
}
.osep-tour-launcher i {
  color: var(--osep-gold-500, #C9A659);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 540px) {
  .osep-tour-tooltip { width: calc(100vw - 28px); }
  .osep-tour-actions { flex-wrap: wrap; }
  .osep-tour-actions .spacer { flex-basis: 100%; height: 0; }
}
