/* Cut-out photos: the host removed the background (src/bgr.js), so the photo is a transparent cut-out that sits on the design.
   kit.js gives the <img> .k-cut and sets data-cut on the root: design | shadow | sticker | line (the host's Finish).
   "design" = the finish that suits the design (the same choice the editor names, public/studio/bgr.js FINISH_OF).
   Colours come only from --k-* so custom colours follow. Filters only: they follow the silhouette, not the box.
   !important: designs develop their photos with Motion, which leaves an inline filter (sepia 0, brightness 1) that would
   otherwise hide the finish for good. A cut-out still arrives with the design's clip, slide and scale. */
.k-root img.k-cut { --k-cut-edge: #fff; background: none; image-rendering: auto; }

/* soft shadow: lifted off the page a little */
.k-root[data-cut="shadow"] img.k-cut,
.k-root[data-cut="design"] img.k-cut {
  filter: drop-shadow(0 .18rem .2rem rgb(0 0 0 / .16)) drop-shadow(0 .9rem 1.1rem rgb(0 0 0 / .22)) !important;
}
/* sticker: a clean paper edge all round, then a short shadow */
.k-root[data-cut="sticker"] img.k-cut {
  filter: drop-shadow(2px 0 0 var(--k-cut-edge)) drop-shadow(-2px 0 0 var(--k-cut-edge)) drop-shadow(0 2px 0 var(--k-cut-edge)) drop-shadow(0 -2px 0 var(--k-cut-edge))
    drop-shadow(0 .5rem .6rem rgb(0 0 0 / .2)) !important;
}
/* gold line: a fine line of the design's metal, with a faint glow */
.k-root[data-cut="line"] img.k-cut {
  filter: drop-shadow(1.2px 0 0 var(--k-gold)) drop-shadow(-1.2px 0 0 var(--k-gold)) drop-shadow(0 1.2px 0 var(--k-gold)) drop-shadow(0 -1.2px 0 var(--k-gold))
    drop-shadow(0 0 .45rem color-mix(in srgb, var(--k-gold-hi, var(--k-gold)) 55%, transparent)) !important;
}

/* the design's own finish (keep in step with FINISH_OF in public/studio/bgr.js) */
.k-root[data-cut="design"]:is([data-template="gatsby"], [data-template="premiere"], [data-template="chandelier"], [data-template="palazzo"], [data-template="keynote"], [data-template="cover-story"], [data-template="nightfall"]) img.k-cut {
  filter: drop-shadow(1.2px 0 0 var(--k-gold)) drop-shadow(-1.2px 0 0 var(--k-gold)) drop-shadow(0 1.2px 0 var(--k-gold)) drop-shadow(0 -1.2px 0 var(--k-gold))
    drop-shadow(0 0 .45rem color-mix(in srgb, var(--k-gold-hi, var(--k-gold)) 55%, transparent)) !important;
}
.k-root[data-cut="design"]:is([data-template="confetti"], [data-template="billet"], [data-template="jetset"], [data-template="afterglow"], [data-template="adire"], [data-template="gallery"]) img.k-cut {
  filter: drop-shadow(2px 0 0 var(--k-cut-edge)) drop-shadow(-2px 0 0 var(--k-cut-edge)) drop-shadow(0 2px 0 var(--k-cut-edge)) drop-shadow(0 -2px 0 var(--k-cut-edge))
    drop-shadow(0 .5rem .6rem rgb(0 0 0 / .2)) !important;
}
/* a sticker on dark paper reads better with the card colour than with stark white */
.k-root[data-tone="dark"] img.k-cut { --k-cut-edge: color-mix(in srgb, var(--k-card) 30%, #fff); }

/* the frame behind a cut-out: a soft wash of the design's own colours instead of an empty hole */
.k-root :has(> img.k-cut) {
  background-color: color-mix(in srgb, var(--k-card) 78%, var(--k-gold) 22%);
}
/* the full-screen viewer shows the cut-out on the viewer's own dark, as it is */
.k-lb img.k-cut { filter: none !important; }
