/**
 * SNAPSMACK - Mosaic Engine CSS
 *
 * Styles for [mosaic:ID] shortcode renders (public-facing)
 * and the admin builder live preview in smack-mosaics.php.
 */

/*
 * SNAPSMACK_EOF_HEADER
 * Last non-empty line of this file MUST be the canonical CSS EOF
 * marker: slash-star, space, five equals, space, the literal string
 * 'SNAPSMACK EOF', space, five equals, space, star-slash.
 * (Authoritative byte sequence: tools/check-eof.py EOF_MARKERS['.css'].)
 * Missing or different = truncated/corrupted. Restore before saving.
 */


/* ── PUBLIC MOSAIC ───────────────────────────────────────────────────────── */

.snap-mosaic {
    position: relative;
    width: 100%;
    margin: 1.5em 0;
    box-sizing: border-box;
}

.mosaic-item {
    position: absolute;
    overflow: hidden;
    background: #111;
}

.mosaic-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* These images are created dynamically. Keep the global fade-loader's
       img[data-lightbox-src] opacity rule from stranding them as black tiles. */
    opacity: 1 !important;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.mosaic-item:hover img {
    transform: scale(var(--mosaic-hover-scale, 1));
    filter: brightness(1.05);
}

/* ── SHARED SQUARE WALL ────────────────────────────────────────────────────
 *
 * A skin selects this mode by adding .ss-square-wall to a container whose
 * children use the shared .ss-masonry-item hook.  The skin may set
 * --ss-square-cols and --ss-gap; the engine owns the square crop.
 *
 * These rules originally lived in SCROLL.  ALFRED uses the same engine and
 * markup contract, so keeping the geometry here prevents the two skins from
 * carrying copies that can drift apart.
 */

.ss-square-wall {
    --ss-square-cols: 4;
    display: grid;
    grid-template-columns: repeat(var(--ss-square-cols), minmax(0, 1fr));
    gap: var(--ss-gap, 6px);
    width: 100%;
}

.ss-square-wall .ss-masonry-item {
    box-sizing: border-box;
    aspect-ratio: 1 / 1;
    min-width: 0;
    margin: 0;
}

.ss-square-wall .ss-masonry-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── ADMIN PREVIEW ───────────────────────────────────────────────────────── */

.mosaic-preview-wrap {
    background: var(--card-bg, #1e1e1e);
    border: 1px solid var(--border, #3a3a3a);
    border-radius: 3px;
    padding: 16px;
    margin-top: 12px;
    min-height: 80px;
}

.mosaic-preview-wrap .snap-mosaic {
    margin: 0;
}
/* ===== SNAPSMACK EOF ===== */
