/* =========================================================
   SECTION — Tour detail hero (all widths) + photo popup
   View: app/Views/sections/tour/hero.php · JS: js/tour-hero.js
   Reference: static design/assets/source/design/tour detail web hero section.png
   Desktop (> 990px): title + meta line | price box, then the 5-photo gallery.
   <= 990px (the width where tour_detail.php shows #mobileView): one column,
   title → rating → price box → photos → features (name + value).
   Tokens from base.css / legacy-bridge.css. The page body still loads the old
   style.css, so every rule here is scoped to .tour-hero / .tour-lightbox.
   ========================================================= */

.tour-hero {
  padding: 124px 0 32px;            /* clears the fixed navbar (35px + 61px) */
  background: var(--color-white);
  font-family: var(--font-base);
  color: var(--color-navy);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Head: info (left) + price box (right) ---------- */
.tour-hero__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
  margin-bottom: 20px;
}
.tour-hero__info { min-width: 0; overflow: hidden; }   /* clips the "|" that starts a wrapped meta line */

.tour-hero__title {
  margin: 0 0 10px;
  font-size: clamp(28px, 2.6vw, 38px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-navy);
}

/* Meta line: rating · reviews | feature | feature … — wraps onto more lines when long.
   Every item starts with a 1px "|" + 12px space; the line is pulled 13px left so the
   separator of the first item on each line falls outside .tour-hero__info and is clipped. */
.tour-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 8px;
  margin-left: -13px;
  font-size: 14px;
  line-height: 20px;
}
.tour-hero__rating,
.tour-hero__feature {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 12px;
}
.tour-hero__rating::before,
.tour-hero__feature::before {
  content: "";
  flex: 0 0 auto;
  width: 1px;
  height: 14px;
  margin-right: 6px;   /* + 6px gap = 12px */
  background: #C9CFD8;
}
.tour-hero__stars { display: inline-flex; gap: 2px; }
.tour-hero__stars svg { width: 15px; height: 15px; display: block; color: #F59E0B; }   /* inline SVG: sharp at any size (the 9×8 star.png blurred) */
.tour-hero__stars svg.is-empty { color: #D9DDE3; }
.tour-hero__score { font-weight: 600; }
.tour-hero__dot { color: var(--color-gray); }
.tour-hero__reviews { color: var(--color-primary); font-weight: 500; text-decoration: none; }
.tour-hero__reviews:hover,
.tour-hero__reviews:focus-visible { color: var(--color-navy); text-decoration: underline; }

.tour-hero__features {
  display: contents;   /* items join the meta line */
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Marquee wrappers (used <= 990px): on desktop they do nothing, the copy is hidden */
.tour-hero__marquee,
.tour-hero__marquee-track { display: contents; }
.tour-hero__features--clone { display: none; }
.tour-hero__feature { color: var(--color-slate); cursor: help; border-radius: 4px; transition: color .2s ease; }
.tour-hero__feature:hover,
.tour-hero__feature:focus-visible { color: var(--color-primary); outline: none; }
.tour-hero__feature:focus-visible > span { text-decoration: underline; text-underline-offset: 3px; }
.tour-hero__feature img { width: 16px; height: 16px; object-fit: contain; display: block; }
.tour-hero__feature-name { white-space: nowrap; }
/* Desktop: the value is in the tooltip; kept in the HTML for screen readers / SEO (Bootstrap .visually-hidden rules) */
.tour-hero__feature-value {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Price box: compact two columns (prices | wishlist + Book Now) so it is not taller than the title block */
.tour-hero__price-box {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    "from   wish"
    "prices book"
    "saving book";
  column-gap: 28px;
  align-items: center;
  padding: 14px 16px 16px 22px;
  border-radius: 14px;
  background: var(--color-white);
  box-shadow: 0 4px 20px rgba(8, 26, 40, .08);
  border: 1px solid #EEF1F5;
}
.tour-hero__from {
  grid-area: from;
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-slate);
}
.tour-hero__per { font-size: 14px; color: var(--color-slate); }
.tour-hero a,
.tour-hero a:hover { text-decoration: none; }   /* old style.css underlines links */
.tour-hero .tour-hero__reviews:hover,
.tour-hero .tour-hero__reviews:focus-visible { text-decoration: underline; }
.tour-hero__reviews--none { color: var(--color-slate); font-weight: 400; }
.tour-hero__prices {
  grid-area: prices;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0 6px;
}
.tour-hero__price-old { font-size: 15px; color: var(--color-danger); }
.tour-hero__price-now { font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; color: var(--color-primary); }
.tour-hero__saving {
  grid-area: saving;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--color-navy);
}
.tour-hero__saving strong { font-weight: 700; }
.tour-hero__badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-yellow);
  color: var(--color-navy);
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
}
.tour-hero__book { grid-area: book; align-self: end; min-width: 168px; justify-content: space-between; padding-left: 24px; }
.tour-hero__book:hover .icon-circle { transform: translateX(2px); }
.tour-hero__book .icon-circle { transition: transform .2s ease; }

/* Wishlist heart (old handler: .mylikespan, swaps the <i> inside) */
.tour-hero__wish {
  grid-area: wish;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #E4E8EE;
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-navy);
  font-size: 16px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.tour-hero__wish:hover,
.tour-hero__wish:focus-visible { transform: scale(1.08); box-shadow: 0 4px 12px rgba(8, 26, 40, .15); }

/* ---------- Gallery: main photo + 4 tiles ---------- */
.tour-gallery {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 12px;
  height: clamp(300px, 28vw, 420px);   /* short enough to show the head + photos in one screen */
}
.tour-gallery__tile {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-light);
  cursor: zoom-in;
}
.tour-gallery__tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.tour-gallery__tile:hover img,
.tour-gallery__tile:focus-visible img { transform: scale(1.06); }
.tour-gallery__tile:focus-visible { outline: 3px solid var(--color-gold); outline-offset: 2px; }
.tour-gallery__tile--main { grid-row: 1 / 3; }

/* Fewer photos */
.tour-gallery--1 { grid-template-columns: 1fr; }
.tour-gallery--2 { grid-template-columns: 2fr 1fr; }
.tour-gallery--2 .tour-gallery__tile:nth-child(2) { grid-row: 1 / 3; }
.tour-gallery--3 { grid-template-columns: 2fr 1fr; }
.tour-gallery--4 .tour-gallery__tile:nth-child(4) { grid-column: 2 / 4; }

/* "+N all photos" on the last tile */
.tour-gallery__more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(8, 26, 40, .55);
  color: var(--color-white);
  font-size: 20px;
  line-height: 1.2;
  font-weight: 600;
  transition: background-color .2s ease;
}
.tour-gallery__more strong { font-weight: 700; }
.tour-gallery__tile:hover .tour-gallery__more { background: rgba(8, 26, 40, .7); }

@media (max-width: 1199.98px) {
  .tour-hero { padding-top: 112px; }
  .tour-hero__head { gap: 24px; }
  .tour-hero__price-box { column-gap: 20px; }
  .tour-hero__book { min-width: 150px; }
  .tour-hero__price-now { font-size: 26px; }
}


/* ---------- <= 990px: one column (title, rating, price, photos, features) ---------- */
@media (max-width: 990px) {
  .tour-hero { padding: 96px 0 8px; background: transparent; }   /* compact navbar: 16px + 64px */
  .tour-hero > .site-container { display: flex; flex-direction: column; }
  /* Flatten the desktop wrappers so their children can be re-ordered */
  .tour-hero__head,
  .tour-hero__info,
  .tour-hero__meta { display: contents; }

  .tour-hero__title { order: 1; margin: 0 0 6px; font-size: clamp(22px, 5.6vw, 30px); line-height: 1.2; }
  .tour-hero__rating { order: 2; margin: 0 0 14px; padding: 0; font-size: 14px; line-height: 20px; }
  .tour-hero__rating::before { display: none; }
  .tour-hero__price-box { order: 3; margin-bottom: 12px; }
  .tour-gallery { order: 4; }
  .tour-hero__marquee { order: 5; }

  /* Price box: compact (prices + saving on the left, Book Now on the right) */
  .tour-hero__price-box {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 0;
    padding: 10px 12px 12px 14px;
    border-radius: 12px;
  }
  .tour-hero__from { font-size: 11px; line-height: 14px; }
  .tour-hero__prices { gap: 6px; margin: 2px 0 4px; }
  .tour-hero__price-now { font-size: 21px; }
  .tour-hero__price-old { font-size: 13px; }
  .tour-hero__per { font-size: 12px; }
  .tour-hero__saving { gap: 6px; font-size: 12px; line-height: 16px; }
  .tour-hero__badge { padding: 1px 6px; font-size: 11px; }
  .tour-hero__book { min-width: 0; height: 40px; padding: 0 6px 0 16px; gap: 8px; font-size: 14px; }
  .tour-hero__book .icon-circle { width: 26px; height: 26px; }
  .tour-hero__wish { width: 28px; height: 28px; font-size: 14px; }


  /* Photos: main photo full width, the others in a row below (last one "+N") */
  .tour-gallery {
    height: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 8px;
  }
  .tour-gallery__tile { aspect-ratio: 4 / 3; height: auto; border-radius: var(--radius-media); }
  .tour-gallery__tile--main { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 16 / 10; }
  .tour-gallery--2,
  .tour-gallery--3,
  .tour-gallery--4 { grid-template-columns: repeat(var(--gallery-thumbs, 4), minmax(0, 1fr)); }
  .tour-gallery--2 { --gallery-thumbs: 1; }
  .tour-gallery--3 { --gallery-thumbs: 2; }
  .tour-gallery--4 { --gallery-thumbs: 3; }
  .tour-gallery--2 .tour-gallery__tile:nth-child(2) { grid-row: auto; aspect-ratio: 16 / 6; }
  .tour-gallery--4 .tour-gallery__tile:nth-child(4) { grid-column: auto; }
  .tour-gallery__more { flex-direction: column; gap: 0; font-size: 12px; line-height: 1.2; text-align: center; }
  .tour-gallery__more strong { font-size: 18px; }

  /* Features: one line of equal chips scrolling right → left (marquee); tap a chip to see
     its value (tooltip). js/tour-hero.js appends a copy of the list (.tour-hero__features--clone)
     so moving the track by -50% loops without a jump; it also sets --marquee-duration and
     .is-paused (finger down / tooltip open) or .is-static (the list fits, no scrolling). */
  .tour-hero__marquee {
    display: block;
    min-width: 0;
    margin: 12px calc(-1 * var(--gutter)) 0;   /* edge to edge so the fades sit at the screen edges */
    padding: 2px 0;          /* room for the focus border */
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
  }
  .tour-hero__marquee-track {
    display: flex;
    width: max-content;
    animation: tour-hero-marquee var(--marquee-duration, 25s) linear infinite;
    will-change: transform;
  }
  .tour-hero__marquee.is-paused .tour-hero__marquee-track { animation-play-state: paused; }
  .tour-hero__features,
  .tour-hero__features--clone {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0;
    padding: 0 8px 0 0;      /* = gap, so the copy follows at the same spacing */
  }
  /* Fits on one line: no scrolling, no copy, no fades */
  .tour-hero__marquee.is-static { margin-inline: 0; -webkit-mask-image: none; mask-image: none; }
  .tour-hero__marquee.is-static .tour-hero__marquee-track { width: auto; padding-left: 0; animation: none; }
  .tour-hero__marquee.is-static .tour-hero__features--clone { display: none; }
  .tour-hero__feature {
    flex: 0 0 auto;
    height: 30px;
    gap: 6px;
    padding: 0 12px 0 10px;
    white-space: nowrap;
    border: 1px solid #E4E8EE;
    border-radius: var(--radius-pill);
    background: var(--color-white);
    color: var(--color-navy);
    font-size: 12px;
    line-height: 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .tour-hero__feature::before { display: none; }
  .tour-hero__feature:hover { color: var(--color-navy); }
  .tour-hero__feature.is-open,
  .tour-hero__feature:focus-visible { border-color: var(--color-primary); color: var(--color-primary); }
  .tour-hero__feature img { width: 14px; height: 14px; }
}
@keyframes tour-hero-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }   /* = one list + its trailing gap */
}
/* Reduced motion: no scrolling; the chips become a row you swipe by hand */
@media (max-width: 990px) and (prefers-reduced-motion: reduce) {
  .tour-hero__marquee { margin-inline: 0; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: none; mask-image: none; }
  .tour-hero__marquee::-webkit-scrollbar { display: none; }
  .tour-hero__marquee-track { animation: none; }
  .tour-hero__features--clone { display: none; }
}
@media (min-width: 576px) and (max-width: 990px) {
  .tour-gallery__tile--main { aspect-ratio: 2 / 1; }
}
/* Small phones: Book Now without the arrow circle so the prices keep one line */
@media (max-width: 400px) {
  .tour-hero__book { padding: 0 16px; }
  .tour-hero__book .icon-circle { display: none; }
}

/* ---------- Photo popup ---------- */
.tour-lightbox .modal-content {
  display: flex;
  flex-direction: column;
  background: rgba(8, 26, 40, .97);
  color: var(--color-white);
  font-family: var(--font-base);
  border: 0;
}
.tour-lightbox__bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px var(--gutter);
}
.tour-lightbox__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tour-lightbox__counter { margin: 0; font-size: 14px; color: rgba(255, 255, 255, .75); white-space: nowrap; }
.tour-lightbox__close,
.tour-lightbox__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: var(--color-white);
  transition: background-color .2s ease;
}
.tour-lightbox__close:hover,
.tour-lightbox__nav:hover,
.tour-lightbox__close:focus-visible,
.tour-lightbox__nav:focus-visible { background: var(--color-primary); }

.tour-lightbox__stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 var(--gutter);
}
.tour-lightbox__image {
  display: block;
  max-width: calc(100% - 120px);
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-media);
  user-select: none;
  animation: tour-lightbox-in .35s ease;
}
@keyframes tour-lightbox-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }

.tour-lightbox__thumbs {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 16px var(--gutter) 20px;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .3) transparent;
}
.tour-lightbox__thumbs li { flex: 0 0 auto; }
.tour-lightbox__thumb {
  display: block;
  width: 102px;
  height: 68px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, .08);
  opacity: .55;
  transition: opacity .2s ease, border-color .2s ease;
}
.tour-lightbox__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tour-lightbox__thumb:hover,
.tour-lightbox__thumb:focus-visible { opacity: .9; }
.tour-lightbox__thumb.is-active { opacity: 1; border-color: var(--color-gold); }

@media (max-width: 767.98px) {
  .tour-lightbox__image { max-width: 100%; }
  .tour-lightbox__nav { position: absolute; top: 50%; z-index: 1; transform: translateY(-50%); }
  .tour-lightbox__nav--prev { left: 8px; }
  .tour-lightbox__nav--next { right: 8px; }
  .tour-lightbox__thumb { width: 76px; height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .tour-gallery__tile img,
  .tour-hero__wish,
  .tour-hero__book .icon-circle { transition: none; }
  .tour-gallery__tile:hover img { transform: none; }
  .tour-lightbox__image { animation: none; }
}

/* ---------- Feature tooltip (value), placed by js/tour-hero.js ---------- */
.tour-hero-tip {
  position: fixed;
  z-index: 1060;
  max-width: 280px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--color-navy);
  color: var(--color-white);
  font-family: var(--font-base);
  font-size: 13px;
  line-height: 18px;
  box-shadow: 0 8px 24px rgba(8, 26, 40, .2);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.tour-hero-tip.is-visible { opacity: 1; visibility: visible; transform: none; }
.tour-hero-tip::after {   /* arrow */
  content: "";
  position: absolute;
  left: var(--tip-arrow, 50%);
  top: 100%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--color-navy);
}
.tour-hero-tip.is-below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--color-navy); }
@media (prefers-reduced-motion: reduce) { .tour-hero-tip { transition: none; } }
