/* MapLibre's late-loaded .maplibregl-map rule must not collapse this layer. */
.home-map > .home-map__live { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0; }
.home-map.has-3d .home-map__live { opacity: 1; }
.home-map.has-3d > .home-map__pin, .home-map.has-3d > .home-map__north, .home-map.has-3d > .home-map__credit { visibility: hidden; }
.home-map.has-3d::after { background: linear-gradient(180deg, transparent 88%, rgb(241 242 237 / 85%)); }
.home-map { --map-paper: #f1f2ed; --map-ink: #234a47; --map-dock-top: 7.5rem; background: var(--map-paper); }
.home-map__paper { position: absolute; inset: 0; z-index: 1; pointer-events: none; background-image: url('../images/map-paper-grain.svg'); opacity: .35; }
/* Noninteractive labels never intercept a map drag. Only buttons/links do. */
.home-map.has-3d .home-map__caption { pointer-events: none; }
.home-map.has-3d .home-map__caption a { pointer-events: auto; }
.home-map[data-place] .home-map__caption { visibility: hidden; }
.home-map__dock { position: absolute; z-index: 4; top: var(--map-dock-top); left: 1.2rem; width: calc(100% - 2.4rem); max-width: 34rem; display: grid; gap: .35rem; pointer-events: none; }
.home-map__dock button, .home-map__place-info a { pointer-events: auto; }
.home-map__control-bar { display: flex; flex-wrap: wrap; background: var(--white); border: 1px solid var(--rule); box-shadow: 0 2px 12px rgb(21 35 29 / 8%); }
.home-map__tools { display: grid; flex: 1 1 11.4rem; grid-template-columns: 2.75rem minmax(5.9rem, 1fr) 2.75rem; }
.home-map__tools button, .home-map__zoom button { display: grid; place-items: center; min-width: 0; min-height: 2.75rem; padding: .3rem; border: 0; background: transparent; color: var(--ink); font: 400 1.3rem/1.3 var(--body); -webkit-text-stroke: 0; }
.home-map__tools [data-map-action='view'] { font-size: .75rem; font-weight: 650; }
.home-map__tools [data-map-action='orbit'] { font-size: .7rem; -webkit-text-stroke: var(--stroke-body) currentColor; }
.home-map__tools button { border-left: 1px solid var(--rule); }
.home-map__tools button:hover:not(:disabled), .home-map__tools button[aria-pressed='true'], .home-map__zoom button:hover:not(:disabled) { background: var(--map-ink); color: #fff; }
.home-map__dock :focus-visible, .home-map__zoom :focus-visible { outline: 2px solid currentColor; outline-offset: -4px; }
.home-map__places { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); min-width: 0; border: 1px solid var(--rule); background: var(--white); box-shadow: 0 2px 12px rgb(21 35 29 / 8%); }
.home-map__return, .home-map__place-list button { min-width: 0; min-height: 2.75rem; padding: .4rem .3rem; border: 0; background: var(--white); color: var(--ink); font-size: .72rem; line-height: 1.4; text-align: center; }
.home-map__return { color: var(--map-ink); text-decoration: underline; text-underline-offset: .25em; }
.home-map__return::before { content: '↶'; margin-right: .25rem; -webkit-text-stroke: 0; }
.home-map__return:hover, .home-map__place-list button:hover { background: #e5ebe7; }
.home-map__place-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
.home-map__place-list button { border-left: 1px solid var(--rule); }
.home-map__place-list button[aria-pressed='true'] { background: var(--map-ink); color: #fff; }
.home-map__zoom { position: absolute; z-index: 3; right: max(.8rem, env(safe-area-inset-right)); top: max(calc(var(--map-dock-top) + 6.5rem), calc(50% - 2.75rem)); display: grid; width: 2.75rem; border: 1px solid var(--rule); background: var(--white); box-shadow: 0 2px 12px rgb(21 35 29 / 8%); }
.home-map__zoom button + button { border-top: 1px solid var(--rule); }
.home-map__gesture-hint { display: none; margin: 0; width: fit-content; font: 400 .65rem/1.45 var(--body); -webkit-text-stroke: 0; color: var(--ink); text-shadow: 0 1px 3px var(--paper), 0 -1px 3px var(--paper); }
.home-map.is-expanded .home-map__gesture-hint { display: block; }
.home-map__editions { display: flex; flex: 1 1 6.75rem; min-width: 0; }
.home-map__editions button { flex: 1; min-height: 2.75rem; padding: .4rem .5rem; border: 0; background: transparent; color: var(--map-ink); font-size: .72rem; line-height: 1.4; white-space: nowrap; }
.home-map__editions button + button { border-left: 1px solid var(--rule); }
.home-map__editions button[aria-pressed='true'] { color: #fff; background: var(--map-ink); }
.home-map__editions button:hover:not([aria-pressed='true']) { background: #e5ebe7; }
.home-map__edition-status, .home-map__model-status { margin: 0; padding: .5rem .7rem; max-width: 36rem; background: var(--white); border-left: 2px solid var(--map-ink); font-size: .75rem; line-height: 1.5; }
.home-map__historical-caption { position: absolute; z-index: 2; left: 1.4rem; right: 1.4rem; bottom: 2.8rem; width: fit-content; max-width: calc(100% - 2.8rem); padding: 0; color: var(--map-ink); pointer-events: none; text-shadow: 0 1px 5px var(--map-paper), 0 -1px 5px var(--map-paper); }
.home-map__historical-title { font: 470 clamp(2rem, 3.5vw, 4.2rem)/1.12 var(--display); -webkit-text-stroke: var(--stroke-display) currentColor; margin: .15rem 0 .3rem; }
.home-map__historical-caption > p:not(.home-map__historical-title), .home-map__historical-caption > a { font-size: .72rem; line-height: 1.55; }
.home-map__historical-caption > a { display: inline-flex; align-items: center; min-height: 2.75rem; pointer-events: auto; }
.home-map__historical-credit { position: absolute; z-index: 4; right: .4rem; bottom: .2rem; max-width: calc(100% - .8rem); padding: .4rem .5rem; background: var(--map-paper); font: 400 .6rem/1.45 var(--body); -webkit-text-stroke: 0; }
.home-map__archive-link { position: absolute; z-index: 3; left: 1rem; top: 8rem; background: var(--map-paper); padding: .6rem; font-size: .75rem; }
.home-map.has-3d .home-map__archive-link { display: none; }
.home-map[data-edition='1689'] { --map-paper: #e9dcc1; --map-ink: #514333; }
.home-map.has-3d[data-edition='1689']::after { background: linear-gradient(180deg, transparent 68%, rgb(233 220 193 / 90%) 95%); }
.home-map[data-edition='1689'] .home-map__paper { opacity: .65; }
.home-map[data-edition='1689'] .home-map__caption, .home-map.has-3d[data-edition='1689'] .home-map__live-credit { display: none; }
.home-map[data-edition='1689'][data-place] .home-map__historical-caption { visibility: hidden; }
.home-map[data-edition='1689'] .map-marker--poi { background: var(--map-paper); }
.home-map[data-edition='1689'] .map-marker--poi[aria-pressed='true'] { background: #514333; color: #fffdf6; }
.home-map__place-info { position: absolute; z-index: 3; inset: auto 1.2rem 3rem; max-height: 32%; overflow-y: auto; padding: .85rem 1rem; border-left: 3px solid #994c28; background: var(--white); }
.home-map__place-title { font: 470 1.55rem/1.2 var(--display); -webkit-text-stroke: var(--stroke-display) currentColor; }
.home-map__place-info > p:not(.home-map__place-title) { font-size: .75rem; line-height: 1.5; margin-top: .35rem; max-width: 44rem; }
.home-map__place-info > a { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: .72rem; }
.home-map .map-marker { color: var(--ink); font: 400 .72rem/1.3 var(--body); -webkit-text-stroke: .4px currentColor; text-decoration: none; transition: none; }
.home-map .map-marker--foundation { display: block; width: max-content; white-space: nowrap; padding: .5rem .75rem; pointer-events: none; background: var(--petrol); color: var(--paper); font: 470 1.3rem/1.15 var(--display); -webkit-text-stroke: var(--stroke-display) currentColor; box-shadow: 0 3px 9px rgb(21 35 29 / 12%); }
.map-marker--foundation::after, .map-marker--poi::after { content: ''; position: absolute; left: calc(50% - 5px); bottom: -9px; border: 5px solid transparent; border-top-color: var(--petrol); }
.map-marker--foundation::after { top: -9px; bottom: auto; border-top-color: transparent; border-bottom-color: var(--petrol); }
.home-map .map-marker--poi { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: .4rem; border: 1px solid #748778; border-radius: 50%; background: var(--paper); box-shadow: 0 2px 8px rgb(21 35 29 / 10%); cursor: pointer; }
.home-map .map-marker--poi[aria-pressed='true'] { visibility: hidden; }
/* The opening is already a close view of the passage; keep its architecture
   clear. The persistent, keyboard-accessible landmark button remains visible. */
.home-map[data-edition='1689']:not([data-place]) .map-marker--poi[data-place-id='historic-passage'] { visibility: hidden; }
.home-map .map-marker--poi:hover, .home-map .map-marker--poi[aria-pressed='true'] { background: #994c28; color: var(--paper); }
.home-map .map-marker--poi[aria-pressed='true']::after { border-top-color: #994c28; }
.home-map .maplibregl-canvas:focus-visible { outline: 2px solid var(--petrol); outline-offset: -4px; }
.home-map .maplibregl-cooperative-gesture-screen { font: 400 .8rem/1.5 var(--body); -webkit-text-stroke: var(--stroke-body) currentColor; pointer-events: none; }
.home-map__live-credit { display: none; position: absolute; z-index: 4; right: .4rem; bottom: .2rem; max-width: calc(100% - .8rem); padding: .35rem .5rem; background: var(--paper); text-align: right; font: 400 .58rem/1.4 var(--body); -webkit-text-stroke: 0; }
.home-map.has-3d .home-map__live-credit { display: block; }
.home-map__data-note:not([hidden]) { display: block; color: #803819; font-size: .65rem; line-height: 1.45; margin-bottom: .2rem; }
.home-map[data-building-state='partial'] .home-map__place-info { bottom: 4rem; }
.home-map.has-3d[data-building-state='partial'] .home-map__caption { bottom: 4rem; }
.home-map.is-expanded { --map-dock-top: max(1rem, env(safe-area-inset-top)); position: fixed; inset: 0; z-index: 30; width: 100%; height: 100vh; height: 100dvh; }
.home-map.is-expanded .home-map__caption { inset: auto var(--gutter) max(2rem, env(safe-area-inset-bottom)); }
@media (max-width: 999px) {
  .home-map { --map-dock-top: 6.75rem; }
  .home-map__dock { left: .6rem; width: calc(100% - 1.2rem); }
}
@media (max-width: 759px) {
  .home-map { --map-dock-top: .6rem; }
  .home-map__dock { left: max(.5rem, env(safe-area-inset-left)); right: max(.5rem, env(safe-area-inset-right)); width: auto; }
  .home-map__return, .home-map__place-list button { font-size: .7rem; }
  .home-map__gesture-hint { display: none; }
  .home-map__historical-caption { left: .8rem; right: .8rem; bottom: 2.7rem; max-width: calc(100% - 1.6rem); }
  .home-map:not(.is-expanded) .home-map__historical-caption > .eyebrow, .home-map:not(.is-expanded) .home-map__historical-caption > p:not(.home-map__historical-title) { display: none; }
  .home-map:not(.is-expanded) .home-map__historical-title { font-size: 1.65rem; margin: 0; }
  .home-map__historical-caption > a { font-size: .65rem; }
  .home-map__historical-credit { font-size: .53rem; bottom: max(.1rem, env(safe-area-inset-bottom)); }
  .home-map__archive-link { top: .75rem; }
  .home-map__place-info { left: .6rem; right: .6rem; bottom: max(2.5rem, env(safe-area-inset-bottom)); padding: .6rem .8rem; }
  .home-map__place-title { font-size: 1.35rem; }
  .home-map.has-3d:not(.is-expanded) .home-map__caption { left: .7rem; bottom: 2.5rem; max-width: 55%; }
  .home-map.has-3d:not(.is-expanded) .home-map__caption > div { display: none; }
  .home-map.has-3d:not(.is-expanded) .home-map__directions { font-size: .65rem; }
  .home-map.is-expanded .home-map__caption { max-width: none; bottom: max(2rem, env(safe-area-inset-bottom)); }
  .home-map__live-credit { font-size: .52rem; bottom: max(.1rem, env(safe-area-inset-bottom)); }
}
@media (max-height: 520px) and (min-width: 760px) { .home-map:not(.is-expanded) { --map-dock-top: 4.5rem; } .home-map__gesture-hint { display: none; } }
/* Touch users retain native two-finger gestures and the orbit control. */
@media (pointer: coarse) {
  .home-map.is-expanded .home-map__gesture-hint { display: none; }
}
