/* home.css — directory-landing-only styles (#349).

   Loaded by the homepage and the localized landings (/, /es/, /yue/, /fil/,
   /ko/) ONLY, never by tour pages. Kept out of styles.css on purpose: styles.css
   is part of every tour's service-worker SHELL, so editing it would force a
   cacheVersion bump + a full 7-tour regenerate. The dynamic stat cards, the
   "most recent tours" carousel, and the condensed photo-credit control all live
   here so this homepage work never drags in a site-wide cache invalidation. */

/* --- Dynamic stat cards: "N tours" · "M languages" --------------------- */
.home-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gutter);
  margin-block: 4px 22px;
}
.stat-card {
  flex: 1 1 140px;
  min-width: 120px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 16px 18px;
  text-align: center;
}
.stat-card__num {
  display: block;
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}
.stat-card__label {
  display: block;
  margin-top: 6px;
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- "Most recent tours" carousel ------------------------------------- */
/* A horizontal scroll-snap strip that replaces the full homepage grid. Native
   scrolling, no autoplay, keyboard-scrollable (the container is focusable). */
.home-carousel {
  display: flex;
  gap: var(--gutter);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-block: 12px 8px;
  /* Room for focus rings / card shadows and a hint of the next card. */
  scroll-padding-inline: 2px;
}
.home-carousel > .tour-card {
  flex: 0 0 clamp(240px, 78vw, 300px);
  scroll-snap-align: start;
}
.home-carousel:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 12px;
}
.home-carousel .loading,
.home-carousel .empty {
  color: var(--ink-2);
}

/* --- Condensed photo-credit control (per-card attribution) ------------- */
/* Only the ⓘ icon shows; the full credit reveals on hover / keyboard focus.
   The text is always in the DOM (visually collapsed, never display:none) so
   assistive tech and crawlers still receive the CC attribution. */
.tour-card .card__credit {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: visible;
}
.card__credit-icon {
  font-size: .95rem;
  line-height: 1;
  color: var(--ink-2);
  opacity: .65;
  cursor: help;
}
.card__credit-text {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  width: max-content;
  max-width: 240px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #12232E;
  color: #fff;
  font-size: .72rem;
  line-height: 1.35;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  pointer-events: none;
}
.card__credit:hover .card__credit-text,
.card__credit:focus-within .card__credit-text,
.tour-card:focus-within .card__credit-text {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .card__credit-text { transition: none; transform: none; }
}
