/* Decorative flight stays in the upper-right, below navigation and away from the title. */
.page-photo-archetypes .archetype-moth {
  position: absolute; left: 0; top: 0; width: 100%; height: 320px;
  z-index: 5; pointer-events: none; user-select: none;
  opacity: 1; transition: opacity 400ms ease;
}
.page-photo-archetypes.is-photo-focused .archetype-moth,
.page-photo-archetypes.is-moth-photo-open .archetype-moth { opacity: 0; }
.page-photo-archetypes .archetype-moth-trigger {
  position: absolute; top: 0; left: 0; z-index: 6; width: 82px; height: 82px;
  margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent;
  box-shadow: none; appearance: none; visibility: hidden; touch-action: manipulation;
}
.page-photo-archetypes .archetype-moth-trigger.is-ready { visibility: visible; }
.page-photo-archetypes .archetype-moth-trigger:focus-visible { outline: 1px solid #bef3ff; outline-offset: 4px; }
.page-photo-archetypes.is-photo-focused .archetype-moth-trigger,
.page-photo-archetypes.is-moth-photo-open .archetype-moth-trigger { visibility: hidden; }
body.is-moth-photo-open { overflow: hidden; }
.moth-photo-viewer {
  position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; overflow: hidden; background: transparent; color: #dceffa;
}
.moth-photo-viewer::backdrop { background: transparent; }
.moth-photo-tone {
  position: absolute; inset: 0; opacity: 0;
  background: #163eaa url('../images/photography/moth-photo-atmosphere.jpg') center / cover no-repeat;
  transition: opacity 1.2s ease;
}
.moth-photo-viewer > img {
  position: relative; display: block; width: 100%; height: 100%; object-fit: contain;
  box-sizing: border-box; padding: clamp(14px, 3vh, 32px) clamp(12px, 3vw, 36px);
  opacity: 0; transition: opacity 1.2s ease;
}
.moth-photo-viewer.is-revealing .moth-photo-tone,
.moth-photo-viewer.is-revealing:not(.is-loading) > img { opacity: 1; }
.moth-swarm { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.moth-photo-close {
  /* Key-questions geometry, raised 24px for the moth viewer only; see docs/navigation-controls.md. */
  position: absolute; z-index: 3; top: 82px;
  right: max(4vw, calc((100vw - 1280px) / 2)); margin: 0; padding: 8px;
  font-size: 30px; line-height: 1; border: 0; border-radius: 0; background: none;
}
.moth-photo-viewer.is-revealing .moth-photo-close { color: #315372; }
.moth-photo-viewer.is-revealing .moth-photo-close:hover { color: #12365b; }
.moth-photo-viewer .moth-photo-close:focus-visible {
  outline: none; box-shadow: none; text-shadow: none;
  opacity: .7;
}
.moth-photo-loading { display: none; position: absolute; inset: 45% 0 auto; text-align: center; }
.moth-photo-viewer.is-loading .moth-photo-loading { display: block; }
.moth-photo-viewer.is-loading > img { opacity: 0; }
@media (max-width: 800px) {
  .moth-photo-close { top: 70px; right: 6vw; }
}
@media (max-width: 650px) {
  .page-photo-archetypes .archetype-moth-trigger { width: 60px; height: 60px; }
}
@media (min-width: 651px) and (max-width: 1250px) {
  .page-photo-archetypes:not(.is-photo-focused) .photo-heading { padding-bottom: 72px; }
}
@media (max-width: 650px) {
  /* A small flight lane between the title and the frames, not across the text. */
  .page-photo-archetypes:not(.is-photo-focused) .photo-heading { padding-bottom: 116px; }
}
@media (prefers-reduced-motion: reduce) {
  .page-photo-archetypes .archetype-moth,
  .moth-photo-tone, .moth-photo-viewer > img { transition: none; }
  .moth-swarm { display: none; }
}
