/* The tour embed (GT-12, GT-D65): only the map's own rules, for a host page that writes every word itself, as Fly's
   embed.css does. The stage, the poster, the map, the labels over it, the credit line, the chapter tab bar, the scroll
   rail and its counter, the hold steps' scroll room and the no-map fallbacks; nothing for html, body, a, main, the cards
   or the footer, so the host's own styles stay as they are. The host sets --plate, --accent, --text and --font on :root
   (content.json brand), and --tour-top to its own fixed header's height (the tab bar sits under it).
   The map's text takes the tour page's base font here, so the labels draw the same pixels under any host's body font. */
#stage, #stage *, #labels *, #credit, #chapters, #chapters *, #rail, #rail *, #rail-count, .maplabel { box-sizing: border-box; }
#labels, #credit, #chapters, #rail-count, .maplabel { font: 500 18px/1.45 var(--font, system-ui), system-ui, -apple-system, sans-serif; }
#stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
#stage img, #map { position: absolute; inset: 0; width: 100%; height: 100%; }
#stage img { object-fit: cover; object-position: top center; transition: opacity 0.4s; }
html.live #stage img { opacity: 0; }
#map { opacity: 0; }
html.live #map { opacity: 1; }
/* the sections scroll over the map: the host's #story sits above it */
#story { position: relative; z-index: 1; }
/* GT-D49: the featured village's name over the map, real HTML, placed by tour.js */
.maplabel { position: fixed; left: 0; top: 0; z-index: 0; margin: 0; padding: 3px 9px; background: rgba(20, 33, 43, 0.88); color: var(--text, #fff); font-weight: 700; font-size: 15px; border-radius: 3px; opacity: 0; pointer-events: none; white-space: nowrap; }
html:not(.live) .maplabel, html.static .maplabel { display: none; }
@media (prefers-reduced-motion: reduce) { .maplabel { display: none; } }
/* no map: reduced motion, Save-Data, no WebGL. MapLibre is never loaded; the host shows each shot's stills in its card. */
html.static #stage { display: none; }
@media (prefers-reduced-motion: reduce) { #stage { display: none; } }
/* the export and stills mode (?export=1): the map alone */
html.bare #story, html.bare #stage img { display: none; }
/* the tour's own rules (tour.css), less the cards, the page's padding and the footer */
#chapters { position: fixed; top: var(--tour-top, 0px); left: 0; right: 0; z-index: 3; display: flex; gap: 4px; overflow-x: auto; padding: 6px 8px; background: #14212b; scrollbar-width: none; font-size: 13px; }   /* GT-10c: opaque, so no card shows through it */
#chapters a { flex: none; color: var(--text); text-decoration: none; padding: 4px 9px; border-radius: 3px; opacity: 0.75; white-space: nowrap; }
#chapters a.on { background: var(--accent); color: var(--plate); opacity: 1; font-weight: 700; }
#chapters .n { margin-right: 0.3em; }
/* the labels: real HTML over the map, each a name with a small category icon, a pointer under it */
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cu-label { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 5px; padding: 3px 8px 3px 6px; margin-top: -8px; background: rgba(255, 255, 255, 0.96); color: #1d2a33; font-weight: 600; font-size: 13px; line-height: 1.2; border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); white-space: nowrap; opacity: 0; }
/* a long name wraps on a narrow screen instead of running off it */
.cu-label span { white-space: normal; max-width: min(15rem, 62vw); }
.cu-label::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: rgba(255, 255, 255, 0.96); }
.cu-label .cu-ic { flex: none; color: #2f5d73; }
.cu-label.cu-head { font-size: 15px; font-weight: 700; padding: 4px 10px 4px 7px; background: var(--accent); color: var(--plate); }
.cu-label.cu-head::after { border-top-color: var(--accent); }
.cu-label.cu-head .cu-ic { color: var(--plate); }
.cu-label.cu-street { background: transparent; box-shadow: none; color: #4a4033; font-style: italic; font-weight: 600; }
.cu-label.cu-street::after { display: none; }
html:not(.closeup) .cu-label.cu-street { color: var(--text); text-shadow: 0 1px 2px #000; }
.cu-label.cu-toward::after { display: none; }
.cu-label.cu-confirm { outline: 2px dashed #b33; }
.cu-label em { font-style: normal; font-size: 10px; color: #b33; text-transform: uppercase; }
/* the credit line, on every frame (its words change with the shot's sources) */
#credit { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; margin: 0; padding: 4px 8px; text-align: center; font-size: 11px; line-height: 1.3; background: rgba(20, 33, 43, 0.82); color: var(--text); pointer-events: none; }
html.bare #credit { bottom: 3%; left: 5%; right: 5%; border-radius: 3px; font-size: 12px; }
html.bare #chapters { display: none; }
html.static #chapters { position: sticky; }
html.static #credit, html.static #labels { display: none; }
@media (prefers-reduced-motion: reduce) { #credit, #labels { display: none; } }
.cu-label.cu-center::after { display: none; }
.cu-label.cu-center { border: 1px dashed rgba(29, 42, 51, 0.35); }
/* a hold step (GT-D75): scroll room over the held map, no card */
section.stop.hold { min-height: 135vh; }
html.static section.stop.hold { display: none; }
@media (prefers-reduced-motion: reduce) { section.stop.hold { display: none; } }
/* labels with lines under the name: a building and what's in it */
.cu-label.cu-multi { align-items: flex-start; white-space: normal; }
.cu-label.cu-multi span b { display: block; font-weight: 700; }
.cu-label.cu-multi span small { display: block; font-size: 12px; font-weight: 500; line-height: 1.3; }
/* GT-D73, GT-D77: Gray's office. Text only, white on SIR Blue (#002349, Pantone 289, Sotheby's International Realty's
   brand guidelines; about 15:1, AA), larger than the other labels */
.cu-label.cu-marker-office { background: #002349; color: #fff; padding: 6px 12px; font-size: 15px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45); }
.cu-label.cu-marker-office::after { border-top-color: #002349; }
.cu-label.cu-marker-office span b { font-size: 17px; }
.cu-label.cu-marker-office span small { font-size: 12.5px; font-weight: 500; opacity: 1; }
/* a highlighted spot (The Icehouse, GT-10c): gold, a little larger (dark text on gold, about 9:1) */
.cu-label.cu-highlight { background: #e3b341; color: #14212b; font-size: 15px; padding: 5px 10px 5px 8px; }
.cu-label.cu-highlight::after { border-top-color: #e3b341; }
.cu-label.cu-highlight .cu-ic { color: #14212b; }
.cu-label.cu-marker-office span { max-width: min(24rem, 88vw); }
/* labels at one point, listed together: every name the same weight */
.cu-label.cu-list span b, .cu-label.cu-list span small { font-size: 13px; font-weight: 600; }
/* GT-D88: the scroll rail (its counter, "3 of 6", sits just under the rail's bottom end, so labels at the right edge
   stay clear of it). 4 px track, 40% of the screen tall, centred, its right edge 10 px in from the screen's; a dim
   neutral track (dark with a light edge, so it reads on light and dark ground) with the gold fill, dots for the turns
   (past filled, current gold and larger, still to come hollow).
   Full while scrolling, 40% after a second at rest. It sits between the tab bar and the credit line on every screen. */
#rail { position: fixed; z-index: 4; right: 6px; top: 30vh; width: 12px; height: 40vh; pointer-events: none; opacity: 0.4; transition: opacity 0.5s ease; }
#rail::before { content: ''; position: absolute; left: 4px; top: 0; bottom: 0; width: 4px; border-radius: 2px; background: rgba(20, 33, 43, 0.45); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4); }
#rail .fill { position: absolute; left: 4px; top: 0; width: 4px; height: 100%; border-radius: 2px; background: var(--accent); transform-origin: top; transform: scaleY(0); }
/* readable on the light close-ups and the dark flyovers alike: a dark ring with a light edge */
#rail .dots b { position: absolute; left: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; box-sizing: border-box; border-radius: 50%; border: 2px solid #14212b; background: transparent; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85); }
#rail .dots b.past { background: #14212b; }
#rail .dots b.now { width: 12px; height: 12px; margin: -6px 0 0 -6px; background: var(--accent); border: 2px solid #14212b; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85); }
#rail-count { position: fixed; z-index: 4; right: 4px; top: calc(70vh + 8px); padding: 1px 6px; font-size: 11px; font-weight: 700; line-height: 1.4; white-space: nowrap; border-radius: 3px; background: rgba(20, 33, 43, 0.88); color: var(--text); pointer-events: none; opacity: 0.4; transition: opacity 0.5s ease; }
#rail-count[hidden] { display: none; }
html.rail-on #rail, html.rail-on #rail-count { opacity: 1; transition-duration: 0.12s; }
html.flat-param #rail, html.flat-param #rail-count { transition: none; }
@media (prefers-reduced-motion: reduce) { #rail, #rail-count { transition: none; } }
html.bare #rail, html.bare #rail-count { display: none; }
