.nl-tm {
  --nl-tm-speed: 40s;
  --nl-tm-direction: normal;
  --nl-tm-gap: 28px;
  --nl-tm-card-w: 360px;
  --nl-tm-fade: 0px;

  --nl-tm-card-bg: #2f74a6;
  --nl-tm-card-bg-2: #3c89b3;
  --nl-tm-text: #ffffff;
  --nl-tm-radius: 22px;

  /* JS sets exact base-set width */
  --nl-tm-shift: 1200px;

  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 20px 0;
}

.nl-tm__track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  width: max-content;

  animation: nl-tm-scroll var(--nl-tm-speed) linear infinite;
  animation-direction: var(--nl-tm-direction);

  will-change: transform;
  transform: translateZ(0);
}

@keyframes nl-tm-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-1 * var(--nl-tm-shift)));
  }
}

@media (prefers-reduced-motion: reduce) {
  .nl-tm__track {
    animation: none;
  }
}

.nl-tm.is-pause:hover .nl-tm__track {
  animation-play-state: paused;
}

/* Edge fade */
.nl-tm::before,
.nl-tm::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--nl-tm-fade);
  pointer-events: none;
  z-index: 2;
}

.nl-tm::before {
  left: 0;
  background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
}

.nl-tm::after {
  right: 0;
  background: linear-gradient(to left, #fff, rgba(255, 255, 255, 0));
}

/* Cards */
.nl-tm__card {
  flex: 0 0 var(--nl-tm-card-w);
  width: var(--nl-tm-card-w);

  border-radius: var(--nl-tm-radius);
  overflow: hidden;
  display: block;
  text-decoration: none;
  color: inherit;
  filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));
  margin-right: 20px;
}

.nl-tm__inner {
  height: 100%;
  padding: 30px 30px 0;
  border-radius: var(--nl-tm-radius);
  background: linear-gradient(
    180deg,
    var(--nl-tm-card-bg),
    var(--nl-tm-card-bg-2)
  );
  color: var(--nl-tm-text);
  box-shadow: 0 12px 28px rgba(10, 18, 40, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.nl-tm__quote {
  /* color: #fff; */
  font-size: 1.1em;
  line-height: 1.55;
  letter-spacing: 0.2px;
  font-weight: 700;
  opacity: 0.98;
  min-height: 100px;
  white-space: normal;
}

.nl-tm__stars {
  margin-top: 14px;
  font-size: 20px;
  letter-spacing: 3px;
  opacity: 0.9;
}

.nl-tm__star {
  display: inline-block;
  transform: translateY(1px);
}

.nl-tm__logoWrap {
  margin-top: 15px;
  display: flex;
  justify-content: flex-end;
  padding-right: 8px;
  margin-bottom: 0;
}

.nl-tm__logo {
  max-height: 90px;
  max-width: 120px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  padding: 7px 12px 0 12px;
  box-shadow: 0 10px 18px rgba(10, 18, 40, 0.16);
  border-radius: 20px 20px 0 0 !important;
}

.nl-tm__logoFallback {
  width: 120px;
  height: 32px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 10px;
}

.nl-tm__card--link:focus {
  outline: none;
}

.nl-tm__card--link:focus .nl-tm__inner {
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.45),
    0 12px 28px rgba(10, 18, 40, 0.18);
}

.nl-tm__notice {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.05);
  font-size: 14px;
}

/* Hard force a single row everywhere */
.nl-tm__track,
.nl-tm__set {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  white-space: nowrap;
  align-items: stretch !important;
}

/* Cards must never shrink or wrap */
.nl-tm__card {
  flex: 0 0 var(--nl-tm-card-w) !important;
  width: var(--nl-tm-card-w) !important;
  min-width: var(--nl-tm-card-w) !important;
  max-width: var(--nl-tm-card-w) !important;
}

/* Safety: prevent any theme styles from forcing wraps via gap grids */
.nl-tm__set > * {
  flex-wrap: nowrap !important;
}

img.nl-tm__logo {
  /* max-height: 100px; */
  max-width: 147px;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  padding: 20px 20px 15px 20px;
  box-shadow: 0 10px 18px rgba(10, 18, 40, 0.16);
  border-radius: 10px 10px 0 0 !important;
  height: 72px;
}

/* =========================================================
   Text + stars must follow the widget text color variable
   ========================================================= */

.nl-tm {
  color: var(--nl-tm-text);
}

.nl-tm .nl-tm__card,
.nl-tm .nl-tm__inner,
.nl-tm .nl-tm__quote {
  color: var(--nl-tm-text);
}

/* Stars inherit the same color */
.nl-tm .nl-tm__stars {
  color: var(--nl-tm-text);
}

.nl-tm .nl-tm__star {
  color: currentColor;
}

/* If the whole card becomes a link, keep color consistent */
.nl-tm a.nl-tm__card,
.nl-tm a.nl-tm__card:visited,
.nl-tm a.nl-tm__card:hover,
.nl-tm a.nl-tm__card:focus {
  color: var(--nl-tm-text);
  text-decoration: none;
}
