/* =========================================================
   Block: TRIP CARDS (v0.1)
   A row of trips or hotels: photo, tag, name, key facts,
   "from" price. Whole card is one link.
   Phones: swipe sideways (next card peeks in, like Airbnb).
   Desktop: four across. Four, not three, on purpose.
   ========================================================= */

.trips__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
  margin-bottom: var(--space-6);
}
.trips__title { font-size: var(--text-h2); max-width: 20ch; }
.trips__intro {
  color: var(--colour-text-muted);
  max-width: 46ch;
  margin-top: var(--space-3);
}
.trips__all {
  font-weight: var(--weight-strong);
  text-decoration: none;
  white-space: nowrap;
}
.trips__all:hover { text-decoration: underline; }

/* ---------- The row of cards ---------- */
.trips__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 82%;                /* phones: one card plus a peek of the next */
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;         /* swipes stop neatly on each card */
  scroll-padding-inline: var(--space-4);
  padding-bottom: var(--space-3);
  margin-inline: calc(var(--space-4) * -1);   /* let the row run to the screen edge */
  padding-inline: var(--space-4);
  scrollbar-width: none;
}
.trips__list::-webkit-scrollbar { display: none; }

@media (min-width: 40rem) {
  .trips__list { grid-auto-columns: 46%; }
}
@media (min-width: 64rem) {
  .trips__list {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, 1fr);
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
}

/* ---------- One card ---------- */
.trip {
  position: relative;                    /* so the whole card can be the link */
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}

.trip__photo {
  aspect-ratio: var(--ratio-card);
  border-radius: var(--radius-large);
  overflow: hidden;
  background: var(--colour-border);      /* shows while the photo loads */
}
.trip__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms ease;
}
.trip__photo { transition: transform 300ms ease; }
.trip:hover .trip__photo { transform: translateY(var(--motion-lift, 0px)); }          /* Motion level */
.trip:hover .trip__photo img { transform: scale(var(--motion-photo-zoom, 1.04)); }

.trip__tag {
  align-self: flex-start;
  margin-top: var(--space-4);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--colour-tag);
  color: var(--colour-on-tag);
  font-size: var(--text-small);
  font-weight: var(--weight-strong);
}

.trip__name {
  font-size: var(--text-h3);
  margin-top: var(--space-3);
}
.trip__name a {
  color: var(--colour-text);
  text-decoration: none;
}
/* Stretch the link over the whole card: tap anywhere to open */
.trip__name a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.trip__name a:focus-visible { outline: none; }
.trip:has(a:focus-visible) {
  outline: 3px solid var(--colour-focus);
  outline-offset: 4px;
  border-radius: var(--radius-large);
}

.trip__facts {
  color: var(--colour-text-muted);
  font-size: var(--text-small);
  margin-top: var(--space-2);
}

.trip__price {
  margin-top: auto;                      /* prices line up at the bottom */
  padding-top: var(--space-3);
  font-size: var(--text-small);
  color: var(--colour-text-muted);
}
.trip__price strong {
  color: var(--colour-text);
  font-size: var(--text-body);
  font-weight: var(--weight-strong);
}

/* ---------- v0.2: cards filled from the offers list ---------- */
/* "Idea" offers may have no photo yet: a plain tile with the name */
.trip__photo--none {
  display: grid;
  place-items: center;
  background: var(--colour-tag);
  color: var(--colour-on-tag);
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  text-align: center;
  padding: var(--space-4);
}
.trip__dates {
  font-size: var(--text-small);
  color: var(--colour-text-muted);
  margin-top: var(--space-1);
}
/* Price + dates sit together at the bottom, so every card's price lines up */
.trip__foot { margin-top: auto; padding-top: var(--space-3); }
.trip__foot .trip__price { margin-top: 0; padding-top: 0; }

/* ---------- v0.3: sliding row when there are more than 4 offers ---------- */
.trips__arrows { display: flex; gap: var(--space-2); }
.trips__arrow {
  width: var(--tap-target-min); height: var(--tap-target-min);
  border: 1px solid var(--colour-border); border-radius: 50%;
  background: var(--colour-surface); color: var(--colour-text);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.trips__arrow:hover:not(:disabled) { border-color: var(--colour-action); color: var(--colour-action); }
.trips__arrow:disabled { opacity: 0.35; cursor: default; }
@media (max-width: 63.99rem) { .trips__arrows { display: none; } }   /* phones and tablets swipe */
@media (min-width: 64rem) {
  .trips--slider .trips__list {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: calc((100% - 3 * var(--space-4)) / 4);   /* four visible, the rest slide in */
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
  }
}
.trips__arrows[hidden] { display: none; }

/* ---------- Offers list page: every card visible, in a grid (no sliding row) ---------- */
.trips--grid .trips__list {
  grid-auto-flow: row;
  grid-template-columns: 1fr;
  gap: var(--space-6) var(--space-4);
  overflow: visible;
  margin-inline: 0;
  padding-inline: 0;
}
@media (min-width: 40rem) { .trips--grid .trips__list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 64rem) { .trips--grid .trips__list { grid-template-columns: repeat(3, 1fr); } }
.trips__empty { max-width: 52ch; margin-bottom: var(--space-5); font-size: var(--text-lead); color: var(--colour-text-muted); }

/* ---------- "Who can book" stamp (Local specials: SA or SADC residents) ---------- */
.trip__photo { position: relative; }
.trip__stamp {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  background: var(--colour-surface);
  color: var(--colour-text);
  border-radius: 999px;
  padding: 0.25em 0.75em;
  font-size: 0.75rem;
  font-weight: var(--weight-strong);
  letter-spacing: 0.02em;
  box-shadow: 0 1px 4px rgb(var(--colour-image-shade) / 0.25);
}
.trip__stamp::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--colour-action);
}

/* ---------- Ribbon across the photo's top-right corner ("Coming soon" teasers, or e.g. "Spring deal") ---------- */
.trip__photo { overflow: hidden; }
.trip__ribbon {
  position: absolute;
  top: 2.2rem;
  right: -3.4rem;
  width: 14.5rem;
  transform: rotate(45deg);
  text-align: center;
  background: var(--colour-action);
  color: var(--colour-on-action);
  font-size: 0.8rem;
  font-weight: var(--weight-strong);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.55em 0;
  box-shadow: 0 2px 6px rgb(var(--colour-image-shade) / 0.3);
  pointer-events: none;
}

/* Longer ribbon wording (15-20 characters, e.g. "Season opening sale"): a longer, flatter band further from the corner */
.trip__ribbon--long { top: 3.2rem; right: -4.9rem; width: 20rem; letter-spacing: 0.05em; }

/* ---------- "Register your interest" (teaser offers) ---------- */
.trip__interest {
  position: relative;
  z-index: 1;                            /* above the card-wide link */
  align-self: flex-start;
  margin-top: var(--space-3);
  font: inherit;
  font-weight: var(--weight-strong);
  color: var(--colour-on-action);
  background: var(--colour-action);
  border: 0;
  border-radius: 999px;
  padding: 0.6em 1.1em;
  cursor: pointer;
}
.trip__interest:hover { background: var(--colour-action-hover); }
.trip__interest:focus-visible { outline: 3px solid var(--colour-focus); outline-offset: 3px; }

.interest {
  width: min(28rem, calc(100vw - 2rem));
  border: 0;
  border-radius: var(--radius-large);
  padding: var(--space-6);
  background: var(--colour-surface);
  color: var(--colour-text);
  box-shadow: 0 20px 60px rgb(var(--colour-image-shade) / 0.35);
}
.interest::backdrop { background: rgb(var(--colour-image-shade) / 0.55); }
.interest__title { font-size: var(--text-h3); margin: 0 0 var(--space-2); }
.interest__sale { color: var(--colour-text-muted); margin: 0 0 var(--space-4); }
.interest__field { display: grid; gap: 0.35rem; font-weight: var(--weight-strong); margin-bottom: var(--space-3); }
.interest__field input {
  font: inherit; font-weight: normal;
  padding: 0.7em 0.8em;
  border: 1px solid var(--colour-input-border);
  border-radius: 10px;
}
.interest__consent { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; align-items: start;
  font-size: var(--text-small); color: var(--colour-text-muted); margin: var(--space-2) 0; }
.interest__privacy { font-size: var(--text-small); color: var(--colour-text-muted); margin: var(--space-2) 0 var(--space-4); }
.interest__consent input { width: 1.2rem; height: 1.2rem; margin-top: 0.1rem; }
.interest__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.interest__problem { color: var(--colour-error); margin: 0 0 var(--space-3); }
.interest__actions { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.interest__close { font: inherit; background: none; border: 0; color: var(--colour-link); text-decoration: underline; cursor: pointer; }
.interest__done p { color: var(--colour-text-muted); margin: 0 0 var(--space-4); }
