/*
 * Front page redesign (homepage only) — loaded after the main stylesheet on
 * is_front_page() so it refines rather than fights the shared design
 * tokens (--ink, --gold, --font-display, --font-body, etc. from style.css).
 *
 * Concept: a trip-journal spread instead of a generic full-bleed slideshow —
 * field notes and a quick-search on the left, three photos pinned to a
 * laterite route line on the right, echoing the hand-drawn "trail" mark
 * already baked into the theme's own icon set (icon-sprite.php).
 */

/* ── Hero — full-bleed photo + rounded pill search, matching the
   reference screenshot's "Travel your heart out" treatment ────────────── */
.fp-hero--photo{
  position: relative;
  min-height: clamp(440px, 58vw, 620px);
  display: flex;
  align-items: flex-end;
  padding-bottom: clamp(36px, 5vw, 64px);
  overflow: hidden;
  isolation: isolate;
}
.fp-hero__bg{ position: absolute; inset: 0; z-index: -1; }
.fp-hero__bg img{
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0;
  animation: fp-hero-cross 18s infinite;
}
.fp-hero__bg img:nth-child(1){ animation-delay: 0s; }
.fp-hero__bg img:nth-child(2){ animation-delay: 6s; }
.fp-hero__bg img:nth-child(3){ animation-delay: 12s; }
@keyframes fp-hero-cross{
  0%, 3%    { opacity: 0; }
  6%, 28%   { opacity: 1; }
  33%, 100% { opacity: 0; }
}
.fp-hero__scrim{
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(20,14,6,.72) 0%, rgba(20,14,6,.28) 46%, rgba(20,14,6,.12) 68%, transparent 100%);
}
/* 3.0.8 — keep hero copy legible over bright, gold-toned photos (Pha That Luang). */
.fp-hero__copy .eyebrow,
.fp-hero__copy h1,
.fp-hero__sub{ text-shadow: 0 1px 2px rgba(20,14,6,.45), 0 2px 18px rgba(20,14,6,.55); }
.fp-hero__copy .eyebrow::before{ box-shadow: 0 1px 6px rgba(20,14,6,.5); }
@media (prefers-reduced-motion: reduce){
  .fp-hero__bg img{ animation: none; opacity: 0; }
  .fp-hero__bg img:first-child{ opacity: 1; }
}

.fp-hero__content{ position: relative; max-width: 760px; }
.fp-hero__copy{ text-align: right; }
.eyebrow--light{ color: var(--gold); }
.fp-hero__content h1{
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  line-height: 1.08;
  max-width: 16ch;
  margin: 10px 0 12px auto;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0,0,0,.3);
}
.fp-hero__sub{
  font-size: 1.05rem;
  color: #f3ecdc;
  max-width: 48ch;
  margin: 0 0 28px auto;
  text-shadow: 0 1px 8px rgba(0,0,0,.25);
}
@media (min-width: 1024px){
  .fp-hero__sub{
    /* Was force-fit to one row with an ellipsis clipping the end; now it
       sizes down slightly and, if a longer custom subtitle still doesn't
       fit the 48ch box, wraps onto a second line instead of cutting off. */
    max-width: 48ch;
    font-size: .95rem;
    text-wrap: balance;
  }
}

/* Rounded pill search bar, floating over the photo */
.fp-search--pill{ max-width: 100%; }
.fp-search__pill{
  display: flex; align-items: center; gap: 2px;
  background: #fff; border-radius: 999px;
  padding: 8px 8px 8px 22px;
  box-shadow: var(--aaa-elev-2, var(--shadow));
  max-width: 760px;
}
.fp-search__pill .fp-search__field{ padding: 2px 14px; min-width: 0; }
.fp-search__pill .fp-search__field label{
  display: block; font-size: .66rem; letter-spacing: .07em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-soft); margin-bottom: 2px;
}
.fp-search__pill .fp-search__field select,
.fp-search__pill .fp-search__field input{
  width: 100%; border: 0; background: transparent; padding: 0;
  font: inherit; font-size: .92rem; color: var(--ink); min-height: 22px;
}
.fp-search__pill .fp-search__field select:focus-visible,
.fp-search__pill .fp-search__field input:focus-visible{ outline: none; }
.fp-search__field--grow{ flex: 1 1 auto; }
.fp-search__divider{ width: 1px; height: 34px; background: var(--line); flex: 0 0 auto; }
.fp-search__go{
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  background: var(--gold-deep); border: 0; color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .15s ease;
}
.fp-search__go svg{ width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.fp-search__go:hover{ background: var(--forest); }

@media (max-width: 480px){
  .fp-hero__copy{ text-align: left; }
  .fp-hero__content h1,
  .fp-hero__sub{ margin-left: 0; margin-right: auto; }
}

@media (max-width: 780px){
  .fp-hero__content h1{ max-width: 100%; }
  .fp-search__pill{
    flex-wrap: wrap; border-radius: var(--radius);
    padding: 14px;
  }
  .fp-search__divider{ display: none; }
  .fp-search__field{ flex: 1 1 45%; }
  .fp-search__field--grow{ flex: 1 1 100%; order: 3; }
  .fp-search__go{ order: 4; width: 100%; height: 44px; border-radius: var(--radius-sm); }
}

/* Big, bold, brand-colour section headings — used on the tours-carousel
   heading and the promise-strip heading to echo the reference screenshot's
   large two-line typography. */
.fp-bigheading{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
  line-height: 1.12;
  color: var(--forest);
  max-width: 18ch;
  margin: 6px 0 0;
}

/* ── Section rhythm polish (homepage sections only) ─────────────────── */
.fp-hero + .section,
.fp-hero ~ .journey{ padding-top: 64px; }

/* Section headings that are a full descriptive sentence rather than a short
   headline (e.g. Popular Destinations intro) — reuses the .lead body-copy
   treatment but keeps the semantic <h2> for document structure/SEO, so it
   doesn't inherit the oversized bold h2 heading size. */
.fp-section-lead{
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(.95rem, .82rem + .5vw, 1.1rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 58ch;
  margin-inline: 0;
  text-wrap: balance;
}
/* Alignment comes from the section-head modifier on the parent
   (--left, --right, --center, etc.) so this class never fights it — it
   only controls the type scale, measure and line-wrap quality. */

@media (max-width: 900px){
  .fp-section-lead{ max-width: 48ch; }
}
@media (max-width: 640px){
  .fp-section-lead{
    font-size: .95rem;
    line-height: 1.55;
    max-width: 100%;
  }
}

/* ── Promo bar — thin rotating strip above the header, homepage only ─── */
.promo-bar{
  background: var(--forest-deep);
  color: var(--cream);
  font-size: .82rem;
}
.promo-bar__inner{ overflow: hidden; }
.promo-bar__list{
  list-style: none; margin: 0; padding: 0;
  height: 38px; position: relative;
}
.promo-bar__list li{
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center; opacity: 0;
  animation: fp-promo-cycle 16s infinite;
}
.promo-bar__list li:nth-child(1){ animation-delay: 0s; }
.promo-bar__list li:nth-child(2){ animation-delay: 4s; }
.promo-bar__list li:nth-child(3){ animation-delay: 8s; }
.promo-bar__list li:nth-child(4){ animation-delay: 12s; }
.promo-bar__list a{ color: inherit; text-decoration: none; }
.promo-bar__list a:hover{ text-decoration: underline; }
@keyframes fp-promo-cycle{
  0%, 2%   { opacity: 0; }
  4%, 21%  { opacity: 1; }
  23%, 100%{ opacity: 0; }
}
@media (prefers-reduced-motion: reduce){
  .promo-bar__list li{ animation: none; opacity: 0; }
  .promo-bar__list li:first-child{ opacity: 1; position: static; }
  .promo-bar__list li:not(:first-child){ display: none; }
}
@media (max-width: 640px){
  .promo-bar__list{ font-size: .78rem; }
}

/* ── Brand promise strip — big heading + three icon+line items ──────── */
.fp-promise{ background: var(--paper-2); border-block: 1px solid var(--line); padding: 44px 0; }
.fp-promise__heading{ max-width: 22ch; margin-bottom: 8px; }
.fp-promise__row{
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  padding: 26px 0 4px;
}
.fp-promise__item{
  display: flex; align-items: center; gap: 12px; min-width: 0;
  color: var(--ink-soft);
}
.fp-promise__icon{
  flex: 0 0 auto; width: 26px; height: 26px; color: var(--gold-deep, var(--gold));
}
/* Each promise line gets a legible, steady size and wraps normally under
   its icon when the column isn't wide enough for the full sentence —
   previously it stayed on one row by shrinking down to ~.42rem (~6.7px)
   on narrow screens, which made the copy unreadable. */
.fp-promise__item span{
  display: block; min-width: 0; flex: 1 1 auto;
  font-size: .88rem;
  line-height: 1.42;
}
@media (max-width: 1300px){
  .fp-promise__row{ grid-template-columns: 1fr; gap: 12px; padding: 16px 0; }
}
@media (max-width: 640px){
  .fp-promise__item span{ font-size: .85rem; }
}

/* ── Popular Destinations — wider 6-up photo grid ────────────────────── */
.dest-grid--wide{ grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px){ .dest-grid--wide{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px){ .dest-grid--wide{ grid-template-columns: 1fr; } }

/* ── Why Us — six-up variant of the existing feature grid ───────────── */
.feature-grid--six{ grid-template-columns: repeat(3, 1fr); row-gap: 34px; }
@media (max-width: 900px){ .feature-grid--six{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px){ .feature-grid--six{ grid-template-columns: 1fr; } }

/* ── Destination tag cloud — closing "where next" link list ─────────── */
.fp-tagcloud{ text-align: center; }
.fp-tagcloud__head{
  font-family: var(--font-display); font-size: clamp(1.5rem, 2.4vw, 2rem);
  margin: 0 0 22px;
}
.fp-tagcloud__list{
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px;
}
.fp-tagcloud__list a{
  display: inline-block; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); text-decoration: none; font-size: .88rem;
  background: var(--card); transition: border-color .15s ease, color .15s ease;
}
.fp-tagcloud__list a:hover{ border-color: var(--gold-deep, var(--gold)); color: var(--gold-deep, var(--gold)); }
