/* ManassasNow interactive map — all rules scoped under .mnow-map */
.mnow-map {
  --mnow-paper: #f5f7f3;
  --mnow-ink: #17262a;
  --mnow-brick: #b0452e;
  --mnow-gold: #e2a63a;
  --mnow-muted: #4d5c60;
  --mnow-line: #d5dbd4;
  --mnow-shadow: 0 10px 28px rgba(23, 38, 42, 0.18);
  box-sizing: border-box;
  font-family: Archivo, "Segoe UI", system-ui, sans-serif;
  color: var(--mnow-ink);
  width: 100%;
  max-width: 100%;
  background: var(--mnow-paper);
}

.mnow-map *,
.mnow-map *::before,
.mnow-map *::after {
  box-sizing: border-box;
}

.mnow-map__intro {
  margin: 0 0 0.75rem;
}

.mnow-map__intro h2 {
  margin: 0 0 0.2rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--mnow-ink);
}

.mnow-map__intro p {
  margin: 0;
  color: var(--mnow-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.mnow-map__frame {
  position: relative;
  width: 100%;
  /* Bigger than the prototype: the map is the page's main feature. */
  height: clamp(560px, 78vh, 820px);
  min-height: 560px;
  border: 1px solid var(--mnow-line);
  border-radius: 14px;
  overflow: hidden;
  background: #e6ebe4;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.mnow-map__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mnow-map__canvas .maplibregl-canvas:focus,
.mnow-map__canvas .maplibregl-canvas:focus-visible {
  outline: 3px solid var(--mnow-brick);
  outline-offset: -3px;
}

.mnow-map .maplibregl-ctrl-group {
  border: 1px solid var(--mnow-line);
  box-shadow: 0 2px 8px rgba(23, 38, 42, 0.12);
  border-radius: 8px;
  overflow: hidden;
}

.mnow-map .maplibregl-ctrl-group button {
  width: 32px;
  height: 32px;
}

.mnow-map .maplibregl-ctrl-top-left {
  max-width: calc(100% - 72px);
}

.mnow-map .maplibregl-ctrl-attrib {
  font-size: 10px;
  line-height: 1.35;
  background: rgba(245, 247, 243, 0.92);
  color: var(--mnow-ink);
  border-radius: 6px;
  margin: 8px;
  max-width: 100%;
}

.mnow-map .maplibregl-ctrl-attrib a {
  color: var(--mnow-brick);
}

/* Markers: pin tip is the anchor. Labels are absolutely positioned
   so they do not change the hit-box height or pull the tip off the building.
   Logos sit in a rounded-square badge with padding and object-fit: contain
   so they are never cropped. */
.mnow-map__marker {
  /* Must stay absolute (MapLibre positions markers with a transform from 0,0).
     "relative" made markers flow inline, shifting each pin 48px per pin before it. */
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 58px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  z-index: 1;
}

.mnow-map__marker.is-active {
  z-index: 4;
}

.mnow-map__pulse {
  position: absolute;
  left: 50%;
  top: -4px;
  width: 54px;
  height: 54px;
  margin-left: -27px;
  border-radius: 14px;
  border: 2px solid var(--mnow-gold);
  background: rgba(226, 166, 58, 0.16);
  animation: mnow-map-pulse 2.4s ease-out infinite;
  pointer-events: none;
}

.mnow-map__pulse--late {
  animation-delay: 1.2s;
}

.mnow-map__marker.is-sample .mnow-map__pulse {
  border-color: var(--mnow-gold);
  background: rgba(226, 166, 58, 0.14);
}

/* Rounded-square logo badge. Overflow is hidden only after padding has
   inset the image, so object-fit: contain keeps the full mark visible. */
.mnow-map__logo {
  position: absolute;
  left: 50%;
  top: 0;
  width: 46px;
  height: 46px;
  margin-left: -23px;
  padding: 5px;
  box-sizing: border-box;
  border-radius: 10px;
  border: 2px solid var(--mnow-gold);
  background: var(--mnow-logo-back, var(--mnow-ink));
  box-shadow:
    0 0 0 3px rgba(226, 166, 58, 0.28),
    0 2px 6px rgba(23, 38, 42, 0.35);
  overflow: hidden;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mnow-map__marker.is-backing-paper .mnow-map__logo {
  background: var(--mnow-paper);
}

/* Square site-icon marks already have padding in the artwork. */
.mnow-map__marker.is-square-pin .mnow-map__logo {
  padding: 3px;
}

.mnow-map__logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}

.mnow-map__logo-fallback {
  color: var(--mnow-paper);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.mnow-map__tip {
  position: absolute;
  left: 50%;
  top: 40px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: var(--mnow-gold);
  transform: rotate(45deg);
  border-radius: 0 0 2px 0;
  box-shadow: 1px 1px 3px rgba(23, 38, 42, 0.28);
  z-index: 0;
}

.mnow-map__label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(245, 247, 243, 0.94);
  border: 1px solid var(--mnow-line);
  color: var(--mnow-ink);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(23, 38, 42, 0.12);
}

.mnow-map__marker[data-label-side="left"] .mnow-map__label {
  left: auto;
  right: calc(100% - 4px);
  transform: none;
  top: 6px;
  margin-top: 0;
}

.mnow-map__marker[data-label-side="right"] .mnow-map__label {
  left: calc(100% - 4px);
  transform: none;
  top: 6px;
  margin-top: 0;
}

.mnow-map__marker:focus,
.mnow-map__marker:focus-visible {
  outline: none;
}

.mnow-map__marker:focus-visible .mnow-map__logo {
  outline: 3px solid var(--mnow-ink);
  outline-offset: 3px;
}

/* Bottom-docked card lives in the frame (sibling of the canvas), so it
   cannot be clipped by MapLibre's overflow:hidden popup pane — the bug
   that cut off Battlefield guide popups on a 390px phone. */
.mnow-map__card {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 5;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.9rem 2.4rem 0.95rem 0.9rem;
  background: var(--mnow-paper);
  color: var(--mnow-ink);
  border: 1px solid var(--mnow-line);
  border-left: 4px solid var(--mnow-brick);
  border-radius: 12px;
  box-shadow: var(--mnow-shadow);
  max-height: calc(100% - 20px);
  overflow: auto;
}

.mnow-map__card[hidden] {
  display: none !important;
}

.mnow-map__card.is-sample {
  border-left-color: var(--mnow-gold);
}

.mnow-map__card-logo {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  padding: 6px;
  box-sizing: border-box;
  border-radius: 12px;
  background: var(--mnow-ink);
  color: var(--mnow-paper);
  border: 2px solid var(--mnow-gold);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  object-fit: contain;
  object-position: center;
  overflow: hidden;
}

img.mnow-map__card-logo {
  display: block;
}

.mnow-map__card.is-backing-paper .mnow-map__card-logo {
  background: var(--mnow-paper);
}

.mnow-map__card .mnow-map__card-logo {
  background: var(--mnow-card-logo-back, var(--mnow-ink));
}

.mnow-map__card.is-backing-paper .mnow-map__card-logo {
  background: var(--mnow-card-logo-back, var(--mnow-paper));
}

.mnow-map__card-body {
  flex: 1 1 auto;
  min-width: 0;
}

.mnow-map__badge {
  display: inline-block;
  margin: 0 0 0.25rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--mnow-gold);
  color: var(--mnow-ink);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mnow-map__card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.mnow-map__blurb,
.mnow-map__addr {
  margin: 0 0 0.3rem;
  font-size: 0.88rem;
  line-height: 1.4;
}

.mnow-map__addr {
  color: var(--mnow-muted);
}

.mnow-map__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin: 0.45rem 0 0;
}

.mnow-map__links a {
  color: var(--mnow-brick);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mnow-map__links a:hover,
.mnow-map__links a:focus-visible {
  color: var(--mnow-ink);
}

.mnow-map__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--mnow-ink);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.mnow-map__close:hover,
.mnow-map__close:focus-visible {
  background: rgba(23, 38, 42, 0.08);
  outline: none;
}

.mnow-map__credit {
  margin: 0.55rem 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--mnow-muted);
}

.mnow-map__credit a {
  color: var(--mnow-brick);
}

@keyframes mnow-map-pulse {
  0% {
    transform: scale(0.72);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.45);
    opacity: 0;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

.mnow-map__label-short {
  display: none;
}

@media (max-width: 640px) {
  .mnow-map__label-full {
    display: none;
  }
  .mnow-map__label-short {
    display: inline;
  }
}

@media (min-width: 700px) {
  .mnow-map__card {
    left: 50%;
    right: auto;
    width: min(420px, calc(100% - 20px));
    transform: translateX(-50%);
  }
}

@media (max-width: 400px) {
  .mnow-map__frame {
    height: min(78vh, 660px);
    min-height: 480px;
    border-radius: 10px;
  }

  .mnow-map__card {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 0.8rem 2.2rem 0.85rem 0.75rem;
    gap: 0.7rem;
  }

  .mnow-map__card-logo {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
    padding: 5px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mnow-map__pulse {
    animation: none !important;
    opacity: 0.4;
    transform: scale(1.2);
  }

  .mnow-map__pulse--late {
    display: none;
  }

  .mnow-map *,
  .mnow-map *::before,
  .mnow-map *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Tiers: basic = static badge, featured = glowing pulse (default),
   premier = larger badge with a stronger glow. */
.mnow-map__marker.is-tier-basic .mnow-map__pulse {
  display: none;
}

.mnow-map__marker.is-tier-premier {
  width: 56px;
  height: 66px;
}

.mnow-map__marker.is-tier-premier .mnow-map__logo {
  width: 54px;
  height: 54px;
  margin-left: -27px;
  box-shadow:
    0 0 0 4px rgba(226, 166, 58, 0.4),
    0 3px 8px rgba(23, 38, 42, 0.4);
}

.mnow-map__marker.is-tier-premier .mnow-map__pulse {
  width: 62px;
  height: 62px;
  margin-left: -31px;
}

.mnow-map__marker.is-tier-premier .mnow-map__tip {
  top: 48px;
}

/* Theme resets: some themes style every button and img. */
.mnow-map button.mnow-map__marker,
.mnow-map button.mnow-map__close {
  min-height: 0;
  box-shadow: none;
  text-transform: none;
  letter-spacing: normal;
}

.mnow-map .mnow-map__logo img,
.mnow-map img.mnow-map__card-logo {
  max-width: none;
}

/* Card floating beside the tapped pin (positioned by mnow-map.js). */
.mnow-map__card.is-floating {
  --mnow-card-edge: var(--mnow-brick);
  right: auto;
  bottom: auto;
  transform: none;
  width: 340px;
  max-width: calc(100% - 16px);
  overflow: visible;
}

.mnow-map__card.is-floating.is-sample {
  --mnow-card-edge: var(--mnow-gold);
}

.mnow-map__card.is-floating::before {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border: 9px solid transparent;
  pointer-events: none;
}

.mnow-map__card.is-floating.is-right::before {
  left: -22px;
  top: calc(var(--mnow-arrow-y, 40px) - 9px);
  border-right: 13px solid var(--mnow-card-edge);
}

.mnow-map__card.is-floating.is-left::before {
  right: -19px;
  top: calc(var(--mnow-arrow-y, 40px) - 9px);
  border-left: 10px solid var(--mnow-paper);
  filter: drop-shadow(1px 0 0 var(--mnow-line));
}

.mnow-map__card.is-floating.is-below::before {
  top: -19px;
  left: calc(var(--mnow-arrow-x, 40px) - 9px);
  border-bottom: 10px solid var(--mnow-paper);
  filter: drop-shadow(0 -1px 0 var(--mnow-line));
}

.mnow-map__card.is-floating.is-above::before {
  bottom: -19px;
  left: calc(var(--mnow-arrow-x, 40px) - 9px);
  border-top: 10px solid var(--mnow-paper);
  filter: drop-shadow(0 1px 0 var(--mnow-line));
}

@media (max-width: 520px) {
  .mnow-map__card.is-floating {
    width: 300px;
  }
}

/* "In view now" list under the map. */
.mnow-map__list {
  margin: 1.5rem 0 0;
}

.mnow-map__list-title {
  margin: 0 0 0.2rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--mnow-ink);
}

.mnow-map__list-count {
  color: var(--mnow-muted);
  font-weight: 600;
}

.mnow-map__list-hint,
.mnow-map__list-empty {
  margin: 0 0 0.85rem;
  color: var(--mnow-muted);
  font-size: 0.9rem;
}

.mnow-map__list-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.75rem;
}

.mnow-map__item {
  margin: 0;
  padding: 0.75rem 0.85rem;
  background: #fff;
  border: 1px solid var(--mnow-line);
  border-left: 4px solid var(--mnow-brick);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.mnow-map__item.is-active {
  border-color: var(--mnow-gold);
  box-shadow: 0 0 0 2px rgba(226, 166, 58, 0.35);
}

.mnow-map button.mnow-map__item-btn {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 0;
  box-shadow: none;
  text-transform: none;
  letter-spacing: normal;
}

.mnow-map__item-btn:focus-visible {
  outline: 3px solid var(--mnow-brick);
  outline-offset: 3px;
  border-radius: 8px;
}

.mnow-map .mnow-map__item-logo {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  max-width: none;
  padding: 5px;
  box-sizing: border-box;
  border-radius: 10px;
  border: 2px solid var(--mnow-gold);
  object-fit: contain;
  object-position: center;
  display: block;
}

.mnow-map__item-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.mnow-map__item-name {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.25;
}

.mnow-map__item-name .mnow-map__badge {
  margin: 0 0 0 0.3rem;
  vertical-align: middle;
}

.mnow-map__item-blurb {
  font-size: 0.88rem;
  line-height: 1.4;
}

.mnow-map__item-addr {
  font-size: 0.85rem;
  color: var(--mnow-muted);
}

.mnow-map__item-links {
  display: flex;
  gap: 0.85rem;
  padding-left: calc(52px + 0.75rem);
}

.mnow-map__item-links a {
  color: var(--mnow-brick);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 520px) {
  .mnow-map__list-items {
    grid-template-columns: 1fr;
  }
}

/* Area jump buttons (1.2.0) */
.mnow-map__areas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}
.mnow-map__area {
  appearance: none;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.55rem 0.95rem;
  min-height: 40px;
  border: 1.5px solid var(--mnow-line);
  border-radius: 999px;
  background: #fff;
  color: var(--mnow-ink);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.mnow-map__area:hover {
  border-color: var(--mnow-brick);
}
.mnow-map__area:focus-visible {
  outline: 3px solid var(--mnow-gold);
  outline-offset: 2px;
}
.mnow-map__area.is-active {
  background: var(--mnow-brick);
  border-color: var(--mnow-brick);
  color: #fff;
}
@media (max-width: 500px) {
  .mnow-map__areas {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .mnow-map__areas::-webkit-scrollbar { display: none; }
  .mnow-map__area { flex: 0 0 auto; font-size: 0.88rem; }
}

/* 1.3.0: "Latest from Manassas NOW" story link on the card */
.mnow-map__story {
  margin: 0.4rem 0 0.1rem;
  padding: 0.45rem 0.55rem;
  border-left: 3px solid var(--mnow-gold);
  background: rgba(23, 38, 42, 0.05);
  border-radius: 0 6px 6px 0;
  font-size: 0.85rem;
  line-height: 1.35;
}

.mnow-map__story-kicker {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--mnow-muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mnow-map__story a {
  color: var(--mnow-ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--mnow-brick);
  text-underline-offset: 2px;
}

.mnow-map__story a:hover,
.mnow-map__story a:focus-visible {
  color: var(--mnow-brick);
}
