/*! Bayfield Interactive Map v1.0.0 — every rule is scoped to .bfm so theme styles stay out and ours stay in.
   Override the --bfm-* tokens on .bfm to match a theme. */
.bfm {
  --bfm-font: inherit;
  --bfm-display: inherit;
  --bfm-size: 15px;
  --bfm-ink: #1d2b2a;
  --bfm-muted: #56645f;
  --bfm-panel: #ffffff;
  --bfm-soft: #f1f4f2;
  --bfm-line: #d5ddd9;
  --bfm-accent: #2f5d62;
  --bfm-hl: #ffd23f;
  --bfm-water: #a7dcef;
  --bfm-radius: 12px;
  --bfm-r: #d0212c;
  --bfm-d: #f3c419;
  --bfm-e: #2e63b3;
  --bfm-s: #378a2c;
  container-type: inline-size;
  display: flex; flex-direction: column; gap: 10px;
  font-family: var(--bfm-font); font-size: var(--bfm-size); line-height: 1.4; color: var(--bfm-ink);
  text-align: left; -webkit-text-size-adjust: 100%;
}
.bfm *, .bfm *::before, .bfm *::after { box-sizing: border-box; }
.bfm [hidden] { display: none !important; }

/* Neutralize theme button/list/input styles */
.bfm .bfm-b {
  -webkit-appearance: none; appearance: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: none;
  box-shadow: none; color: inherit; font: inherit; line-height: inherit; letter-spacing: normal; text-transform: none;
  text-decoration: none; text-shadow: none; width: auto; height: auto; min-width: 0; min-height: 0; cursor: pointer; text-align: inherit;
}
.bfm ul, .bfm li { list-style: none; margin: 0; padding: 0; }
.bfm li::before, .bfm li::marker { content: none; }
.bfm p { margin: 0; }
.bfm .bfm-b:focus-visible, .bfm .bfm-a:focus-visible, .bfm .bfm-search:focus-visible, .bfm summary:focus-visible {
  outline: 3px solid var(--bfm-accent); outline-offset: 2px;
}

/* Category colors */
.bfm .bfm-r { --c: var(--bfm-r); } .bfm .bfm-d { --c: var(--bfm-d); }
.bfm .bfm-e { --c: var(--bfm-e); } .bfm .bfm-s { --c: var(--bfm-s); }
.bfm .bfm-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.bfm .bfm-badge {
  flex: none; display: inline-grid; place-items: center; min-width: 2.15em; height: 2.15em; padding: 0 .4em; border-radius: 99px;
  background: var(--c); color: #fff; font-size: .8em; font-weight: 700; line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.bfm .bfm-badge.bfm-d { color: #1d1d1d; }
.bfm .bfm-badge.bfm-lg { font-size: .95em; }

/* Category chips: one scrollable row on phones */
.bfm .bfm-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.bfm .bfm-chips::-webkit-scrollbar { display: none; }
.bfm .bfm-chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px 7px 9px; border-radius: 99px;
  background: var(--bfm-panel); border: 1px solid var(--bfm-line); font-size: .87em; font-weight: 600; white-space: nowrap;
  transition: opacity .15s, border-color .15s;
}
.bfm .bfm-chip:hover { border-color: var(--bfm-accent); }
.bfm .bfm-chip[aria-pressed="false"] { opacity: .45; }

/* Layout: stacked by default, side-by-side when the container is wide */
.bfm .bfm-body { display: grid; gap: 10px; }
.bfm .bfm-vp {
  position: relative; overflow: hidden; border-radius: var(--bfm-radius); background: var(--bfm-water); border: 1px solid var(--bfm-line);
  height: clamp(320px, 62vh, 560px); touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.bfm .bfm-vp.bfm-drag { cursor: grabbing; }
.bfm .bfm-side {
  background: var(--bfm-panel); border: 1px solid var(--bfm-line); border-radius: var(--bfm-radius);
  display: flex; flex-direction: column; min-height: 0; max-height: 440px; overflow: hidden;
}
@container (min-width: 860px) {
  .bfm .bfm-body { grid-template-columns: minmax(0, 1fr) 290px; }
  .bfm .bfm-vp { height: auto; aspect-ratio: 3795 / 2475; max-height: 85vh; }
  .bfm .bfm-side { height: 0; min-height: 100%; max-height: none; }
}

/* Map stage */
.bfm .bfm-stage { position: absolute; left: 0; top: 0; width: 3795px; height: 2475px; transform-origin: 0 0; will-change: transform; }
.bfm .bfm-stage.bfm-anim { transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.bfm .bfm-img, .bfm .bfm-svg {
  position: absolute; left: 0; top: 0; width: 3795px !important; height: 2475px !important; max-width: none !important;
  margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; display: block;
}
.bfm .bfm-img { pointer-events: none; background: var(--bfm-water); }
.bfm .bfm-svg { overflow: visible; }
.bfm .bfm-bldg {
  fill: rgba(255, 255, 255, .06); stroke: #fff; stroke-width: 2px; stroke-dasharray: 6 4; stroke-linejoin: round;
  vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .15s, stroke .15s;
}
.bfm .bfm-hit { fill: transparent; cursor: pointer; }
.bfm .bfm-ring { fill: none; stroke: var(--bfm-hl); stroke-width: 6px; opacity: 0; transform-box: fill-box; transform-origin: center; }
.bfm .bfm-spot { transition: opacity .2s; }
.bfm .bfm-spot:hover .bfm-bldg, .bfm .bfm-spot.bfm-on .bfm-bldg {
  fill: rgba(255, 210, 63, .3); stroke: var(--bfm-hl); stroke-dasharray: none; stroke-width: 3.5px;
}
.bfm .bfm-spot:hover .bfm-ring, .bfm .bfm-spot.bfm-on .bfm-ring { opacity: 1; animation: bfm-pulse 1.4s ease-out infinite; }
.bfm .bfm-spot.bfm-off { opacity: .12; pointer-events: none; }
@keyframes bfm-pulse { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }

/* Zoom controls + hint */
.bfm .bfm-ctrl { position: absolute; right: 10px; top: 10px; z-index: 3; display: flex; flex-direction: column; gap: 6px; }
.bfm .bfm-zb {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--bfm-panel); color: var(--bfm-ink);
  border: 1px solid var(--bfm-line); box-shadow: 0 2px 6px rgba(0, 0, 0, .15); font-size: 19px; font-weight: 600; line-height: 1;
}
.bfm .bfm-zb svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; }
.bfm .bfm-hint {
  position: absolute; left: 50%; bottom: 12px; z-index: 3; transform: translateX(-50%); max-width: calc(100% - 24px);
  background: rgba(20, 32, 31, .86); color: #fff; font-size: .82em; padding: 6px 12px; border-radius: 99px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; pointer-events: none; opacity: 0; transition: opacity .3s;
}
.bfm .bfm-hint.bfm-show { opacity: 1; }

/* Detail card: floats beside the building, becomes a bottom sheet in narrow embeds */
.bfm .bfm-card {
  position: absolute; z-index: 4; width: 296px; max-width: calc(100% - 20px); transform: translateX(-50%);
  /* category band painted as a background so it follows the rounded corners */
  background: linear-gradient(var(--c, var(--bfm-accent)), var(--c, var(--bfm-accent))) top / 100% 5px no-repeat, var(--bfm-panel);
  color: var(--bfm-ink); border-radius: var(--bfm-radius);
  box-shadow: 0 12px 32px rgba(20, 40, 38, .2), 0 2px 6px rgba(20, 40, 38, .12); padding: 18px 15px 13px; cursor: auto;
}
.bfm .bfm-card[data-cat="r"] { --c: var(--bfm-r); } .bfm .bfm-card[data-cat="d"] { --c: var(--bfm-d); }
.bfm .bfm-card[data-cat="e"] { --c: var(--bfm-e); } .bfm .bfm-card[data-cat="s"] { --c: var(--bfm-s); }
.bfm .bfm-card::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; background: var(--bfm-panel);
  transform: translateX(-50%) rotate(45deg); border-radius: 2px;
}
.bfm .bfm-card[data-pos="below"]::after { bottom: auto; top: -12px; background: var(--c); }
.bfm .bfm-card[data-pos="free"]::after { display: none; }
.bfm.bfm-narrow .bfm-card { left: 8px !important; right: 8px; top: auto !important; bottom: 8px; width: auto; max-width: none; transform: none; max-height: calc(100% - 16px); overflow: auto; }
.bfm.bfm-narrow .bfm-card::after { display: none; }
.bfm.bfm-narrow .bfm-card { padding: 16px 13px 11px; max-height: 64%; }
.bfm.bfm-narrow .bfm-near { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -13px; padding-right: 13px; }
.bfm.bfm-narrow .bfm-near::-webkit-scrollbar { display: none; }
.bfm.bfm-narrow .bfm-nb { flex: none; }
.bfm .bfm-card-top { display: flex; gap: 10px; align-items: center; }
.bfm .bfm-name { font-family: var(--bfm-display); font-size: 1.22em; font-weight: 700; line-height: 1.15; }
.bfm .bfm-cat { font-size: .72em; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--bfm-muted); margin-top: 2px; }
.bfm .bfm-multi { margin-top: 10px; display: grid; gap: 7px; }
.bfm .bfm-multi li { display: flex; align-items: center; gap: 9px; }
.bfm .bfm-mt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bfm .bfm-multi b { font-weight: 600; line-height: 1.2; }
.bfm .bfm-multi small { font-size: .78em; color: var(--bfm-muted); }
.bfm .bfm-near { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-size: .82em; }
.bfm .bfm-near > span { color: var(--bfm-muted); font-weight: 600; margin-right: 2px; }
.bfm .bfm-nb {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 9px 3px 3px; border-radius: 99px;
  background: var(--bfm-soft); border: 1px solid var(--bfm-line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bfm .bfm-nb:hover { border-color: var(--bfm-accent); }
.bfm .bfm-nb .bfm-badge { font-size: .72em; }
.bfm .bfm-actions { display: flex; gap: 8px; align-items: center; margin-top: 11px; }
.bfm .bfm-actions:empty { display: none; }
.bfm .bfm-a { color: var(--bfm-accent); font-weight: 600; text-decoration: none; box-shadow: none; border: 0; }
.bfm .bfm-a:hover { text-decoration: underline; }
.bfm .bfm-pill { font-size: .86em; border: 1px solid var(--bfm-line); border-radius: 99px; padding: 5px 11px; }
.bfm .bfm-pill:hover { border-color: var(--bfm-accent); text-decoration: none; }
.bfm .bfm-close { margin-left: auto; padding: 5px 4px; color: var(--bfm-muted); font-size: .86em; font-weight: 600; }

/* Place list */
.bfm .bfm-find { padding: 10px; border-bottom: 1px solid var(--bfm-line); }
.bfm .bfm-search {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: auto; margin: 0; padding: 8px 12px;
  font: inherit; font-size: 16px; line-height: 1.3; color: var(--bfm-ink); background: var(--bfm-soft);
  border: 1px solid var(--bfm-line); border-radius: 8px; box-shadow: none;
}
.bfm .bfm-search::placeholder { color: var(--bfm-muted); opacity: 1; }
.bfm .bfm-list { flex: 1; min-height: 0; overflow: auto; padding: 4px 6px 8px; overscroll-behavior: contain; }
.bfm .bfm-group {
  display: flex; align-items: center; gap: 7px; padding: 10px 8px 4px; font-size: .72em; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--bfm-muted);
}
.bfm .bfm-row { display: flex; align-items: center; gap: 9px; width: 100%; padding: 5px 8px; border-radius: 8px; font-size: .93em; }
.bfm .bfm-rn { min-width: 0; line-height: 1.25; }
.bfm .bfm-row:hover { background: var(--bfm-soft); }
.bfm .bfm-row.bfm-cur { background: color-mix(in srgb, var(--bfm-hl) 30%, transparent); }
.bfm .bfm-beyond { border-top: 1px solid var(--bfm-line); font-size: .9em; }
.bfm .bfm-beyond summary { cursor: pointer; padding: 10px 14px; font-weight: 600; color: var(--bfm-accent); }
.bfm .bfm-beyond[open] { max-height: 50%; overflow: auto; }
.bfm .bfm-area { padding: 0 14px 12px; }
.bfm .bfm-area b { display: block; }
.bfm .bfm-area small { display: block; color: var(--bfm-muted); margin-bottom: 4px; }
.bfm .bfm-area li { padding: 2px 0; }
.bfm .bfm-area .bfm-a { font-weight: 500; }
.bfm .bfm-credit { font-size: .75em; color: var(--bfm-muted); }

@media (prefers-reduced-motion: reduce) {
  .bfm .bfm-stage.bfm-anim { transition: none; }
  .bfm .bfm-ring { animation: none !important; }
}
