/* ============================================
   Forest Path Styles
   ============================================ */
#path-forest {
  background: linear-gradient(180deg, var(--forest-dark) 0%, #0f2a1e 100%);
}

/* Parallax tree background layers */
.forest-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  display: none;
}

#path-forest.active ~ .forest-bg,
#path-forest.active .forest-bg { display: block; }

[data-active-path="forest"] .forest-bg { display: block; }

.tree-layer {
  position: absolute;
  bottom: 0;
  left: -5%;
  width: 110%;
  height: 100%;
  background-repeat: repeat-x;
  background-position: bottom center;
  background-size: auto 70%;
  will-change: transform;
}

/* SVG tree silhouettes created via JS, these are positioning layers */
.tree-layer-1 { z-index: 3; opacity: 0.9; }
.tree-layer-2 { z-index: 2; opacity: 0.6; }
.tree-layer-3 { z-index: 1; opacity: 0.35; }

/* Leaf particles */
.leaf-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: hidden;
  display: none;
}

[data-active-path="forest"] .leaf-container { display: block; }

.leaf {
  position: absolute;
  width: 14px;
  height: 18px;
  opacity: 0.6;
  animation: leafFall linear infinite;
  /* Leaf shape via clip-path */
  clip-path: polygon(50% 0%, 85% 15%, 100% 50%, 85% 85%, 50% 100%, 15% 85%, 0% 50%, 15% 15%);
}

/* Add a midrib line via ::after */
.leaf::after {
  content: '';
  position: absolute;
  top: 15%;
  left: 50%;
  width: 1px;
  height: 70%;
  background: rgba(0,0,0,0.15);
  transform: translateX(-50%);
}

@keyframes leafFall {
  0% {
    transform: translateY(-20px) rotate(0deg) rotateX(0deg);
    opacity: 0.7;
  }
  25% {
    transform: translateY(27vh) rotate(90deg) rotateX(60deg) translateX(30px);
  }
  50% {
    transform: translateY(55vh) rotate(180deg) rotateX(0deg) translateX(-20px);
  }
  75% {
    transform: translateY(82vh) rotate(270deg) rotateX(-60deg) translateX(25px);
  }
  100% {
    transform: translateY(110vh) rotate(360deg) rotateX(0deg) translateX(-10px);
    opacity: 0;
  }
}

/* Path hero landing image */
.path-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.path-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.path-hero-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 5rem 3rem 4rem;
  background: linear-gradient(to top, rgba(15,42,30,0.95) 0%, rgba(15,42,30,0.7) 50%, transparent 100%);
  color: var(--white);
}

.path-hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0.75rem;
  text-shadow: 0 3px 15px rgba(0,0,0,0.6);
}

.path-hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: rgba(255,255,255,0.9);
  max-width: 600px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* ---- Conservation Philosophy in Hero ---- */
.forest-philosophy {
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  padding-left: 1.2rem;
  border-left: 3px solid var(--forest-bright);
  max-width: 650px;
  font-size: clamp(0.85rem, 1.6vw, 0.95rem);
  line-height: 1.75;
  color: rgba(255,255,255,0.78);
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

/* ============================================
   Full-Screen Scrollytelling Map Explorer
   ============================================ */

/* Scrollytelling container */
.forest-explore {
  position: relative;
  z-index: 5;
}

/* Steps container — drives scroll height, contains everything */
.forest-steps {
  position: relative;
}

/* Clearfix so the float doesn't collapse */
.forest-steps::after {
  content: '';
  display: table;
  clear: both;
}

/* Sticky map — floated left, sticks within .forest-steps */
.forest-map-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 55%;
  float: left;
  z-index: 6;
  overflow: hidden;
  background: rgba(8, 25, 40, 0.5);
}

.forest-map-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.forest-map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

#map-viewport {
  transform-origin: 0 0;
  will-change: transform;
}

/* Land */
.map-land { fill: var(--forest-dark); }

/* Coastline */
.map-coastline {
  stroke: var(--forest-light);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Map Regions ---- */
.map-region {
  transition: fill 0.5s ease, stroke-opacity 0.5s ease, stroke-width 0.5s ease;
}

/* ---- Map Markers ---- */
.marker-dot {
  fill: var(--forest-bright);
  transition: r 0.3s ease, fill 0.3s ease;
}

.marker-pulse {
  fill: var(--forest-bright);
  opacity: 0;
  animation: markerPulse 2.5s ease-out infinite;
}

@keyframes markerPulse {
  0% { r: 6; opacity: 0.5; }
  100% { r: 22; opacity: 0; }
}

.marker-label {
  fill: rgba(255,255,255,0.85);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  pointer-events: none;
}

.map-marker.active .marker-dot {
  fill: #fff;
  r: 8;
  filter: drop-shadow(0 0 8px var(--forest-bright));
}

.map-marker.active .marker-label {
  fill: #fff;
}

.map-marker.active .marker-pulse {
  animation: markerPulseActive 2s ease-out infinite;
}

@keyframes markerPulseActive {
  0% { r: 8; opacity: 0.4; }
  100% { r: 26; opacity: 0; }
}

/* ---- Scroll Steps (right column) ---- */
.forest-step {
  min-height: 85vh;
  margin-left: 55%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
}

/* Overview step */
.forest-step[data-step="overview"] {
  min-height: 60vh;
  align-items: flex-end;
  padding-bottom: 4rem;
}

/* Scroll prompt */
.scroll-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.45);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: scrollPromptBob 2s ease-in-out infinite;
}

.scroll-prompt svg {
  opacity: 0.5;
}

@keyframes scrollPromptBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* Hero → map transition fade */
.forest-explore::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, rgba(8, 25, 40, 0.5));
  pointer-events: none;
  z-index: 10;
}

/* ---- Forest Cards (glassmorphism) ---- */
.forest-card {
  background: rgba(15, 42, 30, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(74, 155, 106, 0.25);
  border-radius: 16px;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  color: var(--white);

  /* Slide-in animation */
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.forest-card.visible {
  opacity: 1;
  transform: translateX(0);
}

.forest-card .card-img-wrap {
  margin: -2rem -2rem 1.5rem -2rem;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}

.forest-card .card-img-wrap img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.forest-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--forest-bright);
  margin-bottom: 0.8rem;
}

.forest-card p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.8);
  margin-bottom: 0.8rem;
}

.forest-card ul {
  margin: 0.5rem 0 1rem 1.2rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.75);
}

.forest-card ul li {
  margin-bottom: 0.3rem;
}

.forest-card .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.forest-card .tag {
  background: rgba(74, 155, 106, 0.2);
  color: var(--forest-bright);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  border: 1px solid rgba(74, 155, 106, 0.2);
}
