/* Page rendering shared by the editor and the print view. Units are physical (mm / pt). */

.pg { position: relative; background: #fff; overflow: hidden; color: #000; }
.pg-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pg-area { position: absolute; outline: 0.2mm dashed rgba(0, 120, 215, .6); pointer-events: none; }
.pg-area i { position: absolute; top: 0; bottom: 0; background: rgba(0, 120, 215, .07); }

.blk { position: absolute; box-sizing: border-box; }
.blk-t {
  width: 100%; height: 100%; box-sizing: border-box; overflow: hidden;
  column-fill: auto; hyphens: manual; overflow-wrap: break-word;
  font-kerning: normal; text-rendering: geometricPrecision;
  orphans: 1; widows: 1;
}
.blk-t p { margin: 0; }
.blk-text .blk-t p + p { text-indent: var(--indent, 1em); }
.blk-text .blk-t p.cont { text-indent: 0; }
.blk-t p.split { text-align-last: justify; }
/* Russian / Ukrainian get soft hyphens from render.js; English relies on the browser dictionary. */
.pg:lang(en) .blk-text .blk-t, .pg:lang(en) .blk-lead .blk-t { hyphens: auto; }
.blk-image { overflow: hidden; }
.blk-image img { width: 100%; height: 100%; display: block; }

.blk-static { overflow: hidden; }
.blk-static img { width: 100%; height: 100%; display: block; }
.blk-crossword { display: flex; gap: 3mm; overflow: hidden; color: #000; }
.cw-g { flex: none; }
.cw-g rect { fill: #fff; stroke: #000; stroke-width: 0.03; }
.cw-g .n { font: 0.3px "PT Sans", sans-serif; fill: #000; }
.cw-g .l { font: 700 0.62px "PT Sans", sans-serif; fill: #000; text-anchor: middle; }
.cw-c { flex: 1; min-width: 0; height: 100%; overflow: hidden; column-width: 42mm; column-gap: 3mm; column-fill: auto; }
.cw-c p { margin: 0 0 1mm; }
.cw-t { font-weight: 700; font-size: 1.5em; line-height: 1.15; text-transform: uppercase; }
.cw-h { text-transform: uppercase; }
.cw-a { font-size: 0.82em; line-height: 1.2; border-top: 0.2mm solid #000; padding-top: 0.8mm; }
/* Polish, English, German and French use the browser's hyphenation dictionaries. */
.pg:lang(pl) .blk-text .blk-t, .pg:lang(de) .blk-text .blk-t, .pg:lang(fr) .blk-text .blk-t,
.pg:lang(pl) .blk-lead .blk-t, .pg:lang(de) .blk-lead .blk-t, .pg:lang(fr) .blk-lead .blk-t { hyphens: auto; }
/* A bold one-line sub-heading stays with the paragraph that follows it. */
.blk-t p:has(> b:only-child) { break-after: avoid; }

/* scanword: the grid fills the frame; grey clue cells with arrows, white letter cells */
.blk-crossword:has(.sw) { flex-direction: column; gap: 1.2mm; }
.sw { position: relative; flex: none; }
.sw > div { position: absolute; box-sizing: border-box; border: 0.15mm solid #000; margin: -0.075mm 0 0 -0.075mm; }
.sw-l { background: #fff; display: grid; place-items: center; font: 700 1em "PT Sans", sans-serif; }
.sw-e { background: #d9d9d9; }
.sw-q { background: #ececec; display: flex; flex-direction: column; overflow: hidden; }
.sw-q .sw-t { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0.3mm 0.4mm; line-height: 1.02; font-family: "PT Sans Narrow", "PT Sans", sans-serif; overflow: hidden; overflow-wrap: anywhere; hyphens: auto; position: relative; }
.sw-q.two .sw-t + .sw-t { border-top: 0.12mm solid #000; }
/* arrows: across — a small triangle on the right edge, down — on the bottom edge */
.sw-q .sw-a::after, .sw-q .sw-d::after { content: ''; position: absolute; width: 0; height: 0; }
.sw-q .sw-a::after { right: -0.1mm; top: 50%; margin-top: -0.9mm; border-left: 1.1mm solid #000; border-top: 0.9mm solid transparent; border-bottom: 0.9mm solid transparent; }
.sw-q .sw-d::after { bottom: -0.1mm; left: 50%; margin-left: -0.9mm; border-top: 1.1mm solid #000; border-left: 0.9mm solid transparent; border-right: 0.9mm solid transparent; }
.sw-title { margin: 0; }
.sw-ans { margin: 0; }

/* a picture instead of a clue: inline in a crossword's list, filling the clue cell in a scanword */
.cw-img { height: 2.6em; width: auto; max-width: 5em; vertical-align: middle; margin: 0 0.3em; object-fit: contain; }
.sw-q .sw-pic { background: #fff center / cover no-repeat; padding: 0; }
