/* ==========================================================================
   MINÈ TOURS: homepage
   Load AFTER styles.css. Uses the same design tokens (custom properties).
   Sections: 1. Text link  2. Hero  3. Featured tours
   ========================================================================== */

/* ---------- 1. Text link (reusable) ---------- */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(37, 36, 31, 0.25);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  /* gold line wipes in from the left on hover */
  background: linear-gradient(var(--gold), var(--gold)) 0 100% / 0 1px no-repeat;
  transition: background-size var(--dur) var(--ease);
}
.text-link:hover,
.text-link:focus-visible { background-size: 100% 1px; }

.text-link__arrow {
  width: 1.1rem;
  height: 0.5rem;
  transition: transform var(--dur) var(--ease);
}
.text-link:hover .text-link__arrow,
.text-link:focus-visible .text-link__arrow { transform: translateX(4px); }

.text-link--light {
  border-bottom-color: rgba(246, 241, 231, 0.4);
  background-image: linear-gradient(var(--gold-soft), var(--gold-soft));
}

/* ==========================================================================
   2. Hero: the client's illustration, gently "breathing"
   Stacked by default (image banner, then text on olive). Full-bleed on
   landscape desktops, where the header sits transparent over the image.
   ========================================================================== */

/* Header stays solid while the hero is stacked */
.site-header--overlay { margin-bottom: 0; }
.site-header--overlay:not(.is-scrolled):not(.nav-open) { --hdr-fg: var(--charcoal); }
.site-header--overlay:not(.is-scrolled):not(.nav-open)::before { opacity: 1; }
.site-header--overlay:not(.is-scrolled):not(.nav-open) .btn {
  --btn-hover-fill: var(--olive-deep);
  --btn-hover-text: var(--cream);
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--olive-deep);
  color: var(--cream);
}

.hero__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1290 / 768;
  background: #B9694A; /* sunset tone while the image loads */
}

/* The breath: a slow 18-second inhale and exhale, centred on the sun */
.hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  transform-origin: 73% 45%;
  animation: breathe 18s ease-in-out infinite;
  will-change: transform;
}

/* A warm glow over the sun that swells in time with the breath */
.hero__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(46% 54% at 73% 45%, rgba(255, 214, 150, 0.6), rgba(255, 214, 150, 0) 70%);
  mix-blend-mode: screen;
  opacity: 0.15;
  animation: glow 18s ease-in-out infinite;
  pointer-events: none;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
@keyframes glow {
  0%, 100% { opacity: 0.15; }
  50%      { opacity: 0.6; }
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 2.25rem;
  align-items: end;
  padding-block: clamp(2.5rem, 7vw, 3.5rem) clamp(3rem, 8vw, 4rem);
}

/* Headline, staggered across three lines */
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 14vw, 5rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.025em;
}

.hero__line {
  display: block;
  overflow: hidden;
  padding: 0 0.06em 0.12em;
  margin-bottom: -0.12em; /* keeps descenders from clipping */
}
.hero__line > span {
  display: block;
  transform: translateY(110%);
  animation: line-rise 1100ms var(--ease) forwards;
  animation-delay: calc(150ms + var(--i, 0) * 120ms);
}
.hero__line--italic { font-style: italic; font-weight: 400; padding-left: 8%; }
.hero__line--last   { padding-left: 3%; }

@keyframes line-rise { to { transform: translateY(0); } }

.hero__aside {
  display: grid;
  justify-items: start;
  gap: 1.75rem;
  max-width: 24rem;
  opacity: 0;
  animation: fade-in 900ms var(--ease) 800ms forwards;
}
.hero__tagline {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: rgba(246, 241, 231, 0.9);
}

@keyframes fade-in { to { opacity: 1; } }

/* Scroll indicator */
.hero__scroll {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  justify-self: start;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(246, 241, 231, 0.8);
  opacity: 0;
  animation: fade-in 900ms var(--ease) 1400ms forwards;
}
.hero__scroll:hover { color: var(--cream); }

.hero__scroll-line {
  position: relative;
  width: 3.5rem;
  height: 1px;
  overflow: hidden;
  background: rgba(246, 241, 231, 0.3);
}
.hero__scroll-line::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: var(--gold-soft);
  animation: scroll-h 2.6s var(--ease) infinite;
}
@keyframes scroll-h {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

/* Landscape desktop: full-bleed image, header transparent over it */
@media (min-width: 64rem) and (min-aspect-ratio: 1 / 1) {
  .site-header--overlay { margin-bottom: calc(var(--header-h) * -1); }
  .site-header--overlay:not(.is-scrolled):not(.nav-open) { --hdr-fg: var(--cream); }
  .site-header--overlay:not(.is-scrolled):not(.nav-open)::before { opacity: 0; }
  .site-header--overlay:not(.is-scrolled):not(.nav-open) .btn {
    --btn-hover-fill: var(--cream);
    --btn-hover-text: var(--charcoal);
  }

  .hero {
    display: grid;
    align-items: end;
    min-height: 100vh;
    min-height: 100svh;
    padding-block: calc(var(--header-h) + 3rem) clamp(2.5rem, 6vw, 5rem);
  }
  .hero__media { position: absolute; inset: 0; z-index: -2; aspect-ratio: auto; }

  /* Light scrims only where type sits: the nav at the top, the headline below */
  .hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
      linear-gradient(180deg, rgba(37, 36, 31, 0.5) 0%, rgba(37, 36, 31, 0.2) 7%, rgba(37, 36, 31, 0) 14%),
      linear-gradient(0deg, rgba(37, 36, 31, 0.66) 0%, rgba(37, 36, 31, 0) 50%);
    pointer-events: none;
  }

  .hero__inner {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 1.5rem;
    row-gap: 0;
    padding-block: 0;
  }
  .hero__title {
    grid-column: 1 / -1;
    grid-row: 1;
    font-size: clamp(4.5rem, 8vw, 7.5rem);
  }
  .hero__line--italic { padding-left: 11%; }
  .hero__line--last   { padding-left: 4%; }

  .hero__aside {
    grid-column: 9 / span 3;
    grid-row: 1;
    align-self: end;
    padding-bottom: 0.9rem;
  }
  .hero__scroll {
    grid-column: 12 / -1;
    grid-row: 1;
    justify-self: end;
    align-self: end;
    flex-direction: column;
    gap: 0.9rem;
    padding-bottom: 0.9rem;
  }
  .hero__scroll-label { writing-mode: vertical-rl; transform: rotate(180deg); }
  .hero__scroll-line { width: 1px; height: 4rem; }
  .hero__scroll-line::after {
    inset: 0 0 auto 0;
    width: auto;
    height: 40%;
    animation-name: scroll-v;
  }
  @keyframes scroll-v {
    0%   { transform: translateY(-100%); }
    100% { transform: translateY(250%); }
  }
}

/* ---------- Hero slider: four slides that crossfade, each one breathing ---------- */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1600ms ease-in-out, visibility 0s linear 1600ms;
}
.hero-slide.active {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
/* every photo uses the same slow "breathe" (scale 1 to 1.06 and back, 18s) */
.hero__media .hero-slide img {
  object-position: center;
  transform-origin: center;
}

.hero-location {
  position: absolute;
  left: max(var(--gutter), calc((100% - var(--container)) / 2));
  bottom: 1rem;
  z-index: 2;
  display: grid;
  gap: 0.15rem;
  color: var(--cream);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 900ms var(--ease) 700ms, transform 900ms var(--ease) 700ms;
}
.hero-slide.active .hero-location { opacity: 1; transform: none; }
.hero-location strong { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; }
.hero-location span { font-family: var(--font-display); font-size: clamp(1rem, 3.4vw, 1.375rem); font-style: italic; }

@media (min-width: 64rem) and (min-aspect-ratio: 1 / 1) {
  /* on the full-bleed hero the caption sits under the navigation */
  .hero-location { top: calc(var(--header-h) + 1.75rem); bottom: auto; }
}

/* ==========================================================================
   3. Featured tours
   ========================================================================== */
.tours {
  padding-block: clamp(5rem, 10vw, 9rem);
  background: var(--cream);
}

.tours__head {
  display: grid;
  gap: 1.75rem;
  margin-bottom: clamp(3rem, 6vw, 5.5rem);
}

.tours__title {
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4vw, 3.75rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.tours__intro {
  display: grid;
  justify-items: start;
  gap: 1.5rem;
  max-width: 34rem;
  color: var(--charcoal-70);
}

@media (min-width: 64rem) {
  .tours__head {
    grid-template-columns: 7fr 5fr;
    align-items: end;
    gap: clamp(3rem, 8vw, 8rem);
  }
}

/* Grid: three columns on desktop, middle card dropped for a staggered rhythm */
.tours__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3.5rem;
  max-width: 36rem;
}

@media (min-width: 64rem) {
  .tours__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1.75rem, 3vw, 3rem);
    align-items: start;
    max-width: none;
  }
  .tours__grid > li:nth-child(2) { margin-top: 3rem; }
}

/* ---------- Card ---------- */
.tour-card {
  position: relative; /* anchors the whole-card link */
  transition: transform var(--dur) var(--ease);
}
.tour-card:hover { transform: translateY(-8px); }

.tour-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 4px;
  background: var(--ph, var(--khaki));
}

.tour-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease);
}
.tour-card:hover .tour-card__media img { transform: scale(1.04); }

/* Soft overlay so the region label is always legible */
.tour-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--overlay-soft), var(--overlay-olive);
  pointer-events: none;
}

.tour-card__region {
  position: absolute;
  left: 1.25rem;
  bottom: 1.1rem;
  z-index: 1;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--cream);
}


.tour-card__body { padding-top: 1.5rem; }

.tour-card__title {
  max-width: 20ch;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.2;
}

.tour-card__desc {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--charcoal-70);
}

.tour-card__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-block: 1rem;
  border-block: 1px solid var(--line);
}

.tour-card__duration {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--charcoal-70);
}

.tour-card__price {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 500;
  line-height: 1;
  text-align: right;
}
.tour-card__from,
.tour-card__unit {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--charcoal-40);
}

.tour-card__link { margin-top: 1.25rem; }

/* Make the entire card clickable while keeping one real link */
.tour-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
}
.tour-card:hover .text-link { background-size: 100% 1px; }
.tour-card:hover .text-link__arrow { transform: translateX(4px); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero__line > span,
  .hero__aside,
  .hero__scroll { animation: none; transform: none; opacity: 1; }
  .hero__scroll-line::after { animation: none; }
  .hero__media img { animation: none; }
  .hero-slide, .hero-location { transition: none; }
  .hero__glow { animation: none; opacity: 0.25; }
  .tour-card:hover { transform: none; }
  .tour-card:hover .tour-card__media img { transform: none; }
}
