/* Featured events block and the events-calendar grid trial. Scoped to the events listing. */

.rfe-featured {
  background: #e7f6e3;
  border-radius: 16px;
  padding: 22px 22px 26px;
  margin: 0 0 28px;
}

.rfe-featured__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: #1c8a34;
}

.rfe-featured__head h2 {
  margin: 0;
  font-family: Inter, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  color: #1c8a34;
}

.rfe-featured__star {
  display: block;
  flex: 0 0 auto;
}

.rfe-featured__viewport {
  container-type: inline-size;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.rfe-featured.is-marquee .rfe-featured__viewport {
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
}

.rfe-featured.is-marquee.is-dragging .rfe-featured__viewport {
  cursor: grabbing;
}

.gallery-cards .rfe-featured .inner-cards.rfe-featured__track {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 32px;
  width: max-content;
  margin: 0;
}

.rfe-featured.is-static .rfe-featured__track {
  width: 100%;
  flex-wrap: wrap;
}

.gallery-cards .rfe-featured .rfe-featured__track .card-box {
  flex: 0 0 calc((100cqw - 64px) / 3);
  width: calc((100cqw - 64px) / 3);
  max-width: none;
  margin: 0;
}

.gallery-cards .rfe-featured .image-content .order.featured_race {
  display: none;
}

@media (max-width: 991.98px) {
  .rfe-featured {
    padding: 16px 0 18px;
    margin-bottom: 20px;
    border-radius: 12px;
  }

  .rfe-featured__head {
    padding-left: 2px;
  }

  .gallery-cards .rfe-featured .inner-cards.rfe-featured__track {
    gap: 32px;
  }

  .gallery-cards .rfe-featured .rfe-featured__track .card-box {
    flex-basis: calc((100cqw - 32px) * 0.75);
    width: calc((100cqw - 32px) * 0.75);
  }
}

.rfe-events .gallery-cards .cards-box > .inner-cards > .card-box {
  min-width: 0;
}

/* Desktop results: 4 columns. 3 gaps of 32px. */
@media (min-width: 992px) {
  .rfe-events .gallery-cards .cards-box > .inner-cards > .card-box {
    width: calc(25% - 24px);
  }
}

/* Mobile and tablet results: 2 columns, same image ratio. */
@media (max-width: 991.98px) {
  .rfe-events .gallery-cards .cards-box > .inner-cards > .card-box {
    width: calc(50% - 16px);
  }

  .rfe-events .gallery-cards .cards-box > .inner-cards > .card-box.rfe-leaderboard {
    width: 100%;
    flex: 0 0 100%;
    align-self: stretch;
    aspect-ratio: auto;
    height: auto;
    overflow: visible;
    background: transparent;
  }

  .rfe-events .gallery-cards .cards-box > .inner-cards > .card-box.rfe-leaderboard .ad-link,
  .rfe-events .gallery-cards .cards-box > .inner-cards > .card-box.rfe-leaderboard .ad-slick,
  .rfe-events .gallery-cards .cards-box > .inner-cards > .card-box.rfe-leaderboard .ad-item {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .rfe-events .gallery-cards .cards-box > .inner-cards > .card-box.rfe-leaderboard img {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
  }
}

.rfe-featured.is-marquee .rfe-featured__track img {
  -webkit-user-drag: none;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  .rfe-featured.is-manual .rfe-featured__viewport {
    overflow-x: auto;
    cursor: auto;
  }
}

.rfe-events .gallery-cards .inner-cards .card-box .trending {
  display: none;
}

.rfe-events .gallery-cards .inner-cards .card-box:not(.rfe-leaderboard) .image-content {
  width: 100%;
  padding-top: 56.25%;
}

@media (max-width: 991.98px) {
  .rfe-events .gallery-cards .inner-cards .card-box .text-content {
    padding-left: 10px;
    padding-right: 10px;
  }

  .rfe-events .gallery-cards .inner-cards .card-box .links-box .flag {
    display: none;
  }

  .rfe-events .gallery-cards .inner-cards .card-box > .customfavorite-button,
  .rfe-events .gallery-cards .inner-cards .card-box > .simplefavorite-button {
    position: static;
    top: auto;
    right: auto;
    left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 20px);
    height: 36px;
    margin: auto 10px 10px;
    padding: 0 8px;
    border: 1px solid #c5c9ce;
    border-radius: 6px;
    background: #fff;
    box-shadow: none;
    color: #04132d;
    font-family: "roc-grotesk", sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
  }

  .rfe-events .gallery-cards .inner-cards .card-box > .customfavorite-button::before,
  .rfe-events .gallery-cards .inner-cards .card-box > .simplefavorite-button::before,
  .rfe-events .gallery-cards .inner-cards .card-box > .customfavorite-button > *,
  .rfe-events .gallery-cards .inner-cards .card-box > .simplefavorite-button > * {
    display: none;
    content: none;
  }

  .rfe-events .gallery-cards .inner-cards .card-box > .customfavorite-button::after,
  .rfe-events .gallery-cards .inner-cards .card-box > .simplefavorite-button::after {
    content: "Bookmark Event";
  }

  .rfe-events .gallery-cards .inner-cards .card-box > .simplefavorite-button.active::after {
    content: "Remove Bookmark";
  }

  .rfe-events .gallery-cards .inner-cards .card-box > .simplefavorite-button.active {
    background: #96ff94;
  }

  .rfe-events .gallery-cards .inner-cards .card-box .rfe-card-badge .order.featured_race {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 28px;
    margin: 0;
    padding: 4px 8px;
    border-radius: 0;
    background-color: #96ff94;
    color: #04132d;
    font-family: "roc-grotesk", sans-serif;
    font-size: 13px;
    line-height: 1.2;
    text-align: center;
  }

  .rfe-events .gallery-cards .inner-cards .card-box .rfe-card-badge .order.featured_race img,
  .rfe-events .gallery-cards .inner-cards .card-box .rfe-card-badge .order.featured_race svg {
    position: static;
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
  }

  .rfe-events .gallery-cards .inner-cards .card-box .text-content .event-meta-wrapper .event-formatted-date {
    flex-wrap: nowrap;
  }

  .rfe-events .gallery-cards .inner-cards .card-box .text-content .event-meta-wrapper .event-formatted-date .event-date-text {
    display: block;
    white-space: nowrap;
  }

  .rfe-events .gallery-cards .inner-cards .card-box .text-content .event-meta-wrapper .event-formatted-location {
    align-items: flex-start;
  }

  .rfe-events .gallery-cards .inner-cards .card-box .text-content .event-meta-wrapper .event-formatted-location .icon-address {
    flex: 0 0 auto;
    margin-top: 1px;
  }

  .rfe-events .gallery-cards .inner-cards .card-box .text-content .event-meta-wrapper .event-formatted-location .rfe-location-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-width: 0;
    flex: 1 1 auto;
    font-size: 13px;
    line-height: 1.3;
    white-space: normal;
  }

  .rfe-events .gallery-cards .inner-cards .card-box .text-content .btns-box ul:empty {
    display: none;
  }

  .rfe-events .gallery-cards .inner-cards .card-box .text-content .btns-box ul {
    display: block;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid #d7dade;
    border-radius: 6px;
    background: #f7f8f9;
  }

  .rfe-events .gallery-cards .inner-cards .card-box .text-content .btns-box li {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 12px;
    line-height: 1.45;
    color: #53585f;
  }

  .rfe-events .gallery-cards .inner-cards .card-box .text-content .btns-box li:not(:last-child)::after {
    content: ", ";
  }
}

/* Desktop: Featured Race cards in the organic results get the same framed look as the
   mobile feed. A green frame runs round the card and the "Featured Race" label sits as a
   bar along the top (the plugin lifts the label out of the image for these cards). */
@media (min-width: 992px) {
  .rfe-events .gallery-cards .cards-box > .inner-cards > .card-box:has(> .rfe-card-badge) {
    box-sizing: border-box;
    padding: 6px;
    border: 2px solid #96ff94;
  }

  .rfe-events .gallery-cards .cards-box > .inner-cards > .card-box > .rfe-card-badge {
    margin: -6px -6px 6px;
  }

  .rfe-events .gallery-cards .cards-box > .inner-cards > .card-box > .rfe-card-badge .order.featured_race {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 28px;
    margin: 0;
    padding: 4px 8px;
    box-sizing: border-box;
    border-radius: 0;
    background-color: #96ff94;
    color: #04132d;
    font-family: "roc-grotesk", sans-serif;
    font-size: 13px;
    line-height: 1.2;
    text-align: center;
  }

  .rfe-events .gallery-cards .cards-box > .inner-cards > .card-box > .rfe-card-badge .order.featured_race svg {
    position: static;
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
  }
}

/* Virtual Event cards in the organic results: same framed card as Featured Race, in lilac.
   The label bar is shared across desktop and mobile; the frame itself comes from the desktop
   block above and from mobile-app.css on mobile. */
.rfe-events .gallery-cards .inner-cards .card-box > .rfe-card-badge .order.virtual_event {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 4px 8px;
  box-sizing: border-box;
  border-radius: 0;
  background-color: #c9b8ff;
  color: #04132d;
  font-family: "roc-grotesk", sans-serif;
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
}

@media (min-width: 992px) {
  .rfe-events .gallery-cards .cards-box > .inner-cards > .card-box:has(> .rfe-card-badge .order.virtual_event) {
    border-color: #c9b8ff;
  }
}
