/* eslint-disable */
// Layovers — trip-duration hub. Same editorial vocabulary as the three-day
// hub (cream/teal/tan, Playfair + DM Sans/Mono, numbered sections, hero
// masthead). Topic: turning an airline routing into a deliberate stop.

const { useState: useLOState } = React;

/* ---------- HERO ---------- */
const LOHero = () => (
  <section className="solo-hero">
    <div
      className="hero-bg"
      style={{ backgroundImage: `url(https://images.unsplash.com/photo-1436491865332-7a61a109cc05?w=2400&q=85)` }}
    ></div>
    <div className="hero-scrim"></div>
    <Nav />

    <div className="container">
      <div className="solo-crumbs">
        <a href="/">Home</a>
        <span className="sep">/</span>
        <a href="/en/plan/">Plan</a>
        <span className="sep">/</span>
        <a href="/en/plan/trip-duration/">Trip Duration</a>
        <span className="sep">/</span>
        <span className="here">Layovers</span>
      </div>

      <div className="solo-mast">
        <div className="lhs">
          <span className="layer-tag">SIX TO SEVENTY-TWO HOURS · 17 GUIDES · {LO_META.newThisSeason} NEW THIS SEASON</span>
          <h1>
            Layovers<em>on Purpose.</em>
          </h1>
          <p className="lede">
            The art of turning an airline routing into a deliberate stop. <em>Two cities, one ticket,</em> sometimes a free hotel. Eight cities worth a stop, four ways to engineer the stopover before you leave home, and the brief on what changes when the trip is six hours instead of three days.
          </p>
        </div>
        <div className="rhs">
          <div className="solo-meta-card">
            <div className="row">
              <span className="k">Guides on file</span>
              <span className="v"><em>{LO_META.count}</em></span>
            </div>
            <div className="row">
              <span className="k">New this season</span>
              <span className="v">{LO_META.newThisSeason}</span>
            </div>
            <div className="row">
              <span className="k">Working window</span>
              <span className="v">6 hr – 3 days</span>
            </div>
            <div className="row">
              <span className="k">Most-read age</span>
              <span className="v">{LO_META.topAge}</span>
            </div>
            <div className="row last">
              <span className="k">Updated</span>
              <span className="v">{LO_META.updated}</span>
            </div>
          </div>
        </div>
      </div>

      <div className="solo-toc">
        <span className="lbl">In this issue</span>
        <a href="#places"><span className="n">I</span>Twelve cities</a>
        <span className="dot">·</span>
        <a href="#field"><span className="n">II</span>Field notes</a>
        <span className="dot">·</span>
        <a href="#itins"><span className="n">III</span>Four ways</a>
        <span className="dot">·</span>
        <a href="#bucket"><span className="n">IV</span>The matrix</a>
        <span className="dot">·</span>
        <a href="#reading"><span className="n">V</span>Reading</a>
        <span className="dot">·</span>
        <a href="#voices"><span className="n">VI</span>The desk</a>
        <span className="dot">·</span>
        <a href="#practical"><span className="n">VII</span>The brief</a>
        <span className="dot">·</span>
        <a href="#faq"><span className="n">VIII</span>FAQ</a>
      </div>
    </div>

    <div className="hero-coord">FORM Nº 11 · ROUTING AS DESTINATION</div>
    <div className="hero-credit">PHOTO — FIELD DESK Nº 117 · IRIS</div>
  </section>
);

/* ---------- I · TWELVE CITIES WORTH A STOP ---------- */
const LOPlaces = () => {
  const [region, setRegion] = useLOState("All");
  const regions = ["All", "Asia", "Middle East", "Europe", "Americas"];
  const filtered = LO_PLACES.filter(p => region === "All" || p.region === region);

  return (
    <section className="solo-places" id="places">
      <div className="container">
        <div className="solo-section-head">
          <div className="num">I</div>
          <div className="titles">
            <h2>Twelve cities,<em>worth the stop.</em></h2>
            <p>Picked because the airport-to-city math actually works — a direct train, a metro line, or a free transit tour. Every card is a hand-built plan walked by the desk.</p>
          </div>
          <div className="filter-pills">
            {regions.map(r => (
              <button
                key={r}
                className={`f-pill ${region === r ? "on" : ""}`}
                onClick={() => setRegion(r)}
              >{r}</button>
            ))}
          </div>
        </div>

        <div className="places-grid">
          {filtered.map((p, i) => (
            <a key={p.id} href={p.href} className={`place-card ${i === 0 ? "feature" : ""}`}>
              <div className="img" style={{ backgroundImage: `url(${p.img})` }}></div>
              <div className="scrim"></div>
              <span className="rank">No. {String(p.rank).padStart(2, "0")}</span>
              {p.tag && <span className="tag">{p.tag}</span>}
              <div className="body">
                <div className="loc">
                  <span className="city">{p.city}</span>
                  <span className="country">{p.country}</span>
                </div>
                <p className="why">{p.why}</p>
                <div className="meta">
                  <span><em>{p.nights}</em> nights</span>
                  <span className="sep">·</span>
                  <span>{p.budget}</span>
                  <span className="sep">·</span>
                  <span>{p.season}</span>
                </div>
                <div className="best-for">
                  {p.best.map(b => <span key={b}>{b}</span>)}
                </div>
                <div className="coord">{p.coord}</div>
              </div>
            </a>
          ))}
        </div>
        <div className="places-foot">
          <span className="ct">Showing {filtered.length} of {LO_PLACES.length}</span>
          <a href="/en/plan/trip-duration/">All trip-duration hubs <Icon name="arrow" size={12} /></a>
        </div>
      </div>
    </section>
  );
};

/* ---------- II · FIELD NOTES (essay quote, dark band) ---------- */
const LOField = () => (
  <section className="solo-practical" id="field" style={{ paddingTop: 110, paddingBottom: 110 }}>
    <div className="container">
      <div className="solo-section-head dark">
        <div className="num">II</div>
        <div className="titles">
          <h2>Field notes.<em>Why the layover is the trip.</em></h2>
          <p>The opening pages of the Plan Desk's house essay on the deliberate stopover — what it is, what it isn't, and why the airline is paying for the second city.</p>
        </div>
        <div className="right">Read the full essay <Icon name="arrow" size={12} /></div>
      </div>

      <blockquote style={{
        fontFamily: "var(--serif)",
        fontSize: "clamp(22px, 2.4vw, 30px)",
        lineHeight: 1.45,
        color: "var(--cream)",
        fontStyle: "italic",
        maxWidth: 920,
        borderLeft: "1px solid var(--tan)",
        padding: "8px 0 8px 32px",
        marginBottom: 28,
      }}>
        "The cheapest way to see a second city is to not pretend you're not flying through it. Singapore Airlines, Qatar, Emirates, Icelandair, TAP, Copa — they all want you in their hub long enough to use it. The hotel is on them. The transit pass is on them. All they want is a fare you were already going to pay. The trip you didn't know you were taking is the one already on your boarding pass."
      </blockquote>
      <p style={{
        fontSize: 15,
        lineHeight: 1.7,
        color: "rgba(241,235,224,0.78)",
        maxWidth: 760,
        marginBottom: 18,
      }}>
        The mistake most travelers make is treating the layover as a problem to minimize — the shortest connection, the smallest window, the least time on the ground. The math runs the other way. A six-hour layover is a two-hour visit. A ten-hour layover is a four-hour visit. A 24-hour stopover is a free night in a city you'd otherwise have flown over.
      </p>
      <p style={{
        fontSize: 15,
        lineHeight: 1.7,
        color: "rgba(241,235,224,0.78)",
        maxWidth: 760,
      }}>
        Pick an airline with a stopover program. Search multi-city, never round-trip. Plan the layover backwards from the time you have to be back through security. Carry your essentials in your one cabin bag and let the rest sit in the hold, ticketed through. The layover is not the price you pay for the long flight. It's the second trip the long flight pays for.
      </p>
      <p style={{
        marginTop: 32,
        fontFamily: "var(--mono)",
        fontSize: 11,
        letterSpacing: "0.18em",
        color: "var(--tan)",
        textTransform: "uppercase",
      }}>— Iris Mendoza, Plan Desk · House essay Nº 11</p>
    </div>
  </section>
);

/* ---------- III · FOUR WAYS TO USE THE LAYOVER ---------- */
const LOWays = () => (
  <section className="solo-itins" id="itins">
    <div className="container">
      <div className="solo-section-head">
        <div className="num">III</div>
        <div className="titles">
          <h2>Four ways<em>to use the layover.</em></h2>
          <p>The booking-side strategy pieces — how to engineer the layover before you've left your kitchen. Each is a complete how-to with route examples and the airline programs that pay for the hotel.</p>
        </div>
        <div className="right">All booking guides <Icon name="arrow" size={12} /></div>
      </div>

      <div className="itins-grid">
        {LO_WAYS.map(it => (
          <a key={it.ref} href={it.href} className="itin-card">
            <div className="pic" style={{ backgroundImage: `url(${it.img})` }}>
              <span className="ref-pill">{it.ref}</span>
              <span className="day-pill"><em>{it.tags[0].split(" ")[0]}</em><span className="d">angle</span></span>
            </div>
            <div className="body">
              <h4>{it.title}<em> {it.em}</em></h4>
              <div className="tags">
                {it.tags.map(t => <span key={t}>{t}</span>)}
              </div>
              <div className="foot">
                <span className="by">By {it.author}</span>
                <span className="price">{it.price}</span>
              </div>
            </div>
          </a>
        ))}
      </div>
    </div>
  </section>
);

/* ---------- IV · THE LAYOVER MATRIX (table) ---------- */
const LOByShape = () => (
  <section className="solo-length" id="bucket">
    <div className="container">
      <div className="solo-section-head">
        <div className="num">IV</div>
        <div className="titles">
          <h2>The layover<em>matrix.</em></h2>
          <p>Six shapes of the stopover. Pick the row that matches the time you actually have on the ground, not the one that sounded romantic when you booked the flight.</p>
        </div>
        <div className="right">Pace planner <Icon name="arrow" size={12} /></div>
      </div>

      <div className="length-table">
        <div className="row head">
          <div>Layover shape</div>
          <div className="d">Nights</div>
          <div className="ct">Guides</div>
          <div className="ex">Best examples</div>
          <div className="pr">Starting</div>
          <div></div>
        </div>
        {LO_BY_SHAPE.map(l => (
          <a href="/en/plan/trip-duration/" key={l.len} className="row">
            <div className="lbl">{l.len}</div>
            <div className="d"><em>{l.days}</em></div>
            <div className="ct">{l.count} guides</div>
            <div className="ex">{l.examples}</div>
            <div className="pr">{l.price}</div>
            <div className="go"><Icon name="arrow" size={14} /></div>
          </a>
        ))}
      </div>
    </div>
  </section>
);

/* ---------- V · READING (the seed essay) ---------- */
const LOReading = () => (
  <section className="solo-reading" id="reading">
    <div className="container">
      <div className="solo-section-head">
        <div className="num">V</div>
        <div className="titles">
          <h2>The seed essay,<em>under this hub.</em></h2>
          <p>The longest piece on file about the layover form — the booking method, the airline programs, and the trade-offs nobody puts on the airline website. (One read: every other URL in this hub is already linked above as a card.)</p>
        </div>
        <div className="right">All Plan essays <Icon name="arrow" size={12} /></div>
      </div>

      <div className="reading-list">
        {LO_READING.map((r, i) => (
          <a key={i} href={r.href} className="r-row">
            <div className="n">{String(i + 1).padStart(2, "0")}</div>
            <div className="tag">{r.tag}</div>
            <div className="t">{r.title}<em>{r.em}</em></div>
            <div className="by">{r.author}</div>
            <div className="dur">{r.duration}</div>
            <div className="go"><Icon name="arrow" size={12} /></div>
          </a>
        ))}
      </div>
    </div>
  </section>
);

/* ---------- VI · THE DESK ---------- */
const LOVoices = () => (
  <section className="solo-voices" id="voices">
    <div className="container">
      <div className="solo-section-head dark">
        <div className="num">VI</div>
        <div className="titles">
          <h2>The Plan desk.<em>Three editors on the form.</em></h2>
          <p>The layover is the trip the desk argues about most after the three-day. These are the people writing it — what they go for, and what they keep coming back to.</p>
        </div>
        <div className="right">Desk masthead <Icon name="arrow" size={12} /></div>
      </div>

      <div className="voices-grid">
        {LO_VOICES.map(v => (
          <article key={v.name} className="voice">
            <div className="av" style={{ backgroundImage: `url(${v.av})` }}></div>
            <div className="who">
              <div className="name">{v.name}</div>
              <div className="role">{v.role}</div>
            </div>
            <p className="line">"{v.line}"</p>
            <div className="foot">
              <span className="trips">{v.trips} field trips</span>
              <a href="/en/plan/">Read their lane <Icon name="arrow" size={12} /></a>
            </div>
          </article>
        ))}
      </div>
    </div>
  </section>
);

/* ---------- VII · THE BRIEF ---------- */
const LOPractical = () => (
  <section className="solo-practical" id="practical">
    <div className="container">
      <div className="solo-section-head dark">
        <div className="num">VII</div>
        <div className="titles">
          <h2>The brief.<em>Six tips, in order of importance.</em></h2>
          <p>The non-obvious things. Tested at Changi, Hamad, Schiphol, and Tocumen, ordered by how much they matter to a layover that actually works.</p>
        </div>
        <div className="right">Full booking guide <Icon name="arrow" size={12} /></div>
      </div>

      <div className="practical-grid">
        {LO_PRACTICAL.map((p, i) => (
          <div key={i} className="pr-card">
            <div className="num">{String(i + 1).padStart(2, "0")}</div>
            <div className="kind">{p.k}</div>
            <h4>{p.h}</h4>
            <p>{p.b}</p>
          </div>
        ))}
      </div>
    </div>
  </section>
);

/* ---------- VIII · FAQ ---------- */
const LOFAQ = () => {
  const [open, setOpen] = useLOState(0);
  return (
    <section className="solo-faq" id="faq">
      <div className="container">
        <div className="faq-shell">
          <div className="lhs">
            <div className="solo-section-head stacked">
              <div className="num">VIII</div>
              <div className="titles">
                <h2>The questions<em>readers send in.</em></h2>
                <p>Lightly edited reader letters about layovers and stopovers. If yours isn't here, the planning desk reads every email.</p>
              </div>
            </div>
            <a href="mailto:plan@howto.travel" className="ask">Ask the desk →</a>
          </div>
          <div className="rhs">
            {LO_FAQS.map((f, i) => (
              <div key={i} className={`f-item ${open === i ? "open" : ""}`} onClick={() => setOpen(open === i ? -1 : i)}>
                <div className="q">
                  <span className="qt">{f.q}</span>
                  <span className="tg">+</span>
                </div>
                <div className="a">{f.a}</div>
              </div>
            ))}
          </div>
        </div>
      </div>
    </section>
  );
};

/* ---------- CTA ---------- */
const LOCTA = () => (
  <section className="solo-cta">
    <div
      className="bg"
      style={{ backgroundImage: `url(https://images.unsplash.com/photo-1436491865332-7a61a109cc05?w=2000&q=80)` }}
    ></div>
    <div className="inner">
      <div className="kicker">PICK A HUB · BOOK MULTI-CITY · LET THE AIRLINE PAY THE HOTEL</div>
      <h2>Make the layover<em>the second trip.</em></h2>
      <p>Open a city, read the booking angle, set the multi-city search, watch the same ticket buy you a second hotel. Six hours to three days, one routing, two cities.</p>
      <div className="cta-actions">
        <a href="/en/book/book-flights-with-a-layover-on-purpose" className="btn-p">Open the seed method →</a>
        <a href="/en/plan/trip-duration/" className="btn-g">↑ Back to Trip Duration</a>
      </div>
    </div>
    <div className="coord">LAYOVERS · FORM Nº 11 · UPDATED 06.05.2026</div>
    <div className="coord right">FIELD DESK Nº 117</div>
  </section>
);

/* ---------- COMPOSE ---------- */
const LOApp = () => (
  <div data-screen-label="Layovers">
    <LOHero />
    <LOPlaces />
    <LOField />
    <LOWays />
    <LOByShape />
    <LOReading />
    <LOVoices />
    <LOPractical />
    <LOFAQ />
    <LOCTA />
    <Footer />
  </div>
);

ReactDOM.createRoot(document.getElementById("root")).render(<LOApp />);
