/* The trip card: one trip in a list, from the design system's Trip card part.
   Author: Pravash Karki - pravashkarki.com */

.trip-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.trip-cards > li { display: flex; min-width: 0; }
.trip-cards--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trip-cards--cols-1 { grid-template-columns: minmax(0, 1fr); }

.trip-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  border: var(--border-hairline, 1px) solid var(--color-outline);
  border-radius: var(--radius-2xl, 24px);
  corner-shape: squircle;
  background: var(--color-base, #fff);
  overflow: hidden;
  transition: box-shadow var(--duration-base, 220ms) var(--ease-out, ease), border-color var(--duration-base, 220ms) var(--ease-out, ease);
}
/* On hover the border turns the link green and a second line of the same green fades in just inside it, over a deeper
   shadow. The second line is its own layer, so nothing changes size and the change eases; it follows the card's corner. */
.trip-card::after {
  content: ""; position: absolute; inset: 0; z-index: 3; border: var(--border-hairline, 1px) solid var(--color-link);
  border-radius: calc(var(--radius-2xl, 24px) - var(--border-hairline, 1px)); corner-shape: squircle;
  opacity: 0; pointer-events: none; transition: opacity var(--duration-base, 220ms) var(--ease-out, ease);
}
.trip-card:hover { border-color: var(--color-link); box-shadow: var(--shadow-4); }
.trip-card:hover::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .trip-card, .trip-card::after { transition: none; } }
.trip-card:has(.trip-card__title a:focus-visible) { outline: var(--focus-width, 2px) solid var(--color-focus, #295e1d); outline-offset: var(--focus-offset, 2px); }

.trip-card__photo { position: relative; aspect-ratio: 4 / 3; background: var(--color-surface); }
.trip-card__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.trip-card__tag {
  position: absolute;
  top: var(--space-3, 12px);
  left: var(--space-3, 12px);
  padding: var(--space-1, 4px) var(--space-3, 12px);
  border-radius: var(--radius-pill, 999px);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: var(--text-body-sm);
  font-weight: 700;
  line-height: var(--leading-heading);
}
/* One tag a card, the first that holds: Guest favourite, Most popular, Departs this week. Each icon is Forma at 20 pixels. */
.trip-card__tag--favourite { --tag-icon: url("../images/icons/medal.svg"); }
.trip-card__tag--popular { --tag-icon: url("../images/icons/group-size.svg"); }
/* A tag's colour says what kind of thing it is. Gold is praise guests gave (Guest favourite). Leaf is how many chose it
   (Most popular). Navy, the strongest on a photograph, is a date to act on (Departs this week). Each pair passes 4.5 to 1. */
.trip-card__tag--favourite { background: var(--ochre-100); color: var(--ochre-900); }
.trip-card__tag--popular { background: var(--leaf-100); color: var(--leaf-900); }
/* A departure the company promises is a date too, so it shares the navy. What kind of trip it is (a homestay, a classic
   route) is a plain fact about it: white, the quietest of the four. */
.trip-card__tag--dates { --tag-icon: url("../images/icons/nav-dates.svg"); display: inline-flex; align-items: center; gap: var(--space-1, 4px); padding-inline-start: var(--space-2, 8px); background: var(--night-900); color: var(--color-on-dark, #fff); }
.trip-card__tag--about { background: var(--color-base, #fff); color: var(--night-900); }
.trip-card__tag[hidden] { display: none; }
.trip-card__tag--dates::before,
.trip-card__tag:is(.trip-card__tag--favourite, .trip-card__tag--popular) { display: inline-flex; align-items: center; gap: var(--space-1, 4px); padding-inline-start: var(--space-2, 8px); }
.trip-card__tag:is(.trip-card__tag--favourite, .trip-card__tag--popular)::before {
  content: "";
  flex: none;
  width: calc(var(--space-5) - var(--space-1));
  height: calc(var(--space-5) - var(--space-1));
  background: currentColor;
  -webkit-mask: var(--tag-icon) center / contain no-repeat;
  mask: var(--tag-icon) center / contain no-repeat;
  /* The words have no descenders to speak of, so they read a hair above the middle of the line; the icon follows them. */
  translate: 0 calc(-1 * var(--border-hairline, 1px));
}

.trip-card__body { display: flex; flex: 1; flex-direction: column; gap: var(--space-3, 12px); padding: var(--space-5, 24px); }
.trip-card__title { margin: 0; font-size: var(--text-heading-sm); font-weight: var(--weight-extrabold, 800); line-height: var(--leading-heading); }
.trip-card__title a { color: var(--color-contrast); text-decoration: none; }
.trip-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.trip-card__title a:focus-visible { outline: none; }
.trip-card:hover .trip-card__title a { text-decoration: underline; text-decoration-thickness: var(--border-strong, 2px); text-underline-offset: var(--space-1, 4px); }

.trip-card__facts { display: flex; flex-wrap: wrap; gap: var(--space-2, 8px) var(--space-4, 16px); margin: 0; padding: 0; list-style: none; color: var(--color-contrast); font-size: var(--text-body-sm); font-weight: var(--weight-450, 450); }
.trip-card__fact { display: inline-flex; align-items: center; gap: var(--space-2, 8px); }
.trip-card__fact::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  background: var(--color-muted);
  -webkit-mask: var(--fact-icon) center / contain no-repeat;
  mask: var(--fact-icon) center / contain no-repeat;
}
.trip-card__fact--days { --fact-icon: url("../images/icons/duration.svg"); }
.trip-card__fact--altitude { --fact-icon: url("../images/icons/max-altitude.svg"); }
.trip-card__fact--grade { --fact-icon: url("../images/icons/difficulty-or-grade.svg"); }

.trip-card__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3, 12px);
  margin-top: auto;
  padding-top: var(--space-4, 16px);
  border-top: var(--border-hairline, 1px) solid var(--color-outline);
}
.trip-card__foot p { margin: 0; }
.trip-card__price { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: baseline; column-gap: var(--space-2, 8px); }
.trip-card__from { grid-column: 1 / -1; color: var(--color-muted); font-size: var(--text-body-sm); }
.trip-card__price b { grid-row: 2; grid-column: 1; color: var(--color-contrast); font-size: var(--text-heading-sm); font-weight: 800; line-height: var(--leading-heading); }
.trip-card__pricing { position: relative; display: flex; align-items: flex-end; gap: var(--space-1, 4px); }
.trip-card__info {
  position: relative; z-index: 2; flex: none; width: 28px; height: 28px; margin: 0 0 -2px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
}
.trip-card__info::before {
  content: ""; position: absolute; inset: 6px; background: var(--color-muted);
  -webkit-mask: url("../images/icons/overview.svg") center / contain no-repeat; mask: url("../images/icons/overview.svg") center / contain no-repeat;
}
.trip-card__info:hover, .trip-card__info[aria-expanded="true"] { background: var(--color-surface, #f4f7f3); }
.trip-card__info:hover::before, .trip-card__info[aria-expanded="true"]::before { background: var(--color-primary-dark); }
.trip-card__info:focus-visible { outline: var(--focus-width, 2px) solid var(--color-focus, #295e1d); outline-offset: 0; }
.trip-card__groups {
  position: absolute; bottom: calc(100% + var(--space-2, 8px)); left: calc(-1 * var(--space-2, 8px)); z-index: 3;
  width: 15rem; padding: var(--space-3, 12px) var(--space-4, 16px);
  border: var(--border-hairline, 1px) solid var(--color-outline); border-radius: var(--radius-xl, 16px); corner-shape: squircle;
  background: var(--color-base, #fff); box-shadow: var(--shadow-3);
}
.trip-card__groups[hidden] { display: none; }
.trip-card__groups-title { margin: 0 0 var(--space-1, 4px); color: var(--color-muted); font-size: var(--text-body-sm); }
.trip-card__groups table { width: 100%; border-collapse: collapse; font-size: var(--text-body-sm); }
.trip-card__groups td { padding: var(--space-1, 4px) 0; border-bottom: var(--border-hairline, 1px) solid var(--color-surface, #f4f7f3); color: var(--color-contrast); }
.trip-card__groups tr:last-child td { border-bottom: 0; }
.trip-card__groups td:last-child { text-align: right; font-weight: 800; white-space: nowrap; }
/* Under the price, a text link to the trip's day by day plan. It sits above the card's stretched link, so it is its own target. */
.trip-card__more { position: relative; z-index: 2; align-self: flex-start; display: inline-flex; align-items: center; min-height: var(--touch-min, 44px); margin-top: var(--space-1, 4px); color: var(--color-link); font-size: var(--text-body-md); font-weight: var(--weight-bold, 700); text-decoration: underline; text-underline-offset: var(--space-1, 4px); }
.trip-card__more:hover { color: var(--color-contrast); text-decoration-thickness: var(--border-strong, 2px); }
.trip-card__rating { display: inline-flex; align-items: center; gap: var(--space-1, 4px); color: var(--color-contrast); font-size: var(--text-body-sm); font-weight: 700; white-space: nowrap; }
.trip-card__rating::before {
  content: "";
  width: 18px;
  height: 18px;
  /* A filled gold star: the mark people read as a rating. An outline star read as an icon, or as "save". */
  background: var(--color-rating);
  -webkit-mask: url("../images/icons/star-filled.svg") center / contain no-repeat;
  mask: url("../images/icons/star-filled.svg") center / contain no-repeat;
}
.trip-card__count { color: var(--color-muted); font-weight: var(--weight-450, 450); }

.wishlist-trip-card { position: relative; }
.wishlist-trip-card .delete-wishlist {
  position: absolute;
  top: var(--space-3, 12px);
  right: var(--space-3, 12px);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--touch-min, 44px);
  min-height: var(--touch-min, 44px);
  padding: 0;
  border: var(--border-hairline, 1px) solid var(--color-outline);
  border-radius: 50%;
  background: var(--color-base, #fff);
  color: var(--color-contrast);
  box-shadow: var(--shadow-2);
}
.wishlist-trip-card .delete-wishlist:hover { color: var(--color-primary-dark); }
.wishlist-trip-card .delete-wishlist:focus-visible { outline: var(--focus-width, 2px) solid var(--color-focus); outline-offset: var(--focus-offset, 2px); }

@media (max-width: 991.98px) {
  .trip-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Phones: a full list stacks; a short row (.trip-cards--swipe) swipes, the next card showing at the edge so the row reads as more. */
@media (max-width: 767.98px) {
  .trip-cards { grid-template-columns: minmax(0, 1fr); }
  .trip-cards--swipe {
    display: flex;
    gap: var(--space-4, 16px);
    margin-inline: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
    padding: var(--space-1, 4px) calc(var(--bs-gutter-x, 1.5rem) * 0.5) var(--space-4, 16px);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
    scrollbar-width: none;
  }
  .trip-cards--swipe::-webkit-scrollbar { display: none; }
  .trip-cards--swipe > li { flex: 0 0 82%; scroll-snap-align: start; }
}

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

/* From the team's test of staging, 13 October 2026. */
/* The theme makes every list inside the best-selling and blog sections a sideways scroller under 992 pixels, with each
   item 60 per cent wide, and a plain block under 576. That reached the card list and the facts inside each card: a grey
   scroll bar under the facts on a tablet, and cards stacked with no gap on a phone. The card's own lists are put back. */
@media (max-width: 991.98px) {
  .best-package ul.trip-cards { display: grid; align-items: stretch; padding: 0; overflow: visible; }
  .best-package ul.trip-cards > li { flex: initial; max-width: none; }
  .best-package .trip-card ul.trip-card__facts { display: flex; flex-wrap: wrap; align-items: center; padding: 0; overflow: visible; }
  .best-package .trip-card ul.trip-card__facts > li { flex: 0 1 auto; max-width: none; }
}
@media (max-width: 767.98px) {
  .best-package ul.trip-cards.trip-cards--swipe { display: flex; padding: var(--space-1, 4px) calc(var(--bs-gutter-x, 1.5rem) * 0.5) var(--space-4, 16px); overflow-x: auto; overflow-y: hidden; }
  .best-package ul.trip-cards.trip-cards--swipe > li { flex: 0 0 82%; max-width: none; }
}
/* On the narrowest phones the rating drops under the price where the two do not fit on one line. */
.trip-card__foot { flex-wrap: wrap; }
