/* native-reviews: token-only styling. Colour, type, radius and spacing come from theme variables (contracts/THEME.md). */

.nrv-root { box-sizing: border-box; padding: var(--space-section) var(--space-gap); font-family: var(--font-body); color: var(--color-text); background: var(--color-bg); }
.nrv-root *, .nrv-root *::before, .nrv-root *::after { box-sizing: border-box; }
.nrv-root :focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }

.nrv-inner { max-width: 1200px; margin: 0 auto; min-width: 0; }
.nrv-head { margin: 0 0 var(--space-gap); }
.nrv-heading {
  margin: 0 0 var(--space-gap);
  font-family: var(--font-heading);
  font-weight: var(--font-weight-heading);
  font-size: calc(clamp(1.75rem, 1.2rem + 2vw, 2.6rem) * var(--heading-scale));
  line-height: 1.15;
  text-wrap: balance;
}

/* rating summary: stars + value + count */
.nrv-rating { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; }
.nrv-rating__stars { color: var(--color-star); font-size: 1.125rem; line-height: 1; letter-spacing: 2px; white-space: nowrap; }
.nrv-rating__text { font-size: 0.95rem; font-weight: 600; color: var(--color-text-secondary); }

/* carousel: real native scroll container; cards snap; touch/trackpad scrolling works for free */
.nrv-track {
  display: flex;
  gap: var(--space-gap);
  margin: 0;
  padding: 4px 2px 16px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.nrv-track::-webkit-scrollbar { height: 6px; }
.nrv-track::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: var(--radius-pill); }
.nrv-card {
  flex: 0 0 min(80%, 20rem);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: var(--space-gap);
  scroll-snap-align: start;
  background: var(--color-surface-raised);
  border: var(--border-width) solid var(--color-card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.nrv-card__stars { color: var(--color-star); font-size: 1.05rem; line-height: 1; letter-spacing: 2px; }
.nrv-card__text { margin: 0; flex: 1 1 auto; line-height: 1.55; color: var(--color-text); overflow-wrap: anywhere; }
.nrv-card__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; font-size: 0.9rem; }
.nrv-card__name { font-weight: 700; color: var(--color-text-secondary); }
.nrv-card__date { color: var(--color-text-muted); }

/* controls under the carousel: arrows on the left, Leave a Review on the right (wraps on phones) */
.nrv-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-gap); margin-top: var(--space-gap); }
.nrv-arrows { display: flex; gap: 8px; }
.nrv-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: var(--border-width) solid var(--color-card-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-raised);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.2s var(--ease-out-expo), color 0.2s var(--ease-out-expo);
}
.nrv-arrow:hover { border-color: var(--color-accent); color: var(--color-accent); }
.nrv-arrow svg { width: 1.25rem; height: 1.25rem; }

.nrv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: var(--color-accent-fg);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s var(--ease-out-expo);
}
.nrv-btn:hover { background: var(--color-accent-hover); }

.nrv-dev {
  padding: var(--space-gap);
  border: var(--border-width) solid var(--color-accent);
  border-radius: var(--radius-md);
  background: var(--color-bg-warm);
  color: var(--color-text);
}

/* 40rem and up: cards a little wider so more of the row shows */
@media (min-width: 40rem) {
  .nrv-card { flex-basis: min(42%, 20rem); }
}

/* 64rem and up: about three cards in view */
@media (min-width: 64rem) {
  .nrv-card { flex-basis: min(calc((100% - 2 * var(--space-gap)) / 3), 22rem); }
}

@media (prefers-reduced-motion: reduce) {
  .nrv-track { scroll-behavior: auto; }
  .nrv-arrow, .nrv-btn { transition: none; }
}

/* left-aligned: the shared stylesheet justifies every <p> in <main>, which opens wide word gaps in narrow cards */
[class^="nrv-"] p, [class*=" nrv-"] p { text-align: left; hyphens: none; }
