/* ==========================================================================
   CURSOR — Custom cursor ring + dot
   ========================================================================== */

/* The native cursor is hidden only once js/components/cursor.js has actually
   built the ring and dot and set .has-custom-cursor on <html>. Hiding it
   unconditionally left the page with no pointer at all whenever the module
   did not run — a touch device, prefers-reduced-motion, or any JS error. */
.has-custom-cursor,
.has-custom-cursor *,
.has-custom-cursor *::before,
.has-custom-cursor *::after {
  cursor: none !important;
}

@media (pointer: coarse) {
  .has-custom-cursor,
  .has-custom-cursor *,
  .has-custom-cursor *::before,
  .has-custom-cursor *::after {
    cursor: auto !important;
  }
}

/* Ensure cursor pointer is always visible and functional in modals, dialogs, and overlays */
.modal-backdrop,
.modal-backdrop *,
.modal-overlay,
.modal-overlay *,
.modal,
.modal *,
.adm-modal-overlay,
.adm-modal-overlay *,
.adm-modal,
.adm-modal * {
  cursor: default !important;
}

.modal-backdrop a,
.modal-backdrop button,
.modal-backdrop [role="button"],
.modal-overlay a,
.modal-overlay button,
.modal-overlay [role="button"],
.modal a,
.modal button,
.modal [role="button"],
.adm-modal-overlay a,
.adm-modal-overlay button,
.adm-modal-overlay [role="button"],
.adm-modal a,
.adm-modal button,
.adm-modal [role="button"] {
  cursor: pointer !important;
}

.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2147483647;
  box-shadow: 0 0 8px rgba(232, 117, 46, 0.7);
  transition: width .2s, height .2s, background .2s, opacity .2s;
  will-change: transform;
}

.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  width: 38px; height: 38px;
  margin: -19px 0 0 -19px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2147483646;
  opacity: .7;
  will-change: transform;
  /* `transform` is deliberately absent from this transition and is never set
     here: it is owned entirely by the rAF loop in cursor.js, which composes
     the position and the click-shrink together. */
  transition: width .25s ease, height .25s ease, border-color .25s ease,
              background .25s ease, opacity .2s ease;
}

.cursor-ring.is-hover {
  width: 56px; height: 56px;
  margin: -28px 0 0 -28px;
  border-color: var(--accent);
  background: var(--accent-soft);
  opacity: 1;
}

.cursor-dot.is-hover {
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
}

.cursor-ring.is-text {
  width: 3px; height: 30px;
  margin: -15px 0 0 -1.5px;
  border-radius: 2px;
  border-color: var(--text-primary);
  background: var(--text-primary);
  opacity: .7;
}

/* The shrink itself is applied from JS (see cursor.js); this only carries
   the colour change that goes with it. */
.cursor-ring.is-click {
  background: var(--accent-soft-strong);
}

/* Pointer left the window. */
.cursor-ring.is-hidden,
.cursor-dot.is-hidden {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .cursor-ring,
  .cursor-dot { display: none; }
}
