/*
 * "Spotlight" layout — [jp_games_cards layout="spotlight"].
 * Colours are tokenized (var(--token, <light-mode default>)) so the theme
 * can flip them dark under body.home without touching this file; every
 * token also has a sane default so the layout looks correct on its own
 * (e.g. a draft page preview) before that mapping exists.
 */

/*
 * The theme gives .jp-sec--games a width:min(1600px,96%) box (see
 * style.css) — wider than the 1180px other sections use, but contained and
 * centred, not a true 100vw breakout. This wrap just fills that box.
 */
.jpms-cards-wrap.is-spotlight {
  margin: 0;
  width: 100%;
  overflow-x: hidden; /* safety net: never let this row cause page-level horizontal scroll */
}

.jpms-cards-wrap.is-spotlight .jpms-cards {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  /* Small inset so the first/last card isn't flush against the section's
     own edge — same edge the heading above it already sits at. */
  padding: 2px 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  align-items: stretch;

  /* Hide the scrollbar chrome; drag/swipe/arrows/keyboard still scroll it. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.jpms-cards-wrap.is-spotlight .jpms-cards::-webkit-scrollbar {
  display: none;
}

.jpms-cards-wrap.is-spotlight .jpms-cards-rail {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

/* -------- card shell -------- */
.jpms-card--spot {
  position: relative;
  flex: 0 0 clamp(210px, 62vw, 260px);
  min-width: 210px;
  background: var(--jpms-spot-bg, #fff);
  border: 1px solid var(--jpms-spot-border, rgba(0,0,0,0.08));
  border-radius: 14px;
  box-shadow: var(--jpms-spot-shadow, 0 10px 30px rgba(16,24,48,0.08));
  box-sizing: border-box;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  scroll-snap-align: start;
  border-left: 4px solid var(--jpms-stripe, transparent);
}

@media (min-width: 769px) {
  .jpms-card--spot { flex: 0 0 270px; }
}

.jpms-card--spot.is-home  { --jpms-stripe: var(--jpms-stripe-home, #2f83f7); }
.jpms-card--spot.is-away  { --jpms-stripe: var(--jpms-stripe-away, #94a3b8); }
.jpms-card--spot.is-neutral { --jpms-stripe: transparent; }

/* -------- head: age badge/HEIM/AUSWÄRTS/LIVE on one line, competition
   name on its own line below (it routinely runs longer than the badge row
   leaves room for, e.g. "DNL Findung A - Gruppe 2", and must never be cut
   off) -------- */
.jpms-spot-head {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--jpms-spot-line, rgba(0,0,0,0.08));
  background: var(--jpms-spot-head-bg, rgba(16,24,48,0.02));
}

.jpms-spot-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* .jpms-badge / .jpms-pill(--home/--away/--live) themselves now live in
   the base stylesheet (jungpanther_manage_ResultGames.css) — every layout
   depends on it, unlike this one, which only loads for layout="spotlight". */

.jpms-spot-comp {
  font-size: 0.68rem;
  color: var(--jpms-spot-text-dim, #5c6a8a);
  line-height: 1.35;
  /* Full text, wraps to a second line rather than being cut off. */
  white-space: normal;
}

/* -------- face: logo — time/score — logo -------- */
.jpms-spot-face {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 10px;
}

.jpms-spot-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.jpms-spot-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.jpms-spot-short {
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--jpms-spot-text, #101830);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jpms-spot-mid {
  text-align: center;
  min-width: 54px;
}

.jpms-spot-time {
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--jpms-spot-text, #101830);
  font-variant-numeric: tabular-nums;
}

.jpms-spot-mid--score .jpms-spot-time,
.jpms-spot-mid--score {
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--jpms-spot-text, #101830);
  font-variant-numeric: tabular-nums;
}

.jpms-spot-day {
  margin-top: 3px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--jpms-spot-accent, #2f83f7);
}

.jpms-spot-tournament {
  grid-column: 1 / -1;
  text-align: center;
}

.jpms-spot-tournament-title {
  font-weight: 800;
  font-size: 1rem;
  color: var(--jpms-spot-text, #101830);
}

.jpms-spot-tournament-result {
  margin-top: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--jpms-spot-text-dim, #5c6a8a);
}

/* -------- foot: venue (arena name only) + a small arrow to the
   Gamecenter — one line, no "Spiel Details" label eating the width -------- */
.jpms-spot-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px 7px 12px;
  border-top: 1px solid var(--jpms-spot-line, rgba(0,0,0,0.08));
  font-size: 0.7rem;
}

.jpms-spot-venue {
  color: var(--jpms-spot-text-dim, #5c6a8a);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jpms-spot-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: var(--jpms-spot-accent, #2f83f7);
  background: var(--jpms-spot-link-bg, rgba(47,131,247,0.1));
  transition: background .15s ease, transform .15s ease;
}
.jpms-spot-link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.jpms-spot-link:hover {
  background: var(--jpms-spot-link-hover-bg, rgba(47,131,247,0.2));
  transform: translateX(1px);
}
.jpms-spot-link:focus-visible {
  outline: 2px solid var(--jpms-spot-accent, #2f83f7);
  outline-offset: 2px;
}

/* -------- nav arrows: reuse the flat layout's, just resized -------- */
.jpms-cards-wrap.is-spotlight .jpms-cards-nav {
  flex: 0 0 26px;
  width: 26px;
  min-width: 26px;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--jpms-spot-bg, #fff);
  border: 1px solid var(--jpms-spot-border, rgba(0,0,0,0.08));
  border-radius: 10px;
  box-shadow: var(--jpms-spot-shadow, 0 10px 30px rgba(16,24,48,0.08));
  cursor: pointer;
  padding: 0;
}

.jpms-cards-wrap.is-spotlight .jpms-cards-nav::before {
  content: "";
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--jpms-nav-arrow, #101830);
  border-right: 2px solid var(--jpms-nav-arrow, #101830);
  display: block;
}

.jpms-cards-wrap.is-spotlight .jpms-cards-prev::before { transform: rotate(-135deg); }
.jpms-cards-wrap.is-spotlight .jpms-cards-next::before { transform: rotate(45deg); }

.jpms-cards-wrap.is-spotlight .jpms-cards-nav.is-hidden {
  opacity: .25;
  pointer-events: none;
}

@media (max-width: 768px) {
  .jpms-cards-wrap.is-spotlight .jpms-cards-nav { display: none; }
}
