/*
 * Cultina Hotspot-Bild widget.
 * A responsive image with absolutely-positioned hotspot markers; each reveals a
 * tooltip on hover / keyboard focus / click (mode set via data-trigger + JS).
 * Most values come from the widget's Style controls; this file holds structure,
 * the marker shapes and the tooltip positioning.
 */

.chs {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
}

.chs__img {
    display: block;
    width: 100%;
    height: auto;
}

/* ----- hotspot marker -------------------------------------------------- */
.chs__spot {
    position: absolute;
    /* left/top (%) come from the per-hotspot controls; centre on that point. */
    transform: translate(-50%, -50%);
    line-height: normal;
}
.chs__spot:hover,
.chs__spot:focus-within,
.chs__spot.is-open { z-index: 6; }

/* circle/square/dot: an EXACT square built from a single size value (px or %),
   WITHOUT relying on aspect-ratio. `width` and `padding-bottom` both resolve
   against the image (.chs) width, so they are always equal → a true square, in
   every browser and the Elementor editor. --chs-size comes from the per-hotspot
   "Größe" control; the fallback keeps it square even if that CSS is momentarily
   missing (e.g. editor preview before save). "Frei" (custom) stays free. */
.chs__spot--circle,
.chs__spot--square,
.chs__spot--dot {
    width: var(--chs-size, 15%);
    height: 0;
    padding-bottom: var(--chs-size, 15%);
}

/* Doubled .chs prefix + min-width/height:0: the Elementor Kit styles
   `.elementor-kit-5 button` (0,1,1) with padding/min-size, which otherwise wins
   over a single-class `.chs__marker` (0,1,0) and stops the button shrinking below
   its kit min-content — so a small marker (e.g. 15px) overflows inset:0 and renders
   as an ellipse. Out-specify (0,2,0) and zero the min-size so the marker always
   collapses to the spot's square. */
.chs .chs__marker {
    display: block;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    min-width: 0;
    min-height: 0;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0);
    cursor: pointer;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 200ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
/* circle/square/dot: the marker fills the padded square box exactly. */
.chs__spot--circle .chs__marker,
.chs__spot--square .chs__marker,
.chs__spot--dot   .chs__marker { position: absolute; inset: 0; width: auto; height: auto; }
/* !important: Elementor V4's atomic base styles apply a small button radius that
   otherwise wins over a single class selector. */
.chs__spot--circle .chs__marker,
.chs__spot--dot .chs__marker { border-radius: 50% !important; }
.chs__spot--square .chs__marker { border-radius: 8px; }
.chs__spot--dot .chs__marker { border-width: 0; }
/* "Frei": exact px size from the Breite/Höhe controls (no square lock); the spot
   shrink-wraps the marker. */
.chs__spot--custom .chs__marker { position: relative; width: auto; height: auto; }

.chs__marker img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

/* Subtle lift on activation (the ring colour change comes from the control). */
.chs__spot:hover .chs__marker,
.chs__spot:focus-within .chs__marker,
.chs__spot.is-open .chs__marker { transform: scale(1.04); }

.chs__marker:focus-visible { outline: none; }

/* ----- tooltip --------------------------------------------------------- */
.chs__tip {
    position: absolute;
    z-index: 7;
    min-width: 150px;
    max-width: 260px;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease, visibility 160ms ease;
}
.chs__tip-title {
    display: block;
    margin: 0 0 4px;
    font-family: "Ubuntu", "Helvetica Neue", Arial, sans-serif;
    font-weight: 500;
    font-size: 24px;
    line-height: 1.2;
    color: #C2006A;
    text-decoration: none;
}
a.chs__tip-title:hover { text-decoration: underline; }
.chs__tip-text {
    display: block;
    font-family: "Ubuntu", "Helvetica Neue", Arial, sans-serif;
    font-weight: 300;
    font-size: 18px;
    line-height: 26px;
    color: #313131;
}

/* tooltip side relative to the marker */
.chs__tip--top .chs__tip    { bottom: 100%; left: 50%;  transform: translateX(-50%); margin-bottom: 14px; }
.chs__tip--bottom .chs__tip { top: 100%;    left: 50%;  transform: translateX(-50%); margin-top: 14px; }
.chs__tip--right .chs__tip  { left: 100%;   top: 50%;   transform: translateY(-50%); margin-left: 14px; }
.chs__tip--left .chs__tip   { right: 100%;  top: 50%;   transform: translateY(-50%); margin-right: 14px; }

/* reveal: hover mode (+ keyboard focus always) and click mode (.is-open) */
.chs[data-trigger="hover"] .chs__spot:hover .chs__tip,
.chs__spot:focus-within .chs__tip,
.chs__spot.is-open .chs__tip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    .chs__marker, .chs__tip { transition: none; }
    .chs__spot:hover .chs__marker,
    .chs__spot:focus-within .chs__marker,
    .chs__spot.is-open .chs__marker { transform: none; }
}

/* Screenshot mode (pixel-diff tooling) — keep markers, hide any open tooltip. */
.cultina-screenshot .chs__tip { opacity: 0; visibility: hidden; }
