/*
 * Coding Ireland proprietary interactive activity module
 * Copyright (c) 2017-2026 Coding Ireland. All rights reserved.
 * Ref: CI-see-shared-viewport
 *
 * Styles for see-viewport.js. Loaded only by the interactives that pan and zoom
 * over an image: map-explorer, source-inquiry, record-extractor, then-and-now.
 */

.sv-host {
    position: relative;
    /* A non-capturing frame. The viewport itself takes touch-action: none so a
     * drag pans instead of scrolling, but inside a 620px iframe on a scrolling
     * lesson page that would trap a child who is trying to reach the next step.
     * The padding leaves a band they can always drag the page by. */
    padding: 10px;
    background: var(--maths-surface-alt);
    border-radius: 12px;
}

.sv-viewport {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    min-height: 220px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--maths-border);
    touch-action: none;
    cursor: grab;
}

.sv-viewport.sv-nopan { touch-action: auto; cursor: default; }
.sv-viewport:active { cursor: grabbing; }

.sv-world {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    will-change: transform;
}

.sv-anim { transition: transform .45s cubic-bezier(.22, .61, .36, 1); }

.sv-image {
    display: block;
    width: 100%;
    height: 100%;
    user-select: none;
    -webkit-user-drag: none;
}

/* No base map, or one that failed to load. Squared paper is honest: it says
 * "we have no map for this" while still showing every pin the lesson placed. */
.sv-graticule {
    position: absolute;
    inset: 0;
    background-color: #fdfbf7;
    background-image:
        linear-gradient(to right, var(--maths-grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--maths-grid-line) 1px, transparent 1px);
    background-size: 8.3333% 11.1111%;
    border: 1px dashed var(--maths-border);
}

.sv-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Overlay children counter-scale, so a pin stays the same size on screen at
 * any zoom. An unscaled pin becomes a postage stamp at 6x and unusable on a
 * board. --see-inv is set by see-viewport.js on every transform. */
.sv-overlay > * {
    position: absolute;
    transform: translate(-50%, -50%) scale(var(--see-inv, 1));
    transform-origin: 50% 50%;
    pointer-events: auto;
}
