/* ==========================================================================
   Victor Harbour Whale Sighting — home page components
   Hand-coded embeds only: CTA band + Recent Whale Sightings carousel.
   Mobile-first (520 artboard); desktop (1440 artboard) at min-width 1024px.
   All values measured from Figma frames 3317:2900 / 3317:3559.
   ========================================================================== */

/* base.css sets img { display: block }, which would defeat the [hidden]
   attribute on template imgs — restore hidden semantics page-wide. */
.vh-home [hidden] {
  display: none !important;
}

/* Josefin display text in the Figma file tracks ~-0.06em tighter than the
   Google Fonts default; applied page-scoped to match the renders 1:1.
   Extrapolated — flag for global review (see DECISIONS.md). */
.vh-home .vh-btn,
.vh-home .vh-live,
.vh-home h3 {
  letter-spacing: -0.06em;
}

/* --------------------------------------------------------------------------
   CTA band — white strip overlapping the hero bottom.
   Mobile: 502px-wide strip (9px hero slivers each side), buttons stacked.
   Desktop: 1280px container strip, three hug-width buttons left-aligned.
   -------------------------------------------------------------------------- */
.vh-cta {
  position: relative;
  z-index: 1;
}

.vh-cta__band {
  width: calc(100% - 18px);
  margin-inline: auto;
  padding-block: 36px;
  background: var(--vh-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.vh-btn--xl {
  width: 307px;
  height: 76px;
  padding: 20px 40px;
  justify-content: flex-start;
}

@media (min-width: 1024px) {
  .vh-cta__inner {
    width: 100%;
    max-width: calc(var(--vh-container) + 160px);
    margin-inline: auto;
    padding-inline: 80px;
  }

  .vh-cta__band {
    width: 100%;
    padding: 32px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 29px;
  }

  .vh-btn--xl {
    width: auto;
    height: 100px;
    padding: 40px;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Recent Whale Sightings carousel panel
   -------------------------------------------------------------------------- */
.vh-carousel-section {
  margin-top: 80px;
}

.vh-carousel {
  background: var(--vh-card);
  border-radius: var(--vh-radius-panel-sm);
  padding: 28px 20px 48px;
}

.vh-carousel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* View-all uses base .vh-btn metrics (16px 28px padding) */
.vh-carousel__viewall {
  flex: 0 0 auto;
}

.vh-carousel__title {
  margin-top: 48px;
  font-size: var(--vh-text-h3);
}

.vh-carousel__sub {
  margin-top: 16px;
}

.vh-carousel__body {
  position: relative;
  margin-top: 48px;
}

.vh-carousel__viewport {
  overflow: hidden;
  touch-action: pan-y;
}

.vh-carousel__track {
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  transition: transform 0.4s ease;
}

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

/* --- Card --- */
.vh-card {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Whole-card link — stretched over the card (extrapolated hover/focus,
   see DECISIONS.md). The meta text stays selectable; only the photo,
   badge and rules sit under the hit area. */
.vh-card__link {
  position: static;
}

.vh-card__link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.vh-card:hover {
  transform: translateY(-4px);
}

.vh-card:hover .vh-card__photo {
  box-shadow: 0 10px 26px rgba(2, 6, 19, 0.22);
}

.vh-card:focus-within {
  outline: 2px solid var(--vh-black);
  outline-offset: 4px;
}

/* The link itself provides the focus target; suppress its own ring in
   favour of the card-level one above */
.vh-card__link:focus-visible {
  outline: none;
}

.vh-card__photo {
  position: relative;
  height: 248px;
  border-radius: var(--vh-radius);
  background-color: var(--vh-black);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* No-photo state: solid black block with centred eye icon */
.vh-card__photo.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.vh-card__badge {
  position: absolute;
  top: 16px;
  left: 12px;
}

.vh-card__meta {
  margin-top: 36px;
}

/* Species row: whale icon is 20x13 sitting 7px down, 8px text gap */
.vh-card__row--species {
  gap: 8px;
}

.vh-card__row--species img {
  width: 20px;
  height: 13px;
  margin-top: 7px;
}

/* Location/date rows nudged 2px right per frame */
.vh-card__row--indent {
  padding-left: 2px;
}

.vh-card__count {
  margin-top: 20px;
}

.vh-card__row--count {
  gap: 11px;
}

.vh-card__row--count img {
  margin-top: 4px;
}

.vh-card__rule {
  margin-top: 35px;
  border-top: 1px solid var(--vh-black);
}

/* --- Prev/next chevrons: desktop only (mobile frame has swipe + dots) --- */
.vh-carousel__nav {
  display: none;
}

/* --- Dot pagination --- */
.vh-carousel__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 36px;
}

.vh-carousel__dot {
  position: relative;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #A8A7A4;
  cursor: pointer;
}

/* Enlarged invisible hit target (a11y) */
.vh-carousel__dot::before {
  content: '';
  position: absolute;
  inset: -8px;
}

.vh-carousel__dot.is-active {
  background: var(--vh-black);
}

/* --- Empty state (extrapolated, see DECISIONS.md) --- */
.vh-carousel__empty {
  margin-top: 48px;
  text-align: center;
}

.vh-carousel__empty a {
  font-weight: 600;
}

@media (min-width: 1024px) {
  .vh-carousel-section {
    margin-top: 100px;
  }

  .vh-carousel {
    border-radius: var(--vh-radius-panel);
    padding: 48px;
  }

  .vh-carousel__head {
    align-items: flex-start;
  }

  .vh-carousel__title {
    margin-top: 18px;
  }

  .vh-carousel__sub {
    margin-top: 20px;
  }

  .vh-card {
    flex-basis: calc((100% - 40px) / 3);
  }

  .vh-card__meta {
    margin-top: 40px;
  }

  .vh-card__rule {
    margin-top: 40px;
  }

  /* Chevrons sit in the 48px panel padding, 132px below track top */
  .vh-carousel__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 124px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
  }

  .vh-carousel__nav--prev {
    left: -42px;
  }

  .vh-carousel__nav--next {
    right: -42px;
  }

  /* Disabled ends — extrapolated (no designed state). aria-disabled instead
     of :disabled so the button keeps focus at the ends (see home.js). */
  .vh-carousel__nav[aria-disabled="true"] {
    opacity: 0.3;
    cursor: default;
  }

  .vh-carousel__dots {
    margin-top: 40px;
  }
}
