/* Quest Log: the painted map, the 3D scroll rods and the paper cutouts (js/map.js, js/fable3d.js, js/cutouts.js). */

/* The painted map (js/map.js). Only present when the map is on; ?nomap leaves the page as it was. */

/* painted on the wall: above the bricks, under the cutouts' shadows, the road and everything else */
#map { position: absolute; left: 0; top: -160px; bottom: 0; width: 100%; z-index: -1; pointer-events: none; overflow: clip; }
/* (it starts above the wall so the range can rise beside the banner; .mf tops are measured from the wall) */
#map > .mf { margin-top: 160px; }
/* drawings may run past the wall's own column into empty margin (js/map.js decides how far) */
.map-on .pg-trail .zone { overflow: visible; }

.mf { position: absolute; }
.mf > img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; -webkit-user-drag: none; user-select: none; }

/* Surveyed as you go. Ahead of the hiker a drawing is only its pencil under-drawing; once reached it is inked,
   then the washes come up, and the pencil is rubbed out. Opacity only, so it never repaints or moves the page. */
.mf__p { opacity: .5; transition: opacity 1.1s ease .15s; }
.mf__i { opacity: 0; transition: opacity .75s ease; }
.mf__w { opacity: 0; transition: opacity 1.5s ease .3s; }
.mf.on .mf__p { opacity: 0; }
.mf.on .mf__i { opacity: var(--ink-o, .92); }
.mf.on .mf__w { opacity: 1; }
/* landmarks carry full ink; weather and the compass sit further back */
.mf--lm { --ink-o: 1; }
.mf--quiet { --ink-o: .62; }
.mf--quiet.on .mf__w { opacity: .8; }
.mf--quiet .mf__p { opacity: .34; }
/* first paint and rebuilds: no fade */
#map.map-init .mf > img { transition: none; }
@media (prefers-reduced-motion: reduce) { .mf > img { transition: none; } }

/* a landmark standing as a paper cutout: the WebGL layer draws the card, so the flat drawing steps aside
   (only once the card really exists; without WebGL the flat drawing stays) */
.mf--cut.mcut-ok .mf__i, .mf--cut.mcut-ok .mf__w { visibility: hidden; }

/* the old terrain icons are replaced by painted ones */
.map-on #gT { display: none; }

/* fable3d: real-time 3D rods, nail and cord (WebGL, see fable3d.js). The paper sheet stays HTML.
   Everything here is gated on html.f3d-on, which the script sets only once WebGL2 is up; without it the drawn art stays. */
html.f3d-on .scroll .rod>svg,html.f3d-on .hs__nail>svg,html.f3d-on .hs__band>.paper,html.f3d-on .hs .sheet>.paper{display:none}
html.f3d-on .scroll .rod:hover{transform:none}
/* the bottom rod is clicked where it is drawn (fable3d moves .f3d-hit with it); where it would be with the scroll
   open is then only empty wall. Without the cutouts layer nothing rolls the scrolls, so there is nothing to click. */
.f3d-hit{position:absolute;left:0;right:0;z-index:3;display:none}
html.f3d-on.cutouts-on:not(.cut-calm) .f3d-hit{display:block;cursor:pointer}
html.f3d-on.cutouts-on .scroll .rod--bot{pointer-events:none}

/* the canvases the 3D is blitted into: they live in the page flow, so they scroll with the compositor */
.f3d{position:absolute;z-index:3;pointer-events:none;
  filter:drop-shadow(1px 2px 1px rgba(27,36,44,.2)) drop-shadow(4px 9px 7px rgba(44,60,84,.3))}
.f3d--bot{filter:drop-shadow(1px 2px 1px rgba(27,36,44,.2)) drop-shadow(5px 11px 9px rgba(44,60,84,.3))}

/* the sheet of paper, from the middle of the top roll to the middle of the bottom roll */
.f3d-paper{position:absolute;z-index:0;pointer-events:none;left:var(--pl);right:var(--pl);top:var(--pt);bottom:var(--pb);
  filter:drop-shadow(3px 7px 6px rgba(44,60,84,.2))}
.f3d-paper>i{position:absolute;inset:0;
  background:
    linear-gradient(0deg,rgba(84,100,128,.5) 0,rgba(84,100,128,.5) var(--rb),rgba(84,100,128,.16) calc(var(--rb) + 5px),rgba(84,100,128,0) calc(var(--rb) + 20px)),
    linear-gradient(90deg,rgba(84,100,128,.1),rgba(84,100,128,0) 18px,rgba(84,100,128,0) calc(100% - 26px),rgba(84,100,128,.14)),
    var(--f3d-paper,#FBF9F4);
  -webkit-mask:var(--ml) left top/9px 320px repeat-y,var(--mr) right top/9px 320px repeat-y,linear-gradient(#000 0 0) center/calc(100% - 17px) 100% no-repeat;
  mask:var(--ml) left top/9px 320px repeat-y,var(--mr) right top/9px 320px repeat-y,linear-gradient(#000 0 0) center/calc(100% - 17px) 100% no-repeat}
.f3d-paper>b{position:absolute;inset:0;background:var(--el) left top/9px 320px repeat-y,var(--er) right top/9px 320px repeat-y}
html.f3d-noink .f3d-paper>b{opacity:.35}

#cut-stage { position: absolute; left: 0; top: 0; overflow: clip; z-index: -1; pointer-events: none; }
#cut-stage canvas { position: absolute; left: 0; top: 0; width: 100%; display: block; will-change: transform; }
/* the WebGL layer draws the drawings and the scrolls; the site's inline versions stay in the DOM for layout,
   clicks and the no-WebGL fallback */
.cutouts-on .pg-trail .va svg.dd,
.cutouts-on .scroll .rod > svg,
.cutouts-on .scroll .paper { visibility: hidden; }
.cutouts-on .rod:hover { transform: none; }
html.capture .rv, html.capture .rv-legend { display: none !important; }
/* the wall clips anything past its sides (style.css: .zone{overflow-x:clip}). A card standing off the wall, and its
   shadow, reach a little past the flat drawing it replaces, so the juggler on the right got sliced. Nothing else in
   the zone spills past it (checked at 390/1280/1920), and the stage is never wider than the viewport. */
.cutouts-on .pg-trail .zone { overflow: visible; }

/* the Complete stamp had a row of its own under the date, leaving ~110px of blank paper before "What I did" once the
   scroll opens. Press it beside the date instead (the date line is short and left-aligned, the stamp sits right).
   A job with no date line keeps the stamp under its title. Overlap with the date text checked at 320-1920. */
.pg-trail .hs__band .flavor + .qdone { margin-top: -34px; }
/* two date lines (UberStrategist) run long enough under 901px that the stamp would land on the second one */
@media (max-width: 900px) { .pg-trail .hs__band .flavor--2 + .qdone { margin-top: 6px; } }
