/* ==========================================================================
 * 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%;
  height: calc(100% - 100px);
  /* Leave safe area for the header */
  margin-top: 100px;
  /* Push the entire map geometry below the header */
  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;
}

/* Removed old max-width 768px height restriction to allow full 100vh pannable map */

/* --------------------------------------------------------------------------------------- */
.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: filter 0.8s ease, opacity 0.8s ease, transform 0.8s ease, box-shadow 0.8s ease;
  cursor: pointer;
}

.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;
}

/* --- Focus Mode Styles --- */
.distance-show-mode .blurred-node {
  filter: blur(10px);
  opacity: 0.05;
  pointer-events: none;
}

.distance-show-mode .detached-node {
  z-index: 100;
  transform: translate(-50%, -50%) scale(1.15);
  animation: focusFloat 4s ease-in-out infinite;
}

.distance-show-mode .detached-node .node-label {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-5px);
  /* Remove box-shadow to keep it transparent and prevent ugly overlapping boxes */
}

@keyframes focusFloat {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1.15) translateY(0);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.15) translateY(-6px);
  }
}

/* ------------------------- */

@keyframes markerPulse {
  0% {
    box-shadow: 0 0 0 0 hsla(var(--dim-hue, 0), 80%, 60%, 0.6);
  }

  70% {
    box-shadow: 0 0 0 12px hsla(var(--dim-hue, 0), 80%, 60%, 0);
  }

  100% {
    box-shadow: 0 0 0 0 hsla(var(--dim-hue, 0), 80%, 60%, 0);
  }
}

.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.has-partner-service .node-marker {
  animation: serviceBlink 2.5s infinite ease-out;
}

.map-node.has-our-service .node-marker::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  animation: markerPulse 2.5s infinite ease-out;
  z-index: -1;
}

@keyframes serviceBlink {

  0%,
  100% {
    box-shadow: 0 0 5px hsla(var(--dim-hue, 0), 80%, 60%, 0.8), 0 0 15px hsla(var(--dim-hue, 0), 100%, 80%, 1);
    transform: scale(0.3);
  }

  50% {
    box-shadow: 0 0 2px hsla(var(--dim-hue, 0), 80%, 60%, 0.4), 0 0 5px hsla(var(--dim-hue, 0), 100%, 80%, 0.5);
    transform: scale(1.3);
  }
}

.map-node:hover .node-marker {
  transform: scale(1.2);
}

.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:hover .node-label {
  opacity: 1;
  transform: translateY(-2px);
}

.map-node.active .node-label {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-5px);
  /* Removed box-shadow here too to keep consistency */
}

.node-badge {
  font-size: 0.8rem;
  margin-left: 4px;
  vertical-align: middle;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.label-name {
  display: block;
}

.label-alt {
  display: block;
  font-size: 0.75rem;
  color: #e3c97d;
  opacity: 0.85;
  margin-top: 3px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.label-alt .meta-icon {
  font-size: 0.8rem;
  margin-right: 2px;
}

@media (max-width: 768px) {
  .map-node .node-marker {
    width: 8px;
    height: 8px;
  }

  .map-node .node-label {
    margin-top: 4px;
  }

  .label-name {
    font-size: 0.6rem;
  }

  .label-alt {
    font-size: 0.55rem;
  }

  .label-alt .meta-icon {
    font-size: 0.55rem;
  }
}

/* --------------------------------------------------------------------------
   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, backdrop-filter 0.5s ease, background-color 0.5s ease;
  opacity: 0;
  background-color: transparent;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}

.story-modal-overlay.active {
  pointer-events: all;
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.4);
  /* Dim the map slightly */
  backdrop-filter: blur(8px);
  /* Blur the background map */
  -webkit-backdrop-filter: blur(8px);
}

.story-modal {
  position: relative;
  width: 90%;
  max-width: 800px;
  /* Use flex column so content can fill the space */
  display: flex;
  flex-direction: column;
  /* Production-ready Glassmorphism Separation */
  background: rgba(15, 15, 20, 0.75);
  backdrop-filter: blur(32px) saturate(120%);
  -webkit-backdrop-filter: blur(32px) saturate(120%);

  /* Dynamic light border mapping to the node */
  border: 1px solid hsla(var(--dim-hue, 45), 70%, 60%, 0.15);
  border-top: 1px solid hsla(var(--dim-hue, 45), 80%, 65%, 0.45);
  border-left: 1px solid hsla(var(--dim-hue, 45), 80%, 65%, 0.3);
  border-radius: 24px;

  /* Multi-layered shadow for elevation + inner specular highlight */
  box-shadow:
    0 40px 80px -20px rgba(0, 0, 0, 0.8),
    0 20px 40px -10px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.15),
    inset 1px 0 1px rgba(255, 255, 255, 0.05);

  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);
  }
}

/* 
  Custom Torn Page Borders for Map Story Modal 
  Uses a pseudo-layer to prevent SVG distortion of the text.
*/
.map-story-modal {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.torn-page-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 15, 20, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 3px solid rgba(240, 235, 225, 0.9);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8), inset 0 0 8px rgba(255, 255, 255, 0.1);
  /* The white jagged edge on all 4 sides */
  filter: url(#frayed-paper) drop-shadow(10px 15px 25px rgba(0, 0, 0, 0.9)) drop-shadow(-5px 10px 15px rgba(0, 0, 0, 0.7));
  z-index: -1;
}

.story-modal-close {
  position: absolute;
  top: 12px;
  right: 20px;
  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: 35vh;
  min-height: 140px;
  max-height: 220px;
  overflow: hidden;
  border-bottom: 1px solid hsla(var(--dim-hue, 0), 80%, 60%, 0.2);
  background-color: #111;
  /* Fallback skeleton background */
  position: relative;
}

/* Loading skeleton shimmer effect */
.story-image-col::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transform: translateX(-100%);
  animation: shimmerLoading 1.5s infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes shimmerLoading {
  100% {
    transform: translateX(100%);
  }
}

@media (min-width: 768px) {
  .story-image-col {
    width: 40%;
    height: 100%;
    min-height: 0;
    max-height: none;
    /* 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;
  position: relative;
  z-index: 1;
  /* Stay above shimmer */
  opacity: 0;
  animation: fadeInImg 0.4s ease-out forwards;
}

@keyframes fadeInImg {
  to {
    opacity: 1;
  }
}

/* Right text column */
.story-text-col {
  flex: 1;
  padding: 24px 24px 32px;
  /* Reduced top padding for optical balance with title font */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
  min-height: 0;
}

@media (min-width: 768px) {
  .story-text-col {
    padding: 24px 48px 40px;
    /* Reduced top padding for optical balance */
    justify-content: flex-start;
  }

}

/* Centers the entire content wrapper vertically when there is extra space */
.story-content-wrapper {
  margin-top: auto;
  margin-bottom: auto;
}



.story-text-col h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  margin: 0 0 16px 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;
  letter-spacing: 0.02em;
  font-weight: 700;
  font-style: italic;
}

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

.story-text-col p {
  margin: 0;
  line-height: 1.7;
  color: var(--warm-white, #fdf8f2);
  font-size: 1.05rem;
  font-family: 'Cormorant Garamond', serif;
  text-align: justify;
  border-left: 2px solid hsla(var(--dim-hue, 0), 80%, 60%, 0.4);
  padding-left: 1rem;
  opacity: 0.95;
}

.story-services {
  margin-top: 1.5rem;
}

.service-group-title {
  display: block;
  font-size: 0.75rem;
  color: #c9a84c;
  /* Brand Gold */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}

.partner-header .service-group-title {
  margin-bottom: 0;
}

.service-tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.service-tag {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform: translateY(-1px);
  /* Slight adjustment for emoji optical baseline */
}

.service-tag.official-service {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: none;
  padding: calc(0.35rem + 1px) calc(0.75rem + 1px);
  background: transparent;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  isolation: isolate;
}

.service-tag.official-service .tag-content {
  position: relative;
  z-index: 3;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.service-tag.official-service .tick-mark {
  position: relative;
  z-index: 3;
}

.service-tag.official-service::before {
  content: "";
  position: absolute;
  width: 800px;
  height: 800px;
  top: 50%;
  left: 50%;
  margin-top: -400px;
  margin-left: -400px;
  background: conic-gradient(from 0deg, transparent 10%, #ffd700 100%);
  animation: rotateGlow 3s linear infinite;
  z-index: 1;
}

.service-tag.official-service::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  right: 1px;
  bottom: 1px;
  background: #11151c;
  border-radius: 19px;
  z-index: 2;
  box-sizing: border-box;
  transition: background 0.2s ease, border 0.2s ease;
}

.service-tag.official-service:hover {
  transform: translateY(-2px);
}

.service-tag.official-service.selected .tag-content {
  color: var(--color-primary);
}

.service-tag.official-service.selected::before {
  opacity: 0;
}

.service-tag.official-service.selected::after {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 20px;
  background: rgba(201, 168, 76, 0.05);
  border: 1px solid rgba(201, 168, 76, 0.5);
}

.service-tag.official-service.selected:hover::after {
  background: rgba(201, 168, 76, 0.15);
}


@keyframes rotateGlow {
  0% {
    transform: rotate(0deg);
  }

  16.5% {
    transform: rotate(71.5deg);
  }

  25% {
    transform: rotate(90deg);
  }

  33.5% {
    transform: rotate(108.5deg);
  }

  50% {
    transform: rotate(180deg);
  }

  66.5% {
    transform: rotate(251.5deg);
  }

  75% {
    transform: rotate(270deg);
  }

  83.5% {
    transform: rotate(288.5deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.service-tag.official-service.selected .tick-mark::after {
  content: '✔';
  color: #4ade80;
  font-weight: 800;
  margin-left: 6px;
  display: inline-block;
  animation: tickPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes tickPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Partner Node Distinctions */
.partner-name-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.4);
  transition: all 0.2s ease;
  cursor: pointer;
}

.partner-name-link:hover {
  color: #c9a84c;
  border-bottom-color: #c9a84c;
}

/* Partner Services and Contact */
.partner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0.6rem;
  width: 100%;
}

.service-group-title.partner-title {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0;
}

.partner-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-info-icon {
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.service-info-icon:hover {
  color: var(--gold-light, #e3c97d);
  transform: scale(1.1);
}

.service-info-panel {
  width: 100%;
  margin-top: 6px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: rgba(20, 20, 25, 0.6);
  border-left: 2px solid rgba(212, 175, 55, 0.5);
  border-radius: 4px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.service-info-panel a {
  color: var(--gold-light, #e3c97d);
  text-decoration: underline;
  transition: color 0.2s ease;
}

.service-info-panel a:hover {
  color: #fff;
}

@keyframes panelDrop {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panelFadeOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.partner-contact-row {
  display: flex;
  gap: 0.4rem;
}

.contact-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  text-decoration: none;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.contact-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.wa-btn {
  color: #25d366;
}

.wa-btn:hover {
  background: rgba(37, 211, 102, 0.2);
  border-color: rgba(37, 211, 102, 0.5);
}

.phone-btn {
  color: #3498db;
}

.phone-btn:hover {
  background: rgba(52, 152, 219, 0.2);
  border-color: rgba(52, 152, 219, 0.5);
}

.mail-btn {
  color: #e74c3c;
}

.mail-btn:hover {
  background: rgba(231, 76, 60, 0.2);
  border-color: rgba(231, 76, 60, 0.5);
}

/* --------------------------------------------------------------------------
   Navigation Help Pill
   -------------------------------------------------------------------------- */
.nav-help-pill-wrapper {
  position: absolute;
  top: 140px;
  left: 2.5rem;
  z-index: 20;
  filter: drop-shadow(0 1px 0px rgba(255, 255, 255, 0.4)) drop-shadow(0 5px 8px rgba(0, 0, 0, 0.7));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.nav-help-pill-wrapper:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 1px 0px rgba(255, 255, 255, 0.6)) drop-shadow(0 8px 15px rgba(0, 0, 0, 0.9));
}

.nav-help-pill {
  background: rgba(30, 30, 35, 0.35);
  /* More transparent for frosted look */
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.05);
  border-bottom: none;
  padding: 4px 6px 10px 6px;
  color: var(--gold-light, #e3c97d);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;

  clip-path: polygon(0% 0%, 100% 0%,
      100% 80%, 95% 70%, 90% 80%, 85% 75%, 80% 90%, 75% 95%, 70% 85%, 65% 75%, 60% 70%, 55% 83%, 50% 80%, 47% 100%, 44% 75%, 40% 80%, 35% 75%, 30% 85%, 25% 80%, 20% 95%, 15% 85%, 10% 70%, 5% 80%, 0% 75%);
}

.nav-help-pill-wrapper:hover .nav-help-pill {
  background: rgba(50, 50, 55, 0.8);
  border-color: rgba(212, 175, 55, 0.8);
}

@media (max-width: 700px) {
  .nav-help-pill-wrapper {
    left: 1rem;
  }
}

.nav-help-pill .pill-icon {
  font-size: 0.95rem;
}

.nav-help-pill .pill-action-icon {
  margin-left: 2px;
  color: var(--gold-light, #e3c97d);
  opacity: 0.7;
  animation: bounceDownPill 2s infinite ease-in-out;
}

@keyframes bounceDownPill {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(3px);
  }

  60% {
    transform: translateY(1.5px);
  }
}

@media (max-width: 768px) {
  .nav-help-pill-wrapper {
    top: 120px;
    left: 16px;
  }

  .nav-help-pill {
    padding: 5px 10px;
    font-size: 0.7rem;
  }

  .nav-help-pill .pill-icon {
    font-size: 0.85rem;
  }
}