/* only the layout this page truly needs; the look lives in ../kit/pages.css */
.wrap.then { max-width: none; height: 100dvh; padding-bottom: 0; display: flex; flex-direction: column; padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
/* a long press on the map or the 3D view must not select the page's words */
.wrap.then { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.wrap.then input { -webkit-user-select: text; user-select: text; }
.then .top, .jump { flex: none; }
.jump { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; }
.jump .chips { flex: 1; min-width: 0; margin: 0 calc(-1 * max(var(--gutter), env(safe-area-inset-right))) 0 0; padding: 0 30px 0 0; align-items: center; }
.then .chip { padding: 12px 14px; }
.find { flex: none; margin: 0; }
.find input { width: 168px; min-height: 40px; padding: 7px 14px 7px 36px; border: 0; border-radius: 999px; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rule); font: 600 16px/1.2 var(--sans); -webkit-appearance: none; appearance: none;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='6.5' cy='6.5' r='4.6' fill='none' stroke='%23857968' stroke-width='1.8'/%3E%3Cpath d='M10.2 10.2l4 4' stroke='%23857968' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 13px center / 15px; }
.find input::-webkit-search-decoration { display: none; }
.find input.miss { box-shadow: inset 0 0 0 2px var(--bad); }
.find input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }

#map { position: relative; flex: 1; min-height: 0; margin: 0 calc(-1 * max(var(--gutter), env(safe-area-inset-right))) 0 calc(-1 * max(var(--gutter), env(safe-area-inset-left))); overflow: hidden; }
#map.leaflet-container { background: var(--soft) !important; }

/* the year on each side: a picker, so it carries a chevron. Dark glass in light and dark alike. */
.yr { position: absolute; top: 10px; z-index: 600; -webkit-appearance: none; appearance: none; min-height: 44px; border: 0; border-radius: 999px; padding: 10px 32px 10px 16px; color: #FFFDF8; font: 800 17px/1 var(--sans); box-shadow: 0 1px 6px rgba(0, 0, 0, .35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  background: rgba(27, 24, 20, .84) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23FFFDF8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 13px center / 10px 6px; }
.yr::picker-icon { display: none; }
.yr.a { left: calc(10px + env(safe-area-inset-left)); }
.yr.b { right: calc(10px + env(safe-area-inset-right)); }
.yr:focus { outline: none; }
.yr:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.yr.wait { animation: breathe 1s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .5; } }

/* the divider: the strip itself lets taps through; the line and the knob take the finger */
.bar { position: absolute; top: 0; bottom: 0; width: 48px; margin-left: -24px; z-index: 550; pointer-events: none; }
.bar i { position: absolute; left: 15px; top: 0; bottom: 0; width: 18px; pointer-events: auto; touch-action: none; cursor: ew-resize; }
.bar i::before { content: ""; position: absolute; left: 7.5px; top: 0; bottom: 0; width: 3px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 0 12px rgba(0, 0, 0, .3); }
.knob { position: absolute; left: 0; top: 76%; width: 48px; height: 48px; margin-top: -24px; padding: 0; border: 1px solid rgba(43, 36, 29, .18); border-radius: 999px; background: #FFFDF8; color: #2B241D; display: grid; place-items: center; pointer-events: auto; touch-action: none; cursor: ew-resize; box-shadow: 0 2px 10px rgba(0, 0, 0, .4); transition: top .25s ease, transform .12s ease; }
.knob svg { width: 24px; height: 24px; }
.knob:active { transform: scale(1.08); }
.knob:focus { outline: none; }
.knob:focus-visible { box-shadow: 0 0 0 3px var(--accent), 0 2px 10px rgba(0, 0, 0, .4); }
#map.open .knob { top: 22%; }

/* an old photo, where it was taken */
.dot { background: none; border: 0; }
.dot span { display: block; width: 34px; height: 34px; margin: 5px; border: 2.5px solid #fff; border-radius: 50%; background: #C94F1E center / cover; box-shadow: 0 1px 6px rgba(0, 0, 0, .5); transition: width .15s ease, height .15s ease, margin .15s ease; }
.dot:focus { outline: none; }
.dot:focus-visible span { box-shadow: 0 0 0 3px var(--accent), 0 1px 6px rgba(0, 0, 0, .5); }
#map.far .dot span { width: 14px; height: 14px; margin: 15px; background-image: none !important; }

.here { position: absolute; right: calc(10px + env(safe-area-inset-right)); bottom: 28px; z-index: 600; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 999px; background: var(--card); color: var(--ink); display: grid; place-items: center; box-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.here svg { width: 24px; height: 24px; }
.here.wait { animation: breathe 1s ease-in-out infinite; }
.play { position: absolute; right: calc(10px + env(safe-area-inset-right)); bottom: 84px; z-index: 600; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 999px; background: var(--card); color: var(--ink); display: grid; place-items: center; box-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.play svg { width: 24px; height: 24px; }
.play .halt, #map.playing .play .go { display: none; }
#map.playing .play .halt { display: block; }
.cube { position: absolute; right: calc(10px + env(safe-area-inset-right)); bottom: 140px; z-index: 600; width: 46px; height: 46px; border-radius: 999px; background: var(--card); color: var(--ink) !important; display: grid; place-items: center; box-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.cube svg { width: 24px; height: 24px; }
.cube[hidden], #map.playing .cube, #map.open .cube { display: none; }
#map.playing .play { background: var(--accent); color: var(--accent-ink); }
#map.playing .yr.a, #map.playing .bar, #map.playing .none { display: none; }
#map.playing .yr.b { opacity: 1; color: #FFFDF8; -webkit-text-fill-color: #FFFDF8; font-size: 22px; padding: 12px 20px; background-image: none; }
#map.open .play, #map.open .here { display: none; }
.none { position: absolute; top: 50%; z-index: 540; transform: translate(-50%, -50%); padding: 8px 14px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font: 700 13.5px/1 var(--sans); white-space: nowrap; pointer-events: none; }

#map .leaflet-control-attribution { margin: 0; padding: 1px 8px; border-radius: 8px 0 0 0; background: rgba(27, 24, 20, .72) !important; color: rgba(255, 255, 255, .92) !important; font: 600 10px/1.6 var(--sans); }
#map .leaflet-control-attribution a { color: inherit !important; text-decoration: none; }

/* Street View beside the pin */
#map .sv .leaflet-popup-content-wrapper { padding: 0; border-radius: 999px; background: var(--card); box-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
#map .sv .leaflet-popup-content { margin: 0; }
#map .sv .leaflet-popup-tip-container { display: none; }
#map .sv .door { display: block; padding: 12px 16px; background: none; color: var(--ink); font: 700 14px/1 var(--sans); white-space: nowrap; }

/* the sheet of old photos */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1100; max-height: 62%; overflow-y: auto; padding: 12px var(--gutter) calc(14px + env(safe-area-inset-bottom)); border-radius: var(--radius) var(--radius) 0 0; background: var(--card); box-shadow: 0 -6px 24px rgba(0, 0, 0, .28); }
.sheet[hidden] { display: none; }
#map .sheet a { color: inherit; }
.sheet .acts { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet .acts b { flex: 1; min-width: 0; font: 700 17px/1.2 var(--serif); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet .door { padding: 12px 16px; }
.sheet .x { flex: none; width: 40px; height: 40px; border: 0; border-radius: 999px; background: var(--soft); color: var(--ink); font: 700 18px/1 var(--sans); }
.sheet iframe { display: block; width: 100%; height: 40vh; max-height: 380px; margin-top: 10px; border: 0; border-radius: 12px; background: var(--soft); }
.old { display: flex; gap: 10px; overflow-x: auto; margin: 12px calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter); scroll-padding: 0 var(--gutter); scroll-snap-type: x mandatory; scrollbar-width: none; }
.old::-webkit-scrollbar { display: none; }
.old a { flex: none; width: min(72vw, 260px); text-decoration: none; scroll-snap-align: start; }
.old img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--rule); border-radius: 12px; background: var(--soft); }
.old b { display: block; margin-top: 7px; font: 700 14px/1.25 var(--sans); }
.old span { display: block; margin-top: 2px; font: 600 12px/1.3 var(--sans); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (orientation: landscape) and (max-height: 500px) {
  .then .top { padding: 6px 0 4px; } .then .top h1 { font-size: 17px; }
  .jump { padding-bottom: 6px; }
  .play { bottom: 28px; right: calc(66px + env(safe-area-inset-right)); } .cube { bottom: 28px; right: calc(122px + env(safe-area-inset-right)); }
  .sheet { left: auto; right: calc(8px + env(safe-area-inset-right)); bottom: 8px; width: 46%; max-height: 86%; border-radius: var(--radius); }
}
@media (min-width: 900px) {
  .sheet { left: auto; right: 72px; bottom: 28px; width: 420px; max-height: 70%; border-radius: var(--radius); }
  #map.open .play, #map.open .here, #map.open .cube:not([hidden]) { display: grid; }
  #map.open .knob { top: 76%; }
}
