/* Base visual do CEOBiblico.ai (mesmas cores, fonte e componentes) — licença da fonte em fonts/OFL.txt */
@font-face {
  font-family: "Inter";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #121214;
  --surface: #19191c;
  --surface-2: #212125;
  --border: #2a2a2f;
  --border-2: #3a3a41;
  --text: #ededef;
  --muted: #8d8d95;
  --gold: #c9a55a;
  --gold-2: #e3c585;
  --silver: #c9ccd1;
  --radius: 10px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --glass: rgba(22, 22, 25, .92); /* sem desfoque por trás (caro sobre o mapa em movimento), então mais opaco */
  --split: 50%;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
[hidden] { display: none !important; }

.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border-2); background: var(--surface-2); border-radius: 8px;
  padding: 8px 13px; cursor: pointer; font-weight: 600; font-size: 13px;
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: #5a5a62; background: #27272c; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #17160f; }
.btn.primary:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn.small { padding: 6px 10px; font-size: 12.5px; }
.btn .icon { width: 15px; height: 15px; }

.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

/* ---------- Mapas ---------- */
.maps { position: fixed; inset: 0; }
.map { position: absolute; inset: 0; }
#mapAntes { clip-path: inset(0 calc(100% - var(--split)) 0 0); z-index: 2; }
body[data-mode="antes"] #mapAntes { clip-path: none; }
body[data-mode="hoje"] #mapAntes { visibility: hidden; }

/* vinheta sutil para dar profundidade */
.maps::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(ellipse at 50% 55%, transparent 55%, rgba(8, 8, 10, .55) 100%);
}

/* Divisor arrastável */
.divisor {
  position: fixed; top: 0; bottom: 0; left: var(--split); z-index: 5;
  width: 0; pointer-events: none;
}
body:not([data-mode="comparar"]) .divisor { display: none; }
.divisor::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px;
  background: linear-gradient(180deg, transparent, var(--gold-2) 12%, var(--gold-2) 88%, transparent);
  box-shadow: 0 0 18px rgba(227, 197, 133, .55);
}
.divisor .alca {
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%; pointer-events: auto; cursor: ew-resize;
  background: var(--gold); color: #17160f; border: 3px solid #17160f;
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  touch-action: none; transition: transform .15s;
}
.divisor .alca:hover { transform: translate(-50%, -50%) scale(1.08); }
.divisor .alca .icon { width: 20px; height: 20px; stroke-width: 2.2; }
.divisor .tag {
  position: absolute; top: 86px; white-space: nowrap; pointer-events: none;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 999px;
}
.divisor .tag.esq { right: 14px; color: var(--gold-2); border-color: #5b4d2c; }
.divisor .tag.dir { left: 14px; color: var(--silver); }
.tag b { font-family: var(--serif); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 13px; margin-left: 4px; }

/* ---------- Topo ---------- */
.topo {
  position: fixed; top: 16px; left: 16px; right: 16px; z-index: 10;
  display: flex; align-items: flex-start; gap: 12px; pointer-events: none;
}
.topo > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 9px 14px 9px 9px; }
.brand img { width: 38px; height: 38px; border-radius: 50%; }
.brand .title { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand .sub { color: var(--muted); font-size: 12px; margin-top: -1px; }

.modos { display: flex; gap: 3px; padding: 3px; margin-left: auto; margin-right: auto; }
.modos button {
  border: 1px solid transparent; background: none; border-radius: 8px; padding: 8px 14px;
  cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 7px;
  transition: color .15s, background .15s, border-color .15s;
}
.modos button:hover { color: var(--text); }
.modos button.on { color: var(--text); background: var(--surface-2); border-color: var(--border-2); }
.modos button[data-mode="antes"].on { color: var(--gold-2); border-color: #5b4d2c; }

.acoes { display: flex; gap: 8px; }
.acoes .btn { background: var(--glass); }
.acoes .btn.primary { background: var(--gold); }

/* ---------- Painel de locais ---------- */
.painel {
  position: fixed; z-index: 10; top: 84px; right: 16px; bottom: 16px; width: 340px;
  display: flex; flex-direction: column; overflow: hidden;
}
.painel .busca { padding: 12px; border-bottom: 1px solid var(--border); }
.painel input {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px 8px 32px;
  transition: border-color .15s;
}
.painel input:focus { outline: none; border-color: var(--gold); }
.busca-wrap { position: relative; }
.busca-wrap .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.lista { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.lista li {
  display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; transition: background .12s, border-color .12s;
}
.lista li:hover { background: var(--surface-2); }
.lista li.on { background: var(--surface-2); border-color: #5b4d2c; }
.lista .n { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--bg); border: 1px solid var(--border-2); color: var(--muted); }
.lista li[data-tour] .n { background: var(--gold); border-color: var(--gold); color: #17160f; }
.lista .t { min-width: 0; }
.lista .t b { display: block; font-weight: 600; font-size: 13.5px; }
.lista .t small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Detalhe do local */
.detalhe { padding: 16px; border-bottom: 1px solid var(--border); overflow-y: auto; max-height: 62%; flex: none; }
.detalhe .topo-det { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.detalhe h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.2; letter-spacing: 0; }
.detalhe .x { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; }
.detalhe .x:hover { color: var(--text); background: var(--surface-2); }
.bloco { margin-top: 12px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); }
.bloco .rot { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; display: flex; justify-content: space-between; gap: 8px; }
.bloco p { margin: 0; font-size: 13px; color: #d6d6da; }
.bloco.antes { border-color: #4a3f27; background: linear-gradient(180deg, #221f17, #17161a); }
.bloco.antes .rot { color: var(--gold-2); }
.bloco.antes p { font-family: var(--serif); font-size: 14.5px; line-height: 1.55; color: #ebe4d3; }
.bloco.hoje .rot { color: var(--silver); }
.bloco .rot span { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.ref { margin-top: 12px; color: var(--gold); font-weight: 600; font-size: 12px; letter-spacing: .04em; }
.nav-tour { display: flex; gap: 8px; margin-top: 14px; }
.nav-tour .btn { flex: 1; }

/* Legenda das regiões */
.legenda { position: fixed; z-index: 10; left: 16px; bottom: 16px; padding: 12px 14px; width: 250px; }
body[data-mode="hoje"] .legenda { display: none; }
.legenda h3 { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-2); }
.legenda ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.legenda li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; cursor: pointer; padding: 2px 4px; border-radius: 5px; }
.legenda li:hover { background: var(--surface-2); }
.legenda i { width: 11px; height: 11px; border-radius: 3px; flex: none; border: 1px solid rgba(255,255,255,.35); }
.legenda .linha { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); }
.legenda .linha i.agua { background: #3f86b8; }
.legenda .linha i.estrada { border: 0; border-top: 2px dashed #e8d7ae; border-radius: 0; height: 0; }
.legenda details summary { cursor: pointer; list-style: none; }
.legenda details summary::-webkit-details-marker { display: none; }

/* Info de região ao passar o mouse */
.chip-regiao {
  position: fixed; z-index: 12; pointer-events: none; max-width: 270px; padding: 10px 12px;
  transform: translate(14px, 14px);
}
.chip-regiao b { font-family: var(--serif); font-weight: 400; font-size: 17px; display: block; }
.chip-regiao small { color: var(--gold-2); font-size: 11px; font-weight: 600; letter-spacing: .04em; display: block; margin: 1px 0 4px; }
.chip-regiao p { margin: 0; font-size: 12.5px; color: #d0d0d5; }

/* ---------- Marcadores ---------- */
.mk { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.mk .pino {
  width: 13px; height: 13px; border-radius: 50%; border: 2px solid #17160f;
  box-shadow: 0 0 0 2px rgba(255,255,255,.18), 0 3px 10px rgba(0,0,0,.6);
  transition: transform .15s;
}
.mk .nome {
  margin-top: 4px; white-space: nowrap; font-size: 12.5px; font-weight: 600; padding: 1px 7px; border-radius: 6px;
  text-shadow: 0 1px 3px rgba(0,0,0,.95), 0 0 10px rgba(0,0,0,.8);
  transition: background .15s;
}
.mk:hover .pino, .mk.on .pino { transform: scale(1.35); }
.mk:hover .nome, .mk.on .nome { background: rgba(18,18,20,.8); text-shadow: none; }
.mk.antes .pino { background: var(--gold); }
.mk.antes .nome { font-family: var(--serif); font-weight: 400; font-size: 14px; color: #f6ebcf; letter-spacing: .01em; }
.mk.hoje .pino { background: #f1f2f4; }
.mk.hoje .nome { color: #fff; font-size: 12px; }
.mk.menor .nome { opacity: 0; transition: opacity .2s; }
.maps[data-zoom="perto"] .mk.menor .nome, .mk.menor:hover .nome, .mk.menor.on .nome { opacity: 1; }
.mk.on .pino { box-shadow: 0 0 0 4px rgba(227,197,133,.45), 0 0 22px rgba(227,197,133,.8); }

.rotulo-regiao {
  pointer-events: none; text-align: center; font-family: var(--serif); color: #fff7e2;
  text-transform: uppercase; letter-spacing: .24em; font-size: 14px; white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,.95), 0 0 16px rgba(0,0,0,.7);
}
.rotulo-regiao small { display: block; font-family: var(--sans); letter-spacing: .08em; font-size: 9.5px; color: #e8d7ae; margin-top: 2px; }

/* Tooltip ao passar sobre um local */
.maplibregl-popup.dica .maplibregl-popup-content {
  background: var(--glass); color: var(--text); border: 1px solid var(--border-2); border-radius: 10px;
  padding: 10px 12px; box-shadow: 0 14px 40px rgba(0,0,0,.5); max-width: 260px;
}
.maplibregl-popup.dica .maplibregl-popup-tip { display: none; }
.dica .rot { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dica.antes .rot { color: var(--gold-2); }
.dica.hoje .rot { color: var(--silver); }
.dica b { display: block; font-size: 14px; margin: 1px 0 3px; }
.dica.antes b { font-family: var(--serif); font-weight: 400; font-size: 16px; }
.dica p { margin: 0; font-size: 12.5px; color: #d0d0d5; line-height: 1.45; }

/* ---------- Controles do MapLibre no tema ---------- */
.maplibregl-ctrl-group { background: var(--glass) !important; border: 1px solid var(--border); border-radius: 10px !important; box-shadow: none !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--border) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1) brightness(.9); }
.maplibregl-ctrl-bottom-right { right: 372px; }
.maplibregl-ctrl-attrib { background: rgba(18,18,20,.7) !important; color: var(--muted); font-size: 10.5px; }
.maplibregl-ctrl-attrib a { color: var(--silver); }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
#mapAntes .maplibregl-control-container { display: none; }

/* ---------- Carregando ---------- */
.intro {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--bg);
  transition: opacity .9s ease;
}
.intro.saindo { opacity: 0; pointer-events: none; }
.intro .caixa { text-align: center; }
.intro img { width: 72px; height: 72px; border-radius: 50%; animation: pulso 1.6s ease-in-out infinite; }
.intro h1 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 16px 0 4px; }
.intro p { color: var(--muted); margin: 0; font-size: 13px; }
@keyframes pulso { 50% { transform: scale(1.06); box-shadow: 0 0 40px rgba(201,165,90,.45); } }

/* ---------- Diálogo de fontes ---------- */
dialog.fontes {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 22px; border: 1px solid var(--border-2);
  border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 24px 70px rgba(0,0,0,.6);
}
dialog.fontes::backdrop { background: rgba(8,8,10,.65); }
.fontes h3 { margin: 0 0 4px; font-size: 17px; }
.fontes > p { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.fontes h4 { margin: 16px 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-2); }
.fontes ul { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 5px; }
.fontes a { color: var(--silver); text-underline-offset: 3px; text-decoration-color: #55555c; }
.fontes a:hover { color: var(--gold-2); }
.fontes .rodape { display: flex; justify-content: flex-end; margin-top: 18px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2e2e34; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- Telas menores ---------- */
@media (max-width: 1100px) {
  .brand .sub { display: none; }
  .acoes .btn span { display: none; }
}
@media (max-width: 820px) {
  .topo { flex-wrap: wrap; top: 10px; left: 10px; right: 10px; gap: 6px; }
  .brand { padding: 5px 10px 5px 5px; gap: 8px; min-width: 0; }
  .brand img { width: 28px; height: 28px; }
  .brand .title { font-size: 13px; white-space: nowrap; }
  .modos { order: 3; width: 100%; margin: 0; }
  .modos button { flex: 1; justify-content: center; padding: 7px 6px; font-size: 12.5px; }
  .modos button .icon { display: none; }
  .acoes { margin-left: auto; gap: 5px; }
  .acoes .btn { padding: 8px 9px; }
  .painel { top: auto; left: 10px; right: 10px; bottom: 10px; width: auto; max-height: 36vh; max-height: 36dvh; }
  .painel.com-detalhe { max-height: 50vh; max-height: 50dvh; }
  .painel.com-detalhe .lista, .painel.com-detalhe .busca { display: none; }
  .painel .busca { padding: 10px; }
  .lista li { padding: 6px 8px; }
  .detalhe { max-height: none; padding: 14px; }
  .detalhe h2 { font-size: 21px; }
  .bloco.antes p { font-size: 14px; }
  .legenda { display: none; }
  /* divisor: alça no meio da área do mapa que sobra acima do painel */
  .divisor .alca { top: 34%; width: 40px; height: 40px; }
  .divisor .tag { top: 102px; padding: 4px 8px; font-size: 10px; }
  .divisor .tag b { display: none; }
  .maplibregl-ctrl-top-right, .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { display: none; }
  .maplibregl-ctrl-bottom-right { right: 0; bottom: calc(36vh + 14px); }
  body:has(.painel.com-detalhe) .maplibregl-ctrl-bottom-right { bottom: calc(50vh + 14px); }
  .chip-regiao { display: none; }
}
@media (max-width: 380px) {
  .brand .title { display: none; }
  .brand { padding: 5px; }
}
