/* Tour Archive Grid */
.tourmaster-tour-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 20px;
}

/* Optional column helpers when used via shortcode */
.tourmaster-tour-grid.columns-1 { grid-template-columns: 1fr; }
.tourmaster-tour-grid.columns-2 { grid-template-columns: repeat(2, 1fr); }
.tourmaster-tour-grid.columns-3 { grid-template-columns: repeat(3, 1fr); }
.tourmaster-tour-grid.columns-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 960px) {
  .tourmaster-tour-grid.columns-3,
  .tourmaster-tour-grid.columns-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .tourmaster-tour-grid,
  .tourmaster-tour-grid.columns-2,
  .tourmaster-tour-grid.columns-3,
  .tourmaster-tour-grid.columns-4 { grid-template-columns: 1fr; }
}

/* Card: keep styling light so theme can override easily */
.tourmaster-tour-card {
  background: var(--tourmaster-card-bg, #fff);
  border: 1px solid var(--tourmaster-card-border, rgba(0,0,0,.08));
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: box-shadow .25s ease, transform .25s ease;
}
.tourmaster-tour-card:hover { transform: translateY(-4px); box-shadow: 0 6px 18px -4px rgba(0,0,0,.15); }

/* Image wrapper (allow auto height; rely on intrinsic ratio) */
.tourmaster-tour-card__image { position: relative; overflow: hidden; }
.tourmaster-tour-card__image a { display: block; }
.tourmaster-tour-card__image img { width: 100%; height: auto; display: block; }

.tourmaster-tour-card__content { padding: 20px; display: flex; flex-direction: column; flex: 1 1 auto; }

/* Title inherits theme typography */
.tourmaster-tour-card__title { margin: 0 0 .5em; font-size: 1.1rem; line-height: 1.3; }
.tourmaster-tour-card__title a { text-decoration: none; color: inherit; }

.tourmaster-tour-card__meta { display:flex; justify-content:space-between; gap:1rem; font-size:.85rem; opacity:.85; margin:0 0 .5rem; flex-wrap:wrap; }
.tourmaster-tour-card__duration { display:flex; align-items:center; gap:.35rem; }
.tourmaster-tour-card__price { font-weight:600; color: var(--tourmaster-price-color, var(--wp--preset--color--primary,#0073aa)); }

.tourmaster-tour-card__excerpt { font-size:.95rem; line-height:1.6; flex-grow:1; margin:0 0 1rem; }

/* Rating */
.tourmaster-tour-card__rating { font-size:.85rem; margin:0 0 .75rem; display:flex; align-items:center; gap:.4em; }
.tourmaster-rating-stars { color: #f7b500; letter-spacing:.5px; font-size:.95rem; }
.tourmaster-rating-text { opacity:.75; }

.tourmaster-tour-card__button { align-self:flex-start; }

/* Spinner for load more */
.tourmaster-country-load-more.is-loading {
  position: relative;
  pointer-events: none;
  opacity: .85;
}
.tourmaster-country-load-more.is-loading:after {
  content: '';
  position: absolute;
  right: -32px;
  top: 50%;
  width: 18px; height: 18px;
  border: 2px solid rgba(0,0,0,.2);
  border-top-color: rgba(0,0,0,.6);
  border-radius: 50%;
  transform: translateY(-50%);
  animation: tm-spin .8s linear infinite;
}

@keyframes tm-spin {
  to { transform: translateY(-50%) rotate(360deg); }
}