/* ==========================================================================
   ABC Tour — home page (/index.php).
   Builds on base.css + components.css; only home-specific layout lives here.
   ========================================================================== */

/* ---------- 1. Hero — full-bleed panorama background on the banner only ---------- */
.home-hero {
  position: relative; isolation: isolate; overflow: hidden;
  /* a floating card: slides up under the sticky header but keeps a small gap on top and both
     sides so all four rounded corners show */
  margin: calc(-1 * (var(--header-h) - 16px)) clamp(10px, 1.6vw, 24px) 0;
  padding-top: calc(var(--header-h) + clamp(18px, 4vw, 54px));
  padding-bottom: clamp(32px, 4vw, 56px);
  border-radius: clamp(26px, 3.6vw, 48px);
  box-shadow: 14px 18px 40px -14px rgb(37 42 80 / .4), -10px -10px 28px rgb(var(--shadow-light) / .9);
}
.home-hero__bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%;
}
/* lavender scrim: keeps the heading readable on the left, lets the art show on the right */
.home-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgb(233 236 246 / .95) 0%, rgb(233 236 246 / .86) 30%, rgb(233 236 246 / .35) 54%, rgb(233 236 246 / 0) 72%),
    linear-gradient(180deg, rgb(233 236 246 / .55) 0%, rgb(233 236 246 / 0) 24%);
}
/* Until the container hits its max width, subtract the card's side margin from the gutter so the
   hero text lines up with every other section (above that, centring already aligns it). */
@media (max-width: 1320px) {
  .home-hero__grid { padding-inline: max(4px, calc(var(--gutter) - clamp(10px, 1.6vw, 24px))); }
}
.home-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr);
  grid-template-rows: 1fr auto;
  column-gap: clamp(40px, 5vw, 72px);
}

.home-hero__copy { grid-column: 1; grid-row: 1; align-self: center; padding-block: 12px 36px; }
.home-hero__title {
  font-size: clamp(2.25rem, 1.2rem + 2.6vw, 3.25rem);
  font-weight: 800; line-height: 1.08; letter-spacing: -.025em;
}
.home-hero__line { display: block; }   /* "Discover" / "Northern Malaysia," / gradient line */
.home-hero__title .text-grad { display: block; padding-bottom: .06em; }
.home-hero__lead { margin-top: 20px; max-width: 46ch; font-size: var(--fs-md); color: var(--ink-2); }
.home-hero__cta { --cluster: 16px; margin-top: 32px; }
.home-hero__chat .icon { color: var(--wa-dark); }

/* Art column: now just the stage for two cards floating over the background image */
.home-hero__art { position: relative; grid-column: 2; grid-row: 1 / span 2; min-height: 480px; }

/* Dark mini stat card (reuses .stat-card — reference weather card, shrunk) */
.hero-stat {
  position: absolute; z-index: 2; top: 8px; right: 4%;   /* top-right corner of the art column */
  width: 188px; padding: 20px 22px;
}
.hero-stat::after { top: 18px; right: 18px; width: 40px; height: 40px; box-shadow: 0 0 26px rgb(142 60 255 / .55); }
.hero-stat .stat-card__value { font-size: 2.6rem; }
.hero-stat .stat-card__label { margin-top: 4px; font-size: .95rem; }
.hero-stat .stat-card__text { margin-top: 2px; }

/* Raised white mini card for one featured destination (reference image card) */
.hero-pick {
  position: absolute; z-index: 2; right: 0; bottom: 120px;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px 14px;
  width: 280px; padding: 12px 18px 14px 12px;
  border-radius: var(--r-lg); background: rgb(245 247 253 / .96);
  box-shadow: 16px 20px 40px -14px rgb(37 42 80 / .45), -6px -6px 18px rgb(255 255 255 / .5);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.hero-pick:hover { transform: translateY(-3px); box-shadow: 18px 24px 44px -14px rgb(37 42 80 / .5), -6px -6px 18px rgb(255 255 255 / .5); }
.hero-pick:focus-visible { outline-offset: 4px; border-radius: var(--r-lg); }
.hero-pick__img { width: 72px; height: 72px; object-fit: cover; border-radius: 18px; box-shadow: var(--raise-sm); }
.hero-pick__body { display: grid; gap: 2px; min-width: 0; }
.hero-pick__name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; color: var(--ink); line-height: 1.2; }
.hero-pick__when { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.hero-pick__when .icon { width: 15px; height: 15px; color: var(--accent); }
.hero-pick__dots { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; padding: 6px 2px 0; }
.hero-pick__dots span { height: 8px; border-radius: var(--pill); box-shadow: var(--inset-sm); }
.hero-pick__dots .is-best { background: var(--grad); box-shadow: 0 3px 8px -2px rgb(91 77 255 / .55); }
/* Wide screens: sit on the foreground trees beside the search pill so the clock tower, shophouses
   and cave temple stay visible (below 1280 the 880px pill reaches under the art column) */
@media (min-width: 1280px) {
  .hero-pick { bottom: 0; }
}

/* Dark search pill, sitting on the image */
.home-search {
  position: relative; z-index: 3;
  grid-column: 1 / -1; grid-row: 2; justify-self: start;
  width: min(100%, 880px); margin-bottom: 8px;
}
.home-search .searchbar__field { padding-block: 8px; }
.home-search__dest { flex-grow: 1.35; }
.home-search select.searchbar__input {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 22px; text-overflow: ellipsis;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234bb8ee' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0 center / 16px;
}
.home-search .btn { --btn-h: 60px; padding: 0 2em; }

@media (max-width: 1100px) {
  .home-hero__grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
  .home-hero__art { min-height: 440px; }
  .home-hero__cta .btn { padding: 0 1.4em; }
  .hero-pick { bottom: 132px; width: 264px; }
  .home-hero::before {
    background:
      linear-gradient(90deg, rgb(233 236 246 / .95) 0%, rgb(233 236 246 / .88) 40%, rgb(233 236 246 / .3) 66%, rgb(233 236 246 / 0) 84%),
      linear-gradient(180deg, rgb(233 236 246 / .55) 0%, rgb(233 236 246 / 0) 24%);
  }
}

@media (max-width: 980px) {
  .home-hero__grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .home-hero__copy { grid-column: 1; grid-row: 1; padding-block: 0 20px; }
  .home-hero__art { grid-column: 1; grid-row: 2; min-height: 340px; }
  .home-hero__bg { object-position: 58% 100%; }
  /* stacked layout: wash the top (text) and let the image breathe underneath */
  .home-hero::before {
    background: linear-gradient(180deg, rgb(233 236 246 / .94) 0%, rgb(233 236 246 / .88) 36%, rgb(233 236 246 / .15) 50%, rgb(233 236 246 / 0) 58%);
  }
  .hero-stat { top: 16px; left: 0; right: auto; }
  .hero-pick { right: 0; bottom: 16px; }
  .home-search { grid-column: 1; grid-row: 3; width: 100%; margin: 20px 0 0; }
}

@media (max-width: 760px) {
  .home-search .btn { --btn-h: 54px; }
  .home-search select.searchbar__input { min-height: 44px; }
}

@media (max-width: 600px) {
  .home-hero__title { font-size: clamp(2rem, 1.2rem + 3.4vw, 2.25rem); }   /* keeps "Northern Malaysia," on one line */
  .home-hero__cta .btn { flex: 1 1 auto; }
  .home-hero__art { min-height: 330px; }
  .hero-stat { top: 12px; left: 0; right: auto; width: auto; padding: 14px 16px; border-radius: var(--r); }
  .hero-stat::after { top: 14px; right: 14px; width: 24px; height: 24px; }
  .hero-stat .stat-card__value { font-size: 1.9rem; padding-right: 34px; }
  .hero-stat .stat-card__label { font-size: .85rem; }
  .hero-stat .stat-card__text { font-size: .75rem; }
  .hero-pick { left: 0; right: 0; bottom: 12px; width: auto; max-width: 380px; margin-inline: auto; }
}
@media (max-width: 359px) {
  .home-hero__title { font-size: 1.7rem; }
}

/* ---------- 2. Trip-style shortcuts (reference round icon row) ---------- */
.home-quick__tray {
  display: grid; grid-template-columns: minmax(200px, .8fr) minmax(0, 2.2fr);
  align-items: center; gap: 24px 40px;
  padding: clamp(24px, 3vw, 36px) clamp(22px, 3.4vw, 44px);
  border-radius: var(--r-xl);
}
.home-quick__head { display: grid; gap: 8px; }
.home-quick__title { font-size: var(--fs-xl); font-weight: 800; }
.home-quick__text { font-size: var(--fs-sm); color: var(--ink-2); }
.home-quick__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; }
.home-quick__link {
  display: flex; align-items: center; gap: 16px;
  padding: 8px; border-radius: var(--r);
}
.home-quick__btn { width: 72px; height: 72px; }
.home-quick__btn .icon { width: 28px; height: 28px; }
.home-quick__link:hover .home-quick__btn { color: var(--accent-2); transform: translateY(-3px); box-shadow: var(--raise); }
.home-quick__link:active .home-quick__btn { box-shadow: var(--inset-sm); transform: none; }
.home-quick__link:focus-visible { outline: none; }
.home-quick__link:focus-visible .home-quick__btn { outline: 3px solid var(--accent); outline-offset: 4px; }
.home-quick__copy { display: grid; gap: 2px; min-width: 0; }
.home-quick__name { font-family: var(--font-display); font-weight: 800; font-size: 1.12rem; color: var(--ink); line-height: 1.25; }
.home-quick__link:hover .home-quick__name { color: var(--accent-text); }
.home-quick__meta { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); }

/* Two-column tray only once the container is at its max width (list column = a fixed ~786px):
   content-sized columns + 64px icons keep each trip-style name on one line */
@media (min-width: 1280px) {
  .home-quick__list { grid-template-columns: repeat(3, auto); justify-content: space-between; column-gap: 12px; }
  .home-quick__link { gap: 14px; }
  .home-quick__btn { width: 64px; height: 64px; }
}
@media (max-width: 1279px) {
  .home-quick__tray { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .home-quick__head { justify-items: center; }
  .home-quick__list { justify-items: center; }
  .home-quick__link { text-align: left; }
}
/* tight tray (.6 x --section below) + this = one full section break before the next heading */
.home-quick + .section { padding-top: calc(var(--section) * .4); }
@media (max-width: 760px) {
  /* three narrow columns: stack icon over the name, like the reference icon row */
  .home-quick__list { column-gap: 8px; align-items: start; }
  .home-quick__link { flex-direction: column; gap: 12px; padding: 6px 2px; text-align: center; }
  .home-quick__btn { width: 64px; height: 64px; }
  .home-quick__btn .icon { width: 26px; height: 26px; }
  .home-quick__name { font-size: 1rem; }
  .home-quick__meta { display: grid; }   /* state above price instead of a ragged wrap */
  .home-quick__sep { display: none; }
}

/* Section heads: on small laptops a shorter lead line keeps the "View all" button beside the
   heading instead of dropping under the lead */
@media (min-width: 960px) and (max-width: 1100px) {
  main .section-lead { max-width: 46ch; }
}
/* Without eyebrows the hierarchy is carried by size alone: keep every section h2 below the hero h1 */
main .section-title { font-size: clamp(1.75rem, 1.2rem + 1.7vw, 2.6rem); }

/* ---------- 3. Featured destinations — exactly three cards, never an orphan cell ---------- */
.home-dests { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) {
  .home-dests { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Tablet: one column of wide cards, image left and copy right */
@media (min-width: 600px) and (max-width: 959px) {
  .home-dests .dest-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); column-gap: 22px; }
  .home-dests .dest-card__media { aspect-ratio: auto; min-height: 220px; }
  .home-dests .dest-card__body { padding: 12px 10px 6px 0; }
}

/* ---------- 4. Popular packages ---------- */
/* Destination line: flex gap pushed the comma away from the name; dark card needs light text */
.home-pkgs .pkg-card__dest { gap: 0; }
.home-pkgs .pkg-card__dest .icon { margin-right: 6px; }
.home-pkgs .pkg-card--dark .pkg-card__dest { color: var(--on-panel-2); }
.home-pkgs .pkg-card--dark .pkg-card__dest a { color: #fff; }
.home-pkgs .pkg-card--dark .pkg-card__dest a:hover { color: var(--cyan); }
.home-pkgs .pkg-card--dark .pkg-card__dest .icon { color: var(--cyan); }

.home-pkgs { grid-template-columns: minmax(0, 1fr); }

/* Lift the dark middle card once the row is three-up */
@media (min-width: 960px) {
  .home-pkgs { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; padding-top: 14px; }
  .home-pkgs > .pkg-card--dark { transform: translateY(-14px); }
}
/* Tablet: one column of wide cards — photo, name and price left; inclusions and CTA right */
@media (min-width: 640px) and (max-width: 959px) {
  .home-pkgs { row-gap: 36px; }
  .home-pkgs .pkg-card {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: repeat(4, auto) 1fr; column-gap: 32px; row-gap: 16px;
  }
  .home-pkgs .pkg-card > :not(.pkg-card__flag, .checklist, .pkg-card__cta) { grid-column: 1; }
  .home-pkgs .checklist {
    grid-column: 2; grid-row: 1 / span 4; align-self: stretch;
    display: grid; align-content: center; padding: 20px 22px;
    border-radius: var(--r); box-shadow: var(--inset-sm);
  }
  .home-pkgs .pkg-card--dark .checklist { background: rgb(0 0 0 / .14); box-shadow: var(--panel-inset); }
  .home-pkgs .pkg-card__cta { grid-column: 2; grid-row: 5; align-self: end; }
}

/* ---------- 5. How booking works (reference DATA rings) ---------- */
.home-steps {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px;
  padding: clamp(32px, 4vw, 52px) clamp(20px, 3vw, 40px);
  border-radius: var(--r-xl); counter-reset: none;
}
.home-steps__item { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.home-steps__item:not(:last-child)::after {
  content: ""; position: absolute; top: 63px; left: calc(50% + 80px); width: calc(100% - 128px);
  border-top: 2px dashed rgb(var(--shadow-dark));
}
.home-steps__title { margin-top: 26px; font-size: 1.12rem; font-weight: 700; }
.home-steps__text { margin-top: 8px; max-width: 30ch; font-size: var(--fs-sm); color: var(--ink-2); }

@media (max-width: 1000px) {
  .home-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 44px; }
  .home-steps__item::after { display: none; }
}
@media (max-width: 600px) {
  /* Vertical list: small ring on the left, copy on the right, dashed line linking the rings */
  .home-steps { grid-template-columns: minmax(0, 1fr); row-gap: 30px; padding: 28px 20px; }
  .home-steps__item { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 18px; align-items: start; text-align: left; }
  .home-steps .ring { --size: 84px; grid-row: 1 / span 2; }
  .home-steps .ring__label { display: none; }
  .home-steps .ring__value { font-size: 1.35rem; }
  .home-steps__item:not(:last-child)::after { display: block; top: 96px; bottom: -22px; left: 41px; width: 0; border-top: 0; border-left: 2px dashed rgb(var(--shadow-dark)); }
  .home-steps__title { margin-top: 14px; }
  .home-steps__text { margin-top: 4px; max-width: none; }
}

/* ---------- 6. About ---------- */
.home-about { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: clamp(18px, 2.4vw, 32px); }
.home-about__features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 32px); }
.home-about__stats { display: grid; gap: clamp(18px, 2.4vw, 32px); }
/* Compact horizontal stat cards: number left, label + line right, glow disc on the far right */
.home-about__stats .stat-card {
  display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 18px;
  align-items: center; align-content: center; padding: 24px 92px 24px 26px;
}
.home-about__stats .stat-card__value { grid-row: 1 / span 2; }
.home-about__stats .stat-card__label { grid-column: 2; margin-top: 0; font-size: 1.05rem; }
.home-about__stats .stat-card__text { grid-column: 2; margin-top: 2px; }
.home-about__stats .stat-card::after { top: 50%; right: 24px; width: 48px; height: 48px; translate: 0 -50%; }
.home-about__stats .stat-card:nth-child(2)::after { width: 40px; height: 40px; right: 28px; background: var(--grad-cool); box-shadow: 0 0 30px rgb(75 184 238 / .45); }
.home-about__stats .stat-card:nth-child(3)::after { width: 56px; height: 56px; right: 20px; }

@media (max-width: 980px) {
  .home-about { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .home-about__features { grid-template-columns: minmax(0, 1fr); }
  .home-about__stats .stat-card { grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; padding: 20px 56px 20px 20px; }
  .home-about__stats .stat-card__value { font-size: 2.4rem; }
  .home-about__stats .stat-card::after,
  .home-about__stats .stat-card:nth-child(n)::after { top: 22px; right: 20px; width: 28px; height: 28px; translate: none; }
}
