/* ==========================================================================
   Outreach Africa — Tour Detail page
   Uses the site's editorial type, palette, button and container system so
   this page stays visually consistent with the redesigned tours/about pages.
   ========================================================================== */
.tour-detail-page {
  --td-serif: "Playfair Display", Georgia, serif;
  --td-cream: #fbf7f1;
  --td-red: #b5221d;
  --td-red-dark: #8f1915;
  --td-gold: #a46e20;
  --td-ink: #201e1b;
  --td-muted: #68625b;
  --td-line: #e8e0d7;
}
.tour-detail-page main h1,
.tour-detail-page main h2,
.tour-detail-page main h3 { font-family: var(--td-serif); }
.tour-detail-page .container { max-width: 1240px; }

/* ==========================================================================
   Gallery
   ========================================================================== */
.td-gallery-section { padding: 28px 0 0; }
.td-gallery {
  position: relative;
  display: grid;
  grid-template-columns: 55fr 45fr;
  gap: 8px;
  height: clamp(320px, 34vw, 420px);
}
.td-gallery-main-frame {
  position: relative;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--td-cream);
}
.td-gallery-main {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.td-gallery-main img,
.td-gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.td-gallery-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  height: 100%;
}
.td-gallery-tile {
  position: relative;
  display: block;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: var(--td-cream);
  cursor: pointer;
  border: 0;
  padding: 0;
}
.td-gallery-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 6px 12px;
  background: rgba(20, 18, 16, .72);
  border-radius: 6px;
  color: #fff;
  font-family: var(--font-body);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.td-gallery-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(20, 17, 14, .38);
  color: #fff;
  text-align: center;
  transition: background-color .18s ease;
}
.td-gallery-tile:hover .td-gallery-overlay,
.td-gallery-main:hover .td-gallery-overlay { background: rgba(20, 17, 14, .5); }
.td-gallery-overlay strong { font-family: var(--td-serif); font-size: 1.7rem; font-weight: 700; line-height: 1; }
.td-gallery-overlay span { font-family: var(--font-body); font-size: .82rem; font-weight: 600; }
.td-play-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, .92);
  color: var(--td-red);
  border-radius: 50%;
  font-size: .95rem;
}
.td-gallery-video .td-gallery-overlay { background: rgba(20, 17, 14, .45); }

.td-gallery-arrow {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 3;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 16, 12, .65);
  color: #fff;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: .85rem;
  transition: background-color .18s ease;
}
.td-gallery-arrow.td-gallery-next { left: auto; right: 16px; }
.td-gallery-arrow:hover { background-color: var(--td-red); }
.td-gallery.has-multiple .td-gallery-main-frame .td-gallery-arrow { display: flex; }

/* ==========================================================================
   Lightbox
   ========================================================================== */
.td-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(12, 10, 9, .93);
}
.td-lightbox.is-open { display: flex; }
.td-lightbox-stage { position: relative; width: min(1100px, 92vw); max-height: 84vh; }
.td-lightbox-stage img { display: block; width: 100%; max-height: 84vh; object-fit: contain; border-radius: 8px; }
.td-lightbox-video { position: relative; width: 100%; padding-bottom: 56.25%; display: none; background: #000; border-radius: 8px; overflow: hidden; }
.td-lightbox-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.td-lightbox.is-video .td-lightbox-stage img { display: none; }
.td-lightbox.is-video .td-lightbox-video { display: block; }
.td-lightbox-close,
.td-lightbox-prev,
.td-lightbox-next {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color .18s ease;
}
.td-lightbox-close:hover,
.td-lightbox-prev:hover,
.td-lightbox-next:hover { background: rgba(255, 255, 255, .25); }
.td-lightbox-close { top: 24px; right: 24px; }
.td-lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.td-lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }
.td-lightbox-count {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .85);
  font-family: var(--font-body);
  font-size: .82rem;
  letter-spacing: .03em;
}

/* ==========================================================================
   Content layout
   ========================================================================== */
.td-content { padding: 40px 0 0; }
.td-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  column-gap: 56px;
  align-items: start;
  grid-template-areas:
    "title       sidebar"
    "intro       sidebar"
    "facts       sidebar"
    "highlights  sidebar"
    "description sidebar"
    "bring       sidebar";
}
.td-area-title { grid-area: title; }
.td-area-intro { grid-area: intro; }
.td-area-facts { grid-area: facts; }
.td-area-highlights { grid-area: highlights; }
.td-area-description { grid-area: description; }
.td-area-bring { grid-area: bring; }
.td-area-sidebar { grid-area: sidebar; }

.td-title {
  margin: 0 0 18px;
  color: var(--td-ink) !important;
  font-size: clamp(2.1rem, 3vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.18;
}
.td-intro { max-width: 640px; margin: 0 0 28px; color: var(--td-muted); font-size: 1rem; line-height: 1.7; }
.td-intro p:last-child { margin-bottom: 0; }

/* Facts row */
.td-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 32px;
  padding: 22px 0;
  margin-bottom: 36px;
  border-top: 1px solid var(--td-line);
  border-bottom: 1px solid var(--td-line);
}
.td-fact { display: flex; align-items: flex-start; gap: 12px; min-width: 130px; }
.td-fact-icon { flex: none; width: 20px; padding-top: 3px; color: var(--td-muted); font-size: 1.05rem; text-align: center; }
.td-fact-value { display: block; color: var(--td-ink); font-size: .96rem; font-weight: 700; line-height: 1.3; }
.td-fact-label { display: block; color: var(--td-muted); font-size: .8rem; line-height: 1.4; }

/* Section headings */
.td-section { margin-bottom: 38px; }
.td-heading {
  position: relative;
  margin: 0 0 22px;
  padding-bottom: 12px;
  color: var(--td-ink) !important;
  font-size: 1.55rem;
  font-weight: 700;
}
.td-heading::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 46px;
  height: 3px;
  background: var(--td-gold);
  border-radius: 2px;
}
.td-subheading { margin: 0 0 16px; color: var(--td-ink) !important; font-size: 1.15rem; font-weight: 700; }

/* Highlights */
.td-highlights { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 32px; margin: 0; padding: 0; }
.td-highlights li { position: relative; padding-left: 30px; color: var(--td-ink); font-size: .96rem; line-height: 1.55; }
.td-highlights li i { position: absolute; left: 0; top: 3px; color: var(--td-red); font-size: .95rem; }

/* Description */
.td-description { max-width: 760px; color: var(--td-body, #3d3b38); font-size: 1rem; line-height: 1.72; }
.td-description p { margin: 0 0 20px; font-size: 1rem; line-height: 1.72; }
.td-description p:last-child { margin-bottom: 0; }
/* Some tour descriptions come from a WYSIWYG editor that outputs <div>
   paragraphs (with an empty <div><br></div> as the blank line between
   them) instead of <p> tags — match the same body type either way. */
.td-description div { font-size: 1rem; line-height: 1.72; }

/* What to bring */
.td-bring { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; margin: 0; padding: 0; max-width: 760px; }
.td-bring li { position: relative; padding-left: 26px; color: var(--td-ink); font-size: .95rem; line-height: 1.5; }
.td-bring li i { position: absolute; left: 0; top: 4px; color: var(--td-gold); font-size: .82rem; }

/* ==========================================================================
   Booking card
   ========================================================================== */
.td-sidebar { position: relative; }
.td-booking-card {
  position: sticky;
  top: 112px;
  padding: 26px;
  background: #fff;
  border: 1px solid var(--td-line);
  border-radius: 12px;
  box-shadow: var(--shadow-md, 0 10px 30px rgba(28, 26, 23, .1));
}
.td-booking-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.td-price-label,
.td-duration-label { display: block; margin-bottom: 4px; color: var(--td-muted); font-size: .82rem; }
.td-price { margin: 0; color: var(--td-red); font-family: var(--td-serif); font-size: 2rem; font-weight: 700; line-height: 1.1; }
.td-price-sub { display: block; margin-top: 2px; color: var(--td-muted); font-size: .78rem; }
.td-duration-value { margin: 0; color: var(--td-ink); font-size: 1.3rem; font-weight: 700; text-align: right; }

.td-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: #fbf1e2;
  border: 1px solid #f1dfba;
  border-radius: 8px;
}
.td-notice i { margin-top: 3px; color: var(--td-gold); font-size: .95rem; }
.td-notice strong { display: block; color: var(--td-ink); font-size: .86rem; font-weight: 700; }
.td-notice span { display: block; color: var(--td-muted); font-size: .8rem; margin-top: 2px; }

.td-field-label { display: block; margin-bottom: 8px; color: var(--td-ink); font-size: .84rem; font-weight: 600; }
.td-date-group { position: relative; margin-bottom: 18px; }
.td-date-group i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--td-muted);
  font-size: .92rem;
  pointer-events: none;
}
.td-date-input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 42px;
  background: #fff;
  border: 1px solid var(--td-line);
  border-radius: 8px;
  color: var(--td-ink);
  font-family: var(--font-body);
  font-size: .92rem;
}
.td-date-input:focus { outline: none; border-color: var(--td-red); box-shadow: 0 0 0 3px rgba(181, 34, 29, .12); }

.td-qty-label { display: block; margin-bottom: 10px; color: var(--td-ink); font-size: .84rem; font-weight: 600; }
.td-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--td-cream);
  border-radius: 8px;
}
.td-qty-label-group { display: flex; align-items: center; gap: 10px; min-width: 0; }
.td-qty-label-group i, .td-qty-label-group svg { flex: none; color: var(--td-muted); }
.td-qty-title { color: var(--td-ink); font-size: .9rem; font-weight: 600; }
.td-qty-title small { display: block; color: var(--td-muted); font-size: .74rem; font-weight: 400; }
.td-qty-controls { display: flex; align-items: center; gap: 10px; flex: none; }
.td-qty-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--td-line);
  border-radius: 50%;
  color: var(--td-ink);
  cursor: pointer;
  font-size: .78rem;
  min-height: 44px;
  min-width: 44px;
}
@media (min-width: 576px) { .td-qty-btn { min-height: 30px; min-width: 30px; } }
.td-qty-btn:hover { border-color: var(--td-red); color: var(--td-red); }
.td-qty-input {
  width: 26px;
  border: 0;
  background: transparent;
  text-align: center;
  color: var(--td-ink);
  font-size: .95rem;
  font-weight: 700;
  padding: 0;
}

.td-breakdown { margin: 4px 0 16px; padding-top: 14px; border-top: 1px dashed var(--td-line); }
.td-breakdown-row { display: flex; justify-content: space-between; padding: 4px 0; color: var(--td-muted); font-size: .88rem; }
.td-breakdown-row.td-total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--td-line); color: var(--td-ink); font-size: 1rem; font-weight: 700; }

.td-book-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  background: var(--td-red);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background-color .18s ease;
}
.td-book-btn:hover { background: var(--td-red-dark); }
.td-book-btn:disabled { opacity: .7; cursor: default; }

.td-secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 0;
  color: var(--td-muted);
  font-size: .8rem;
  font-weight: 600;
}
.td-secure-note i { color: var(--color-success, #1e7d46); }
.td-reassurance { list-style: none; margin: 16px 0 0; padding: 16px 0 0; border-top: 1px solid var(--td-line); display: grid; gap: 12px; }
.td-reassurance li { display: flex; align-items: flex-start; gap: 10px; }
.td-reassurance li i { margin-top: 2px; color: var(--td-red); font-size: .85rem; }
.td-reassurance strong { display: block; color: var(--td-ink); font-size: .84rem; font-weight: 600; }
.td-reassurance span { display: block; color: var(--td-muted); font-size: .77rem; }

/* ==========================================================================
   Included / Tour information panel
   ========================================================================== */
.td-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin: 48px 0 0;
  padding: 34px 0 0;
  border-top: 1px solid var(--td-line);
}
.td-panel-heading { position: relative; margin: 0 0 18px; padding-bottom: 10px; color: var(--td-ink) !important; font-size: 1.2rem; font-weight: 700; }
.td-panel-heading:not(:first-child) { margin-top: 26px; }
.td-panel-heading--accent::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36px;
  height: 3px;
  background: var(--td-gold);
  border-radius: 2px;
}
.td-check-list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 12px; }
.td-check-list li { display: flex; align-items: flex-start; gap: 10px; color: var(--td-ink); font-size: .93rem; line-height: 1.5; }
.td-check-list li i { margin-top: 3px; font-size: .85rem; }
.td-check-list.is-included li i { color: var(--color-success, #1e7d46); }
.td-check-list.is-excluded li i { color: var(--color-danger, #b3261e); }

.td-info-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.td-info-rows li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--td-line); }
.td-info-rows li:last-child { border-bottom: 0; padding-bottom: 0; }
.td-info-rows i { color: var(--td-gold); font-size: 1rem; text-align: center; }
.td-info-rows .td-info-label { color: var(--td-muted); font-size: .88rem; }
.td-info-rows .td-info-value { color: var(--td-ink); font-size: .9rem; font-weight: 600; text-align: right; }

/* ==========================================================================
   Final CTA
   ========================================================================== */
.td-final-cta {
  min-height: 220px;
  display: flex;
  align-items: center;
  margin-top: 56px;
  padding: 46px 0;
  background-image:
    linear-gradient(rgba(23, 20, 17, .61), rgba(23, 20, 17, .67)),
    url('../images/capetown-table-mountain.jpg');
  background-position: center 48%;
  background-size: cover;
}
.td-final-cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.td-final-cta-copy { max-width: 520px; }
.tour-detail-page main .td-final-cta h2 {
  margin: 0 0 8px;
  color: #fff !important;
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -.02em;
}
.td-final-cta p { margin: 0; color: rgba(255, 255, 255, .93); font-size: .96rem; line-height: 1.6; }
.td-final-actions { display: flex; flex-wrap: wrap; gap: 12px; flex: none; }
.td-final-actions .btn { min-width: 155px; }
.td-final-actions .btn-light { border: 1px solid #fff; color: #fff; background: transparent; font-weight: 600; }
.td-final-actions .btn-light:hover { background: #fff; color: var(--td-red); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1199.98px) {
  .td-layout { grid-template-columns: minmax(0, 1fr) 340px; column-gap: 40px; }
}

@media (max-width: 991.98px) {
  /* Booking card moves into normal flow, right after the facts row —
     matches the reference's mobile priority (price/CTA before the
     long-form content). */
  .td-layout {
    grid-template-columns: 1fr;
    row-gap: 0;
    grid-template-areas:
      "title"
      "intro"
      "facts"
      "sidebar"
      "highlights"
      "description"
      "bring";
  }
  .td-area-sidebar { margin: 8px 0 40px; }
  .td-booking-card { position: static; }
  .td-panel { grid-template-columns: 1fr; gap: 8px; }
  .td-panel-heading:not(:first-child) { margin-top: 30px; }
}

@media (max-width: 767.98px) {
  .td-gallery-section { padding: 0; }
  .td-gallery { grid-template-columns: 1fr; height: auto; aspect-ratio: 4 / 3; gap: 0; }
  .td-gallery-main { border-radius: 0; height: 100%; }
  .td-gallery-side { display: none; }
  .td-content { padding: 28px 0 0; }
  .tour-detail-page .container { padding-right: 20px; padding-left: 20px; }
  .td-title { font-size: 1.9rem; }
  .td-facts { grid-template-columns: 1fr 1fr; display: grid; gap: 18px; }
  .td-highlights,
  .td-bring { grid-template-columns: 1fr; }
  .td-final-cta-inner { justify-content: center; text-align: center; }
  .td-final-cta-copy { max-width: 100%; }
  .td-final-actions { justify-content: center; width: 100%; }
  .td-final-actions .btn { flex: 1 1 auto; }
  .td-lightbox-prev, .td-lightbox-next { width: 38px; height: 38px; }
}

@media (max-width: 575.98px) {
  .td-facts { grid-template-columns: 1fr 1fr; }
  .td-qty-row { flex-wrap: wrap; }
  .td-final-actions { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  .tour-detail-page *,
  .tour-detail-page *::before,
  .tour-detail-page *::after { transition: none !important; }
}
