/* catalog-flip.css - MODA motion module "catalog-flip" (Moving catalog filters). Script: catalog-flip.js
 * WHAT: styles for the FLIP ghosts, the rolling count and the "back from a watch" outline. The FLIP itself is
 *       animated from JS (Web Animations, `translate`/`opacity`/`scale` only).
 * PAGES: /catalog (#cat-tools, #cat-grid, #cat-count) and the .wcard cards on /catalog/<brand>.
 * NO PRE-HIDING: nothing here hides or offsets any content. Every rule needs a class the script adds
 *       (html.mm-catalog-flip-on, .mm-catalog-flip-live, .mm-catalog-flip-back); with JS off the page is untouched.
 * REDUCED MOTION: no roll, no fade; the outline is shown steady and removed by the script.
 * OFF: remove this <link> (and the script), or set data-mm-catalog-flip-off on <html>.
 */

/* the count: the page's own #cat-count stays for screen readers, visually replaced by the rolling one */
html.mm-catalog-flip-on #cat-count {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.mm-catalog-flip-count { display: inline-block; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; min-width: 11.5em; }
.mm-catalog-flip-n { display: inline-block; vertical-align: top; color: var(--ink); }
.mm-catalog-flip-col { display: inline-block; vertical-align: top; height: 1.2em; overflow: hidden; }
.mm-catalog-flip-strip {
  display: block;
  transition: translate 520ms cubic-bezier(.2, .7, 0, 1) var(--mm-catalog-flip-d, 0ms);
}
.mm-catalog-flip-strip > span { display: block; height: 1.2em; line-height: 1.2; }

/* ghosts of cards that left the filter: absolutely placed in the grid, under the cards that stay */
.mm-catalog-flip-live { position: relative; }
.mm-catalog-flip-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: visible; pointer-events: none; }
.mm-catalog-flip-ghost {
  position: absolute !important; margin: 0 !important; box-sizing: border-box;
  pointer-events: none; transform: none !important; box-shadow: none !important; overflow: hidden;
}

/* back from a watch page: 1px emerald outline, steady ~1.2s, then fades */
@keyframes mm-catalog-flip-outline {
  0%, 75% { outline-color: var(--emerald); }
  100%    { outline-color: transparent; }
}
.wcard.mm-catalog-flip-back {
  outline: 1px solid var(--emerald);
  outline-offset: 3px;
  animation: mm-catalog-flip-outline 1600ms linear both;
}

@media (prefers-reduced-motion: reduce) {
  .mm-catalog-flip-strip { transition: none; }
  .wcard.mm-catalog-flip-back { animation: none; }
}
@media print { .mm-catalog-flip-layer { display: none; } }
