/* ========================================
   LA MAPPA — Scrollytelling Tour Styles
   ======================================== */

.scrolly-map {
  position: relative;
  width: 100%;
  background: var(--parchment, #FAF2DB);
}

/* === STICKY VISUAL LAYER === */
.scrolly-visual {
  position: sticky;
  top: 54px;
  height: calc(100vh - 54px);
  width: 100%;
  overflow: hidden;
  background: var(--terracotta-dark, #8B3A1F);
  z-index: 1;
}

.visual-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  transition: transform-origin 0.1s linear;
  will-change: transform;
}

.base-panorama {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* === SPOTLIGHT OVERLAY === */
.spotlight {
  position: absolute;
  width: 30vh;
  height: 30vh;
  border-radius: 50%;
  pointer-events: none;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.35),
    inset 0 0 0 2px rgba(212, 160, 80, 0.6),
    inset 0 0 60px rgba(212, 160, 80, 0.2);
  opacity: 0;
  transition: opacity 0.8s ease, width 0.8s ease, height 0.8s ease;
}

.spotlight.active { opacity: 1; }

/* === TOP BAR (progress + map button) === */
.scrolly-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 16px 24px;
  gap: 16px;
}

.scrolly-progress-track {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.scrolly-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gold, #D4A050);
  transition: width 0.6s ease;
}

.map-mode-toggle {
  background: var(--terracotta, #C5573A);
  color: #FAF2DB;
  border: none;
  padding: 10px 18px;
  border-radius: 22px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.map-mode-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

/* === DOT NAVIGATION === */
.scrolly-dots {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 10px;
  background: rgba(20, 14, 8, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 24px;
  border: 1px solid rgba(212, 160, 80, 0.25);
}

.scrolly-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  cursor: pointer;
  padding: 0;
  transition: all 0.25s ease;
  position: relative;
  flex-shrink: 0;
}

.scrolly-dot:hover {
  background: #ffffff;
  transform: scale(1.25);
}

.scrolly-dot.active {
  background: var(--gold, #D4A050);
  border-color: var(--gold, #D4A050);
  transform: scale(1.4);
  box-shadow: 0 0 0 3px rgba(212, 160, 80, 0.3);
}

.scrolly-dot[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20, 14, 8, 0.92);
  color: #FAF2DB;
  padding: 8px 14px;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* === SCROLLING STEPS === */
.scrolly-steps {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.scroll-step {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8vw 0 5vw;
  pointer-events: none;
}

.scroll-step .step-card {
  pointer-events: auto;
  max-width: 440px;
  background: rgba(252, 247, 235, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 36px 32px;
  border-radius: 2px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  border-left: 4px solid var(--terracotta, #C5573A);
}

.step-card .step-counter {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terracotta, #C5573A);
  margin-bottom: 12px;
  font-weight: 500;
}

.step-card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--ink, #2A1810);
  margin: 0 0 16px;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.step-card p {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink, #2A1810);
  margin: 0 0 18px;
}

.step-card .step-image {
  width: 100%;
  height: auto;
  margin-top: 16px;
  border-radius: 2px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.step-card.cta-card { text-align: center; }

.step-card .cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.step-card .cta-buttons a {
  background: var(--terracotta, #C5573A);
  color: #FAF2DB;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 22px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: transform 0.2s ease;
}

.step-card .cta-buttons a:hover { transform: translateY(-1px); }

.step-card .cta-buttons a.secondary {
  background: transparent;
  color: var(--terracotta, #C5573A);
  border: 1.5px solid var(--terracotta, #C5573A);
}

/* === MAP MODAL === */
.map-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 20, 20, 0.95);
  display: none;
}

.map-modal.open { display: block; }

.map-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1001;
  background: var(--parchment, #FAF2DB);
  color: var(--ink, #2A1810);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

/* === MOBILE === */
@media (max-width: 768px) {
  .scroll-step {
    justify-content: center;
    align-items: flex-end;
    padding: 0 16px 32px;
  }

  .scroll-step .step-card {
    max-width: 100%;
    padding: 24px 22px;
  }

  .step-card h2 { font-size: 26px; }
  .step-card p { font-size: 14px; }

  .scrolly-dots {
    right: auto;
    left: 50%;
    top: 70px;
    transform: translateX(-50%);
    flex-direction: row;
  }

  .scrolly-topbar { padding: 12px 16px; }

  .map-mode-toggle {
    padding: 8px 14px;
    font-size: 12px;
  }
}

.scroll-step:not(.ready) { opacity: 0; }
