/* FLOODLIT map — styles. Dark by design; the map should look like what it is. */
.flm {
  --bg: #0f1114;
  --panel: #171a1f;
  --panel-2: #1f232a;
  --line: #2b3038;
  --text: #e9e6e1;
  --muted: #9a958d;
  --accent: #ff6b4a;           /* default pin */
  --yes: #ff3b2f;              /* church failed / covered up */
  --no: #4da3ff;               /* church reported / no cover-up alleged */
  --unk: #a39d94;              /* unknown */
  --focus: #ffd166;
  --ring: #ffd166;
  --accent-text: #140a07;
  --glass: rgba(15,17,20,.86);
  color: var(--text);
  background: var(--bg);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 560px;
  display: flex;
  overflow: hidden;
  box-sizing: border-box;
}
.flm.flm-mode-hero, .flm.flm-mode-mini { min-height: 260px; border-radius: 12px; }
.flm.flm-mode-mini { min-height: 240px; }
.flm *, .flm *::before, .flm *::after { box-sizing: inherit; }
.flm button, .flm input, .flm select { font: inherit; color: inherit; }
.flm a { color: #ffb199; }

/* ---------- side panel ---------- */
.flm-panel {
  width: 340px;
  flex: 0 0 340px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 3;
  transition: transform .25s ease;
}
.flm-panel-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.flm-brand { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.flm-brand h1 { font-size: 17px; margin: 0; letter-spacing: .02em; font-weight: 700; }
.flm-brand h1 span { color: var(--accent); }
.flm-count { font-size: 13px; color: var(--muted); margin-top: 4px; }
.flm-count strong { color: var(--text); font-weight: 600; }
.flm-panel-body { overflow-y: auto; overflow-x: hidden; padding: 8px 16px 24px; flex: 1; scrollbar-width: thin; }
.flm-section { border-bottom: 1px solid var(--line); padding: 10px 0; }
.flm-section:last-child { border-bottom: 0; }
.flm-section > summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; font-size: 14px; padding: 4px 0; user-select: none;
}
.flm-section > summary::-webkit-details-marker { display: none; }
.flm-section > summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.flm-section[open] > summary::after { content: "–"; }
.flm-section .flm-badge:empty { display: none; }
.flm-section .flm-badge { font-size: 11px; background: var(--panel-2); color: var(--muted); border-radius: 10px; padding: 1px 7px; margin-left: 6px; font-weight: 500; }

.flm-search { width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); margin: 6px 0 2px; }
.flm-search:focus { outline: 2px solid var(--focus); outline-offset: 1px; }

.flm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.flm-chip {
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 4px 10px; font-size: 13px;
  cursor: pointer; line-height: 1.2; display: inline-flex; gap: 6px; align-items: center;
}
.flm-chip small { color: var(--muted); }
.flm-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text, #140a07); }
.flm-chip[aria-pressed="true"] small { color: #3a1a12; }
.flm-chip:focus-visible { outline: 2px solid var(--focus); }
.flm-more { background: none; border: 0; color: var(--muted); padding: 4px 0; cursor: pointer; font-size: 13px; text-decoration: underline; }

.flm-row { display: flex; gap: 8px; align-items: center; margin: 8px 0 2px; flex-wrap: wrap; }
.flm-row label { font-size: 13px; color: var(--muted); }
.flm select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.flm-btn {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; cursor: pointer; font-size: 14px;
}
.flm-btn:hover { border-color: var(--muted); }
.flm-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text, #140a07); font-weight: 600; }
.flm-btn:focus-visible { outline: 2px solid var(--focus); }
.flm-toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 6px 0; cursor: pointer; }
.flm-toggle input { width: 16px; height: 16px; accent-color: var(--accent); }

/* legend */
.flm-legend { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; font-size: 13px; }
.flm-legend div { display: flex; align-items: center; gap: 8px; }
.flm-legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(255,255,255,.35); }

/* near you */
.flm-near-result { font-size: 14px; margin-top: 8px; padding: 10px; background: var(--panel-2); border-radius: 8px; border-left: 3px solid var(--accent); }
.flm-near-result ol { margin: 6px 0 0; padding-left: 18px; }
.flm-near-result li { margin: 2px 0; font-size: 13px; }
.flm-near-result .flm-muted { color: var(--muted); font-size: 12px; }

/* unmapped */
.flm-unmapped { font-size: 13px; color: var(--muted); }
.flm-unmapped ul { margin: 6px 0 0; padding-left: 18px; columns: 2; }

/* ---------- map area ---------- */
.flm-map-wrap { flex: 1; position: relative; min-width: 0; }
/* MapLibre's own stylesheet sets .maplibregl-map { position: relative }; when it is loaded after this file (hero and mini modes load the library on demand) that rule would win and collapse the map to zero height, so pin the geometry with higher specificity. */
.flm .flm-map, .flm .flm-map.maplibregl-map { position: absolute; inset: 0; width: auto; height: auto; }
.flm-map canvas:focus { outline: none; }
.maplibregl-ctrl-attrib { font-size: 11px; }

/* top bar over map */
.flm-topbar {
  position: absolute; top: 10px; left: 10px; right: 56px; z-index: 2; display: flex; gap: 8px; align-items: center; pointer-events: none;
}
.flm-topbar > * { pointer-events: auto; }
.flm-panel-toggle { display: none; }
.flm-stat {
  background: var(--glass); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px;
}
.flm-stat b { font-size: 22px; font-weight: 700; color: var(--accent); margin-right: 4px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.flm-stat .flm-muted { color: var(--muted); }
.flm-spacer { flex: 1; }

/* time bar over map bottom */
.flm-timebar {
  position: absolute; left: 10px; right: 10px; bottom: 28px; z-index: 2;
  background: var(--glass); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 8px;
}
.flm-time-head { display: flex; align-items: center; gap: 10px; }
.flm-time-year { font-size: 26px; font-weight: 700; min-width: 76px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.flm-time-caption { color: var(--muted); font-size: 13px; flex: 1; }
.flm-play { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.flm-hist { display: block; width: 100%; height: 44px; margin-top: 4px; }
.flm-hist rect { fill: #3a3f48; }
.flm-hist rect.on { fill: var(--accent); }
.flm-time-range { width: 100%; margin: 0; accent-color: var(--accent); cursor: pointer; }

/* keep MapLibre's own controls clear of the time bar */
.flm .maplibregl-ctrl-bottom-right { bottom: 172px; }
.flm .maplibregl-ctrl-bottom-left { bottom: 0; }
.flm-err { position:absolute; left:10px; bottom:150px; z-index:9; background:#7a1a10; color:#fff; font:12px/1.3 monospace; padding:6px 8px; border-radius:6px; max-width:60%; white-space:pre-wrap; }

/* hover tooltip */
.flm-tip {
  position: absolute; z-index: 5; pointer-events: none; max-width: 300px; background: #fffdf8; color: #1a1613; border-radius: 8px;
  padding: 8px 10px; font-size: 13px; line-height: 1.35; box-shadow: 0 6px 24px rgba(0,0,0,.45); display: none;
}
.flm-tip b { display: block; font-size: 14px; margin-bottom: 2px; }
.flm-tip .flm-muted { color: #6b645c; font-size: 12px; }

/* popup card */
.maplibregl-popup-content { background: #fffdf8; color: #1a1613; border-radius: 10px; padding: 0; box-shadow: 0 8px 30px rgba(0,0,0,.5); max-width: 340px; }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: #fffdf8; }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: #fffdf8; }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: #fffdf8; }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: #fffdf8; }
.maplibregl-popup-close-button { font-size: 20px; padding: 2px 8px; color: #6b645c; }
.flm-card { display: flex; gap: 10px; padding: 12px 12px 10px; font-size: 14px; line-height: 1.4; }
.flm-card img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex: 0 0 64px; background: #e5e0d8; }
.flm-card h3 { margin: 0 0 2px; font-size: 16px; line-height: 1.2; }
.flm-card .flm-where { color: #6b645c; font-size: 12px; margin-bottom: 4px; }
.flm-card p { margin: 4px 0; }
.flm-card .flm-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 4px; }
.flm-card .flm-tags span { font-size: 11px; background: #efe9df; border-radius: 4px; padding: 1px 6px; color: #3d362f; }
.flm-card .flm-tags span.yes { background: #ffd9d4; color: #7a1a10; }
.flm-card a.flm-read { display: inline-block; margin-top: 4px; color: #a8321f; font-weight: 600; text-decoration: none; }
.flm-card a.flm-read:hover { text-decoration: underline; }

/* cluster list */
.flm-list { font-size: 13px; }
.flm-list a { display: block; padding: 5px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.flm-list a:hover { color: var(--accent); }
.flm-list .flm-muted { color: var(--muted); }

.flm-foot { font-size: 12px; color: var(--muted); padding-top: 8px; }
.flm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .flm { height: 100vh; height: 100dvh; }
  .flm-panel {
    position: absolute; left: 0; right: 0; bottom: 0; top: auto; width: 100%; flex: none; max-height: 72%;
    border-right: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; transform: translateY(100%);
  }
  .flm.panel-open .flm-panel { transform: translateY(0); }
  .flm-panel-toggle { display: inline-flex; }
  .flm-timebar { bottom: 22px; padding: 8px 10px 6px; }
  .flm-time-year { font-size: 20px; min-width: 60px; }
  .flm-hist { height: 30px; }
  .flm-stat b { font-size: 18px; }
  .flm-stat .flm-muted { display: none; }
  .flm-stat { padding: 6px 10px; }
  .flm-topbar { right: 10px; }
  .flm-unmapped ul { columns: 1; }
  .flm.panel-open .flm-timebar { display: none; }
}

/* state rings + notes (added for cases known only to the state) */
.flm-legend i.flm-ring-icon { background: transparent; border: 2px solid var(--ring); }
.flm-legend-note { color: var(--muted); font-size: 12px; margin-top: 4px; display: block !important; }

/* ---------- hardening against the site theme (The7 styles every input, select, list and heading) ---------- */
#floodlit-map { max-width: none; margin: 0; padding: 0; line-height: 1.45; letter-spacing: normal; text-transform: none; }
#floodlit-map h1, #floodlit-map h3 { font-family: inherit; color: inherit; text-transform: none; letter-spacing: normal; padding: 0; }
#floodlit-map .flm-brand h1 { font-size: 17px; line-height: 1.2; margin: 0; }
#floodlit-map .flm-card h3 { font-size: 16px; line-height: 1.2; margin: 0 0 2px; color: #1a1613; }
#floodlit-map p { margin: 4px 0; font-size: inherit; line-height: 1.4; }
#floodlit-map ul, #floodlit-map ol { margin: 6px 0 0; padding-left: 18px; }
#floodlit-map li { margin: 2px 0; padding: 0; background: none; list-style: disc; }
#floodlit-map ol li { list-style: decimal; }
#floodlit-map summary { font-family: inherit; color: inherit; background: none; padding: 4px 0; margin: 0; }
#floodlit-map .flm-search,
#floodlit-map input[type="search"].flm-search,
#floodlit-map input[type="text"].flm-search {
  width: 100%; height: auto; min-height: 0; padding: 9px 10px; margin: 6px 0 2px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-size: 15px; box-shadow: none;
}
#floodlit-map .flm-search::placeholder { color: var(--muted); opacity: 1; }
#floodlit-map select {
  height: auto; min-height: 0; width: auto; padding: 6px 28px 6px 8px; margin: 0; border-radius: 8px; border: 1px solid var(--line);
  background-color: var(--panel-2); color: var(--text); font: inherit; font-size: 14px; box-shadow: none; -webkit-appearance: auto; appearance: auto;
}
#floodlit-map .flm-btn, #floodlit-map .flm-chip, #floodlit-map .flm-more {
  font-family: inherit; text-transform: none; letter-spacing: normal; line-height: 1.2; min-height: 0; height: auto; box-shadow: none; width: auto;
}
#floodlit-map .flm-btn { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); padding: 7px 11px; font-size: 14px; border-radius: 8px; }
#floodlit-map .flm-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text, #140a07); }
#floodlit-map .flm-chip { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); padding: 4px 10px; font-size: 13px; border-radius: 999px; }
#floodlit-map .flm-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text, #140a07); }
#floodlit-map .flm-more { background: none; border: 0; color: var(--muted); padding: 4px 0; font-size: 13px; }
#floodlit-map input[type="range"].flm-time-range {
  width: 100%; height: 18px; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; -webkit-appearance: auto; appearance: auto;
}
#floodlit-map input[type="checkbox"] { width: 16px; height: 16px; margin: 0; -webkit-appearance: auto; appearance: auto; }
#floodlit-map a { box-shadow: none; text-decoration: none; }
#floodlit-map .flm-near-result a, #floodlit-map .flm-unmapped a { color: #ffb199; text-decoration: underline; }
#floodlit-map .maplibregl-popup-content a.flm-read { color: #a8321f; }
#floodlit-map .flm-list a { color: var(--text); text-decoration: none; }
#floodlit-map .maplibregl-popup-content .flm-list a { color: #1a1613; border-bottom-color: #e5e0d8; }
#floodlit-map .maplibregl-popup-content .flm-list .flm-muted { color: #6b645c; }
#floodlit-map img { max-width: none; }
#floodlit-map .maplibregl-canvas { outline: none; }


/* ---------- light basemap variant ---------- */
.flm.flm-light {
  --bg: #f3f1ec; --panel: #ffffff; --panel-2: #f1ede6; --line: #d9d4cb; --text: #1a1613; --muted: #6b645c; --focus: #b8860b; --ring: #b8860b; --glass: rgba(255,253,248,.92); --accent-text: #ffffff;
}
.flm.flm-light a { color: #a8321f; }
.flm.flm-light .flm-hist rect { fill: #d9d4cb; }

/* ---------- poster facade: what the page shows before any script runs ---------- */
.flm-poster-wrap { position: absolute; inset: 0; z-index: 4; pointer-events: none; transition: opacity .7s ease; background: var(--bg); }
.flm-poster { display: block; width: 100%; height: 100%; }
.flm.flm-ready .flm-poster-wrap { opacity: 0; }
.flm-facade-ui { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: space-between; padding: 14px; pointer-events: none; }
.flm-facade-ui > * { pointer-events: auto; }
.flm-facade-stat {
  align-self: flex-start; max-width: 420px; background: var(--glass); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 14px; color: var(--text);
}
.flm-facade-head { font-size: 15px; line-height: 1.3; }
.flm-facade-head b { font-size: 22px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.flm-facade-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.flm-facade-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.flm-facade-loading { font-size: 13px; color: var(--muted); background: var(--glass); border-radius: 999px; padding: 5px 12px; }
.flm-facade-open { margin: 0; }
.flm-facade-link { margin-left: auto; font-size: 13px; color: var(--text); background: var(--glass); border-radius: 999px; padding: 5px 12px; text-decoration: none; }
.flm-facade-link:hover { text-decoration: underline; }
.flm-noscript { position: absolute; left: 14px; bottom: 14px; z-index: 6; background: #fffdf8; color: #1a1613; padding: 8px 12px; border-radius: 8px; font-size: 13px; }
.flm-poster-hl { animation: flm-pulse 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes flm-pulse { 0%, 100% { stroke-opacity: .35; } 50% { stroke-opacity: .08; } }
@media (prefers-reduced-motion: reduce) { .flm-poster-hl { animation: none; } .flm-poster-wrap { transition: none; } }
.flm.flm-facade { cursor: default; }
.flm.flm-facade.flm-mode-hero:not([data-flm-booted="1"]), .flm.flm-facade.flm-mode-mini:not([data-flm-booted="1"]) { cursor: pointer; }

/* ---------- hero and mini: no side panel, no time bar ---------- */
.flm-mode-hero .flm-panel, .flm-mode-mini .flm-panel, .flm-mode-hero .flm-timebar, .flm-mode-mini .flm-timebar { display: none; }
.flm-mode-hero .maplibregl-ctrl-top-right, .flm-mode-mini .maplibregl-ctrl-top-right { top: 0; }
.flm-mode-hero .flm-topbar, .flm-mode-mini .flm-topbar { right: 56px; }
.flm-embed-bar {
  position: absolute; left: 10px; right: 10px; bottom: 32px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--glass); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
}
.flm-embed-bar .flm-btn.primary { text-decoration: none; white-space: nowrap; }
.flm-embed-note { font-size: 12px; }
.flm-legend-inline { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; margin: 0; font-size: 12px; }
.flm-mode-hero .maplibregl-ctrl-bottom-right, .flm-mode-mini .maplibregl-ctrl-bottom-right { bottom: 0; }
.flm-mode-hero .maplibregl-ctrl-bottom-left, .flm-mode-mini .maplibregl-ctrl-bottom-left { bottom: 0; }
.flm-hero-year {
  position: absolute; right: 16px; top: 54px; z-index: 2; font-size: 44px; font-weight: 800; letter-spacing: -.02em; color: var(--text); opacity: .85;
  font-variant-numeric: tabular-nums; text-shadow: 0 2px 12px rgba(0,0,0,.6); pointer-events: none;
}
@media (max-width: 760px) {
  .flm.flm-mode-hero, .flm.flm-mode-mini { height: 360px !important; }
  .flm.flm-mode-mini { height: 300px !important; }
  .flm-embed-bar { flex-direction: column; align-items: stretch; bottom: 22px; }
  .flm-legend-inline { display: none; }
  .flm-mode-hero .flm-stat .flm-muted, .flm-mode-mini .flm-stat .flm-muted { display: none; }
  .flm-hero-year { font-size: 30px; top: 50px; }
  .flm-facade-stat { max-width: 75%; }
  .flm-facade-link { font-size: 12px; }
}
/* theme hardening for the new pieces */
#floodlit-map .flm-facade-link, #floodlit-map-case .flm-facade-link, .flm .flm-full-link { box-shadow: none; }
.flm .flm-embed-bar a.flm-btn.primary { color: var(--accent-text, #140a07); background: var(--accent); border-color: var(--accent); }
.flm .flm-embed-bar a.flm-btn.primary:hover { filter: brightness(1.08); }

/* Floodlight look (pins="floodlight"): legend swatches glow like the map's lights */
.flm-glow .flm-legend i { border: none; }

.flm-poster .flm-pg { display: none; }
.flm-glow .flm-poster .flm-pg { display: inline; }
