/* The Layman's Lantern — Bible Maps (pairs with bible-maps.js) */
.bm-panel {
  --bm-ink: var(--ink, #241a10);
  --bm-gold: var(--lit-accent, var(--gold, #9a7a2e));
  --bm-rule: var(--rule, #ddd0b4);
  --bm-muted: var(--muted, #655740);
  --bm-card: var(--paper-card, #fbf8ef);
  --bm-rubric: #8b2a1d;
  box-sizing: border-box;
  max-width: 900px;
  margin: 6px auto 28px;
  padding: 0;
  border: 1px solid var(--bm-rule);
  background: var(--bm-card);
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 10px 30px -22px rgba(36,26,16,.55);
}
.bm-panel[hidden] { display: none; }
.bm-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 4px; border-bottom: 1px solid var(--bm-rule); }
.bm-panel.is-collapsed .bm-head { border-bottom: 0; }
.bm-toggle {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 6px 8px; cursor: pointer; text-align: left; color: var(--bm-ink);
}
.bm-ico { width: 22px; height: 22px; flex: none; color: var(--bm-gold); display: inline-flex; }
.bm-ico svg, .bm-chev svg { width: 100%; height: 100%; }
.bm-titles { display: flex; flex-direction: column; min-width: 0; }
.bm-title { font-family: var(--display, 'Cinzel', serif); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep, #7d6224); }
.bm-sub { font-family: var(--head, 'Cormorant Garamond', serif); font-style: italic; font-size: 16px; color: var(--bm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-chev { width: 18px; height: 18px; margin-left: auto; color: var(--bm-muted); transition: transform .2s; }
.bm-panel.is-collapsed .bm-chev { transform: rotate(-90deg); }
.bm-actions { display: flex; gap: 6px; flex: none; }
.bm-panel.is-collapsed .bm-actions, .bm-panel.is-collapsed .bm-body { display: none; }
.bm-btn, .bm-link, .bm-chipmore {
  font-family: var(--display, 'Cinzel', serif); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--bm-ink); background: transparent; border: 1px solid var(--bm-rule); padding: 6px 10px; cursor: pointer;
}
.bm-btn:hover, .bm-chipmore:hover { border-color: var(--gold-deep, #7d6224); color: var(--gold-deep, #7d6224); }
.bm-btn:focus-visible, .bm-chipmore:focus-visible, .bm-link:focus-visible, .bm-toggle:focus-visible, .bm-chip:focus-visible, .bm-pop-verses button:focus-visible, .bm-pop-more:focus-visible {
  outline: 2px solid var(--bm-rubric, #8b2a1d); outline-offset: 2px;
}
.bm-pill:focus-visible { outline: 2px solid var(--champagne, #c9a85a); outline-offset: 3px; }
.bm-link { border: 0; padding: 0; color: var(--gold-deep, #7d6224); text-decoration: underline; text-underline-offset: 3px; }
.bm-body { padding: 10px 10px 8px; }
.bm-away { font-family: var(--head, serif); font-style: italic; color: var(--bm-muted); padding: 10px 6px; font-size: 16px; }

/* --- the map "plate" --- */
.bm-stage {
  position: relative; height: 380px; overflow: hidden; background: #ece2c4;
  border: 1px solid #b59a6a; outline: 1px solid #d8c69e; outline-offset: -5px;
  box-shadow: inset 0 0 0 4px #efe5c8;
}
.bm-stage .bm-map, .bm-stage .bm-map.maplibregl-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.bm-paper {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(ellipse at center, rgba(255,250,235,0) 55%, rgba(120,90,45,.22) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .35 0 0 0 0 .2 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
.bm-rose { position: absolute; z-index: 2; right: 12px; top: 12px; width: 54px; height: 54px; color: rgba(90,66,36,.72); pointer-events: none; }
.bm-msg {
  position: absolute; z-index: 3; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: 86%;
  background: rgba(251,248,239,.95); border: 1px solid var(--bm-rule, #ddd0b4); padding: 8px 12px;
  font-family: var(--body, serif); font-size: 15px; color: var(--bm-ink, #241a10); text-align: center;
}
.bm-stagebar { display: none; }

/* MapLibre chrome restyled */
.bm-stage .maplibregl-ctrl-group { background: rgba(251,248,239,.92); border-radius: 0; box-shadow: none; border: 1px solid #c7b48a; }
.bm-stage .maplibregl-ctrl-group button { width: 28px; height: 28px; }
.bm-stage .maplibregl-ctrl-group button + button { border-top: 1px solid #d8c69e; }
.bm-stage .maplibregl-ctrl-scale {
  background: rgba(251,248,239,.75); border: 1px solid #6e5634; border-top: 0; color: #5a4630;
  font-family: var(--head, serif); font-size: 12px; font-style: italic; padding: 0 5px;
}
.bm-stage .maplibregl-ctrl-top-left, .bm-stage .maplibregl-ctrl-bottom-left { z-index: 2; }
.bm-stage .maplibregl-cooperative-gesture-screen { font-family: var(--head, serif); font-size: 18px; background: rgba(36,26,16,.55); }

/* --- markers --- */
.bm-pin {
  position: relative; display: block; width: 12px; height: 12px; padding: 0; margin: 0; border: 0; background: none; cursor: pointer;
}
.bm-dot {
  position: absolute; left: 1px; top: 1px; width: 10px; height: 10px; border-radius: 50%;
  background: #fbf6e6; border: 1.6px solid #3c2b18; box-sizing: border-box;
}
.bm-dot::after { content: ''; position: absolute; left: 2.2px; top: 2.2px; width: 2.4px; height: 2.4px; border-radius: 50%; background: #3c2b18; }
.bm-c1 .bm-dot, .bm-c0 .bm-dot { border-style: dashed; }
.bm-c0 .bm-dot::after { display: none; }
.bm-t-m .bm-dot { border-radius: 0; border: 0; background: none; width: 0; height: 0; left: 0; top: 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid #5a4024; }
.bm-t-m .bm-dot::after { display: none; }
.bm-t-w .bm-dot { border-color: #3f6a78; background: #dde8e4; }
.bm-t-w .bm-dot::after { background: #3f6a78; }
.bm-label {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%); white-space: nowrap;
  font-family: var(--body, 'EB Garamond', serif); font-size: 14.5px; line-height: 1.05; color: #2b1f12; letter-spacing: .01em;
  text-shadow: 0 0 2px #f3ead2, 0 0 3px #f3ead2, 0 0 5px #f3ead2;
  pointer-events: auto;
}
.bm-t-w .bm-label { color: #2f5866; font-style: italic; }
.bm-pin.is-area { width: auto; height: auto; }
.bm-pin.is-area .bm-label {
  position: static; transform: none; display: block;
  font-family: var(--display, 'Cinzel', serif); font-size: 12.5px; letter-spacing: .32em; text-transform: uppercase; color: rgba(74,52,28,.86);
}
.bm-pin.is-area.bm-t-w .bm-label { font-family: var(--head, serif); font-size: 15px; letter-spacing: .12em; text-transform: none; color: #2f5866; font-style: italic; }
.bm-pin.lp-l .bm-label { left: auto; right: 15px; }
.bm-pin.lp-t .bm-label { left: 50%; top: auto; bottom: 13px; transform: translateX(-50%); }
.bm-pin.lp-b .bm-label { left: 50%; top: 13px; transform: translateX(-50%); }
.bm-pin.no-label .bm-label { display: none; }
.bm-pin.is-near .bm-dot { box-shadow: 0 0 0 3px rgba(154,122,46,.35); }
.bm-pin.is-near .bm-label { font-weight: 600; }
.bm-pin.is-hot .bm-dot, .bm-pin:hover .bm-dot, .bm-pin:focus-visible .bm-dot { box-shadow: 0 0 0 4px rgba(139,42,29,.25); }
.bm-pin.is-hot .bm-label, .bm-pin:hover .bm-label { display: block; color: #8b2a1d; }
.bm-pin.is-sel { z-index: 3; }
.bm-pin.is-sel .bm-dot { background: #8b2a1d; border-color: #5c1a11; }
.bm-pin.is-sel .bm-dot::after { background: #fbf6e6; }
.bm-pin.is-sel .bm-label { display: block; color: #8b2a1d; font-weight: 600; }
.bm-pin.is-sel.bm-t-m .bm-dot { border-bottom-color: #8b2a1d; background: none; }
.bm-pin:focus-visible { outline: 2px solid #8b2a1d; outline-offset: 3px; }
.bm-pin.is-sel .bm-dot { animation: bm-pulse 1.6s ease-out 2; }
@keyframes bm-pulse { 0% { box-shadow: 0 0 0 0 rgba(139,42,29,.5); } 100% { box-shadow: 0 0 0 14px rgba(139,42,29,0); } }

.bm-water { pointer-events: none; }
.bm-water span { display: inline-block; font-family: var(--head, 'Cormorant Garamond', serif); font-style: italic; color: rgba(40,78,92,.95); white-space: nowrap; letter-spacing: .14em; }
.bm-water-sea span { font-size: 17px; letter-spacing: .3em; }
.bm-water-lake span { font-size: 13px; }
.bm-water-river span { font-size: 13px; }

/* --- popup --- */
.bm-popup .maplibregl-popup-content {
  background: #fbf8ef; border: 1px solid #c7b48a; border-radius: 0; padding: 12px 14px 10px;
  box-shadow: 0 10px 24px -12px rgba(36,26,16,.5); font-family: var(--body, serif); color: #241a10;
}
.bm-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: #c7b48a; }
.bm-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: #c7b48a; }
.bm-popup.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: #c7b48a; }
.bm-popup.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: #c7b48a; }
.bm-popup .maplibregl-popup-close-button { font-size: 18px; color: #655740; padding: 2px 7px; }
.bm-pop-kicker { font-family: var(--display, serif); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-deep, #7d6224); }
.bm-pop-name { font-family: var(--head, serif); font-size: 24px; font-weight: 600; line-height: 1.1; margin: 2px 0 2px; }
.bm-pop-alt, .bm-pop-today { font-size: 15px; color: #655740; font-style: italic; }
.bm-pop-today em { font-style: normal; }
.bm-pop-conf { font-size: 14px; margin-top: 6px; color: #3d5a2a; }
.bm-pop-conf.bm-c1, .bm-pop-conf.bm-c0 { color: #8b5a1d; }
.bm-pop-verses { margin-top: 8px; font-size: 14.5px; }
.bm-pop-verses button {
  font: inherit; font-size: 13.5px; background: none; border: 1px solid #ddd0b4; padding: 1px 6px; margin: 2px 2px 0 0; cursor: pointer; color: #241a10;
}
.bm-pop-verses button:hover { border-color: #8b2a1d; color: #8b2a1d; }
.bm-pop-more { display: inline-block; margin-top: 9px; font-size: 14px; color: var(--gold-deep, #7d6224); }

/* --- place chips --- */
.bm-chips { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.bm-chips li[hidden] { display: none; }
.bm-chip {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--body, serif); font-size: 15px; color: var(--bm-ink);
  background: #fffdf7; border: 1px solid var(--bm-rule); padding: 3px 9px 3px 7px; cursor: pointer; line-height: 1.3;
}
.bm-chip:hover { border-color: var(--bm-gold); }
.bm-chip.is-sel { border-color: var(--bm-rubric); color: var(--bm-rubric); }
.bm-chipdot { width: 7px; height: 7px; border-radius: 50%; border: 1.4px solid #3c2b18; background: #fbf6e6; }
.bm-chip.bm-c1 .bm-chipdot, .bm-chip.bm-c0 .bm-chipdot { border-style: dashed; }
.bm-chip.is-unknown { color: var(--bm-muted); font-style: italic; }
.bm-chip.is-unknown .bm-chipdot { border-color: transparent; background: none; }
.bm-chip.is-unknown .bm-chipdot::before { content: '?'; font-size: 12px; position: relative; top: -5px; left: -1px; color: var(--bm-muted); }
.bm-chipv { font-size: 12.5px; color: var(--bm-muted); font-variant-numeric: oldstyle-nums; }
.bm-credit { margin: 10px 2px 0; font-family: var(--body, serif); font-size: 12.5px; line-height: 1.45; color: var(--bm-muted); }
.bm-credit a { color: inherit; }

/* --- names inside the Scripture text --- */
.bm-name {
  cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-decoration-color: rgba(154,122,46,.75);
  text-decoration-thickness: 1.5px; text-underline-offset: 3px; border-radius: 2px;
}
.bm-name:hover, .bm-name.is-hot { text-decoration-color: #8b2a1d; color: #6f2016; }
.bm-name.is-sel { background: rgba(139,42,29,.08); text-decoration-style: solid; text-decoration-color: #8b2a1d; }
.bm-name:focus-visible { outline: 2px solid #8b2a1d; outline-offset: 2px; }
.bible-verse-wrap.bm-flash { animation: bm-flash 1.8s ease-out; }
@keyframes bm-flash { 0%, 30% { background: rgba(201,168,90,.28); } 100% { background: transparent; } }

/* --- floating dock & enlarged view --- */
.bm-dock { position: fixed; z-index: 900; left: 18px; bottom: 18px; width: min(400px, calc(100vw - 36px)); background: #fbf8ef; border: 1px solid #b59a6a; box-shadow: 0 18px 40px -16px rgba(26,18,11,.55); }
.bm-dock[hidden] { display: none; }
.bm-dock .bm-stage { height: 330px; border: 0; }
.bm-dock .bm-stagebar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; position: absolute; z-index: 4; left: 0; right: 0; top: 0;
  padding: 6px 8px; background: linear-gradient(rgba(251,248,239,.97), rgba(251,248,239,.85));
  border-bottom: 1px solid #d8c69e;
}
.bm-dock .bm-stagetitle { font-family: var(--display, serif); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep, #7d6224); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-dock .bm-stagebtns { display: flex; gap: 6px; }
.bm-dock .bm-btn { padding: 4px 8px; font-size: 12px; background: #fbf8ef; }
.bm-dock .maplibregl-ctrl-top-left { top: 40px; }
.bm-dock .bm-rose { top: 46px; width: 44px; height: 44px; }
.bm-dock.is-full { left: 24px; right: 24px; top: 24px; bottom: 24px; width: auto; }
.bm-dock.is-full .bm-stage { height: 100%; }
.bm-dock.is-full::before { content: ''; position: fixed; inset: 0; background: rgba(26,18,11,.55); z-index: -1; }
html.bm-noscroll, html.bm-noscroll body { overflow: hidden; }
.bm-pill {
  position: fixed; z-index: 899; left: 18px; bottom: 18px; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display, serif); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--paper, #f6f1e6); background: var(--espresso, #1a120b); border: 1px solid var(--champagne, #c9a85a);
  padding: 9px 14px 9px 10px; cursor: pointer; box-shadow: 0 8px 22px -10px rgba(0,0,0,.6);
}
.bm-pill[hidden] { display: none; }
.bm-pill .bm-ico { width: 18px; height: 18px; color: var(--champagne, #c9a85a); }

@media (max-width: 700px) {
  .bm-panel { margin: 4px -4px 22px; }
  .bm-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  .bm-chips li { flex: none; }
  .bm-chips li[hidden] { display: list-item; }
  .bm-chipmore { display: none; }
  .bm-stage { height: 280px; }
  .bm-actions .bm-btn[data-bm-act="full"] { display: none; }
  .bm-label { font-size: 13.5px; }
  .bm-rose { width: 40px; height: 40px; }
  .bm-dock { left: 0; right: 0; bottom: 0; width: auto; border-left: 0; border-right: 0; }
  .bm-dock .bm-stage { height: 44vh; }
  .bm-dock.is-full { left: 0; right: 0; top: 0; bottom: 0; }
  .bm-pill { left: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .bm-pin.is-sel .bm-dot, .bible-verse-wrap.bm-flash { animation: none; }
}
@media print { .bm-panel, .bm-dock, .bm-pill { display: none !important; } }
