/* SevenLoft Interactive Images - Frontend */
.slii-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
    font-size: 0;
}

/*
 * IMPORTANT: some themes force the image to a fixed height (e.g.
 * `.marker-image .slii-container .slii-image { height: 800px; width: auto; }`),
 * which changes the image's aspect ratio so the % markers land in the wrong
 * place. We override that here with high specificity + !important so the image
 * always keeps its natural aspect ratio (width:100%, height:auto). Markers are
 * positioned as % of the image, so this is what keeps them aligned.
 */
.slii-container .slii-image,
.marker-image .slii-container .slii-image {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
    width: 100% !important;
    vertical-align: top;
}

.slii-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* SVG mask overlay - dims everything except hovered polygon */
.slii-mask-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.slii-container.slii-hovering .slii-mask-svg {
    opacity: 1;
}

.slii-mask-svg .slii-dim {
    fill: rgba(0, 0, 0, 0.65);
}

/*
 * SVG mask logic: in the mask, white = dim shows, black = dim is hidden (image shows through).
 * Default polygon fill = white -> polygon area is also dimmed (no hole).
 * When the related marker is hovered, polygon becomes black -> punches a hole -> image shows through bright.
 */
.slii-mask-svg .slii-poly {
    fill: white;
    transition: fill 0.2s ease;
}

.slii-mask-svg .slii-poly.slii-poly-active {
    fill: black;
}

.slii-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
    z-index: 2;
    line-height: 1;
}

.slii-marker-label {
    display: inline-block;
    color: #ffffff;
    font-size: 32px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    padding: 6px 10px;
    transition: transform 0.2s ease;
    user-select: none;
    white-space: nowrap;
}

.slii-marker:hover .slii-marker-label,
.slii-marker:focus .slii-marker-label,
.slii-marker.slii-active .slii-marker-label {
    transform: scale(1.1);
}

.slii-tooltip {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #2c4a3e;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 6px;
    min-width: 180px;
    max-width: 260px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;
    text-align: left;
    pointer-events: none;
}

.slii-marker:hover .slii-tooltip,
.slii-marker:focus .slii-tooltip,
.slii-marker.slii-active .slii-tooltip {
    opacity: 1;
    visibility: visible;
}

.slii-tooltip-title {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 15px;
}

.slii-tooltip-lines {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
}

.slii-tooltip-lines li {
    margin: 2px 0;
}

/* Auto-flip tooltip when near right edge */
.slii-marker.slii-flip-left .slii-tooltip {
    left: auto;
    right: calc(100% + 12px);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .slii-marker-label {
        font-size: 22px;
        padding: 4px 8px;
    }
    .slii-tooltip {
        font-size: 13px;
        min-width: 150px;
        max-width: 200px;
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .slii-marker-label {
        font-size: 18px;
    }
}
