html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-color: black;
}

/* #MapStage is the element that goes full screen.
   #MapFrame is exactly as large as the map. The navbar, tools, carousel and
   "Display Captions" button are positioned against it, so in full screen
   they stay on the map and never drift onto the black bands */
#MapFrame {
  position: relative;
}

#MapCarousel {
  width: 100%;
}

#MapCarousel .carousel-inner,
#MapCarousel .carousel-item {
  width: 100%;
}

.carousel-map-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-map-wrapper img.map-img {
  display: block;
  width: 100%;
  height: 100%;
}

.carousel-item img.photo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* No touch-action override: native pinch-zoom keeps working */
.carousel-map-wrapper svg.hotspot-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible; /* pins near the edge are drawn in full */
}

/* Clip only left and right (needed for the slide animation).
   "clip" does not create a scrollable area, so the sliding photos
   cannot make the page scroll. Pins may still extend above the map */
#MapCarousel .carousel-inner {
  overflow-x: clip;
  overflow-y: visible;
}

/* =====================
   NAVBAR AND TOOLS
   ===================== */
/* Overlays the top of the map, but scrolls away with it */
.map-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
}

/* Only the logo and buttons of the navbar are clickable */
.navbar { pointer-events: none; }
.navbar a,
.navbar button { pointer-events: auto; }

/* Pin button, top right, just below the navbar */
.map-tools {
  position: absolute;
  top: 4rem;
  right: 0.75rem;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Round icon buttons (navbar and pin button) */
.tool-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tool-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Full screen icon: arrows apart / arrows together */
.fs-exit-icon { display: none; }
#MapStage.is-fullscreen .fs-enter-icon { display: none; }
#MapStage.is-fullscreen .fs-exit-icon { display: inline; }

/* Pin toggle icon: a slash through the pin while pins are hidden */
.tool-slash { display: none; }
.tool-btn.off .tool-slash { display: inline; }

/* Pins hidden on request */
#MapStage.pins-hidden .pin { display: none; }

/* Full screen: the map is as large as fits the screen, centered */
#MapStage.is-fullscreen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

/* The area outside the stage in full screen is black too */
#MapStage:fullscreen::backdrop { background: #000; }
#MapStage:-webkit-full-screen::backdrop { background: #000; }

#MapStage.is-fullscreen #MapFrame {
  width: min(100%, 177.78vh); /* 16:9 */
  margin: 0 auto;
}

/* Tooltips never catch the pointer, so they cannot get in the way of clicks */
.tooltip {
  pointer-events: none;
}

/* =====================
   PINS
   ===================== */
:root {
  --pin-color: #010100;    /* normal */
  --pin-hover: #d90000;    /* hover / keyboard focus */
  --pin-visited: #5c6670;  /* after the photo has been opened */
}

.pin {
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* Invisible, larger area that makes the pin easier to hit */
.pin-hit {
  fill: transparent;
  stroke: none;
}

/* The white edge is drawn first and the fill covers its inner half,
   so 2px of the 4px stroke shows outside the pin */
.pin-body {
  fill: var(--pin-color);
  stroke: #fff;
  stroke-opacity: 0.8;
  stroke-width: 4;
  stroke-linejoin: round;
  paint-order: stroke;
  transition: fill 0.15s ease;
}

.pin-dot {
  fill: #fff;
}

/* Checkmark in the white circle, only on visited pins */
.pin-check {
  display: none;
  fill: none;
  stroke: var(--pin-visited);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pin.visited .pin-body {
  fill: var(--pin-visited);
}

.pin.visited .pin-check {
  display: inline;
}

/* Hover only on devices that truly hover (avoids sticky hover on touch) */
@media (hover: hover) {
  .pin:hover .pin-body {
	fill: var(--pin-hover);
  }
}

.pin:focus-visible .pin-body {
  fill: var(--pin-hover);
}

.pin:focus-visible .pin-hit {
  stroke: #fff;
  stroke-opacity: 0.9;
  stroke-width: 2;
}

/* Back on the map: the pin just visited starts in its active (red) state
   and slowly fades to its normal visited gray */
.pin.fade-from-active .pin-body {
  animation: pin-fade 2s ease-out 1s backwards;
}

@keyframes pin-fade {
  from { fill: var(--pin-hover); }
}

@media (prefers-reduced-motion: reduce) {
  .pin.fade-from-active .pin-body { animation: none; }
}

/* =====================
   CAPTIONS
   ===================== */
/* Widest the caption box may become. It is centered when it hits this limit,
   which happens at a screen width of about 1280px (70% of 1280 = 896) */
:root {
  --caption-max: 56rem;
}

.carousel-caption {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 0.25rem;
  max-width: var(--caption-max);
  margin-left: auto;
  margin-right: auto;
}

.carousel-caption p {
  text-align: left;
}

/* Keeps the title clear of the close button */
.carousel-caption h2 {
  padding-right: 1.5rem;
}

.carousel-caption .caption-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

/* Hide all captions when the visitor closes one */
#MapCarousel.captions-hidden .carousel-caption {
  display: none;
}

/* Button that brings the captions back, at the bottom of the map area */
.caption-show {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 5;
  padding: 0.5rem 1rem;
  border: 0;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
  font-size: 0.75rem; /* 75% of the root size */
}

.caption-show:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* Caption padding */
.px-6 {
  padding-left: 4rem !important;
  padding-right: 4rem !important;
}

@media (min-width: 1200px) {
  .px-xl-6 {
	padding-left: 4rem !important;
	padding-right: 4rem !important;
  }
}

/* Let clicks pass through the wide prev/next buttons to the map beneath;
   only the arrow icons themselves stay clickable */
.carousel-control-prev,
.carousel-control-next {
  pointer-events: none;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  pointer-events: auto;
}

/* =====================
   INFO DIALOG
   ===================== */
.info-dialog {
  width: min(42rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0; /* keeps clicks outside the box on the backdrop */
  border: 0;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
}

.info-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.info-dialog-body {
  position: relative;
  padding: 1.75rem 2rem;
}

.info-dialog .info-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

/* =====================
   COORDINATE HELPER (only with ?place in the address)
   ===================== */
.place-mode .hotspot-overlay,
.place-mode .pin {
  cursor: crosshair;
}

.place-panel {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 1040;
  width: 17rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.85rem;
}

/* The preview marker is red, like a pin under the pointer, and never catches clicks */
.place-preview {
  pointer-events: none;
}

.place-preview .pin-body {
  fill: var(--pin-hover);
}
	
/* =====================
   MINI-MAP (on every photo)
   ===================== */
.minimap {
  position: absolute;
  top: 4rem; /* below the navbar: the corner where the pin button sits on the map */
  right: 0.75rem;
  z-index: 3;
  width: clamp(6.3rem, 16.1vw, 18.4rem); /* options: 5.5rem, 14vw, 16rem OR 10.75rem, 21vw, 24rem */
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 0.25rem;
  background: #000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.15s ease;
}

.minimap:hover,
.minimap:focus-visible {
  opacity: 1;
}

.minimap:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.minimap img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(0.25rem - 2px);
}

/* Same coordinates as the big map; the pin may stick out of the box, like on the map */
.minimap svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

/* The pin of this photo is always shown in its active (red) color */
.minimap .pin-body {
  fill: var(--pin-hover);
}

/* Closing the captions hides the mini-map too */
#MapCarousel.captions-hidden .minimap {
  display: none;
}

/* No mini-map on phones: too small to read, and in portrait the captions
   (and with them the mini-map) cannot be closed.
   Covers phones held upright (narrow screen) and on their side (short screen) */
@media (max-width: 767.98px), (max-height: 500px) {
  .minimap {
	display: none;
  }
}

/* =====================
   PHONES HELD UPRIGHT
   ===================== */
@media (orientation: portrait) and (max-width: 767.98px) {

  /* Captions cannot be closed here, so their instructions do not apply */
  .caption-tip {
	display: none;
  }

  /* Captions sit below the photo here, so full screen may need to scroll */
  #MapStage.is-fullscreen {
	overflow: auto;
  }

  /* The navbar takes its own space above the map instead of covering it */
  .map-nav {
	position: static;
	background: #000;
  }

  /* The caption sits below the photo instead of over it */
  .carousel-caption {
	position: static;
	padding-top: 0.75rem;
	padding-bottom: 1.5rem;
	background: transparent;
	border-radius: 0;
	text-align: left;
  }

  /* The caption no longer covers the photo, so there is nothing to close */
  .carousel-caption .caption-close,
  .caption-show {
	display: none !important;
  }

  #MapCarousel.captions-hidden .carousel-caption {
	display: block;
  }

  /* Arrows: centered on the photo area only, not on the caption below.
	 56.25vw is the height of a 16:9 photo at full width */
  .carousel-control-prev,
  .carousel-control-next {
	bottom: auto;
	height: 56.25vw;
  }
}