/*
 * otDiary 1.10.42 — Safe JavaScript navigation feedback.
 *
 * IMPORTANT: no cross-document View Transitions, no fetch router, no DOM
 * transplantation and no shared-element snapshots. WordPress owns the full
 * document lifecycle. JavaScript only previews the dock destination and gives
 * the newly loaded main content a tiny opacity-only arrival cue.
 */

@view-transition { navigation: none; }

html.otd-native-navigation-enabled,
html.otd-native-navigation-enabled body {
  scroll-behavior: auto;
}

body.otd-native-navigation-enabled .otd-main,
body.logged-in.otd-native-navigation-enabled .otd-public-floating-ui,
body.logged-in.otd-native-navigation-enabled .otd-floating-nav {
  view-transition-name: none !important;
}

/* Never dim, scale, translate or hide the outgoing page. */
html.otd-native-route-leaving body .otd-main,
html.otd-native-route-leaving body .otd-public-floating-ui {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  filter: none !important;
}

/* New-document feedback only. Opacity is intentionally subtle and there is
 * no transform, so feed cards can never zoom/morph during route changes. */
body.otd-js-route-arrived .otd-main {
  animation: otd-safe-route-arrival 90ms ease-out both;
}
@keyframes otd-safe-route-arrival {
  from { opacity: .975; }
  to { opacity: 1; }
}

/* Feed viewers are overlays only when their owners explicitly open them. A
 * navigation transition must never promote a feed card/viewer to fullscreen. */
html.otd-native-route-leaving .otd-feed-viewer[hidden],
html.otd-native-route-leaving .otd-feed-static-viewer[hidden] {
  display: none !important;
}

/* Edit/profile/task layers remain above global chrome. */
body.otd-profile-edit-open .otd-public-profile .otd-profile-actions {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
body.otd-profile-edit-open [data-otd-profile-edit-layer] { z-index: 999990 !important; }
body.otd-profile-edit-open [data-otd-profile-edit-panel] { position: relative; z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  body.otd-js-route-arrived .otd-main { animation: none !important; }
}
