/**
 * Gestes carte Actus & Docs - cooperativeGestures tactile.
 * Inclure via lib/map-cooperative-gestures.php (actus_map_coop_print_tags).
 * JS ajoute .ad-coop-map / .ad-coop-wrap sur le conteneur carte.
 */

/* PC : .map-wrap peut garder touch-action: none (page).
   Tactile : 1 doigt = scroll page (sinon touch-action:none bloque). */
@media (hover: none), (pointer: coarse) {
    .ad-coop-wrap,
    .ad-coop-map,
    .ad-coop-map .maplibregl-canvas-container,
    .ad-coop-map .maplibregl-canvas {
        touch-action: pan-x pan-y !important;
    }
}

.ad-coop-map .maplibregl-cooperative-gesture-screen {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    background: rgba(15, 23, 42, 0.55);
    pointer-events: none !important;
    opacity: 0;
    visibility: hidden;
    /* Ecrase le fade MapLibre (delay 1s) */
    transition: opacity 0.32s ease, visibility 0.32s ease !important;
}

.ad-coop-map .maplibregl-cooperative-gesture-screen.maplibregl-show {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.12s ease !important;
}

.ad-coop-map .maplibregl-cooperative-gesture-screen.ad-gesture-leaving {
    opacity: 0 !important;
    visibility: hidden !important;
}

@media (max-width: 640px), (hover: none) and (pointer: coarse) {
    .ad-coop-map .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        max-width: 280px;
        line-height: 1.35;
    }
    .ad-coop-map .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message .ad-fingers-anim {
        display: block;
        width: 150px;
        height: 165px;
        margin: 0 auto 2px;
        pointer-events: none;
        overflow: visible;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ad-coop-map .ad-fingers-anim .pv-hand-wrap,
    .ad-coop-map .ad-fingers-anim .pv-hand02,
    .ad-coop-map .ad-fingers-anim .pv-hand03,
    .ad-coop-map .ad-fingers-anim .pv-a02-top,
    .ad-coop-map .ad-fingers-anim .pv-a02-bot,
    .ad-coop-map .ad-fingers-anim .pv-a03-top,
    .ad-coop-map .ad-fingers-anim .pv-a03-bot {
        animation: none !important;
    }
}
