/* ==========================================================================
 * Travel Guide Page Styles
 * Passages — Sacred Routes of Malana
   ========================================================================== */

.path-main {
  padding: 0;
  max-width: 100%;
  height: 100vh;
  overflow: hidden;
}

.interactive-map-section {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: transparent;
}

.map-3d-container {
  position: relative;
  width: 100%; /* Fit to viewport */
  height: 100%;
  display: flex;
  align-items: center;
  z-index: 1;
}

/* Energy Lines */
.map-edges {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}

.map-edge-line {
  stroke-width: 1;
  pointer-events: none;
}

@media (max-width: 768px) {
  .travel-map-section {
    height: 400px;
  }
}


   Map Nodes
   -------------------------------------------------------------------------- */
.map-nodes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  transform-style: preserve-3d;
}

.map-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s ease;
}

.node-content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.map-node.active .node-content-wrapper {
  transform: scale(1.15) translateY(-5px);
}

.map-node.active {
  z-index: 10;
}

.node-marker {
  width: 12px;
  height: 12px;
  background: hsla(var(--dim-hue, 0), 80%, 60%, 1);
  border-radius: 50%;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px hsla(var(--dim-hue, 0), 80%, 60%, 0.6);
}

.map-node.active .node-marker {
  background: rgba(50, 50, 50, 1);
  transform: scale(1.5);
  border: 2px solid hsla(var(--dim-hue, 0), 80%, 60%, 1);
}

.node-label {
  margin-top: 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  background: transparent;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  opacity: 0.5;
  transition: all 0.3s ease;
}

.map-node.active .node-label {
  opacity: 1;
  transform: translateY(-5px);
  box-shadow: 0 8px 24px hsla(var(--dim-hue, 0), 80%, 60%, 0.4);
}

/* --------------------------------------------------------------------------
   Story Modal
   -------------------------------------------------------------------------- */
/* HUD Modal - Modern Transparent Screen */
.story-modal-overlay {
  position: fixed; /* Keep it fixed to the viewport */
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none; /* Let clicks pass through to map when not active */
  z-index: 1000; /* Ensure it's above everything */
  transition: opacity 0.5s ease;
  opacity: 0;
}

.story-modal-overlay.active {
  pointer-events: all;
  opacity: 1;
}

.story-modal {
  position: relative;
  width: 90%;
  max-width: 800px;
  /* Use flex column so content can fill the space */
  display: flex;
  flex-direction: column;
  /* Glassmorphism / Transparent Screen */
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid hsla(var(--dim-hue, 0), 80%, 60%, 0.3);
  border-top: 1px solid hsla(var(--dim-hue, 0), 80%, 80%, 0.6);
  border-left: 1px solid hsla(var(--dim-hue, 0), 80%, 80%, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5), 
    inset 0 0 40px hsla(var(--dim-hue, 0), 80%, 60%, 0.1),
    0 0 20px hsla(var(--dim-hue, 0), 80%, 60%, 0.2);
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  /* Mobile: restrict height and allow scroll */
  max-height: 90vh;
}

@media (min-width: 768px) {
  .story-modal {
    height: 420px; /* Fixed height on desktop for predictable layout */
    max-height: 90vh;
  }
}

.story-modal-overlay.active .story-modal {
  transform: scale(1);
  opacity: 1;
}

/* Warp Transition Animation */
.story-modal-overlay.portal-warp {
  animation: warp 0.8s ease-in-out;
}

@keyframes warp {
  0% { filter: brightness(1) blur(0px); }
  50% { filter: brightness(1.2) blur(3px); }
  100% { filter: brightness(1) blur(0px); }
}

.story-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 100;
  flex-shrink: 0;
}

.story-modal-close:hover {
  background: var(--color-primary);
  color: var(--color-bg);
  border-color: var(--color-primary);
}

/* 
  Modal Content: stacks vertically on mobile,
  side-by-side on desktop.
  flex: 1 ensures it fills the whole modal.
*/
.story-modal-content {
  display: flex;
  flex-direction: column;
  flex: 1; /* Fill the modal */
  min-height: 0; /* Required for flex children to shrink/scroll correctly */
  overflow: hidden;
}

@media (min-width: 768px) {
  .story-modal-content {
    flex-direction: row;
  }
}

/* Left image column */
.story-image-col {
  flex: none;
  width: 100%;
  height: 220px; /* Fixed height on mobile */
  overflow: hidden;
  border-bottom: 1px solid hsla(var(--dim-hue, 0), 80%, 60%, 0.2);
}

@media (min-width: 768px) {
  .story-image-col {
    width: 40%;
    height: 100%; /* Take full row height on desktop */
    flex: 0 0 40%;
    border-bottom: none;
    border-right: 1px solid hsla(var(--dim-hue, 0), 80%, 60%, 0.2);
  }
}

.story-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Right text column */
.story-text-col {
  flex: 1;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto; /* Scrollable if text is long */
  /* Extra right padding so close button doesn't overlap text */
  padding-right: 56px;
}

@media (min-width: 768px) {
  .story-text-col {
    padding: 36px 56px 36px 36px;
    justify-content: center;
  }
}

.story-text-col h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0 0 14px 0;
  color: hsla(var(--dim-hue, 0), 80%, 60%, 1);
  text-shadow: 0 0 10px hsla(var(--dim-hue, 0), 80%, 60%, 0.3);
  line-height: 1.2;
}

@media (min-width: 768px) {
  .story-text-col h3 {
    font-size: 2rem;
    margin-bottom: 20px;
  }
}

.story-text-col p {
  margin: 0;
  line-height: 1.7;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}
