/* Homepage featured articles only. Load after home and theme styles. */
html.home-page #home-shell #attractions-grid {
  display: flex;
  flex-flow: row nowrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 4px 0 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

html.home-page #home-shell #attractions-grid > .discovery-attraction-card:not(.gotooi-sk-card) {
  position: relative;
  box-sizing: border-box;
  flex: 0 0 clamp(220px, 72vw, 320px);
  width: clamp(220px, 72vw, 320px);
  min-width: 0;
  max-width: none;
  height: auto;
  min-height: 0;
  aspect-ratio: 2 / 3;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #111827;
  scroll-snap-align: start;
}

html.home-page #home-shell #attractions-grid .discovery-attraction-card:not(.gotooi-sk-card) .discovery-attraction-media {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  margin: 0;
  padding: 0;
  border-radius: inherit;
  overflow: hidden;
  isolation: isolate;
}

html.home-page #home-shell #attractions-grid .discovery-attraction-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

html.home-page #home-shell #attractions-grid .discovery-attraction-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

html.home-page #home-shell #attractions-grid .discovery-attraction-media::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgb(0 0 0 / 8%) 0%, transparent 35%, rgb(0 0 0 / 30%) 65%, rgb(0 0 0 / 88%) 100%);
}

html.home-page #home-shell #attractions-grid .discovery-attraction-badge {
  position: absolute;
  inset: 12px auto auto 12px;
  z-index: 3;
  max-width: calc(100% - 24px);
  box-sizing: border-box;
  padding: 6px 12px;
  border: 1px solid #f5d77b;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff0b3, #e4b742);
  color: #392706;
  -webkit-text-fill-color: #392706;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
  text-shadow: none;
}

html.home-page #home-shell #attractions-grid .discovery-attraction-location {
  position: absolute;
  inset: 56px auto auto 12px;
  z-index: 3;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgb(17 24 39 / 65%);
  color: #fff;
  -webkit-text-fill-color: #fff;
  font-size: 12px;
  line-height: 1.4;
}

html.home-page #home-shell #attractions-grid .discovery-attraction-title {
  position: absolute;
  inset: auto 16px 20px;
  z-index: 2;
  margin: 0;
  padding: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: #fff;
  -webkit-text-fill-color: #fff;
  font-size: clamp(17px, 1.6vw, 22px);
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 3px rgb(0 0 0 / 45%);
}

html.home-page #home-shell #attractions-grid .discovery-attraction-card:focus-visible {
  outline: 3px solid var(--color-primary, #5b7fff);
  outline-offset: -3px;
}


/* Featured author row and functional bookmark button. */
html.home-page #home-shell #attractions-grid
.featured-editorial-bookmark {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 92%);
  color: #172033;
  -webkit-text-fill-color: #172033;
  cursor: pointer;
}

html.home-page #home-shell #attractions-grid
.featured-editorial-bookmark.is-on {
  color: #be123c;
  -webkit-text-fill-color: #be123c;
}

html.home-page #home-shell #attractions-grid
.featured-editorial-bookmark:disabled {
  opacity: .6;
  cursor: wait;
}

html.home-page #home-shell #attractions-grid
.featured-editorial-bookmark:focus-visible {
  outline: 3px solid #5b7fff;
  outline-offset: 3px;
}

html.home-page #home-shell #attractions-grid
.discovery-attraction-badge {
  max-width: calc(100% - 80px);
}

html.home-page #home-shell #attractions-grid
.has-editorial-author .discovery-attraction-title {
  bottom: 66px;
}

html.home-page #home-shell #attractions-grid
.featured-editorial-author {
  position: absolute;
  inset: auto 16px 20px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 30px;
  color: #fff;
  -webkit-text-fill-color: #fff;
  font-size: 14px;
  line-height: 1.4;
}

html.home-page #home-shell #attractions-grid
.featured-editorial-author img {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

html.home-page #home-shell #attractions-grid
.featured-editorial-author img[hidden] {
  display: none;
}

html.home-page #home-shell #attractions-grid
.featured-editorial-author span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* Mobile native scroll: destinations and featured articles only. */
@media (max-width: 1024px) {
  html.home-page #home-shell .home-main,
  html.home-page #home-shell .home-main-inner,
  html.home-page #home-shell .home-discovery-dest,
  html.home-page #home-shell .discovery-slider-wrap,
  html.home-page #home-shell .home-attractions {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  html.home-page #home-shell #discovery-slider,
  html.home-page #home-shell #attractions-grid {
    display: flex;
    flex-flow: row nowrap;
    justify-content: flex-start;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    touch-action: auto;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
  }

  html.home-page #home-shell #discovery-slider *,
  html.home-page #home-shell #attractions-grid * {
    touch-action: auto;
  }

  html.home-page #home-shell #discovery-slider > .discovery-card {
    flex-shrink: 0;
  }

  html.home-page #home-shell #attractions-grid >
  .discovery-attraction-card:not(.gotooi-sk-card) {
    /* Destination width is (100% - 20px) / 2.2.
       Featured article width is 1.25 times that width. */
    --featured-mobile-width: calc((100% - 20px) / 2.2 * 1.25);
    flex: 0 0 var(--featured-mobile-width);
    width: var(--featured-mobile-width);
    min-width: var(--featured-mobile-width);
    max-width: var(--featured-mobile-width);
  }
}


/* Mobile scroll wrapper correction v2. */
@media (max-width: 1024px) {
  html.home-page #home-shell .home-discovery-dest
  .discovery-slider-wrap,
  html.home-page #home-shell .home-attractions
  .discovery-attractions-scroll {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    touch-action: auto;
  }

  html.home-page #home-shell .home-attractions
  .discovery-attractions-scroll {
    overflow: visible;
    scroll-snap-type: none;
  }

  html.home-page #home-shell #discovery-slider,
  html.home-page #home-shell #attractions-grid {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    overflow-x: auto;
    overflow-y: hidden;
    touch-action: auto;
  }
}


/* Mobile destination layout: two cards plus a preview. */
@media (max-width: 1024px) {
  html.home-page #home-shell #attractions-title {
    display: none;
  }

  html.home-page #home-shell #discovery-pointer {
    display: none !important;
  }

  html.home-page #home-shell #discovery-slider >
  .discovery-card.is-active::after {
    content: none;
    display: none;
  }

  html.home-page #home-shell #discovery-slider {
    --dest-tab-width: calc((100% - 20px) / 2.2);
    --dest-tab-height: clamp(88px, 24vw, 120px);
    --dest-tab-extra: 0px;
    gap: 10px;
    padding-top: 4px;
    padding-bottom: 8px;
  }

  html.home-page #home-shell #discovery-slider >
  .discovery-card,
  html.home-page #home-shell #discovery-slider >
  .discovery-card.is-active {
    --dest-card-height: var(--dest-tab-height);
    flex: 0 0 var(--dest-tab-width);
    width: var(--dest-tab-width);
    min-width: var(--dest-tab-width);
    max-width: var(--dest-tab-width);
    height: var(--dest-card-height);
  }

  html.home-page #home-shell #discovery-slider
  .discovery-card-name {
    inset: auto 10px 10px;
    font-size: clamp(18px, 4.8vw, 24px);
    line-height: 1.2;
  }
}
