/* Voyatale V2 — trip-story detail, gallery and comments sheet. */
body.v2-trip-detail-open { overflow: hidden; }

.v2TripDetail {
  position: fixed;
  inset: 0;
  z-index: 8200;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--v2-surface-warm, #faf8fb);
  color: var(--v2-text, #17131a);
  overflow: hidden;
}
.v2TripDetail[hidden], .v2CommentsLayer[hidden], .v2StoryLightbox[hidden] { display: none !important; }
.v2TripDetailTop {
  min-height: 58px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  padding: max(5px, env(safe-area-inset-top)) 12px 5px;
  border-bottom: 1px solid rgba(37, 23, 42, .09);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
  z-index: 2;
}
.v2TripDetailTop strong { text-align: center; font-size: 16px; }
.v2TripDetailBack, .v2TripDetailSave,
.v2CommentsClose, .v2StoryLightbox button {
  width: 44px;
  min-width: 44px;
  height: 44px;
}
.v2TripDetailBack, .v2TripDetailSave, .v2CommentsClose {
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 25px;
  cursor: pointer;
}
.v2TripDetailTop strong { color: var(--vt-v2-purple, #7d0088); font-size: 18px; letter-spacing: -.035em; }
.v2TripDetailSave svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.v2TripDetailSave.is-saved svg { fill: color-mix(in srgb, var(--vt-v2-orange, #ff7900) 22%, transparent); color: var(--vt-v2-purple, #7d0088); }
.v2TripDetailScroll {
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px max(12px, calc((100vw - 860px) / 2)) calc(32px + env(safe-area-inset-bottom));
}
.v2TripDetailStatus {
  width: min(100%, 760px);
  margin: 18vh auto 0;
  padding: 28px 20px;
  border: 1px solid rgba(121, 0, 128, .12);
  border-radius: var(--vt-v2-radius-lg, 16px);
  background: #fff;
  text-align: center;
}
.v2TripDetailStatus p { margin: 0 0 14px; color: var(--v2-text-muted, #667085); }
.v2TripDetailStatus button { min-height: 44px; }
.v2TripDetailHost { width: min(100%, 820px); margin: 0 auto; min-width: 0; }
.v2TripDetailHost > .vgFeedStack { gap: 0; }
.v2TripDetailHost .v2TripDetailCard {
  border-radius: var(--vt-v2-radius-lg, 16px) !important;
  box-shadow: 0 18px 50px rgba(42, 22, 48, .09) !important;
  overflow: hidden;
}
.v2TripDetailCard .vgTitle { font-size: clamp(25px, 4vw, 38px) !important; line-height: 1.08 !important; }
.v2TripDetailCard .vgSummaryText,
.v2TripDetailCard [data-post-text="1"] {
  display: block !important;
  overflow: visible !important;
  -webkit-line-clamp: unset !important;
  max-height: none !important;
}
.v2TripDetailCard [data-action="togglePostText"],
.v2TripDetailCard [data-action="collapseSmartStory"] { display: none !important; }
.v2TripDetailCard .vgSmartStory { display: block !important; }
.v2TripDetailCard .vgPhotoRow { margin-top: 18px; }
.v2TripDetailCard .vgDesktopPhotoLayout,
.v2TripDetailCard .vgMobilePhotoLayout { min-height: 360px; }
.v2TripDetailCard .vgMap { min-height: 420px; }
.v2TripDetailCard .vgComments { display: none !important; }
.v2TripDetailCard .vgCommentCountLabel { min-height: 44px; }
.v2TripDetailCard .vgComposer { cursor: text; }
.v2TripDetailCard .postMoreBtn { width: 44px; min-width: 44px; height: 44px; }

.v2CommentsLayer {
  position: fixed;
  inset: 0;
  z-index: 8700;
  display: grid;
  align-items: end;
  background: rgba(21, 14, 24, .48);
  padding-top: max(28px, env(safe-area-inset-top));
}
.v2CommentsSheet {
  width: min(100%, 680px);
  max-height: min(82dvh, 780px);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: var(--vt-v2-sheet-radius, 24px) var(--vt-v2-sheet-radius, 24px) 0 0;
  background: #fff;
  box-shadow: 0 -24px 70px rgba(17, 11, 20, .2);
  overflow: hidden;
}
.v2CommentsSheet::before {
  content: "";
  width: 38px;
  height: 4px;
  margin: 8px auto -4px;
  border-radius: 999px;
  background: rgba(38, 31, 42, .18);
}
.v2CommentsHead {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 20px;
  border-bottom: 1px solid rgba(37, 23, 42, .09);
}
.v2CommentsHead strong { font-size: 17px; }
.v2CommentsList { min-width: 0; overflow: auto; padding: 14px 18px 24px; }
.v2CommentsList .vgCommentItem { margin-bottom: 12px; }
.v2CommentsState { padding: 34px 18px; color: var(--v2-text-muted, #667085); text-align: center; }
.v2CommentsComposer {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 44px;
  align-items: end;
  gap: 9px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(37, 23, 42, .09);
  background: #fff;
}
.v2CommentsComposer img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.v2CommentsComposer textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  max-height: 126px;
  resize: vertical;
  padding: 11px 14px;
  border: 1px solid rgba(37, 23, 42, .15);
  border-radius: 18px;
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
}
.v2CommentsSend {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--vt-v2-purple, #7d0088);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.v2StoryLightbox {
  position: fixed;
  inset: 0;
  z-index: 9200;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #0b090c;
  color: #fff;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
}
.v2StoryLightboxTop {
  min-height: 52px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
}
.v2StoryLightboxTop span { text-align: center; font-weight: 800; }
.v2StoryLightbox button {
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font: inherit;
  font-size: 26px;
  cursor: pointer;
}
.v2StoryLightboxStage { position: relative; min-width: 0; min-height: 0; display: grid; place-items: center; overflow: hidden; touch-action: pan-y; }
.v2StoryLightboxStage img { display: block; width: 100%; height: 100%; object-fit: contain; }
.v2StoryPrev, .v2StoryNext { position: absolute; top: 50%; transform: translateY(-50%); }
.v2StoryPrev { left: 8px; }
.v2StoryNext { right: 8px; }
.v2StoryLightboxFoot { min-height: 92px; display: grid; place-items: center; gap: 7px; padding: 8px 12px; }
.v2StoryThumbs { width: min(100%, 720px); display: flex; gap: 7px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.v2StoryThumbs::-webkit-scrollbar { display: none; }
.v2StoryLightbox .v2StoryThumb { width: 58px; min-width: 58px; height: 48px; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 9px; background: rgba(255,255,255,.08); }
.v2StoryLightbox .v2StoryThumb.is-active { border-color: #fff; }
.v2StoryThumb img { width: 100%; height: 100%; object-fit: cover; }
.v2StoryCaption { margin: 0; max-width: 760px; color: rgba(255,255,255,.82); text-align: center; }
.v2StoryMapButton { width: auto !important; min-width: 176px !important; padding: 0 20px; border-radius: 14px !important; font-size: 15px !important; font-weight: 800 !important; }

:is(.v2TripDetail, .v2CommentsLayer, .v2StoryLightbox) :focus-visible {
  outline: 3px solid var(--vt-v2-orange, #ff7900);
  outline-offset: 3px;
}

@media (max-width: 768px) {
  .v2TripDetailScroll { padding: 0 0 calc(82px + env(safe-area-inset-bottom)); }
  .v2TripDetailHost .v2TripDetailCard { border-radius: 0 !important; box-shadow: none !important; }
  .v2TripDetailCard .vgTitle { font-size: 25px !important; }
  .v2TripDetailCard .vgDesktopPhotoLayout { display: none !important; }
  .v2TripDetailCard .vgMobilePhotoLayout { min-height: 0; }
  .v2TripDetailCard .vgMobileFeedCollage {
    display: grid !important;
    width: 100% !important;
    height: clamp(178px, 52vw, 215px) !important;
    min-width: 0 !important;
    gap: 4px !important;
    overflow: hidden !important;
    border-radius: 14px !important;
  }
  .v2TripDetailCard .vgMobilePhoto {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #eef0ef !important;
  }
  .v2TripDetailCard .vgMobilePhoto img { width: 100% !important; height: 100% !important; object-fit: cover !important; }
  .v2TripDetailCard .vgMobileFeedCollage.is-one { grid-template: 1fr / 1fr !important; }
  .v2TripDetailCard .vgMobileFeedCollage.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .v2TripDetailCard .vgMobileFeedCollage.is-three {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, .9fr) !important;
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    grid-template-areas: "main second" "main third" !important;
  }
  .v2TripDetailCard .vgMobileFeedCollage.is-four {
    grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, .45fr)) !important;
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    grid-template-areas: "main second second" "main third fourth" !important;
  }
  .v2TripDetailCard .vgMobileFeedCollage:is(.is-three, .is-four) .vgMobilePhoto.is-main { grid-area: main !important; }
  .v2TripDetailCard .vgMobileFeedCollage:is(.is-three, .is-four) .vgMobilePhoto.is-second { grid-area: second !important; }
  .v2TripDetailCard .vgMobileFeedCollage:is(.is-three, .is-four) .vgMobilePhoto.is-third { grid-area: third !important; }
  .v2TripDetailCard .vgMobileFeedCollage.is-four .vgMobilePhoto.is-fourth { grid-area: fourth !important; }
  .v2TripDetailCard .vgMobilePhotoMore {
    position: absolute !important;
    inset: 0 !important;
    display: grid !important;
    place-items: center !important;
    background: rgba(18, 24, 21, .48) !important;
    color: #fff !important;
    font-size: 25px !important;
    font-weight: 800 !important;
    pointer-events: none !important;
  }
  .v2TripDetailCard .vgMap { min-height: 68vh; }
  .v2CommentsSheet { max-height: 86dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .v2TripDetail *, .v2CommentsLayer *, .v2StoryLightbox * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
