<script src="https://unpkg.com/lucide@latest"></script>

<section id="routes" class="py-24 bg-surface font-sans overflow-hidden">
  <div class="container mx-auto px-6">
    
    <div class="relative max-w-3xl mx-auto text-center mb-20">
      <span class="text-secondary font-black tracking-widest text-xs uppercase bg-primary/10 px-4 py-2 rounded-full mb-4 inline-block tracking-[0.2em]">Expedition Paths</span>
      <h2 class="text-4xl md:text-6xl font-black text-navy tracking-tighter mb-6">
        Select Your <span class="text-secondary">Challenge</span>
      </h2>
      <p class="text-lg text-muted max-w-2xl mx-auto">
        From established trails to wild, untamed ridges—Mount Kenya offers six distinct paths to the sky.
      </p>
    </div>

    <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10">
      
      <article class="group relative flex flex-col bg-surface rounded-[2.5rem] overflow-hidden transition-all duration-500 hover:shadow-2xl hover:-translate-y-2">
        <div class="relative h-64 overflow-hidden">
          <img src="<?= base_url('assets/images/routes/naro-moru.webp') ?>" alt="Naro Moru Route Mount Kenya" class="w-full h-full object-cover transition-transform duration-1000 group-hover:scale-110">
          <div class="absolute inset-0 bg-gradient-to-t from-navy/90 via-navy/20 to-transparent"></div>
          <div class="absolute top-6 left-6">
            <div class="backdrop-blur-md bg-white/20 border border-white/30 rounded-2xl px-4 py-2 text-white"><p class="text-[10px] font-black uppercase tracking-widest">Fastest Ascent</p></div>
          </div>
        </div>
        <div class="p-8 flex-grow flex flex-col -mt-12 relative z-10 bg-surface rounded-t-[2.5rem]">
          <h3 class="text-3xl font-black text-navy tracking-tight mb-2">Naro Moru</h3>
          <p class="text-muted leading-relaxed mb-6">Direct and efficient. Features the iconic Vertical Bog and quick access to Point Lenana.</p>
          <div id="details-naro" class="hidden mb-6 space-y-4 animate-[fadeIn_0.4s_ease-out]">
            <div class="grid grid-cols-2 gap-3">
              <div class="bg-surface p-4 rounded-2xl border border-border text-center"><span class="text-[10px] font-bold text-muted uppercase block">Duration</span><p class="text-sm font-black text-navy">4-5 Days</p></div>
              <div class="bg-surface p-4 rounded-2xl border border-border text-center"><span class="text-[10px] font-bold text-muted uppercase block">Difficulty</span><p class="text-sm font-black text-accent uppercase">Mod-Chal</p></div>
            </div>
          </div>
          <button onclick="toggleRoute('details-naro', this)" class="w-2/5 mt-auto flex items-center justify-center gap-3 py-4 bg-accent border-2 border-accent text-white rounded-2xl font-black transition-all hover:bg-surface hover:text-accent uppercase text-xs tracking-widest"><span>Explore</span><i data-lucide="plus" class="w-4 h-4 transition-transform duration-300"></i></button>
        </div>
      </article>

      <article class="group relative flex flex-col bg-surface rounded-[2.5rem] overflow-hidden transition-all duration-500 hover:shadow-2xl hover:-translate-y-2">
        <div class="relative h-64 overflow-hidden">
          <img src="<?= base_url('assets/images/routes/burguret.jpg') ?>" alt="Burguret Route Mount Kenya" class="w-full h-full object-cover transition-transform duration-1000 group-hover:scale-110">
          <div class="absolute inset-0 bg-gradient-to-t from-navy/90 via-navy/20 to-transparent"></div>
          <div class="absolute top-6 left-6">
            <div class="backdrop-blur-md bg-white/20 border border-white/30 rounded-2xl px-4 py-2 text-white"><p class="text-[10px] font-black uppercase tracking-widest">Wilderness</p></div>
          </div>
        </div>
        <div class="p-8 flex-grow flex flex-col -mt-12 relative z-10 bg-surface rounded-t-[2.5rem]">
          <h3 class="text-3xl font-black text-navy tracking-tight mb-2">Burguret</h3>
          <p class="text-muted leading-relaxed mb-6">A rough, untamed path through dense forest. Perfect for those seeking absolute solitude.</p>
          <div id="details-burguret" class="hidden mb-6 space-y-4 animate-[fadeIn_0.4s_ease-out]">
            <div class="grid grid-cols-2 gap-3">
              <div class="bg-surface p-4 rounded-2xl border border-border text-center"><span class="text-[10px] font-bold text-muted uppercase block">Duration</span><p class="text-sm font-black text-navy">5-7 Days</p></div>
              <div class="bg-surface p-4 rounded-2xl border border-border text-center"><span class="text-[10px] font-bold text-muted uppercase block">Difficulty</span><p class="text-sm font-black text-warning uppercase">Challenging</p></div>
            </div>
          </div>
          <button onclick="toggleRoute('details-burguret', this)" class="w-2/5 mt-auto flex items-center justify-center gap-3 py-4 bg-accent border-2 border-accent text-white rounded-2xl font-black transition-all hover:bg-surface hover:text-accent uppercase text-xs tracking-widest"><span>Explore</span><i data-lucide="plus" class="w-4 h-4 transition-transform duration-300"></i></button>
        </div>
      </article>

      <article class="group relative flex flex-col bg-surface rounded-[2.5rem] overflow-hidden transition-all duration-500 hover:shadow-2xl hover:-translate-y-2">
        <div class="relative h-64 overflow-hidden">
          <img src="<?= base_url('assets/images/routes/timau.jpg') ?>" alt="Timau Route Mount Kenya" class="w-full h-full object-cover transition-transform duration-1000 group-hover:scale-110">
          <div class="absolute inset-0 bg-gradient-to-t from-navy/90 via-navy/20 to-transparent"></div>
          <div class="absolute top-6 left-6">
            <div class="backdrop-blur-md bg-white/20 border border-white/30 rounded-2xl px-4 py-2 text-white"><p class="text-[10px] font-black uppercase tracking-widest">Gentle Descent</p></div>
          </div>
        </div>
        <div class="p-8 flex-grow flex flex-col -mt-12 relative z-10 bg-surface rounded-t-[2.5rem]">
          <h3 class="text-3xl font-black text-navy tracking-tight mb-2">Timau</h3>
          <p class="text-muted leading-relaxed mb-6">The oldest route on the mountain. Offers a gradual approach through the northern slopes.</p>
          <div id="details-timau" class="hidden mb-6 space-y-4 animate-[fadeIn_0.4s_ease-out]">
            <div class="grid grid-cols-2 gap-3">
              <div class="bg-surface p-4 rounded-2xl border border-border text-center"><span class="text-[10px] font-bold text-muted uppercase block">Duration</span><p class="text-sm font-black text-navy">5-6 Days</p></div>
              <div class="bg-surface p-4 rounded-2xl border border-border text-center"><span class="text-[10px] font-bold text-muted uppercase block">Difficulty</span><p class="text-sm font-black text-secondary uppercase">Moderate</p></div>
            </div>
          </div>
          <button onclick="toggleRoute('details-timau', this)" class="w-2/5 mt-auto flex items-center justify-center gap-3 py-4 bg-accent border-2 border-accent text-white rounded-2xl font-black transition-all hover:bg-surface hover:text-accent uppercase text-xs tracking-widest"><span>Explore</span><i data-lucide="plus" class="w-4 h-4 transition-transform duration-300"></i></button>
        </div>
      </article>

      <article class="group relative flex flex-col bg-surface rounded-[2.5rem] overflow-hidden transition-all duration-500 hover:shadow-2xl hover:-translate-y-2">
        <div class="relative h-64 overflow-hidden">
          <img src="<?= base_url('assets/images/routes/chogoria-route.jpg') ?>" alt="Chogoria Route Mount Kenya" class="w-full h-full object-cover transition-transform duration-1000 group-hover:scale-110">
          <div class="absolute inset-0 bg-gradient-to-t from-navy/90 via-navy/20 to-transparent"></div>
          <div class="absolute top-6 left-6">
            <div class="backdrop-blur-md bg-white/20 border border-white/30 rounded-2xl px-4 py-2 text-white"><p class="text-[10px] font-black uppercase tracking-widest">Most Scenic</p></div>
          </div>
        </div>
        <div class="p-8 flex-grow flex flex-col -mt-12 relative z-10 bg-surface rounded-t-[2.5rem]">
          <h3 class="text-3xl font-black text-navy tracking-tight mb-2">Chogoria</h3>
          <p class="text-muted leading-relaxed mb-6">The scenic masterpiece. Passes Gorges Valley, Lake Michaelson, and spectacular waterfalls.</p>
          <div id="details-chogoria" class="hidden mb-6 space-y-4 animate-[fadeIn_0.4s_ease-out]">
            <div class="grid grid-cols-2 gap-3">
              <div class="bg-surface p-4 rounded-2xl border border-border text-center"><span class="text-[10px] font-bold text-muted uppercase block">Duration</span><p class="text-sm font-black text-navy">5-6 Days</p></div>
              <div class="bg-surface p-4 rounded-2xl border border-border text-center"><span class="text-[10px] font-bold text-muted uppercase block">Difficulty</span><p class="text-sm font-black text-accent uppercase">Mod-Chal</p></div>
            </div>
          </div>
          <button onclick="toggleRoute('details-chogoria', this)" class="w-2/5 mt-auto flex items-center justify-center gap-3 py-4 bg-accent border-2 border-accent text-white rounded-2xl font-black transition-all hover:bg-surface hover:text-accent uppercase text-xs tracking-widest"><span>Explore</span><i data-lucide="plus" class="w-4 h-4 transition-transform duration-300"></i></button>
        </div>
      </article>

      <article class="group relative flex flex-col bg-surface rounded-[2.5rem] overflow-hidden transition-all duration-500 hover:shadow-2xl hover:-translate-y-2">
        <div class="relative h-64 overflow-hidden">
          <img src="<?= base_url('assets/images/routes/kamweti.webp') ?>" alt="Kamweti Route Mount Kenya" class="w-full h-full object-cover transition-transform duration-1000 group-hover:scale-110">
          <div class="absolute inset-0 bg-gradient-to-t from-navy/90 via-navy/20 to-transparent"></div>
          <div class="absolute top-6 left-6">
            <div class="backdrop-blur-md bg-white/20 border border-white/30 rounded-2xl px-4 py-2 text-white"><p class="text-[10px] font-black uppercase tracking-widest">Elite Trail</p></div>
          </div>
        </div>
        <div class="p-8 flex-grow flex flex-col -mt-12 relative z-10 bg-surface rounded-t-[2.5rem]">
          <h3 class="text-3xl font-black text-navy tracking-tight mb-2">Kamweti</h3>
          <p class="text-muted leading-relaxed mb-6">A wilderness odyssey through ancient forests. The longest and most demanding approach.</p>
          <div id="details-kamweti" class="hidden mb-6 space-y-4 animate-[fadeIn_0.4s_ease-out]">
            <div class="grid grid-cols-2 gap-3">
              <div class="bg-surface p-4 rounded-2xl border border-border text-center"><span class="text-[10px] font-bold text-muted uppercase block">Duration</span><p class="text-sm font-black text-navy">6-7 Days</p></div>
              <div class="bg-surface p-4 rounded-2xl border border-border text-center"><span class="text-[10px] font-bold text-muted uppercase block">Difficulty</span><p class="text-sm font-black text-warning uppercase">Extreme</p></div>
            </div>
          </div>
          <button onclick="toggleRoute('details-kamweti', this)" class="w-2/5 mt-auto flex items-center justify-center gap-3 py-4 bg-accent border-2 border-accent text-white rounded-2xl font-black transition-all hover:bg-surface hover:text-accent uppercase text-xs tracking-widest"><span>Explore</span><i data-lucide="plus" class="w-4 h-4 transition-transform duration-300"></i></button>
        </div>
      </article>

      <article class="group relative flex flex-col bg-surface rounded-[2.5rem] overflow-hidden transition-all duration-500 hover:shadow-2xl hover:-translate-y-2">
        <div class="relative h-64 overflow-hidden">
          <img src="<?= base_url('assets/images/routes/sirimon.webp') ?>" alt="Sirimon Route Mount Kenya" class="w-full h-full object-cover transition-transform duration-1000 group-hover:scale-110">
          <div class="absolute inset-0 bg-gradient-to-t from-navy/90 via-navy/20 to-transparent"></div>
          <div class="absolute top-6 left-6">
            <div class="backdrop-blur-md bg-white/20 border border-white/30 rounded-2xl px-4 py-2 text-white"><p class="text-[10px] font-black uppercase tracking-widest">Stable Weather</p></div>
          </div>
        </div>
        <div class="p-8 flex-grow flex flex-col -mt-12 relative z-10 bg-surface rounded-t-[2.5rem]">
          <h3 class="text-3xl font-black text-navy tracking-tight mb-2">Sirimon</h3>
          <p class="text-muted leading-relaxed mb-6">The climber's favorite for acclimatization. Stunning moorland and high-altitude flora.</p>
          <div id="details-sirimon" class="hidden mb-6 space-y-4 animate-[fadeIn_0.4s_ease-out]">
            <div class="grid grid-cols-2 gap-3">
              <div class="bg-surface p-4 rounded-2xl border border-border text-center"><span class="text-[10px] font-bold text-muted uppercase block">Duration</span><p class="text-sm font-black text-navy">4-5 Days</p></div>
              <div class="bg-surface p-4 rounded-2xl border border-border text-center"><span class="text-[10px] font-bold text-muted uppercase block">Difficulty</span><p class="text-sm font-black text-secondary uppercase">Moderate</p></div>
            </div>
          </div>
          <button onclick="toggleRoute('details-sirimon', this)" class="w-2/5 mt-auto flex items-center justify-center gap-3 py-4 bg-accent border-2 border-accent text-white rounded-2xl font-black transition-all hover:bg-surface hover:text-accent uppercase text-xs tracking-widest"><span>Explore</span><i data-lucide="plus" class="w-4 h-4 transition-transform duration-300"></i></button>
        </div>
      </article>

    </div>
  </div>
</section>

<script>
  lucide.createIcons();

  function toggleRoute(id, btn) {
    const detail = document.getElementById(id);
    const isHidden = detail.classList.contains('hidden');
    const span = btn.querySelector('span');
    const icon = btn.querySelector('i');

    if (isHidden) {
      detail.classList.remove('hidden');
      span.innerText = 'Collapse';
      icon.style.transform = 'rotate(45deg)';
      btn.classList.replace('bg-accent', 'bg-light');
      btn.classList.add('text-accent');
    } else {
      detail.classList.add('hidden');
      span.innerText = 'Explore';
      icon.style.transform = 'rotate(0deg)';
      btn.classList.replace('bg-light', 'bg-accent');
      btn.classList.remove('text-accent');
    }
  }
</script>