/* ==========================================================================
   Epoch — Interactive Map
   ========================================================================== */

.epoch-map-container {
  position: relative;
  max-width: var(--content-wide);
  margin: 0 auto 3rem;
  padding: 0 var(--gutter);
}

.epoch-map {
  position: relative;
  overflow: hidden;
  touch-action: pinch-zoom;
}

.epoch-map-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Map points */
.epoch-point {
  position: absolute;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  border-radius: 50%;
  background: rgba(196, 163, 90, 0.85);
  border: 2px solid #a8873a;
  cursor: pointer;
  z-index: 5;
  transition: transform 0.3s ease, background 0.3s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.3);
}

.epoch-point:hover {
  transform: scale(1.25);
  background: rgba(196, 163, 90, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.3);
}

.epoch-point-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: #2a1f0e;
  text-shadow: 0 1px 0 rgba(255,255,255,0.2);
}

/* Tooltip label */
.epoch-point-label {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  color: #fff;
  background: rgba(30, 25, 15, 0.9);
  padding: 3px 8px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.epoch-point-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(30, 25, 15, 0.9);
}

.epoch-point:hover .epoch-point-label {
  opacity: 1;
}

/* Side panel */
.epoch-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-primary);
  z-index: 150;
  padding: 5rem 2rem 2rem;
  overflow-y: auto;
  transition: right 0.4s ease;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
}

.epoch-panel.open {
  right: 0;
}

.epoch-panel-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s ease;
}

.epoch-panel-close:hover {
  color: var(--text-primary);
}

.epoch-panel-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: var(--font-h2);
  color: var(--accent-deep);
  margin-bottom: 1rem;
}

.epoch-panel-body {
  font-size: var(--font-body);
  line-height: var(--lh-relaxed);
  color: var(--text-secondary);
}

/* Overlay */
.epoch-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 140;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.epoch-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Closing text */
.epoch-closing {
  font-family: 'Cormorant Garamond', Garamond, serif;
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  line-height: var(--lh-relaxed);
  text-align: center;
  color: var(--text-secondary);
  padding: var(--section-spacing) 0;
  font-style: italic;
}

/* Mobile: bigger touch targets */
@media (max-width: 639px) {
  .epoch-point {
    width: 24px;
    height: 24px;
    margin-left: -12px;
    margin-top: -12px;
  }

  .epoch-point-number {
    font-size: 0.55rem;
  }

  .epoch-point-label {
    display: none;
  }

  .epoch-panel {
    width: 100vw;
    max-width: 100vw;
    right: -100vw;
  }
}
