/* What draws a photo book's or a calendar's page (consistency lab, 2026-12-03): photo frames, stickers, text boxes, and the editor's handles and
   snap lines on them. One copy, loaded by book.html, calendar.html and both print pages (engine/templates/render_book.py, render_calendar.py).
   The calendar's print page loads no site sheet, so a rule here that reaches print uses literal colours or the page's own --fc/--fw, never a
   site token. The handles and snap lines exist only in the editors, which have site.css. Product-only rules stay in book.css and calendar.css. */

/* a frame over a photo: the photo's own clip is the product's; --fc and --fw are set on the frame */
.fr { position: absolute; inset: 0; pointer-events: none; box-sizing: border-box; }
svg.fr { width: 100%; height: 100%; overflow: visible; }
.fr.brush { filter: url(#bk-brush); }
.fr.corners, .tile .lay i.fr.corners { background:
  linear-gradient(135deg, var(--fc) 50%, transparent 50%) left top / var(--fw) var(--fw) no-repeat,
  linear-gradient(225deg, var(--fc) 50%, transparent 50%) right top / var(--fw) var(--fw) no-repeat,
  linear-gradient(45deg, var(--fc) 50%, transparent 50%) left bottom / var(--fw) var(--fw) no-repeat,
  linear-gradient(315deg, var(--fc) 50%, transparent 50%) right bottom / var(--fw) var(--fw) no-repeat; }
/* washi tape across two corners (owner 2026-11-16, item 12) */
.fr.tape::before, .fr.tape::after { content: ''; position: absolute; top: 3%; width: 34%; height: calc(var(--fw) * 1.1); background: var(--fc); opacity: .82; box-shadow: 0 0 0 .3px rgb(0 0 0 / .06); }
.fr.tape::before { left: -7%; transform: rotate(-32deg); }
.fr.tape::after { right: -7%; transform: rotate(32deg); }

/* stickers (owner 2026-11-16, item 14) and text boxes */
.stk { position: absolute; z-index: 3; display: block; margin: 0; padding: 0; border: 0; background: none; line-height: 0; }
.stk svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tile .lay.stkprev { display: grid; place-items: center; color: #1d1d1b; }  /* black, as the Black swatch (owner, 2026-11-21) */
.tile .lay.stkprev svg { width: 62%; height: 62%; }
.wbox { position: absolute; display: grid; align-content: center; white-space: pre-wrap; overflow-wrap: anywhere; overflow: hidden; }

/* free placement (owner, 2026-11-19): handles round the chosen frame, caption, sticker or text box, and snap lines; editor only */
.fh { position: absolute; z-index: 6; box-sizing: border-box; border: 1.5px solid var(--walnut); pointer-events: none; }
.fh [data-h] { position: absolute; width: 14px; height: 14px; margin: -7px; box-sizing: border-box; border: 2px solid var(--walnut); border-radius: 0; background: var(--paper); pointer-events: auto; touch-action: none; }
.fh [data-h]::after { content: ''; position: absolute; inset: -8px; }  /* a 30px target round each 14px handle (WCAG 2.5.8) */
.fh [data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; } .fh [data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.fh [data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; } .fh [data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.fh [data-h="w"] { left: 0; top: 50%; cursor: ew-resize; } .fh [data-h="e"] { left: 100%; top: 50%; cursor: ew-resize; }
.fh [data-h="rot"] { left: 50%; top: -26px; border-radius: 50%; cursor: grab; }
.fh [data-h="rot"]::before { content: ''; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 12px; margin-left: -.75px; background: var(--walnut); }
.fh.knob-in [data-h="rot"] { top: 22px; }  /* near the top of the page the knob would be cut off: it sits just inside */
.fh.knob-in [data-h="rot"]::before { top: auto; bottom: 100%; }
.guide { position: absolute; z-index: 7; pointer-events: none; background: var(--brass); }
.guide.gv { top: 0; bottom: 0; width: 1px; margin-left: -.5px; }
.guide.gh { left: 0; right: 0; height: 1px; margin-top: -.5px; }
html.dragging, html.dragging * { cursor: grabbing !important; user-select: none; }
html.dragging .fh [data-h] { cursor: inherit; }
