﻿// Footer for Layer 1 static pages.
// All hrefs must resolve. Network links go to sibling editions; internal links
// hit real routes. Update href="#" candidates as those routes ship.
// URL convention: apex "/" is the canonical English homepage; every other
// path is "/<lang>/<rest>" including English. The lane links below are
// generated lang-aware so es/plan/ → /es/plan/, en/plan/ → /en/plan/, etc.

const Footer = () => {
  const path = typeof window !== "undefined" ? window.location.pathname : "/";
  const { lang } = (typeof parseLayer1Path === "function") ? parseLayer1Path(path) : { lang: "en" };
  const planHref = (typeof urlForLang === "function") ? urlForLang("/plan/", lang) : "/en/plan/";
  const bookHref = (typeof urlForLang === "function") ? urlForLang("/book/", lang) : "/en/book/";

  return (
  <footer className="footer">
    <div className="footer-stamp">T</div>
    <div className="container">
      <div className="footer-colophon footer-colophon-3">
        <div className="footer-col footer-brand">
          <h3 className="serif footer-brand-mark">HowTo:<em>Travel.</em></h3>
          <p className="footer-brand-tag">We believe everyone has the ability to see the world. Our job is the guidance, inspiration, and company to help you go.</p>
        </div>
        <div className="footer-col">
          <h5>Explore</h5>
          <ul>
            <li><a href="https://roundtrips.org">RoundTrips</a></li>
            <li><a href={planHref}>Plan</a></li>
            <li><a href={bookHref}>Book</a></li>
            <li><a href="/about">About</a></li>
            <li><a href="/contact">Contact</a></li>
          </ul>
        </div>
        <div className="footer-col">
          <h5>The Network</h5>
          <ul>
            <li><a href="https://thehowtonetwork.com">HowTo Network</a></li>
            <li><a href="https://howtohomeedition.com">HowTo: Home</a></li>
            <li><a href="https://howtofoodedition.com">HowTo: Food</a></li>
            <li><a href="https://howtobeautyedition.com">HowTo: Beauty</a></li>
            <li><a href="https://howtotechedition.com">HowTo: Tech</a></li>
            <li><a href="https://howtofamilyedition.com">HowTo: Family</a></li>
            <li><a href="https://howtofinanceedition.com">HowTo: Finance</a></li>
          </ul>
        </div>
      </div>
      <div className="footer-bottom">
        <span>© 2026 HowTo Network · Made with care in 14 timezones</span>
        <div className="socials">
          <a href="/privacy">Privacy</a>
          <a href="/terms">Terms</a>
          <a href="https://thehowtonetwork.com">Network</a>
        </div>
      </div>
    </div>
  </footer>
  );
};

Object.assign(window, { Footer });
