/* Home page — layout that's specific to this page's composition.
   Shared widgets (cards, buttons, banners) live in src/css/components/. */

.hero {
  padding-block: var(--space-16) var(--space-12);
  position: relative;
  overflow: hidden;
}

/* Hero banner: a rotating slideshow, each slide pairing a real photo/
   illustration with a highlight caption on a brand-gradient panel, full-
   width above the fold, with the real accessible heading/CTA content
   stacked below it. */
.hero__banner {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: var(--space-10);
}

.hero-slideshow {
  position: relative;
  aspect-ratio: 2 / 1;
}

.hero-slideshow__slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  align-items: stretch;
  background: linear-gradient(135deg, #0f4c39 0%, #072a20 100%);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base);
}

.hero-slideshow__slide.is-active {
  opacity: 1;
  visibility: visible;
}

.hero-slideshow__photo {
  position: relative;
  overflow: hidden;
}

/* <picture> is display:inline by default and has no definite height of its
   own, which breaks the img's height:100% (it has nothing to resolve
   against) — force it to participate in the same stretch as the img. */
.hero-slideshow__photo picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-slideshow__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Fades the photo into the gradient panel so the two halves read as one
   composition rather than a hard-edged split. */
.hero-slideshow__photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(7, 42, 32, 0.85) 0%, rgba(7, 42, 32, 0) 22%);
  z-index: 1;
}

.hero-slideshow__caption {
  position: relative;
  z-index: 2;
  align-self: center;
  padding: var(--space-8);
  max-width: 420px;
}

.hero-slideshow__eyebrow {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-on-dark);
  margin-bottom: var(--space-2);
}

.hero-slideshow__text {
  font-size: var(--text-sm);
  color: var(--color-text-on-dark-muted);
}

.hero-slideshow__dots {
  position: absolute;
  z-index: 3;
  bottom: var(--space-5);
  right: var(--space-6);
  display: flex;
  gap: var(--space-2);
}

.hero-slideshow__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: rgba(243, 246, 244, 0.4);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.hero-slideshow__dot.is-active {
  background-color: var(--color-accent);
  transform: scale(1.2);
}

.hero-slideshow__dot:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .hero-slideshow__slide {
    transition: none;
  }
}

@media (max-width: 767px) {
  .hero-slideshow {
    aspect-ratio: 3 / 4;
  }

  .hero-slideshow__slide {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .hero-slideshow__photo::before {
    background: linear-gradient(to top, rgba(7, 42, 32, 0.85) 0%, rgba(7, 42, 32, 0) 35%);
  }

  .hero-slideshow__caption {
    max-width: none;
    padding: var(--space-5);
  }

  .hero-slideshow__eyebrow {
    font-size: var(--text-lg);
  }

  .hero-slideshow__dots {
    right: var(--space-4);
    bottom: var(--space-3);
  }
}

.hero__content {
  max-width: 680px;
  margin-inline: auto;
  text-align: center;
}

.hero__title {
  margin-bottom: var(--space-5);
}

.hero__title .accent {
  color: var(--color-accent-text);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.hero-badges {
  margin-top: var(--space-12);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  padding: var(--space-2);
}

.hero-badges .info-card {
  padding: var(--space-4);
  align-items: center;
}

.hero-badges .info-card__label {
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .hero-badges {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Matches the .grid--2/4/5/6 convention: 2 columns is still cramped once
   you factor in the fixed-size icon, so drop to 1 column on the narrowest
   phones (e.g. a card with icon + "Transparent Process" no longer has
   room to wrap "Transparent" without it clipping past the card edge). */
@media (max-width: 479px) {
  .hero-badges {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 479px) {
  .hero__actions .btn {
    width: 100%;
  }
}

/* Section header with a title on the left and a "view all" link on the
   right (Popular Destinations). Falls back to stacked/centered when the
   default .section-header--center is used instead. */
.section-header--split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  max-width: none;
}

@media (max-width: 599px) {
  .section-header--split {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Testimonials: horizontal scroll-snap carousel. overflow:hidden is
   load-bearing: .testimonial-track's own overflow-x:auto clips it visually,
   but its ~864px intrinsic content width still leaks into the page's
   scrollable area unless an outer ancestor also clips — that phantom width
   is what makes mobile browsers zoom the whole page out on load. */
.testimonial-carousel {
  position: relative;
  overflow: hidden;
}

.testimonial-track {
  display: flex;
  gap: var(--space-6);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--container-padding);
  padding-block: var(--space-2);
  scrollbar-width: none;
}

.testimonial-track::-webkit-scrollbar {
  display: none;
}

.testimonial-track > li {
  flex: 0 0 min(360px, 85vw);
  scroll-snap-align: start;
}

.testimonial-carousel__controls {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.testimonial-carousel__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.testimonial-carousel__btn:hover {
  background-color: var(--color-primary);
  color: var(--color-text-on-dark);
}

.testimonial-carousel__btn svg {
  width: 18px;
  height: 18px;
}

.testimonial-carousel__btn--prev svg {
  transform: rotate(180deg);
}

/* Data-driven grids show this while src/data/countries.json is loading. */
.data-loading,
.data-error {
  padding: var(--space-6);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  grid-column: 1 / -1;
}
