/* Keep repeated tour cards comparable; the former alternating offset made
   catalogue rows look broken and fixed image heights exaggerated the drift. */
.tour-grid,
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 48px 28px;
}

.tour-grid .tour-card,
.catalog-grid .tour-card:nth-child(n) {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: 0;
  grid-column: auto;
}

.tour-card .tour-image-wrap,
.catalog-grid .tour-card .tour-image-wrap {
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 4 / 3;
}

.tour-card .tour-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 20px 0 0;
}

.tour-card .tour-copy > p:first-child {
  min-height: 16px;
  margin: 0;
  line-height: 1.6;
}

.tour-card .tour-copy h3 {
  min-height: 2.6em;
  margin: 0;
  font-size: 28px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.tour-card .tour-meta {
  align-items: flex-start;
  gap: 8px;
  min-height: 29px;
  margin: 0;
}

.tour-card .tour-description {
  flex: 1;
  min-height: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
}

.tour-card .tour-copy > .text-link {
  align-self: flex-start;
  min-height: 44px;
  margin-top: 2px;
  padding-block: 10px;
}

/* Shared content tracks align titles and actions without reserving empty
   title lines. The flex layout above remains a safe older-browser fallback. */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 761px) {
    .tour-grid .tour-card,
    .catalog-grid .tour-card:nth-child(n) {
      display: grid;
      grid-template-rows: subgrid;
      grid-row: span 6;
      row-gap: 0;
    }

    .tour-card .tour-copy {
      display: grid;
      grid-template-rows: subgrid;
      grid-row: span 5;
      row-gap: 14px;
    }

    .tour-card .tour-copy h3 {
      min-height: 0;
    }

    .tour-card .tour-copy > .text-link {
      align-self: start;
      justify-self: start;
    }
  }
}

@media (max-width: 1199px) and (min-width: 761px) {
  .tour-grid,
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 42px 24px;
  }
}

@media (max-width: 760px) {
  .tour-grid,
  .catalog-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .tour-card .tour-copy {
    gap: 12px;
    padding-top: 18px;
  }

  .tour-card .tour-copy h3 {
    min-height: 0;
    font-size: 26px;
  }
}
