/**
 * pwa-tour.css - Quick tour first-run après installation PWA
 * Overlay fullscreen 3 slides, swipe horizontal, safe-area respectées.
 */

#hd-pwa-tour {
  position: fixed;
  inset: 0;
  z-index: 100100;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at top, #0b1428 0%, #050c1c 70%);
  color: #e9e4d1;
  overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  animation: hdTourFadeIn 0.35s ease-out;
}

body.hd-pwa-tour-open {
  overflow: hidden;
}

@keyframes hdTourFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#hd-pwa-tour.is-closing {
  animation: hdTourFadeOut 0.25s ease-in forwards;
}
@keyframes hdTourFadeOut {
  to { opacity: 0; transform: scale(0.98); }
}

/* ─── Skip button top-right ─── */
.hd-pwa-tour__skip {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 0.9rem);
  right: calc(env(safe-area-inset-right, 0px) + 1rem);
  background: transparent;
  border: 1px solid rgba(233, 228, 209, 0.2);
  color: rgba(233, 228, 209, 0.75);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font: 400 0.78rem/1.2 'Lora', serif;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  z-index: 2;
}
.hd-pwa-tour__skip:hover,
.hd-pwa-tour__skip:focus-visible {
  background: rgba(233, 228, 209, 0.08);
  color: #e9e4d1;
  outline: none;
}

/* ─── Track (slides horizontal) ─── */
.hd-pwa-tour__track {
  flex: 1;
  display: flex;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  touch-action: pan-y;
}

@media (prefers-reduced-motion: reduce) {
  .hd-pwa-tour__track {
    transition: none;
  }
  #hd-pwa-tour,
  #hd-pwa-tour.is-closing {
    animation: none;
  }
}

.hd-pwa-tour__slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  padding: 1.5rem 1.75rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  text-align: center;
}

.hd-pwa-tour__icon {
  width: 120px;
  height: 120px;
  margin: auto auto 0.5rem;
  filter: drop-shadow(0 0 16px rgba(201, 168, 76, 0.2));
}
.hd-pwa-tour__icon svg {
  width: 100%;
  height: 100%;
}

.hd-pwa-tour__eyebrow {
  font: 500 0.72rem/1 'Lora', serif;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(201, 168, 76, 0.9);
  margin-top: auto;
}

.hd-pwa-tour__title {
  font: 300 2rem/1.15 'Cormorant Garamond', serif;
  letter-spacing: 0.005em;
  color: #e9e4d1;
  margin: 0;
  padding: 0 0.5rem;
  max-width: 560px;
}
.hd-pwa-tour__title em {
  color: #c9a84c;
  font-style: italic;
  font-weight: 400;
}

.hd-pwa-tour__body {
  font: 400 1rem/1.55 'Lora', serif;
  color: rgba(233, 228, 209, 0.78);
  margin: 0 auto auto;
  max-width: 480px;
  padding: 0 0.25rem;
}

/* ─── Dots pagination ─── */
.hd-pwa-tour__dots {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.5rem 0 0.75rem;
}
.hd-pwa-tour__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(233, 228, 209, 0.25);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}
.hd-pwa-tour__dot.is-active {
  width: 24px;
  border-radius: 4px;
  background: #c9a84c;
}
.hd-pwa-tour__dot:focus-visible {
  outline: 2px solid #c9a84c;
  outline-offset: 3px;
}

/* ─── Navigation bar ─── */
.hd-pwa-tour__nav {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 1.75rem calc(env(safe-area-inset-bottom, 0px) + 1.25rem);
  justify-content: space-between;
}

.hd-pwa-tour__nav-btn {
  flex: 1;
  max-width: 200px;
  min-height: 48px;
  border-radius: 999px;
  font: 500 0.92rem/1 'Lora', serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.hd-pwa-tour__nav-btn--prev {
  background: transparent;
  border: 1px solid rgba(233, 228, 209, 0.25);
  color: rgba(233, 228, 209, 0.75);
}
.hd-pwa-tour__nav-btn--prev:disabled {
  opacity: 0;
  pointer-events: none;
}
.hd-pwa-tour__nav-btn--prev:not(:disabled):hover,
.hd-pwa-tour__nav-btn--prev:not(:disabled):focus-visible {
  background: rgba(233, 228, 209, 0.08);
  color: #e9e4d1;
  outline: none;
}

.hd-pwa-tour__nav-btn--next {
  background: linear-gradient(135deg, #c9a84c 0%, #b08a2e 100%);
  border: 0;
  color: #050c1c;
  font-weight: 600;
}
.hd-pwa-tour__nav-btn--next:hover,
.hd-pwa-tour__nav-btn--next:focus-visible {
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.35);
}

/* ─── Responsive (très grand écran) ─── */
@media (min-width: 720px) {
  .hd-pwa-tour__icon {
    width: 160px;
    height: 160px;
  }
  .hd-pwa-tour__title {
    font-size: 2.5rem;
  }
  .hd-pwa-tour__body {
    font-size: 1.1rem;
  }
}

/* Landscape très plat → réduire l'icône pour laisser place au texte */
@media (orientation: landscape) and (max-height: 520px) {
  .hd-pwa-tour__icon {
    width: 72px;
    height: 72px;
    margin: 0.5rem auto 0;
  }
  .hd-pwa-tour__title {
    font-size: 1.5rem;
  }
  .hd-pwa-tour__eyebrow {
    margin-top: 0.25rem;
  }
}
