/* Discover page */

/* Hero: title sits high (117px), buttons near the bottom edge */
.hero--discover .hero__inner { justify-content: space-between; padding-top: 117px; padding-bottom: 47px; }
/* Bright aerial footage: darker scrim + soft text shadow keep the title and subtitle readable */
.hero--discover .hero__text { text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55), 0 0 2px rgba(0, 0, 0, 0.35); }
.hero--discover .hero__media::after { background: radial-gradient(ellipse 55% 32% at 50% 24%, rgba(0, 0, 0, 0.38), transparent), linear-gradient(to bottom, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.18) 50%, rgba(0, 0, 0, 0.35)); }

/* What is Hideaway */
.wih { gap: var(--s-15); }
.wih__row { display: flex; gap: var(--s-30); align-items: flex-start; }
.wih__intro { flex: 0 0 438px; display: flex; flex-direction: column; gap: 1.2em; }
.wih__features { flex: 1; display: flex; gap: var(--s-15); align-self: stretch; }
.wih__feature {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s-15);
  padding-left: var(--s-15);
  border-left: 0.75px solid var(--c-brown-60);
}
.wih__feature h3 { font-weight: 300; align-items: flex-start; }
.wih__more { text-decoration: underline; text-underline-offset: 4px; }
.wih__more:hover { color: var(--c-brown-60); }

/* Search */
.search { gap: var(--s-30); }
.search__popular { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-15); }
.search__popular a { display: inline-flex; align-items: center; gap: var(--s-10); transition: color 0.2s var(--ease); }
.search__popular a:hover { color: var(--c-brown); }
.search__popular img { height: 15px; width: auto; }
.search__bar {
  display: flex;
  align-items: center;
  gap: var(--s-15);
  padding: var(--s-20) var(--s-30);
  background: var(--c-beige);
  border: 1px solid var(--c-brown);
  border-radius: var(--r-5);
}
.search__popular button { color: inherit; font-size: inherit; transition: color 0.2s var(--ease); }
.search__popular button:hover { color: var(--c-brown); text-decoration: underline; text-underline-offset: 4px; }
.search__popular li + li:not(:nth-child(2))::before { content: "·"; margin-right: var(--s-15); color: var(--c-brown-60); }

.search__bar { position: relative; }
.search__field { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s-10); font-size: var(--fs-small); }
.search__trigger {
  text-align: left;
  font-size: var(--fs-small);
  color: var(--c-brown-60);
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search__trigger.has-value { color: var(--c-brown); }
.search__trigger::after { content: " ⌄"; color: var(--c-brown-60); }
.search__field.is-open .search__label,
.search__trigger:hover { text-decoration: underline; text-underline-offset: 4px; }

.search__popover {
  position: absolute;
  top: calc(100% + 34px);
  left: -16px;
  z-index: 20;
  background: var(--c-white);
  border: 1px solid var(--c-brown);
  border-radius: var(--r-5);
  box-shadow: 0 18px 40px rgba(49, 28, 24, 0.18);
  padding: var(--s-20);
  animation: popover-in 0.35s var(--ease-zoom);
}
@keyframes popover-in { from { opacity: 0; transform: translateY(-6px); } }
.search__popover--where { width: min(620px, 90vw); }
.search__popover--when { width: min(640px, 92vw); left: 50%; transform: translateX(-50%); animation-name: popover-in-center; }
@keyframes popover-in-center { from { opacity: 0; transform: translate(-50%, -6px); } }
.search__popover--type { width: 300px; right: -16px; left: auto; }

/* destinations: 4 country columns */
.dest-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-20); }
.dest-group { display: flex; flex-direction: column; gap: 2px; }
.dest-option {
  text-align: left;
  padding: 6px 8px;
  margin-left: -8px;
  border-radius: var(--r-5);
  font-size: var(--fs-small);
  color: var(--c-brown);
  transition: background-color 0.2s var(--ease);
}
.dest-option--country { font-family: var(--f-display); font-style: italic; font-weight: 500; font-size: 22px; line-height: 1.1; margin-bottom: 6px; }
.dest-option:hover,
.dest-option:focus-visible { background: var(--c-beige); outline: none; }
.dest-option[aria-selected="true"] { background: var(--c-brown); color: var(--c-white); }

/* trip type */
.type-list { display: flex; flex-direction: column; gap: var(--s-10); }
.type-option { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: var(--s-15); border: 1px solid var(--c-brown-60); border-radius: var(--r-5); transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease); }
.type-option span { font-size: var(--fs-body); }
.type-option small { font-size: 12px; color: var(--c-brown-60); }
.type-option:hover { border-color: var(--c-brown); }
.type-option.is-selected { border-color: var(--c-brown); background: var(--c-beige); }

/* range calendar */
.range-cal { display: flex; flex-direction: column; gap: var(--s-15); }
.range-cal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-10); }
.range-cal__nav { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--c-brown-60); border-radius: var(--r-round); }
.range-cal__nav img { width: 6px; height: 12px; }
.range-cal__nav[data-cal-prev] img { transform: scaleX(-1); }
.range-cal__nav:disabled { opacity: 0.3; cursor: default; }
.range-cal__months { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-30); }
.range-cal__title { font-family: var(--f-display); font-style: italic; font-weight: 500; font-size: 24px; text-align: center; margin-bottom: var(--s-10); }
.range-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; text-align: center; }
.range-cal__dow { font-size: 11px; color: var(--c-brown-60); padding-bottom: 6px; }
.range-cal__day { position: relative; height: 36px; font-size: 13px; color: var(--c-brown); z-index: 0; }
.range-cal__day::before { content: ""; position: absolute; inset: 2px; border-radius: var(--r-round); z-index: -1; transition: background-color 0.2s var(--ease); }
.range-cal__day:not(:disabled):hover::before { background: var(--c-beige); }
.range-cal__day:disabled { color: rgba(49, 28, 24, 0.25); cursor: default; }
.range-cal__day.is-between { background: var(--c-beige); }
.range-cal__day.is-start,
.range-cal__day.is-end { color: var(--c-white); }
.range-cal__day.is-start::before,
.range-cal__day.is-end::before { background: var(--c-brown); }
.range-cal__day.is-preview::before { background: var(--c-brown-60); }
.range-cal__foot { display: flex; align-items: center; justify-content: space-between; border-top: 0.75px solid var(--c-brown-60); padding-top: var(--s-15); }
.range-cal__clear { text-decoration: underline; text-underline-offset: 4px; color: var(--c-brown-60); }
.range-cal__foot .btn { min-height: 44px; padding: 10px 28px; }

.search__note a { color: var(--c-brown); text-decoration: underline; text-underline-offset: 4px; }
.search__note strong { font-weight: 400; color: var(--c-brown); }
.search__bar .divider-v { align-self: stretch; }

/* Categories: 3 cards on top, 2 below */
.categories { gap: var(--s-30); }
.categories__grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 234px;
  gap: var(--s-15);
  text-align: left;
}
.categories__grid > :nth-child(-n + 3) { grid-column: span 2; }
.categories__grid > :nth-child(n + 4) { grid-column: span 3; }
/* category names are always visible — they explain what each card is */
.categories__grid .media-card__footer { opacity: 1; }
.categories__grid .media-card__text,
.categories__grid .media-card__actions { transform: none; }

/* Quote */
.quote {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-30) var(--gutter);
  text-align: center;
}

/* Editorial (The Brando) */
.editorial { flex-direction: row; gap: var(--s-30); }
.editorial__image {
  position: relative;
  flex: 1;
  min-height: 396px;
  border: 1px solid var(--c-brown);
  border-radius: var(--r-round);
  overflow: hidden;
}
.editorial__image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--zoom-duration) var(--ease-zoom), filter var(--zoom-duration) var(--ease-zoom); }
.editorial__image:hover img { transform: scale(var(--zoom-scale)); filter: var(--zoom-filter); }
.editorial__content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s-15); }
.editorial__content .chip-row > .btn { cursor: default; }
.editorial__content .chip-row > .btn:hover { background: none; color: var(--c-brown); }

/* Going further */
.going-further { flex-direction: row; align-items: center; justify-content: center; gap: var(--s-30); padding-block: var(--s-30); }
.going-further__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s-15); }
.going-further__text h2 { text-align: center; }
.going-further__stat { display: flex; align-items: flex-start; gap: var(--s-30); }
.going-further__photos { position: relative; flex: 0 0 515px; height: 357px; }
.photo-card {
  position: absolute;
  object-fit: cover;
  border: 1px solid var(--c-brown);
  border-radius: var(--r-5);
  box-shadow: var(--shadow-card);
  transition: transform var(--zoom-duration) var(--ease-zoom), box-shadow var(--zoom-duration) var(--ease-zoom), filter var(--zoom-duration) var(--ease-zoom);
  cursor: zoom-in;
}
.photo-card--left   { top: 0; left: 0; width: 250px; height: 178px; }
.photo-card--right  { top: 0; right: 0; width: 250px; height: 178px; }
.photo-card--bottom { bottom: 0; left: 50%; width: 230px; height: 164px; transform: translateX(-50%); z-index: 1; }
/* Each photo grows on its own when hovered */
.photo-card:hover { z-index: 2; transform: scale(1.12); filter: var(--zoom-filter); box-shadow: 0 18px 36px rgba(49, 28, 24, 0.35); }
.photo-card--bottom:hover { transform: translateX(-50%) scale(1.12); }

/* Listings */
.listings { padding-bottom: var(--s-30); }
.listing-card[hidden] { display: none; }

/* Horizontal carousel: one row, 4 cards in view, swipe / drag / arrows */
.listings__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-20); width: 100%; flex-wrap: wrap; }
.carousel-nav { display: flex; gap: var(--s-10); }
.country-filter { margin-left: auto; color: var(--c-brown-60); }
.country-filter span { color: var(--c-brown); }
.country-filter button { margin-left: var(--s-10); font-size: inherit; color: var(--c-brown-60); text-decoration: underline; text-underline-offset: 4px; }
.listings__empty a { color: var(--c-brown); text-decoration: underline; text-underline-offset: 4px; }
.carousel-nav .btn-arrow { width: 57px; height: 57px; }
.carousel-nav .btn-arrow:hover { transform: none; background: var(--c-beige); }
.carousel-nav .btn-arrow:disabled { opacity: 0.3; cursor: default; background: var(--c-white); }
.listing-carousel {
  --per-view: 4;
  display: flex;
  gap: var(--s-15);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  cursor: grab;
  height: 493px;
}
.listing-carousel::-webkit-scrollbar { display: none; }
.listing-carousel > .listing-card {
  flex: 0 0 calc((100% - (var(--per-view) - 1) * var(--s-15)) / var(--per-view));
  scroll-snap-align: start;
}
.listing-carousel.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; user-select: none; }
.listing-carousel.is-animating { scroll-snap-type: none; scroll-behavior: auto; }
.listing-carousel.is-dragging a { pointer-events: none; }
.listing-carousel img { -webkit-user-drag: none; user-select: none; }
.listings__empty { text-align: center; }

/* Masonry strip: two-image columns, scrolling continuously */
.masonry { height: 562px; overflow: hidden; }
.masonry__track { display: flex; gap: var(--s-15); width: max-content; animation: masonry-scroll 90s linear infinite; }
.masonry__set { display: flex; gap: var(--s-15); }
.masonry__col { width: var(--w); display: flex; flex-direction: column; gap: var(--s-15); }
.masonry__col img { width: 100%; height: var(--h); object-fit: cover; }
@keyframes masonry-scroll {
  to { transform: translateX(calc(-50% - var(--s-15) / 2)); }
}

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1100px) {
  .listing-carousel { --per-view: 3; }
  .wih__row { flex-direction: column; }
  .wih__intro { flex-basis: auto; }
  .going-further__photos { flex-basis: 420px; transform: scale(0.82); }
}

@media (max-width: 900px) {
  .hero--discover .hero__inner { padding-top: 140px; gap: var(--s-60); justify-content: center; }
  .wih__features { flex-direction: column; }
  .wih__feature { padding: 0 0 0 var(--s-15); }
  .search__bar { flex-wrap: wrap; padding: var(--s-20); }
  .search__field { flex: 1 1 100%; }
  .search__bar .divider-v { width: 100%; height: 0.75px; }
  .search__bar .btn-arrow { margin-left: auto; }
  .search__popover,
  .search__popover--where,
  .search__popover--when,
  .search__popover--type { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; transform: none; max-height: 80vh; overflow: auto; animation-name: popover-in; }
  .dest-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .categories__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 200px; }
  .categories__grid > :nth-child(n) { grid-column: span 1; }
  .categories__grid > :last-child { grid-column: span 2; }
  .editorial,
  .going-further { flex-direction: column; align-items: stretch; }
  .editorial__image { min-height: 300px; }
  .going-further__photos { flex-basis: auto; transform: none; width: 100%; max-width: 515px; align-self: center; }
  .listing-carousel { --per-view: 2; height: 440px; }
  .masonry { height: 420px; }
  .masonry__col { width: calc(var(--w) * 0.75); }
  .masonry__col img { height: calc(var(--h) * 0.75); }
}

@media (max-width: 600px) {
  .categories__grid { grid-template-columns: 1fr; grid-auto-rows: 220px; }
  .range-cal__months { grid-template-columns: 1fr; }
  .categories__grid > :last-child { grid-column: span 1; }
  .editorial__image { min-height: 240px; }
  .going-further__photos { height: 300px; }
  .photo-card--left,
  .photo-card--right { width: 58%; height: 150px; }
  .photo-card--bottom { width: 55%; height: 140px; }
  /* category chips: smaller, sized to their text */
  .listings .chip-row { gap: 8px; }
  .listings .chip-row > .btn { flex: 0 0 auto; width: auto; min-height: 38px; padding: 8px 14px; font-size: 13px; }
  /* cards grow to fit the location, rating and price rows */
  .listing-carousel { --per-view: 1.15; height: auto; }
  .listing-carousel .listing-card .media-card { flex: none; min-height: 300px; }
  .carousel-nav { display: none; }
  .masonry { height: 320px; }
  .masonry__col { width: calc(var(--w) * 0.55); }
  .masonry__col img { height: calc(var(--h) * 0.55); }

  /* What is Hideaway: no side dividers on phones */
  .wih__feature { border-left: 0; padding-left: 0; }

  /* Popular: no "·" separators — they ended up at line starts when the row wrapped */
  .search__popular { gap: var(--s-10) var(--s-20); }
  .search__popular li + li:not(:nth-child(2))::before { content: none; }

  /* Search: the round arrow becomes a full-width rectangular button inside the bar, arrow centred */
  .search__bar .btn-arrow {
    flex: 1 1 100%;
    width: 100%;
    height: 57px;
    margin: 0;
    border-radius: var(--r-5);
  }
  .search__bar .btn-arrow:hover { transform: none; }
  .search__bar .btn-arrow img { width: 8px; height: 16px; }

  /* Hero: title block centred, buttons at the bottom with the same 15px gap below as between them */
  .hero--discover { display: flex; flex-direction: column; }
  .hero--discover .hero__inner { flex: 1; height: auto; justify-content: space-between; gap: var(--s-30); padding-bottom: var(--s-15); }
  .hero--discover .hero__text { flex: 1; justify-content: center; }

  /* Curator's pick: eyebrow, title and labels centred; labels without "·" separators */
  .editorial__content > .t-eyebrow,
  .editorial__content > h2 { text-align: center; }
  .editorial__content .tag-list { justify-content: flex-start; gap: 6px 18px; }
  .more-desktop { display: none; }
  .editorial__content .tag-list li + li::before { content: none; }

  /* Going further: three photos in a tidy grid instead of an overlapping stack (no hover on phones) */
  .going-further__photos { height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-10); max-width: none; }
  .photo-card,
  .photo-card--left,
  .photo-card--right,
  .photo-card--bottom { position: relative; inset: auto; left: auto; width: 100%; height: 150px; transform: none; box-shadow: none; cursor: default; }
  .photo-card--bottom { grid-column: 1 / -1; height: 190px; }
  /* tap a photo to enlarge it a little, tap again to settle it back */
  .photo-card { position: relative; z-index: 0; transition: transform 0.6s var(--ease-zoom), box-shadow 0.6s var(--ease-zoom); }
  .going-further__photos .photo-card.is-zoomed { transform: scale(1.06); z-index: 2; box-shadow: 0 14px 30px rgba(49, 28, 24, 0.35); }
  .going-further:hover .photo-card--left,
  .going-further:hover .photo-card--right,
  .going-further:hover .photo-card--bottom,
  .photo-card:hover { transform: none; filter: none; box-shadow: none; }
}
