/* Hallmark · redesign (in-place) · pre-emit critique: P5 H4 E5 S5 R5 V4
 * Tour detail page — new light header + photo gallery + key-detail cards +
 * accordion itinerary (based on the TravelEase sample, adapted to Aussie
 * Travel's ocean destination palette). Scoped to .dst so it inherits the
 * --dst-* tokens / --font-display from destination.css. Only linked from
 * TourDetailPage — category pages never load this file.
 */

/* ===================== HEADER ===================== */
.dst-td-header {
  max-width: 1320px;
  margin: calc(68px + 1.5rem) auto 0;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 6vw, 5rem) 0;
}

/* Breadcrumb restyled for the light background (destination.css styles it
   white-on-photo for the old hero). */
.dst-td-header .dst-breadcrumb {
  font-size: 0.78rem;
  font-weight: 400;
  margin-bottom: 1rem;
  opacity: 1;
  animation: none;
}
.dst-td-header .dst-breadcrumb a {
  color: var(--dst-blue);
  text-decoration: none;
  transition: color 0.2s;
}
.dst-td-header .dst-breadcrumb a:hover { color: var(--dst-ink); }
.dst-td-header .dst-breadcrumb-sep { color: var(--dst-muted); }
.dst-td-header .dst-breadcrumb-current { color: var(--dst-muted); }

.dst-td-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 3.4rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--dst-ink);
  text-wrap: balance;
  margin: 0 0 0.85rem;
}

.dst-td-trust {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--dst-muted);
  font-size: 0.85rem;
  margin-bottom: 0.9rem;
}
.dst-td-trust svg { color: var(--dst-teal); flex-shrink: 0; }

.dst-td-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}
.dst-td-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--dst-line);
  border-radius: 999px;
  background: #fff;
  color: var(--dst-blue);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.dst-td-badge--choice {
  background: rgba(47, 182, 174, 0.1);
  border-color: rgba(47, 182, 174, 0.35);
  color: var(--dst-deep);
}
.dst-td-badge svg { color: var(--dst-teal); }

.dst-td-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}
.dst-td-consult {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--dst-teal);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(47, 182, 174, 0.4);
  padding-bottom: 2px;
  transition: color 0.25s, border-color 0.25s;
}
.dst-td-consult:hover { color: var(--dst-blue); border-color: var(--dst-blue); }
.dst-td-consult:focus-visible { outline: 3px solid var(--dst-teal); outline-offset: 3px; }

.dst-td-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: 1px solid var(--dst-line);
  border-radius: 50%;
  background: #fff;
  color: var(--dst-muted);
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s, background 0.25s, transform 0.2s;
}
.dst-td-save:hover { color: var(--dst-sun); border-color: var(--dst-sun); transform: translateY(-2px); }
.dst-td-save:focus-visible { outline: 3px solid var(--dst-teal); outline-offset: 2px; }
.dst-td-save.is-saved,
.dst-td-save[aria-pressed="true"] {
  color: var(--dst-sun);
  border-color: var(--dst-sun);
  background: rgba(239, 123, 69, 0.08);
}
.dst-td-save svg { transition: transform 0.2s; }
.dst-td-save.is-saved svg { transform: scale(1.12); }

.dst-td-summary {
  max-width: 64ch;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--dst-muted);
  margin: 0 0 1.6rem;
}

/* ===================== GALLERY ===================== */
.dst-td-gallery {
  /* position: relative — the containing block for the absolutely-positioned
     "+N ảnh" overlay (without it, the overlay's inset:0 would resolve against
     the viewport and cover the whole page). */
  position: relative;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: repeat(2, minmax(140px, 1fr));
  gap: 12px;
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 6vw, 5rem) 0;
}
.dst-td-gallery figure { margin: 0; }
.dst-td-gallery-main {
  position: relative;
  grid-row: 1 / 3;
  overflow: hidden;
  border-radius: var(--dst-radius);
  background:
    radial-gradient(120% 90% at 80% 12%, rgba(111, 215, 206, 0.55), transparent 55%),
    radial-gradient(140% 120% at 12% 105%, rgba(239, 123, 69, 0.28), transparent 50%),
    linear-gradient(155deg, var(--dst-blue) 0%, var(--dst-deep) 62%, #05303f 100%);
  box-shadow: var(--dst-shadow);
}
.dst-td-gallery-thumb {
  position: relative;
  overflow: hidden;
  border-radius: var(--dst-radius);
  background:
    radial-gradient(120% 90% at 80% 12%, rgba(111, 215, 206, 0.55), transparent 55%),
    radial-gradient(140% 120% at 12% 105%, rgba(239, 123, 69, 0.28), transparent 50%),
    linear-gradient(155deg, var(--dst-blue) 0%, var(--dst-deep) 62%, #05303f 100%);
  box-shadow: var(--dst-shadow);
}
.dst-td-gallery-main img,
.dst-td-gallery-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.dst-td-gallery-main:hover img,
.dst-td-gallery-thumb:hover img { transform: scale(1.05); }

/* "+N ảnh" overlay on the last thumb tile — a <button> inside a
   position:relative figure, so inset:0 stays anchored to the tile
   (never the viewport). Opens the lightbox (data-gallery-open). */
.dst-td-gallery-more {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  background: rgba(8, 65, 92, 0.68);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(2px);
  transition: background 0.25s;
}
.dst-td-gallery-more:hover { background: rgba(8, 65, 92, 0.82); }
.dst-td-gallery-more:focus-visible { outline: 3px solid var(--dst-aqua); outline-offset: -3px; }

/* ===================== LIGHTBOX ===================== */
/* Rendered only when open (hidden attribute + JS toggling). Default state is
   closed: hidden + no content interaction. */
.dst-td-lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 3vw, 2rem);
}
.dst-td-lightbox[hidden] { display: none; }
.dst-td-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 40, 55, 0.82);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
}
.dst-td-lightbox-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  width: min(1100px, 94vw);
  max-height: 88vh;
  background: #fff;
  border-radius: var(--dst-radius);
  box-shadow: 0 30px 80px -24px rgba(4, 32, 43, 0.7);
  padding: 0.9rem;
  animation: dst-fade 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.dst-td-lightbox-stage {
  grid-column: 2;
  grid-row: 1 / 3;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(120% 90% at 80% 12%, rgba(111, 215, 206, 0.35), transparent 55%),
    linear-gradient(155deg, var(--dst-blue) 0%, var(--dst-deep) 62%, #05303f 100%);
  display: grid;
  place-items: center;
  min-height: 40vh;
  max-height: 78vh;
}
.dst-td-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
}
.dst-td-lightbox-close {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--dst-line);
  border-radius: 50%;
  background: var(--dst-shell);
  color: var(--dst-ink);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.dst-td-lightbox-close:hover { color: var(--dst-sun); border-color: var(--dst-sun); background: #fff; }
.dst-td-lightbox-close:focus-visible,
.dst-td-lightbox-nav:focus-visible { outline: 3px solid var(--dst-teal); outline-offset: 2px; }
.dst-td-lightbox-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--dst-line);
  border-radius: 50%;
  background: #fff;
  color: var(--dst-deep);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.dst-td-lightbox-nav:hover { color: var(--dst-teal); border-color: var(--dst-teal); }
.dst-td-lightbox-prev { grid-column: 1; grid-row: 1 / 3; }
.dst-td-lightbox-next { grid-column: 3; grid-row: 1 / 3; }
.dst-td-lightbox-counter {
  grid-column: 1 / 4;
  grid-row: 3;
  justify-self: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dst-muted);
}

/* ===================== KEY DETAILS ===================== */
.dst-td-key-details {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.75rem, 2vw, 1.25rem);
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 6vw, 5rem) 0;
}
.dst-td-key-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.1rem 1.2rem;
  background: #fff;
  border: 1px solid var(--dst-line);
  border-radius: var(--dst-radius);
  box-shadow: var(--dst-shadow);
}
.dst-td-key-card svg { color: var(--dst-teal); flex-shrink: 0; }
.dst-td-key-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dst-muted);
}
.dst-td-key-value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dst-ink);
}

/* ===================== READ MORE / LESS ===================== */
.dst-td-readmore {
  max-width: 1320px;
  margin: clamp(1.5rem, 3vw, 2.5rem) auto 0;
  padding: 0 clamp(1.5rem, 6vw, 5rem);
}
.dst-td-readmore-card {
  background: #fff;
  border: 1px solid var(--dst-line);
  border-radius: var(--dst-radius);
  padding: 1.1rem 1.3rem;
  box-shadow: var(--dst-shadow);
}
.dst-td-readmore-card summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--dst-teal);
  user-select: none;
}
.dst-td-readmore-card summary::-webkit-details-marker { display: none; }
.dst-td-readmore-card summary:focus-visible { outline: 3px solid var(--dst-teal); outline-offset: 3px; }
.dst-td-readmore-card summary:hover { color: var(--dst-blue); }
.dst-td-readmore-more { display: inline; }
.dst-td-readmore-less { display: none; }
.dst-td-readmore-card[open] .dst-td-readmore-more { display: none; }
.dst-td-readmore-card[open] .dst-td-readmore-less { display: inline; }

.dst-td-readmore-body {
  margin-top: 0.8rem;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.65;
  color: var(--dst-muted);
  white-space: normal;
}
.dst-td-readmore-body p { margin: 0 0 0.75rem; }
.dst-td-readmore-body > :last-child { margin-bottom: 0; }
/* Clamp to ~4 lines when collapsed — pure CSS, no JS */
.dst-td-readmore-card:not([open]) .dst-td-readmore-body {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===================== ITINERARY ACCORDION ===================== */
.dst-td-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--dst-ink);
  text-wrap: balance;
  margin: 0 0 1.25rem;
}
.dst-td-itinerary {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.dst-day-item {
  background: #fff;
  border: 1px solid var(--dst-line);
  border-radius: var(--dst-radius);
  overflow: hidden;
  box-shadow: var(--dst-shadow);
}
.dst-day-item summary {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  transition: background 0.25s;
}
.dst-day-item summary::-webkit-details-marker { display: none; }
.dst-day-item summary:hover { background: var(--dst-shell-2); }
.dst-day-item summary:focus-visible { outline: 3px solid var(--dst-teal); outline-offset: -3px; }
.dst-day-item-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--dst-teal);
  color: var(--dst-blue);
  background: var(--dst-shell);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
}
.dst-day-item-badge--night { border-color: #4338CA; color: #4338CA; }
.dst-day-item-title {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dst-ink);
  margin: 0;
}
.dst-day-item-chevron {
  flex-shrink: 0;
  color: var(--dst-blue);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.dst-day-item[open] .dst-day-item-chevron { transform: rotate(180deg); }
.dst-day-item-body {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--dst-line);
}
.dst-day-item-body .dst-day-row { padding-top: 1.25rem; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 960px) {
  .dst-td-gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: none;
  }
  .dst-td-gallery-main { grid-column: 1 / -1; grid-row: auto; min-height: 260px; }
  .dst-td-key-details { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .dst-td-header { padding-top: 1.5rem; }
  .dst-td-key-details { grid-template-columns: 1fr; }
  .dst-day-item summary { padding: 0.85rem 1rem; gap: 0.7rem; }
  .dst-day-item-body { padding: 0 1rem 1rem; }
  .dst-td-lightbox-panel { grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.5rem; padding: 0.5rem; }
  .dst-td-lightbox-stage { min-height: 30vh; }
}

/* ===================== A11Y — reduced motion ===================== */
@media (prefers-reduced-motion: reduce) {
  .dst-td-gallery-main img,
  .dst-td-gallery-thumb img,
  .dst-day-item-chevron,
  .dst-td-save,
  .dst-td-save svg { transition: none; }
  .dst-td-lightbox-panel { animation: none; }
}
