/* ==========================================================================
   AYAN VACATIONS — Upcoming Group Tours (page-specific)

   Loaded after css/style.css. Every colour, radius, shadow, font and easing
   below comes from the tokens already defined in :root there — this file
   adds no design system of its own.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Intro band above the grid
   -------------------------------------------------------------------------- */
.tours-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: end;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.tours-intro__count {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-700);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Grid — 3 up on desktop, 2 on tablet, 1 on mobile
   -------------------------------------------------------------------------- */
.tour-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.15rem, 2vw, 1.75rem);
  /* stretch, not start: tours carry different amounts of content, and equal
     card heights keep every WhatsApp button on the same line across a row. */
  align-items: stretch;
}

#tour-states[aria-busy="true"] {
  min-height: 220px;
}

/* --------------------------------------------------------------------------
   Jump links — only shown when both sections have departures
   -------------------------------------------------------------------------- */
.tour-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: clamp(2rem, 4vw, 2.75rem);
}

/* An explicit display beats the hidden attribute, so restore it — otherwise
   the bar keeps its margin when there is only one section to show. */
.tour-jump[hidden],
.tour-jump a[hidden] {
  display: none;
}

.tour-jump a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.9125rem;
  font-weight: 600;
  color: var(--navy);
  transition: border-color 0.35s var(--ease), transform 0.4s var(--ease-out),
    background-color 0.35s var(--ease), color 0.35s var(--ease);
}

.tour-jump a svg {
  width: 17px;
  height: 17px;
  color: var(--green-700);
  transition: color 0.35s var(--ease);
}

.tour-jump a:hover,
.tour-jump a:focus-visible {
  border-color: transparent;
  background: var(--navy);
  color: #fff;
  transform: translateY(-2px);
}

.tour-jump a:hover svg,
.tour-jump a:focus-visible svg {
  color: #86d18d;
}

/* --------------------------------------------------------------------------
   Category sections (Domestic / International)
   -------------------------------------------------------------------------- */
.tour-section + .tour-section {
  margin-top: clamp(2.75rem, 6vw, 4.5rem);
}

.tour-section__head {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding-bottom: 1.1rem;
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
}

.tour-section__ico {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--green-100);
  color: var(--green-700);
}

.tour-section__ico svg {
  width: 22px;
  height: 22px;
}

.tour-section__title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 72;
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.tour-section__sub {
  font-size: 0.875rem;
  color: var(--ink-mute);
  margin-top: 0.2rem;
}

.tour-section__count {
  margin-left: auto;
  flex: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-700);
  white-space: nowrap;
}

@media (max-width: 520px) {
  .tour-section__head {
    flex-wrap: wrap;
  }

  .tour-section__count {
    margin-left: 0;
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Loading state
   -------------------------------------------------------------------------- */
.tour-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: clamp(2.5rem, 6vw, 4rem) 1rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.tour-loading__spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: tourSpin 0.8s linear infinite;
  flex: none;
}

@keyframes tourSpin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   Empty / error state
   -------------------------------------------------------------------------- */
.tour-state {
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 3rem);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
}

.tour-state__title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 72;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.tour-state__text {
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 auto 1.75rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Tour card
   -------------------------------------------------------------------------- */
.tour-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease),
    border-color 0.4s var(--ease);
}

.tour-card:hover,
.tour-card:focus-within {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

/* Landing from group-tours.html?tour=<id> */
.tour-card--focused {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(65, 164, 74, 0.18), var(--shadow-md);
}

/* ---- media ---- */
.tour-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--cream-deep);
}

.tour-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-out);
}

.tour-card:hover .tour-card__media img {
  transform: scale(1.05);
}

/* No photograph yet: a quiet branded panel rather than an empty box. */
.tour-card__media--placeholder {
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(65,164,74,0.16) 0%, rgba(65,164,74,0) 60%),
    linear-gradient(160deg, var(--navy-800) 0%, var(--navy-950) 100%);
}

.tour-card__media--placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.09) 1px, transparent 1px);
  background-size: 20px 20px;
}

.tour-card__placeholder-mark {
  position: relative;
  width: auto;
  height: 46%;
  max-width: 55%;
  object-fit: contain;
  opacity: 0.9;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35));
}

/* the hover zoom belongs to real photography only */
.tour-card:hover .tour-card__media--placeholder .tour-card__placeholder-mark {
  transform: none;
}

/* Small note under a date, e.g. "Date to be announced" */
.tour-card__meta-note {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-mute);
  margin-top: 2px;
}

.tour-card__theme {
  position: absolute;
  right: 0.9rem;
  bottom: 0.9rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.94);
  color: var(--navy);
}

/* ---- body ---- */
.tour-card__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.15rem, 2vw, 1.5rem);
  flex: 1;
}

.tour-card__name {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60;
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.tour-card__destination {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9125rem;
  font-weight: 600;
  color: var(--green-700);
}

.tour-card__destination svg {
  width: 16px;
  height: 16px;
  flex: none;
}

/* ---- meta rows: date, duration, departure city ---- */
.tour-card__meta {
  display: grid;
  gap: 0.7rem;
  padding: 0.95rem 0;
  border-block: 1px solid var(--line-soft);
}

.tour-card__meta-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.tour-card__meta-row svg {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 2px;
  color: var(--green-700);
}

.tour-card__meta-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* Departure date is one of the most important things on the card */
.tour-card__meta-value {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  margin-top: 2px;
}

.tour-card__desc {
  font-size: 0.9125rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ---- route ---- */
.tour-card__route {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.tour-card__route-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 0.25rem;
}

/* ---- highlights ---- */
.tour-card__highlights {
  display: grid;
  gap: 0.5rem;
}

.tour-card__highlights li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9125rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.tour-card__highlights svg {
  width: 17px;
  height: 17px;
  flex: none;
  margin-top: 2px;
  color: var(--green);
}

/* ---- inclusions ---- */
.tour-card__inclusions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tour-card__inclusions li {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--cream);
}

/* ---- foot ---- */
.tour-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: clamp(1rem, 1.8vw, 1.35rem) clamp(1.15rem, 2vw, 1.5rem);
  border-top: 1px solid var(--line-soft);
  background: var(--cream);
  margin-top: auto;
}

.tour-card__price {
  display: flex;
  flex-direction: column;
}

.tour-card__price-prefix {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 2px;
}

/* On request there is no figure to shout about, so it sits at body weight
   rather than mimicking a price. */
.tour-card__price-amount--request {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
}

.tour-card__price-amount {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60;
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--navy);
  line-height: 1.1;
}

.tour-card__price-unit {
  font-size: 0.75rem;
  color: var(--ink-mute);
  margin-top: 2px;
}

.tour-card__cta {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
  font-size: 0.875rem;
  padding-inline: 1.1rem;
  text-align: center;
}

.tour-card__sold {
  flex: 1 1 auto;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-mute);
  text-align: right;
}

/* --------------------------------------------------------------------------
   Price disclaimer
   -------------------------------------------------------------------------- */
.tours-disclaimer {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-mute);
  max-width: 70ch;
}

/* --------------------------------------------------------------------------
   Why travel with us
   -------------------------------------------------------------------------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 1.6vw, 1.5rem);
}

.why-card {
  padding: clamp(1.4rem, 2.2vw, 1.9rem);
  border: 1px solid var(--line-light);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  transition: background-color 0.4s var(--ease), transform 0.5s var(--ease-out),
    border-color 0.4s var(--ease);
}

.why-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(134, 209, 141, 0.45);
  transform: translateY(-4px);
}

.why-card__ico {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(134, 209, 141, 0.14);
  color: #86d18d;
  margin-bottom: 1.1rem;
}

.why-card__ico svg {
  width: 22px;
  height: 22px;
}

.why-card h3 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 40;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.28;
  margin-bottom: 0.5rem;
}

.why-card p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.65);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .tour-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .why-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .tour-grid,
  .why-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tours-intro {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  /* Easy to tap: the WhatsApp CTA spans the card on mobile */
  .tour-card__foot {
    flex-direction: column;
    align-items: stretch;
  }

  .tour-card__cta {
    width: 100%;
  }

  .tour-card__sold {
    text-align: left;
  }
}

/* --------------------------------------------------------------------------
   Motion preference
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .tour-card,
  .tour-card__media img,
  .why-card {
    transition: none;
  }

  .tour-card:hover .tour-card__media img {
    transform: none;
  }

  .tour-loading__spinner {
    animation-duration: 2s;
  }
}
