/* ==========================================================================
   tour-detail.css — /en/tour-detail.html
   Design A "Editorial Trust"
   Page-unique styles only. Shared components live in global.css.
   ========================================================================== */

/* ── Layout helpers ─────────────────────────────────────────────────────── */
.detail-layout-wrap   { margin-block-start: var(--sp-6); }

/* ── Task 7: H1 above the gallery ───────────────────────────────────────────
   The title used to sit inside .detail-header, below the gallery. It now leads the
   page, so it needs its own vertical rhythm: .detail-header's padding-block no
   longer applies to it. Same type scale as .detail-h1 below — this only positions. */
.detail-h1-lead {
  margin-block: var(--sp-5) var(--sp-4);
}

/* ── Task 7: gallery main image locked to 3:2 ───────────────────────────────
   .gallery-hero in global.css sizes its single grid row with fixed pixel heights
   (260px, then 440px at >=1024px), so the hero's aspect ratio drifted with the
   viewport width — wide and letterboxed on a large screen, near-square on a small
   one. aspect-ratio on .gallery-main makes the row height derive from its own
   width instead, giving a true 3:2 at every breakpoint.

   grid-template-rows must go back to auto or the fixed row would still win and the
   aspect-ratio would have nothing to size. The height stays DEFINITE (derived from
   width), which is what .gallery-main img's height:100% needs to resolve — see the
   long comment on .gallery-main in global.css for what happens when it does not.
   object-fit: cover is already set there, so the image crops rather than distorts.

   Scoped with a modifier and applied only in the Tour views: .gallery-hero is also
   used by Car detail, and changing that was not asked for. Two classes so this wins
   over global.css's media-query rules regardless of stylesheet order. */
.gallery-hero.gallery-hero--ratio-32 {
  grid-template-rows: auto;
}
.gallery-hero.gallery-hero--ratio-32 .gallery-main {
  aspect-ratio: 3 / 2;
}

/* ── The thumbs column takes its height FROM that row, never gives height TO it ──
   With grid-template-rows: auto the row is sized by the TALLEST item, so the thumbs
   column has to contribute nothing — otherwise it, not .gallery-main, decides the
   row and the 3:2 above is silently overruled.

   It did. `.gallery-thumb { flex: 1 }` is `flex: 1 1 0%`, and a *percentage*
   flex-basis against the column's indefinite height falls back to content sizing,
   so each thumb contributed its image's intrinsic height. The delivered image is
   what sets that height — the width/height attributes only reserve space until it
   loads — and the Cloudflare variants are 800x800 squares, so each thumb came out
   347px (its own width), three of them plus gaps sized the row at 1056px, while
   .gallery-main stayed pinned at its 3:2 693px. Result: 363px of bare --gray-200
   hero background under the main image, with the thumb column running past it.

   A LENGTH flex-basis resolves to 0 even when the container is indefinite, so the
   thumbs contribute nothing, .gallery-main sizes the row at a true 3:2, and the
   column then stretches to that row and splits it three ways — object-fit: cover
   in global.css crops each square into its share. min-block-size overrides a flex
   item's automatic minimum, which would otherwise let the same intrinsic height
   back in. Scoped to the modifier: Car detail declares a fixed row, so its thumbs
   already get a definite height and are unaffected either way. */
.gallery-hero.gallery-hero--ratio-32 .gallery-thumb {
  flex-basis: 0px;
  min-block-size: 0;
  /* ── A fixed three-slot rack, however many photos the tour has ──────────────
     Design-A only ever drew the full gallery: its static tour-detail.html
     hardcodes exactly three tiles and a "+9" badge. Live tours are mostly
     smaller than that — of 16, twelve have two thumbnails, one has a single one
     — and with the thumbs free to share the whole column, the tile SHAPE was
     decided by how many photos happened to exist: three tiles gave the intended
     ~3:2 (347x226), two gave squares (347x343), and one gave a 347x693 portrait
     sliver, an 800x800 photo cover-cropped to its middle half.

     So cap a tile at one third of the column instead of letting it grow into
     whatever share is free. Tiles now measure 347x226 at every photo count, and
     a short gallery simply leaves its unused slots empty rather than stretching
     to hide them. flex-basis stays a length so the thumbs still contribute
     nothing to the auto row (see above) — max-block-size only limits growth,
     and its percentage resolves against the column height the main image set. */
  max-block-size: calc((100% - 2 * var(--sp-2)) / 3);
}

/* An unused slot stays grey — Basam's call, 2026-08-01. The rack leaves the
   bottom third(s) of a short gallery uncovered, and the hero's own --gray-200
   shows through there, so the gallery keeps a clean filled rectangle instead of
   a notched one. Nothing to declare: that background already comes from
   .gallery-hero in global.css. Do NOT move it onto the tiles to make the empty
   slot fall through to the page — that was tried and rejected. */

/* ── Detail header (title + meta) ───────────────────────────────────────── */
.detail-header {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding-block: var(--sp-6) var(--sp-4);
}
.detail-h1 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--gray-900);
  line-height: var(--leading-snug);
}
@media (min-width: 768px) {
  .detail-h1 { font-size: var(--text-3xl); }
}
.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
}
.detail-author {
  font-size: var(--text-sm);
  color: var(--gray-700);
}
.detail-author a {
  color: var(--secondary);
  font-weight: var(--weight-semibold);
}
.detail-author-badge {
  /* The reset in shared/global.css sets `img, video, svg { display: block }` to kill
     the inline-baseline gap. .detail-author is a plain <p>, not a flex container, so
     without this override the badge computes to block and drops onto its own line
     under the provider name — and vertical-align below silently does nothing.
     Same display+vertical-align pairing as .panel-note-icon further down. */
  display: inline;
  color: var(--primary);
  vertical-align: middle;
  margin-inline-start: 3px;
}

/* ── Quick info embellishments (column items) ───────────────────────────── */
.quick-info-item-label {
  font-size: var(--text-xs);
  color: var(--gray-700);
}
.quick-info-item-text {
  display: flex;
  flex-direction: column;
}

/* ── Tabs spacing for this page ─────────────────────────────────────────── */
.detail-tabs-wrap { margin-block-start: var(--sp-8); }

/* ── Overview body copy ─────────────────────────────────────────────────── */
.overview-paragraph {
  font-size: var(--text-base);
  color: var(--gray-700);
  line-height: var(--leading-relaxed);
  margin-block-end: var(--sp-4);
}
.overview-paragraph:last-child { margin-block-end: 0; }

/* ── Highlights list ────────────────────────────────────────────────────── */
.highlight-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--text-sm);
  color: var(--gray-700);
  line-height: var(--leading-relaxed);
}
.highlight-item svg {
  width: 16px;
  height: 16px;
  color: var(--success);
  flex-shrink: 0;
  margin-block-start: 3px;
}

/* ── Included / Excluded grid ───────────────────────────────────────────── */
.incl-excl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-6);
}
@media (min-width: 600px) {
  .incl-excl-grid { grid-template-columns: 1fr 1fr; }
}
.incl-excl-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin-block-end: var(--sp-4);
}
.incl-excl-title.is-incl { color: var(--success); }
.incl-excl-title.is-excl { color: var(--error); }
.incl-excl-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.incl-excl-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--gray-700);
  line-height: var(--leading-snug);
}
.incl-excl-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-block-start: 3px;
}
.incl-excl-item.incl svg { color: var(--success); }
.incl-excl-item.excl svg { color: var(--error); }

/* ── Itinerary timeline ─────────────────────────────────────────────────── */
.itinerary {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.itinerary::before {
  content: '';
  position: absolute;
  inset-block: 24px 24px;
  inset-inline-start: 19px;
  width: 2px;
  background: var(--gray-200);
}
.itinerary-step {
  display: flex;
  gap: var(--sp-5);
  position: relative;
}
.itinerary-step + .itinerary-step { margin-block-start: var(--sp-5); }
.itinerary-dot {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  border: 2px solid var(--primary);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.itinerary-content {
  flex: 1;
  padding-block-start: var(--sp-2);
}
.itinerary-time {
  font-size: var(--text-xs);
  color: var(--primary);
  font-weight: var(--weight-semibold);
}
.itinerary-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--gray-900);
}
.itinerary-desc {
  font-size: var(--text-sm);
  color: var(--gray-700);
  margin-block-start: var(--sp-1);
}

/* ── Reviews block ──────────────────────────────────────────────────────── */
.reviews-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-6);
  padding-block-end: var(--sp-6);
  border-block-end: 1px solid var(--gray-200);
  margin-block-end: var(--sp-6);
}
.review-summary { text-align: center; }
.review-summary-stars {
  justify-content: center;
  margin-block: var(--sp-1);
}
.review-score-big {
  font-size: var(--text-5xl);
  font-weight: var(--weight-bold);
  color: var(--gray-900);
  line-height: 1;
}
.review-score-label {
  font-size: var(--text-sm);
  color: var(--gray-700);
}
.review-bars {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  flex: 1;
  min-width: 180px;
}
.review-bar-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-xs);
  color: var(--gray-700);
}
.review-bar-label { width: 32px; text-align: end; }
.review-bar-track {
  flex: 1;
  height: 6px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.review-bar-fill {
  height: 100%;
  background: #F59E0B;
  border-radius: var(--radius-full);
}
.review-bar-fill[data-pct="78"] { width: 78%; }
.review-bar-fill[data-pct="16"] { width: 16%; }
.review-bar-fill[data-pct="4"]  { width: 4%; }
.review-bar-fill[data-pct="1"]  { width: 1%; }
.review-bar-count { width: 24px; }

.review-card {
  padding-block: var(--sp-5);
  border-block-end: 1px solid var(--gray-200);
}
.review-card:last-child { border-block-end: none; }
.review-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-block-end: var(--sp-3);
}
.review-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--secondary-light);
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  flex-shrink: 0;
}
.review-author {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.review-stars-sm {
  gap: 1px;
  margin-block: 2px;
}
.review-date {
  font-size: var(--text-xs);
  color: var(--gray-700);
}
.review-text {
  font-size: var(--text-sm);
  color: var(--gray-700);
  line-height: var(--leading-relaxed);
}

/* ── Provider section heading ───────────────────────────────────────────── */
.provider-section {
  margin-block-start: var(--sp-10);
}
.provider-section-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  margin-block-end: var(--sp-5);
}
.provider-card-meta-row {
  margin-block-start: var(--sp-1);
}

/* ── Similar tours strip ────────────────────────────────────────────────── */
.similar-section { padding-block: var(--sp-12); }
.similar-section-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  margin-block-end: var(--sp-6);
}
.similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-6);
}

/* ── Detail panel embellishments ────────────────────────────────────────── */
.panel-price-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
}
.panel-divider-tight { margin-block: 0; }
.panel-intro-text {
  font-size: var(--text-xs);
  color: var(--gray-700);
  margin-block-end: var(--sp-3);
}
.panel-locked-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--navy-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.panel-locked-icon svg {
  color: var(--navy);
}
.panel-locked-desc {
  font-size: var(--text-sm);
  color: var(--gray-700);
}
.panel-locked-fineprint {
  font-size: var(--text-xs);
  color: var(--gray-700);
}
.panel-locked-fineprint a { color: var(--secondary); }

.panel-note-icon {
  display: inline;
  vertical-align: middle;
  margin-inline-end: 4px;
}

.panel-quickfacts {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.panel-quickfact {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--gray-700);
}
.panel-quickfact svg {
  color: var(--primary);
  flex-shrink: 0;
}

.panel-actions {
  display: flex;
  gap: var(--sp-3);
}
.panel-actions .btn {
  flex: 1;
  width: auto;
}

/* ── Mobile sticky bar typography ───────────────────────────────────────── */
.sticky-bar-amount-unit {
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
}
