/* ============================================================
   CUSTOM CURSOR — the themed arrow, hand and quill.

   How it resolves (every rule is !important so no component CSS can
   paint an unthemed OS cursor over the theme):

     1. ARROW  — every element, by default.
     2. HAND   — every interactive element AND EVERYTHING INSIDE IT.
                 The old sheet set the hand on <a>/<button> only, and the
                 '*' arrow rule then repainted each child: the pointer
                 flipped hand → arrow → hand while crossing a link's icon
                 or label. The selector list lives inside :where(), so it
                 carries zero specificity and every later rule wins.
     3. QUILL  — text fields (typing cursor), even inside a clickable label.
     4. INTENT — the few places a component asks for a specific cursor
                 (zoom on dossier art, hidden while a video idles).
     5. LOCKED — disabled controls and everything inside them show the
                 arrow with not-allowed, hovered or not. The old
                 'button:hover' rule outranked '[disabled]', so a disabled
                 button still showed the hand.
     6. MAP    — the world map keeps its own cursor.

   HOTSPOTS — the point that actually clicks must be where the artwork
   points. They were all 13 13 (the middle of each image), so the click
   landed 13px right of and below the spear's tip: aiming the tip at a
   line of 13px text hit the gap under it (the footer missed 13 of 21
   targets). Measured from the art's alpha:
     arrow  24×31 spear, tip at its top-left corner      → 1 1
     hand   26×26 glove, index fingertip at ~(3,3)       → 3 3
     quill  18×25 I-beam, centred                        → 9 12
     map    32×32 compass, centred                       → 16 16 (unchanged)
   ============================================================ */

/* 1 · ARROW */
* {
    cursor: url('/assets/img/cursor-pyramid-32-sm.png') 1 1, auto !important;
}

/* 2 · HAND — the control and all of its children */
:where(
    a[href], button, summary, select,
    label[for], label:has(input:not([type='text'], [type='search'], [type='email'], [type='password'], [type='url'], [type='tel'], [type='number'])),
    input[type='checkbox'], input[type='radio'], input[type='range'], input[type='file'],
    input[type='color'], input[type='submit'], input[type='button'], input[type='reset'], input[type='image'],
    [role='button'], [role='link'], [role='tab'], [role='menuitem'], [role='menuitemradio'],
    [role='menuitemcheckbox'], [role='option'], [role='switch'], [role='checkbox'], [role='radio'],
    .btn, .uk-button, .action-btn, .swiper-button-prev, .swiper-button-next,
    .uk-modal-close-default, [data-uk-close]
),
:where(
    a[href], button, summary, select,
    label[for], label:has(input:not([type='text'], [type='search'], [type='email'], [type='password'], [type='url'], [type='tel'], [type='number'])),
    [role='button'], [role='link'], [role='tab'], [role='menuitem'], [role='menuitemradio'],
    [role='menuitemcheckbox'], [role='option'], [role='switch'], [role='checkbox'], [role='radio'],
    .btn, .uk-button, .action-btn, .swiper-button-prev, .swiper-button-next,
    .uk-modal-close-default, [data-uk-close]
) * {
    cursor: url('/assets/img/cursor-button-sm.png') 3 3, pointer !important;
}

/* 3 · QUILL — text entry, wherever it sits */
input[type='text'],
input[type='email'],
input[type='password'],
input[type='search'],
input[type='tel'],
input[type='url'],
input[type='number'],
input:not([type]),
textarea,
[contenteditable='true'],
[contenteditable='true'] * {
    cursor: url('/assets/img/cursor-typing-sm.png') 9 12, text !important;
    caret-color: transparent !important;
}
input[type='text']:focus,
input[type='email']:focus,
input[type='password']:focus,
input[type='search']:focus,
input[type='tel']:focus,
input[type='url']:focus,
input[type='number']:focus,
input:not([type]):focus,
textarea:focus,
[contenteditable='true']:focus {
    caret-color: #FFD700 !important;
}

/* 4 · INTENT — cursors a component explicitly asks for */
.cdt-codex__page,
.cdt-codex__page *,
.cdt-thumb,
.cdt-thumb * {
    cursor: zoom-in !important;
}
.vp.is-idle,
.vp.is-idle * {
    cursor: none !important;
}
/* Clickable surfaces that are not buttons: the manga reader's page (click
   either half to turn, in both spread and single-page mode) and a film's
   picture (click to play or pause). */
.pf__book,
.pf__book *,
.vp__video,
/* [FA-story-3] a Story video card's caption plays the video on click (it
   lifts and sounds like the poster does) but showed the arrow */
.st-live--playable .vp-card__text,
.st-live--playable .vp-card__text * {
    cursor: url('/assets/img/cursor-button-sm.png') 3 3, pointer !important;
}
/* The current page number is a button that does nothing when clicked. */
.y-pg__btn.is-current,
.y-pg__btn.is-current * {
    cursor: url('/assets/img/cursor-pyramid-32-sm.png') 1 1, auto !important;
}
/* The 3D book while it is being turned by a drag. */
.yk-book3d.is-dragging,
.yk-book3d.is-dragging * {
    cursor: grabbing !important;
}
/* The 3D dossier model orbits under a drag. model-viewer draws its own
   grab cursor inside its shadow root; the host must not paint the arrow
   over it at the edges. */
model-viewer {
    cursor: grab !important;
}
model-viewer:active {
    cursor: grabbing !important;
}

/* 5 · LOCKED — disabled controls, hovered or not */
:is(button, input, select, textarea, fieldset)[disabled],
:is(button, input, select, textarea, fieldset)[disabled] *,
[aria-disabled='true'],
[aria-disabled='true'] *,
.disabled,
.disabled *,
.is-disabled,
.is-disabled * {
    cursor: url('/assets/img/cursor-pyramid-32-sm.png') 1 1, not-allowed !important;
}
[disabled],
.disabled {
    opacity: 0.6;
}

/* 6 · MAP — the world map keeps its own cursor.
   `.map-container *` is required: the interactive world layers (territory
   paths, state markers) blanket the whole viewport, and the hand rule
   above would otherwise swap in the hand over every inch of the map.
   Chrome OUTSIDE the container (zoom controls, selection panel) keeps
   the hand on purpose. */
.coming-soon-page,
.page-main.map-page,
.map-container,
.map-container *,
.map-wrapper {
    cursor: url('/assets/img/cursor-map.png') 16 16, auto !important;
}

/* Draggable surfaces */
.swiper-container,
.draggable {
    cursor: url('/assets/img/cursor-pyramid-32-sm.png') 1 1, grab !important;
}
.swiper-container:active,
.draggable:active {
    cursor: url('/assets/img/cursor-pyramid-32-sm.png') 1 1, grabbing !important;
}
