/**
 * Midwest Klaviyo Reviews — marquee styles.
 *
 * Pure-CSS marquee: track holds two copies of the review set; translateX(-50%) loops.
 * Hover-pause via animation-play-state.
 *
 * Theme model
 * -----------
 * The site chrome's night mode darkens the *chrome surfaces only* (header, footer,
 * ticker) and intentionally keeps the body content area on a LIGHT surface so
 * product photos, price tags, cart, and checkout all read consistently. See the
 * comment in midwest-armor-theme/assets/chrome/chrome.css:
 *
 *     Night mode = dark chrome (header, footer, ticker) with a LIGHT content area.
 *     The body background is NOT flipped dark.
 *
 * Reviews are body content, not chrome, so this component is light in both day
 * and night by design. The shortcode attr `theme="dark"` is still available as
 * an explicit force-dark override if you ever want to embed it inside a chrome-
 * colored section, but `theme="auto"` (default) and `theme="light"` both render
 * the same light palette.
 */

.mwa-kr {
  --mwa-kr-bg:          #FFFFFF;                        /* block bg matches surrounding page surface */
  --mwa-kr-card-bg:     #FFFFFF;
  --mwa-kr-border:      rgba(20, 20, 22, 0.10);
  --mwa-kr-border-soft: rgba(20, 20, 22, 0.06);
  --mwa-kr-text:        #141416;
  --mwa-kr-muted:       rgba(20, 20, 22, 0.58);
  --mwa-kr-mute2:       rgba(20, 20, 22, 0.40);
  --mwa-kr-stars:       rgba(20, 20, 22, 0.42);         /* muted gray filled stars per design ref */
  --mwa-kr-star-off:    rgba(20, 20, 22, 0.14);
  --mwa-kr-accent:      #D97A4A;                        /* brand orange, used sparingly */

  position: relative;
  width: 100%;
  padding: 48px 0;
  background: var(--mwa-kr-bg);
  color: var(--mwa-kr-text);
  font-family: var(--mw-font-sans, 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif);
  box-sizing: border-box;
}

/* Explicit force-light — useful if you ever override the bg from a parent
   section. Cards keep their hairline border so they remain visible on white. */
.mwa-kr.mwa-kr--force-light {
  --mwa-kr-bg:          #FFFFFF;
  --mwa-kr-card-bg:     #FFFFFF;
}

/* Explicit force-dark — only applies when shortcode passes theme="dark".
   Day/night system mode does NOT touch the reviews component. */
.mwa-kr.mwa-kr--force-dark {
  --mwa-kr-bg:          #24272A;
  --mwa-kr-card-bg:     #1E2023;
  --mwa-kr-border:      rgba(237, 238, 240, 0.10);
  --mwa-kr-border-soft: rgba(237, 238, 240, 0.06);
  --mwa-kr-text:        #EDEEF0;
  --mwa-kr-muted:       rgba(237, 238, 240, 0.64);
  --mwa-kr-mute2:       rgba(237, 238, 240, 0.42);
  --mwa-kr-stars:       rgba(237, 238, 240, 0.55);
  --mwa-kr-star-off:    rgba(237, 238, 240, 0.14);
}

.mwa-kr *,
.mwa-kr *::before,
.mwa-kr *::after {
  box-sizing: border-box;
}

/* Heading — matches "● FIELD REPORTS · 1,847 VERIFIED" pattern from ref */
.mwa-kr__heading {
  margin: 0 auto 28px;
  padding: 0 24px;
  max-width: 1200px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mw-font-mono, 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mwa-kr-text);
}

.mwa-kr__heading::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mwa-kr-text);
  flex: 0 0 auto;
}

.mwa-kr__heading-sep {
  color: var(--mwa-kr-mute2);
  margin: 0 4px;
}

.mwa-kr__heading-count {
  color: var(--mwa-kr-muted);
  font-weight: 500;
}

/* Viewport: clips overflow + fades edges so cards melt into bg */
.mwa-kr__viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0, #000 80px, #000 calc(100% - 80px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 80px, #000 calc(100% - 80px), transparent 100%);
}

/* Track: flex row, two copies of cards, animates -50% for seamless loop.
 *
 * Speed is driven by --mwa-kr-speed (set inline on .mwa-kr from PHP, default
 * 60s). On narrow viewports we multiply that base value so the perceived
 * sweep rate stays roughly constant. The track moves at a fixed px/sec
 * regardless of viewport width, but on mobile (~375px wide) a single card
 * covers most of the screen, so the same px/sec FEELS much faster than on
 * desktop where 3-4 cards are visible at once. Bumping the duration by
 * 1.6× under 768px and 2× under 480px keeps the cards on-screen long
 * enough for the visitor to actually read them. */
.mwa-marquee-track {
  display: flex;
  flex-wrap: nowrap;
  width: max-content;
  gap: 16px;
  padding: 8px 10px;
  animation-name: mwa-marquee;
  animation-duration: var(--mwa-kr-speed, 60s);
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}

@media (max-width: 768px) {
  .mwa-marquee-track {
    animation-duration: calc(var(--mwa-kr-speed, 60s) * 2.2);
  }
}

@media (max-width: 480px) {
  .mwa-marquee-track {
    animation-duration: calc(var(--mwa-kr-speed, 60s) * 3);
  }
}

.mwa-marquee-track:hover,
.mwa-marquee-track:focus-within {
  animation-play-state: paused;
}

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

@media (prefers-reduced-motion: reduce) {
  .mwa-marquee-track {
    animation: none;
    transform: none;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding: 8px 24px;
  }
}

/* Card — white surface, hairline border, monospace meta */
.mwa-kr__card {
  flex: 0 0 360px;
  min-height: 200px;
  padding: 18px 22px 16px;
  background: var(--mwa-kr-card-bg);
  border: 1px solid var(--mwa-kr-border);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 180ms ease;
}

.mwa-kr__card:hover {
  border-color: rgba(20, 20, 22, 0.25);
}

/* Top row: stars on left, date on right */
.mwa-kr__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mwa-kr__stars {
  display: inline-flex;
  gap: 1px;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 1px;
}

.mwa-kr__star {
  color: var(--mwa-kr-star-off);
}

.mwa-kr__star.is-on {
  color: var(--mwa-kr-stars);
}

.mwa-kr__date {
  font-family: var(--mw-font-mono, 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--mwa-kr-mute2);
}

.mwa-kr__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--mwa-kr-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mwa-kr__body {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--mwa-kr-text);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer row: author block on left, product block on right */
.mwa-kr__meta {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--mwa-kr-border-soft);
}

.mwa-kr__person {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mwa-kr__author {
  font-family: var(--mw-font-mono, 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mwa-kr-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mwa-kr__sub {
  font-size: 12px;
  color: var(--mwa-kr-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mwa-kr__gear {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
  text-align: right;
}

.mwa-kr__gear-label {
  font-family: var(--mw-font-mono, 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--mwa-kr-mute2);
  text-transform: uppercase;
}

.mwa-kr__product {
  font-family: var(--mw-font-mono, 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mwa-kr-mute2);                   /* same muted tone as the GEAR label above it */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Verified is conveyed by the count in the heading; no per-card badge */
.mwa-kr-error {
  margin: 8px 0;
  padding: 10px 14px;
  border-left: 3px solid #DC2626;
  background: #FEF2F2;
  color: #7F1D1D;
  font-size: 13px;
}

@media (max-width: 640px) {
  .mwa-kr__card { flex-basis: 300px; padding: 16px 18px 14px; }
  .mwa-kr { padding: 32px 0; }
  .mwa-kr__heading { font-size: 12px; }
}
