/* R7 loading/transition authority. Loaded after all historical styles. */
:root {
  --ygz-r5-ease: cubic-bezier(.16, 1, .3, 1);
  --ygz-r5-press: cubic-bezier(.2, .82, .2, 1);
}

html.ygz-r5-motion .main-wrapper {
  animation: ygzR7PageSettle 220ms var(--ygz-r5-ease) both !important;
}

/* Never fade a complete page from black. Motion is spatial only, so loading
   remains visible while finished content settles without a brightness flash. */
@keyframes ygzR7PageSettle {
  from { opacity: 1; transform: translate3d(0, 4px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes ygzR7CardSettle {
  from { opacity: 1; transform: translate3d(0, 5px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

html.ygz-r5-motion .post-card,
html.ygz-r5-motion .post-detail-card,
html.ygz-r5-motion .reply-item,
html.ygz-r5-motion .child-card {
  opacity: 1 !important;
  animation: ygzR7CardSettle 240ms var(--ygz-r5-ease) both !important;
  animation-delay: min(calc(var(--post-index, 0) * 12ms), 72ms) !important;
}

html.ygz-r5-motion .feed-loader {
  opacity: 1 !important;
  transition: transform 160ms var(--ygz-r5-ease), background-color 160ms ease !important;
}

html.ygz-r5-motion .feed-loader:active {
  transform: scale(.94);
}

html.ygz-r5-motion .ygz-top-nav .ygz-primary-indicator,
html.ygz-r5-motion .ygz-floating-header .ygz-primary-indicator,
html.ygz-r5-motion .profile-tab-indicator:not(.bottom-nav-indicator),
html.ygz-r5-motion .tabs-indicator:not(.bottom-nav-indicator),
html.ygz-r5-motion .tab-indicator:not(.bottom-nav-indicator),
html.ygz-r5-motion .segment-indicator:not(.bottom-nav-indicator),
html.ygz-r5-motion .tab-underline:not(.bottom-nav-indicator) {
  transition-property: transform, opacity !important;
  transition-duration: 260ms, 120ms !important;
  transition-timing-function: var(--ygz-r5-ease), ease !important;
  animation: none !important;
  will-change: auto !important;
}

html.ygz-r5-motion .is-indicator-moving .ygz-primary-indicator {
  will-change: transform !important;
}

html.ygz-r5-motion .ygz-is-pressed {
  transform: translate3d(0, 1px, 0) scale(.982) !important;
  transition-duration: 72ms !important;
  transition-timing-function: var(--ygz-r5-press) !important;
}

/* Generic intrinsic heights made forum cards change size while scrolling.
   Fifteen rows per page are cheap enough to keep their real layout. */
@supports (content-visibility: auto) {
  html.ygz-r5-motion .post-card,
  html.ygz-r5-motion .reply-item {
    content-visibility: visible !important;
    contain-intrinsic-size: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.ygz-r5-motion .main-wrapper { animation: none !important; }
  html.ygz-r5-motion .post-card,
  html.ygz-r5-motion .post-detail-card,
  html.ygz-r5-motion .reply-item,
  html.ygz-r5-motion .child-card { animation: none !important; }
  html.ygz-r5-motion .ygz-is-pressed { transform: none !important; transition: none !important; }
  html.ygz-r5-motion .ygz-primary-indicator,
  html.ygz-r5-motion .profile-tab-indicator,
  html.ygz-r5-motion .tabs-indicator,
  html.ygz-r5-motion .tab-indicator,
  html.ygz-r5-motion .segment-indicator,
  html.ygz-r5-motion .tab-underline {
    transition: none !important;
    will-change: auto !important;
  }
}
