
/* Variables must be in scope on every listing card, not only homepage grids. */
.ke-dates-badge,
.ke-date-pill,
.ke-dates-more,
.ke-dates-all,
.ke-dates-block,
.ke-dates-row,
.kf-grid .card,
.ke-related .ke-card,
.astra-shop-thumbnail-wrap,
li.product {
  --ke-dates-navy: var(--navy, #0B1F3A);
  --ke-dates-gold: var(--gold, #C9A227);
  --ke-dates-gold-soft: #F7F0D8;
  --ke-dates-blue: var(--blue, #1565C0);
  --ke-dates-muted: var(--muted, #5b6b7c);
}
.ke-date-pill {
  background: var(--ke-dates-gold-soft, #F7F0D8);
  color: var(--ke-dates-navy, #0B1F3A);
  border-color: #e0d19a;
}
.ke-dates-more {
  background: var(--ke-dates-navy, #0B1F3A);
  color: #fff;
}
.ke-dates-badge {
  background: var(--ke-dates-gold, #C9A227);
  color: var(--ke-dates-navy, #0B1F3A);
}

/**
 * Extra selectors so the homepage date-cue styles (ke-home-dates.css)
 * apply on Course Finder, product categories, related courses and
 * WooCommerce shop/search cards.
 */
.kf-grid .card .media,
.ke-related .ke-card .media,
.astra-shop-thumbnail-wrap {
  position: relative;
}

.kf-grid .card .ke-dates-block,
.ke-related .ke-card .ke-dates-block,
li.product .ke-dates-block {
  margin-top: 2px;
}

.kf-grid .card .kf-next { display: none; } /* replaced by the date-cue block */

/* Related is a tight 4-up; shop/search often is too. */
.ke-related .ke-more-until,
ul.products .ke-more-until {
  display: none;
}

.ke-related .ke-card .body {
  gap: 6px;
}
.ke-related .ke-card .ke-dates-block {
  margin-top: 0;
}

/* Search / default WooCommerce loop: View all dates is a real link. */
li.product .ke-dates-block {
  margin: 8px 0 4px;
}
li.product a.ke-dates-all {
  color: #1565C0 !important;
  text-decoration: none;
  font-weight: 650;
}
li.product a.ke-dates-all:hover,
li.product a.ke-dates-all:focus {
  text-decoration: underline;
}
li.product a.ke-dates-all::after {
  content: " →";
  font-weight: 700;
}
.rtl li.product a.ke-dates-all::after,
html[dir="rtl"] li.product a.ke-dates-all::after {
  content: " ←";
}

@media (max-width: 640px) {
  .kf-grid .ke-more-until { display: none; }
  .ke-related .ke-date-pill:nth-child(n+3),
  ul.products .ke-date-pill:nth-child(n+3),
  .kf-grid .ke-date-pill:nth-child(n+3) { display: none; }
}
