/* mira-site/carousel.css (arch-102). ONE reusable carousel pattern for the
   whole site family. Colors, type and spacing come ONLY from tokens.css
   custom properties. Load this file AFTER site.css / explore.css so the
   .mcar-track flex row outranks any earlier grid on the same element.

   The pattern is progressive: the markup is a plain CSS scroll-snap row
   that scrolls natively with no JS (thin visible scrollbar, native swipe).
   carousel.js adds prev/next buttons, dot indicators, keyboard arrows and
   aria labels into the reserved .mcar-ui strip (reserved height, CLS 0).
   Every animated property here is covered by both reduced-motion belts. */

.mcar { position: relative; }

.mcar-track {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  list-style: none;
  margin: 0 -0.25rem;
  padding: 0.25rem 0.25rem 0.85rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.mcar-track::-webkit-scrollbar { height: 8px; }
.mcar-track::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.mcar-track::-webkit-scrollbar-track { background: transparent; }
.mcar-track:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Slides: each use sets --mcar-slide on its own container; the default
   shows one card with a peek of the next on phones. min-width: 0 lets
   long content wrap instead of stretching the track. */
.mcar-slide {
  flex: 0 0 var(--mcar-slide, min(86%, 24rem));
  scroll-snap-align: start;
  min-width: 0;
}

/* Controls strip: height reserved in the HTML so the JS filling it
   shifts nothing. With JS off it stays a quiet empty band under a row
   that already scrolls natively. */
.mcar-ui {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}
.mcar-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--paper-raised);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.mcar-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-deep); }
.mcar-btn:active:not(:disabled) { color: var(--accent-deep); }
.mcar-btn:disabled { opacity: 0.35; cursor: default; }

.mcar-dots { display: flex; gap: 0.15rem; }
.mcar-dot {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.mcar-dot::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--ink-faint);
  background: transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.mcar-dot:hover::before { border-color: var(--accent); transform: scale(1.2); }
.mcar-dot[aria-current]::before { background: var(--accent); border-color: var(--accent); }

/* visually hidden live status ("2 of 5") for screen readers */
.mcar-status {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- reduced-motion coverage (both belts). Scrolling behavior
   itself is decided in carousel.js: reduced motion means instant jumps,
   never smooth animation. ---------- */
@media (prefers-reduced-motion: reduce) {
  .mcar-track { scroll-behavior: auto; }
  .mcar-btn, .mcar-dot::before { transition: none; }
}
html[data-motion="off"] .mcar-track { scroll-behavior: auto; }
html[data-motion="off"] .mcar-btn,
html[data-motion="off"] .mcar-dot::before { transition: none; }
