/* Shared package/group detail presentation. Hand-authored like group-tours.css. */
:is(.journey-page, .group-tour-page) { overflow-wrap: anywhere; }
:is(.journey-page, .group-tour-page) :is(.journey-topline, .journey-meta, .journey-meta > span, .journey-body > *, .journey-content, .journey-content section, .included-panels article, .stay-panels article, .inclusion-heading h3, .journey-highlights span, .travel-section-heading > *, .day-timeline strong, .journey-facts dt, .journey-facts dd) { min-width: 0; max-width: 100%; }
:is(.journey-page, .group-tour-page) :is(.journey-meta > span, .journey-topline .text-link, .group-dates-summary .button, .group-panel-actions .button) { white-space: normal; }
:is(.journey-page, .group-tour-page) :is(.journey-meta svg, .journey-highlights svg, .inclusion-heading svg, .day-badge, .day-toggle) { flex-shrink: 0; }
:is(.journey-page, .group-tour-page) .journey-highlights > div { align-items: flex-start; }
:is(.journey-page, .group-tour-page) .travel-section-heading { flex-wrap: wrap; }
:is(.journey-page, .group-tour-page) .group-dates-summary > * { min-width: 0; max-width: 100%; }
.group-hotel-table { table-layout: fixed; }
.group-hotel-table :is(th, td) { overflow-wrap: anywhere; }
@media (min-width: 601px) and (max-width: 1100px) {
  :is(.journey-page, .group-tour-page) :is(.included-panels, .stay-panels) { grid-template-columns: minmax(0,1fr); }
}

.tour-gallery { padding-bottom: 26px; }
/* Row gaps are 3/4 of column gaps: a tile spanning 2×2 cells remains 4:3. */
.tour-gallery-preview { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 12px; row-gap: 9px; }
.tour-gallery-tile { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; min-width: 0; min-height: 0; overflow: hidden; border-radius: 16px; background: #eef1eb; }
.tour-gallery-preview[data-photo-count="5"] { grid-template-columns: repeat(4,minmax(0,1fr)); }
.tour-gallery-preview[data-photo-count="3"] { grid-template-columns: repeat(3,minmax(0,1fr)); }
.tour-gallery-preview:is([data-photo-count="3"], [data-photo-count="5"]) .tour-gallery-tile:first-child { grid-column: span 2; grid-row: span 2; }
.tour-gallery-preview[data-photo-count="1"] { grid-template-columns: minmax(0,1fr); max-width: 820px; margin-inline: auto; }
.tour-gallery-preview[data-photo-count="4"] { max-width: 960px; margin-inline: auto; }
.tour-gallery-tile img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.tour-gallery-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; }
.tour-gallery-footer .section-note { margin: 0; }
.tour-gallery-footer .button { min-height: 44px; padding: 10px 16px; font-size: 14px; gap: 6px; white-space: normal; flex-shrink: 0; background: #fff; }
.tour-gallery a:focus-visible, .tour-photo-dialog :is(a, button):focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.tour-gallery-tile:hover { box-shadow: 0 0 0 2px var(--ink); }
.tour-gallery-fallback a { display: inline-block; padding: 12px; }

.tour-photo-dialog { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: #fffefa; color: var(--ink); overflow: hidden; overscroll-behavior: contain; }
.tour-photo-dialog[open] { display: flex; flex-direction: column; }
.tour-photo-dialog [hidden] { display: none !important; }
.tour-photo-header { display: flex; align-items: center; gap: 20px; flex-shrink: 0; padding: max(18px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 18px max(24px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: white; }
.tour-photo-heading { flex: 1; min-width: 0; }
.travel-page .tour-photo-heading h2 { margin: 0; font-size: 20px; line-height: 1.3; letter-spacing: -.3px; overflow-wrap: anywhere; }
.tour-photo-heading p { margin: 5px 0 0; font-size: 13px; }
.tour-photo-header .icon-button { flex-shrink: 0; }
.tour-photo-back { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.tour-photo-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 24px max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); }
.tour-photo-grid { columns: 3; column-gap: 18px; max-width: 1800px; margin: auto; }
.tour-photo-item { display: block; break-inside: avoid; margin-bottom: 18px; border-radius: 14px; overflow: hidden; background: #eef1eb; }
.tour-photo-item img { display: block; width: 100%; height: auto; object-fit: contain; }
.tour-photo-viewer { height: 100%; min-height: 220px; display: flex; flex-direction: column; gap: 14px; }
.tour-photo-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: #eef1eb; border-radius: 16px; overflow: hidden; }
.tour-photo-stage img { width: 100%; height: 100%; object-fit: contain; touch-action: pan-y pinch-zoom; }
.tour-photo-stage p { padding: 24px; text-align: center; }
.tour-photo-actions { display: flex; align-items: center; justify-content: center; gap: 20px; flex-shrink: 0; }
.tour-photo-original { font-size: 14px; text-decoration: underline; min-height: 44px; display: flex; align-items: center; text-align: center; }
@media (max-width: 1000px) { .tour-photo-grid { columns: 2; } }
@media (max-width: 600px) {
  .tour-gallery-preview { column-gap: 8px; row-gap: 6px; }
  .tour-gallery-preview[data-photo-count="3"] { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tour-gallery-preview[data-photo-count="4"] { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .tour-gallery-preview .tour-gallery-tile { border-radius: 12px; }
  .tour-gallery-preview:is([data-photo-count="3"], [data-photo-count="4"], [data-photo-count="5"]) .tour-gallery-tile:first-child { grid-column: 1 / -1; grid-row: auto; }
  .tour-gallery-footer { align-items: flex-start; }
  .tour-gallery-footer .section-note { font-size: 12px; }
  .tour-gallery-footer .button { padding: 9px 12px; font-size: 12px; }
  .tour-photo-header { gap: 10px; padding: max(12px, env(safe-area-inset-top)) 16px 12px; flex-wrap: wrap; }
  .travel-page .tour-photo-heading h2 { font-size: 17px; }
  .tour-photo-back { font-size: 12px; padding: 8px; }
  .tour-photo-scroll { padding: 16px 16px max(16px, env(safe-area-inset-bottom)); }
  .tour-photo-grid { columns: 1; }
  .tour-photo-item { margin-bottom: 14px; }
  .tour-photo-actions { gap: 12px; }
}
