/**
 * Draw Attention Pro's interactive images (PR 6.2).
 *
 * Seven pages run a `[drawattention]` shortcode: `/`, `/contact-us/`, the semi-managed,
 * our-approach and ConnectIQ service pages, and the Ericsson Cradlepoint and Teltonika
 * business-internet landings. The plugin is not ours, so this file only corrects how its
 * output sits in the theme's layout. It loads only on a page where the shortcode or
 * the plugin's `draw-attention/image` block rendered
 * (`opt_connect_2025_child_enqueue_draw_attention_style()`).
 */

/* --------------------------------------------------------------------------
 * The page scrolls sideways
 *
 * Leaflet's SVG renderer draws on a canvas 10% wider than the map on every side, so
 * paths stay drawn while the map pans. Draw Attention's tooltip layout sets the map
 * container to `overflow: visible`, which lets its tooltips escape the image but lets
 * that padding escape too. A map that reaches the column's right edge pushed the
 * document 32–43px wider than the viewport (`/` at 1024, 782 and 390px).
 *
 * The map container is clipped on the x axis only. Tooltips keep escaping above and
 * below the image. Sideways they don't need to: the responsive-popup script places
 * each tooltip inside the map. Measured on every tooltip hotspot (31, on the six pages
 * with a tooltip image) at 1280, 1024 or 390px, also after a resize: none opened
 * past the image's sides.
 *
 * Not a clip on the SVG's own pane: Leaflet translates the map pane after a resize
 * (`invalidateSize`, then `panBy`), so a box sized to the map inside it drifts off the
 * image and cuts the hotspots. The container never moves.
 *
 * (0,3,0) to beat the plugin's `.layout-tooltip .leaflet-container`, which loads after
 * this file. `clip` rather than `hidden`, so the other axis stays visible and the map
 * does not become a scroll container.
 * ---------------------------------------------------------------------- */
.hotspots-container .hotspots-map-container.leaflet-container {
	overflow-x: clip;
}

/* --------------------------------------------------------------------------
 * The tooltip text flashes under the image
 *
 * In the tooltip layout (six of the seven images) every hotspot's caption is printed
 * after the image as a `.hotspot-info` box. The plugin's script hides them all with
 * `.da-hidden` on DOM ready and copies each box's HTML into its tooltip. Until it
 * runs, the boxes stack under the image (30364's office photos, 30051's factor
 * headings), then disappear.
 *
 * They start hidden here instead, for 5s. The plugin's own hiding wins well inside
 * that time. If its script never runs (blocked by consent, or failed), the boxes are
 * the only place that text exists, so they show once the delay ends. CSS rather than a
 * script, since Cookiebot holds scripts it doesn't know.
 *
 * The cost: if Cookiebot holds the plugin's script until a visitor consents after
 * the 5s, the boxes show at 5s and vanish on consent, and the page below the image
 * moves up. Hiding them for good would lose the text for visitors who never consent.
 *
 * Hidden with `visibility` and taken out of the flow with `position`, not with
 * `display: none`: Firefox (158, 2026-12-01) ignores `display` in a keyframe, so the
 * boxes stacked under the map there until the plugin ran. Out of the flow, the
 * container is only the image's height, so the plugin's loading dot (its `::after`,
 * centred in the container) sits on the image rather than among the boxes.
 * `max-height: 0; overflow: hidden` hold the same space shut in case a browser
 * skips `position` in a keyframe; checked in Chrome 158 and Firefox 158, which
 * apply all four. The other layouts
 * (30173's side panel) keep their boxes in the plugin's own hidden placeholder.
 * ---------------------------------------------------------------------- */
.hotspots-container.layout-tooltip .hotspot-info:not(.da-hidden) {
	animation: oc-da-info-fallback 0s 5s backwards;
}

@keyframes oc-da-info-fallback {
	from {
		position: absolute;
		visibility: hidden;
		max-height: 0;
		overflow: hidden;
	}
}
