/* ==========================================================================
   Atlas Bíblico — estilos (vanilla, sin dependencias)
   Prefijo .ab- para no colisionar con los estilos de serjudio.com
   ========================================================================== */

.ab-root {
  --ab-bg: #f4ecd8;
  --ab-panel: #fbf6e9;
  --ab-ink: #3a2f21;
  --ab-muted: #8a7a5f;
  --ab-border: #d9cbac;
  --ab-primary: #7a4a24;
  --ab-primary-ink: #fbf6e9;
  --ab-accent: #c8912f;
  --ab-radius: 10px;

  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 520px;
  color: var(--ab-ink);
  background: var(--ab-bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius);
  overflow: hidden;
  box-sizing: border-box;
}
.ab-root *,
.ab-root *::before,
.ab-root *::after { box-sizing: border-box; }

/* Barra superior */
.ab-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--ab-primary);
  color: var(--ab-primary-ink);
  flex-wrap: wrap;
}
.ab-title {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
  margin: 0;
}
.ab-subtitle {
  font-size: 12px;
  opacity: 0.85;
  margin: 0;
}
.ab-search {
  margin-left: auto;
  flex: 1 1 200px;
  max-width: 320px;
}
.ab-search input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.15);
  color: var(--ab-primary-ink);
  font-size: 14px;
  outline: none;
}
.ab-search input::placeholder { color: rgba(255, 255, 255, 0.7); }

/* Cuerpo: mapa + panel lateral */
.ab-body {
  display: flex;
  flex: 1;
  min-height: 0;
}
.ab-map {
  flex: 1;
  min-height: 0;
  background: #aecfe0;
}
.ab-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--ab-panel);
  border-left: 1px solid var(--ab-border);
  min-height: 0;
}

/* Leyenda / filtros */
.ab-legend {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ab-border);
}
.ab-legend h3 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ab-muted);
}
.ab-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ab-ink);
  text-align: left;
}
.ab-legend-item:hover { background: rgba(0, 0, 0, 0.04); }
.ab-legend-item[data-off="true"] { opacity: 0.4; }
.ab-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.25);
}
.ab-legend-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--ab-muted);
}

/* Lista */
.ab-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.ab-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid var(--ab-border);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.ab-list-item:hover { background: rgba(0, 0, 0, 0.04); }
.ab-list-item[data-active="true"] { background: rgba(200, 145, 47, 0.18); }
.ab-list-name { font-size: 14px; font-weight: 600; color: var(--ab-ink); }
.ab-list-heb { font-size: 12px; color: var(--ab-muted); }
.ab-list-meta { margin-left: auto; text-align: right; }
.ab-list-mentions {
  font-size: 12px;
  font-weight: 700;
  color: var(--ab-primary);
}
.ab-list-type { font-size: 11px; color: var(--ab-muted); }

/* Panel de detalle (overlay sobre el mapa) */
.ab-detail {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 500;
  width: min(320px, calc(100% - 24px));
  background: var(--ab-panel);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  padding: 14px 16px;
  display: none;
}
.ab-detail[data-open="true"] { display: block; }
.ab-detail-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--ab-muted);
  line-height: 1;
}
.ab-detail-name { margin: 0; font-size: 20px; font-weight: 700; }
.ab-detail-heb { font-size: 15px; color: var(--ab-primary); margin: 2px 0 10px; }
.ab-detail-row { display: flex; gap: 8px; font-size: 13px; margin: 4px 0; }
.ab-detail-row span:first-child { color: var(--ab-muted); min-width: 84px; }
.ab-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: #fff;
}

/* Marcadores */
.ab-marker {
  border-radius: 50%;
  border: 1.5px solid rgba(58, 47, 33, 0.55);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s ease;
}
.ab-marker.ab-selected {
  border: 3px solid var(--ab-ink);
  z-index: 1000 !important;
}

.ab-loading,
.ab-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--ab-muted);
  font-size: 14px;
  padding: 24px;
  text-align: center;
}

/* Responsive: en móvil el panel va abajo del mapa */
@media (max-width: 720px) {
  .ab-body { flex-direction: column; }
  .ab-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--ab-border);
    max-height: 42%;
  }
  .ab-map { min-height: 320px; }
  .ab-search { max-width: none; }
}
