/* Cursor concept 01: a compact photographic focus frame. */
.cursor-viewfinder { display: none; }

@media (hover: hover) and (pointer: fine) {
  .cursor.idle {
    width: 22px;
    height: 22px;
    color: #fff;
    background: transparent;
    border: 0;
    border-radius: 0;
    mix-blend-mode: difference;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: visible;
    transition: width 180ms ease-out, height 180ms ease-out;
  }

  .cursor.idle .cursor-viewfinder {
    display: block;
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  .viewfinder-corner {
    position: absolute;
    width: 6px;
    height: 6px;
    border: 0 solid currentColor;
    border-radius: 0.5px;
  }
  .viewfinder-corner.top-left { top: 0; left: 0; border-top-width: var(--viewfinder-stroke, 1.25px); border-left-width: var(--viewfinder-stroke, 1.25px); }
  .viewfinder-corner.top-right { top: 0; right: 0; border-top-width: var(--viewfinder-stroke, 1.25px); border-right-width: var(--viewfinder-stroke, 1.25px); }
  .viewfinder-corner.bottom-left { bottom: 0; left: 0; border-bottom-width: var(--viewfinder-stroke, 1.25px); border-left-width: var(--viewfinder-stroke, 1.25px); }
  .viewfinder-corner.bottom-right { bottom: 0; right: 0; border-bottom-width: var(--viewfinder-stroke, 1.25px); border-right-width: var(--viewfinder-stroke, 1.25px); }

  /* Difference blending disappears on mid-gray; keep both light and dark edges
     while the viewer is open, including its closing transition. */
  body:has(#lightbox.open) .cursor.idle,
  body:has(#lightbox.open) .click-focus {
    --viewfinder-stroke: 2px;
    color: #fff;
    mix-blend-mode: normal;
    filter: drop-shadow(0 0 1px #111) drop-shadow(0 1px 1px rgba(0, 0, 0, 0.7));
  }

  .cursor.focusing { opacity: 0 !important; }

  .click-focus {
    position: fixed;
    width: 32px;
    height: 32px;
    z-index: 10010;
    color: #fff;
    mix-blend-mode: difference;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%);
  }
  .click-focus::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 2px;
    background: currentColor;
    transform: translate(-50%, -50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor.idle { transition: none; }
}
