/* ============================================================================
   MonHaras — Panneau élevage : visite guidée et aide « ? » (elevage-tour.js).
   Marine / doré, titres en Fraunces. Tout est en position fixe au-dessus du
   tiroir mobile et de la barre d'onglets (z-index 60).
   ========================================================================= */

/* ---- Voile + projecteur ---- */
.elv-tour { position: fixed; inset: 0; z-index: 1000; opacity: 0; transition: opacity .3s ease; }
.elv-tour.on { opacity: 1; }
.elv-tour.off { opacity: 0; pointer-events: none; }
/* Le trou : une ombre immense assombrit tout AUTOUR de la cible. Ses
   coordonnées glissent d'une étape à l'autre. */
.elv-tour-hole {
  position: fixed; left: 50%; top: 50%; width: 0; height: 0; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 200vmax rgba(12, 20, 38, .66);
  transition: left .45s cubic-bezier(.65, 0, .35, 1), top .45s cubic-bezier(.65, 0, .35, 1),
              width .45s cubic-bezier(.65, 0, .35, 1), height .45s cubic-bezier(.65, 0, .35, 1);
}
.elv-tour-hole::after {
  content: ""; position: absolute; inset: -3px; border-radius: 14px; border: 2px solid #C99A3E;
  animation: elvTourRing 1.8s ease-out infinite;
}
.elv-tour-hole.none { width: 0 !important; height: 0 !important; }
.elv-tour-hole.none::after { display: none; }
@keyframes elvTourRing {
  0%   { box-shadow: 0 0 0 0 rgba(201, 154, 62, .55); }
  70%  { box-shadow: 0 0 0 12px rgba(201, 154, 62, 0); }
  100% { box-shadow: 0 0 0 0 rgba(201, 154, 62, 0); }
}

/* ---- Bulle ---- */
.elv-tour-bub {
  position: fixed; left: 0; top: 0; box-sizing: border-box; width: min(340px, calc(100vw - 24px));
  background: #FFFDF8; color: #1B2740; border-radius: 16px; padding: 16px 18px 14px;
  border-top: 3px solid #C99A3E; box-shadow: 0 22px 48px rgba(8, 14, 30, .38);
  transition: left .45s cubic-bezier(.65, 0, .35, 1), top .45s cubic-bezier(.65, 0, .35, 1);
}
.elv-tour-bub.pop { animation: elvTourPop .42s cubic-bezier(.2, .9, .3, 1.25); }
@keyframes elvTourPop {
  from { opacity: 0; transform: translateY(8px) scale(.94); }
  to   { opacity: 1; transform: none; }
}
/* Flèche vers la cible (côté selon data-side ; --ax/--ay posés par le JS). */
.elv-tour-bub::before {
  content: ""; position: absolute; width: 14px; height: 14px; background: #FFFDF8; transform: rotate(45deg);
  display: none;
}
.elv-tour-bub[data-side="r"]::before { display: block; left: -7px; top: calc(var(--ay, 30px) - 7px); }
.elv-tour-bub[data-side="b"]::before { display: block; top: -8px; left: calc(var(--ax, 30px) - 7px); background: #C99A3E; }
.elv-tour-bub[data-side="t"]::before { display: block; bottom: -7px; left: calc(var(--ax, 30px) - 7px); }

.elv-tour-k { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.elv-tour-n { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #B0812B; }
.elv-tour-x { background: none; border: none; color: #8a93a6; font-size: .95rem; cursor: pointer; padding: 4px 6px; border-radius: 8px; line-height: 1; }
.elv-tour-x:hover { background: #F1E6CC; color: #1B2740; }
.elv-tour-bub h3 { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 1.28rem; line-height: 1.2; margin: 4px 0 6px; color: #172640; }
.elv-tour-bub p { margin: 0; font-size: .9rem; line-height: 1.5; color: #33415e; }

.elv-tour-dots { display: flex; gap: 5px; margin: 13px 0 12px; }
.elv-tour-dots i { height: 5px; flex: 1; border-radius: 3px; background: #E6E0D2; transition: background .3s; position: relative; overflow: hidden; }
.elv-tour-dots i.done { background: #C99A3E; }
.elv-tour-dots i.on { background: #E6E0D2; }
.elv-tour-dots i.on::after { content: ""; position: absolute; inset: 0; background: #C99A3E; transform-origin: left; animation: elvTourFill .5s ease-out forwards; }
@keyframes elvTourFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.elv-tour-btns { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.elv-tour-btns > span { display: flex; gap: 6px; margin-left: auto; }
.elv-tour-btns button { font: inherit; font-size: .86rem; cursor: pointer; border-radius: 10px; min-height: 40px; padding: 0 14px; border: none; }
.elv-tour-skip { background: none; color: #6b7590; text-decoration: underline; text-underline-offset: 3px; padding: 0 4px !important; }
.elv-tour-skip:hover { color: #1B2740; }
.elv-tour-prev { background: #F3EEE3; color: #1B2740; }
.elv-tour-prev:hover { background: #EADFC8; }
.elv-tour-next { background: linear-gradient(180deg, #223a5e, #172640); color: #fff; font-weight: 600; box-shadow: 0 3px 10px rgba(23, 38, 64, .3); transition: transform .15s; }
.elv-tour-next:hover { transform: translateY(-1px); }
.elv-tour button:focus-visible { outline: 2px solid #C99A3E; outline-offset: 2px; }

/* ---- Bouton « ? » de l'en-tête de section ---- */
.elv-helpq {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; border: 1.5px solid rgba(176, 129, 43, .45);
  background: #FFFDF8; color: #B0812B; font: 700 .9rem/1 Fraunces, Georgia, serif; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; opacity: .8; transition: opacity .15s, background .15s, transform .15s;
}
.elv-helpq:hover, .elv-helpq[aria-expanded="true"] { opacity: 1; background: #F1E6CC; transform: scale(1.06); }
.elv-helpq[hidden] { display: none; }

.elv-helppop {
  position: fixed; z-index: 990; box-sizing: border-box; width: min(300px, calc(100vw - 24px));
  background: #172640; color: #E6EBF4; border-radius: 13px; padding: 13px 15px 12px;
  box-shadow: 0 16px 36px rgba(12, 20, 38, .35); border-top: 3px solid #C99A3E;
  animation: elvTourPop .25s cubic-bezier(.2, .9, .3, 1.2);
}
.elv-helppop::before { content: ""; position: absolute; top: -8px; left: calc(var(--ax, 50%) - 6px); width: 12px; height: 12px; background: #C99A3E; transform: rotate(45deg); z-index: -1; }
.elv-helppop b { display: block; font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 1.02rem; color: #F0D79A; margin-bottom: 4px; }
.elv-helppop p { margin: 0 0 10px; font-size: .86rem; line-height: 1.5; }
.elv-helppop-tour { background: none; border: none; padding: 4px 0; color: #F0D79A; font: inherit; font-size: .8rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 380px) {
  .elv-tour-bub { padding: 14px 14px 12px; }
  .elv-tour-bub h3 { font-size: 1.15rem; }
  .elv-tour-btns button { padding: 0 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .elv-tour, .elv-tour-hole, .elv-tour-bub { transition: none !important; }
  .elv-tour-bub.pop, .elv-helppop, .elv-tour-hole::after, .elv-tour-dots i.on::after { animation: none !important; }
  .elv-tour-dots i.on { background: #C99A3E; }
}
@media print { .elv-tour, .elv-helppop, .elv-helpq { display: none !important; } }
