/* SportsBracket Calendar
   Deliberately few opinions: the host theme owns the page, this owns a list and
   a strip. Colours come from CSS variables so a theme can retint both without
   touching the plugin. */

.sbcal {
  --sbcal-ink: currentColor;
  --sbcal-muted: color-mix(in oklab, currentColor 62%, transparent);
  --sbcal-rule: color-mix(in oklab, currentColor 14%, transparent);
}

.sbcal-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sbcal-item {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 2px 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--sbcal-rule);
}

.sbcal-date {
  font-variant-numeric: tabular-nums;
  color: var(--sbcal-muted);
  white-space: nowrap;
}

.sbcal-name {
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.sbcal-place,
.sbcal-deadline {
  grid-column: 2;
  color: var(--sbcal-muted);
  font-size: 0.92em;
}

.sbcal-more {
  margin: 1rem 0 0;
  font-size: 0.92em;
}

.sbcal-empty {
  padding: 1.25rem 0;
}

.sbcal-empty-hint {
  color: var(--sbcal-muted);
  font-size: 0.92em;
}

@media (max-width: 32rem) {
  .sbcal-item {
    grid-template-columns: 1fr;
  }
  .sbcal-place,
  .sbcal-deadline {
    grid-column: 1;
  }
}

/* ── The ticker ─────────────────────────────────────────────────────────── */

.sbcal-ticker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  padding: 0.45rem 0.75rem;
  background: var(--sbcal-ticker-bg, #241f18);
  color: var(--sbcal-ticker-ink, #f6f1e6);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sbcal-ticker-track {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  animation: sbcal-scroll 42s linear infinite;
}

.sbcal-ticker.is-paused .sbcal-ticker-track {
  animation-play-state: paused;
}

.sbcal-ticker-run {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding-right: 0.75rem;
}

.sbcal-ticker-sep {
  opacity: 0.45;
}

.sbcal-ticker-pause {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: inherit;
  font: inherit;
  font-size: 0.62rem;
  padding: 2px 9px;
  cursor: pointer;
}

.sbcal-ticker-pause:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

@keyframes sbcal-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* A visitor who has asked for less motion gets a static strip, not a slower
   one. The duplicate copy is hidden so the text does not read twice. */
@media (prefers-reduced-motion: reduce) {
  .sbcal-ticker-track {
    animation: none;
    overflow: hidden;
  }
  .sbcal-ticker-run + .sbcal-ticker-run {
    display: none;
  }
  .sbcal-ticker-pause {
    display: none;
  }
}

.sbcal-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
