/* Antet unificat pentru hărțile istorice — istorie.bacaualert.ro */
.ba-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  background: #0B162C;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  gap: 12px;
  z-index: 1200;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
}

.ba-topbar *,
.ba-topbar *::before,
.ba-topbar *::after {
  box-sizing: border-box;
}

.ba-topbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.ba-topbar-home {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  flex-shrink: 0;
  opacity: 0.96;
  transition: opacity 0.15s ease;
}

.ba-topbar-home:hover {
  opacity: 1;
}

.ba-topbar-pill {
  background: #D97706;
  color: #ffffff;
  font-size: 0.66rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  line-height: 1.35;
  white-space: nowrap;
  flex-shrink: 0;
}

.ba-topbar-sep {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.ba-topbar-title {
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  line-height: 1.25;
}

.ba-title-sub {
  font-weight: 600;
  color: #cbd5e1;
}

.ba-topbar-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: #cbd5e1;
  flex-shrink: 0;
}

.ba-topbar-stats .stat-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.ba-topbar-stats .stat-chip strong {
  color: #ffffff;
}

.ba-topbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ba-topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.ba-topbar-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.ba-topbar-link.active {
  background: rgba(217, 119, 6, 0.24);
  border-color: #F59E0B;
  color: #FDE68A;
}

.ba-topbar-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0;
  line-height: 1;
}

.ba-topbar-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

@media (max-width: 1720px) {
  .ba-topbar.ba-has-stats .ba-title-sub {
    display: none;
  }
}

@media (max-width: 1520px) {
  .ba-topbar-stats {
    display: none;
  }
}

@media (max-width: 1100px) {
  .ba-title-sub {
    display: none;
  }
}

@media (max-width: 992px) {
  .ba-topbar {
    padding: 0 10px;
    gap: 8px;
  }
  .ba-topbar-title {
    font-size: 0.9rem;
  }
  .ba-topbar-toggle {
    display: inline-flex;
  }
  .ba-topbar-nav {
    display: none;
  }
  .ba-topbar-nav.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: 54px;
    left: 0;
    right: 0;
    z-index: 1300;
    background: #0B162C;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    padding: 10px 12px 14px;
    gap: 6px;
    box-shadow: 0 16px 32px rgba(11, 22, 44, 0.45);
  }
  .ba-topbar-nav.open .ba-topbar-link {
    padding: 10px 12px;
    font-size: 0.9rem;
    min-height: 42px;
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .ba-topbar-pill {
    display: none;
  }
}

/* Buton credite în antetul hărților */
.ba-topbar-credits-btn {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(217, 119, 6, 0.16);
  color: #fde68a;
  cursor: pointer;
  font-family: inherit;
}

.ba-topbar-credits-btn:hover {
  background: rgba(217, 119, 6, 0.3);
  border-color: #f59e0b;
  color: #ffffff;
}

.ba-topbar-credits-btn i {
  color: #fbbf24;
}

/* Buton inline discret în bara .map-footer */
.map-footer-credit-btn {
  display: inline;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  font-weight: 800;
  color: #b45309;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(217, 119, 6, 0.45);
  text-underline-offset: 2px;
}

.map-footer-credit-btn:hover {
  color: #92400e;
  text-decoration-color: #92400e;
}

/* Modală comună „Contribuții și surse documentare” */
.ba-credits-backdrop {
  box-sizing: border-box;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: 20000;
  background: rgba(11, 22, 44, 0.72);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  cursor: pointer;
  overscroll-behavior: contain;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ba-credits-backdrop.open {
  display: flex;
}

.ba-credits-dialog {
  box-sizing: border-box;
  background: #ffffff;
  color: #0f172a;
  width: 100%;
  max-width: 860px;
  max-height: 100%;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 24px 60px rgba(11, 22, 44, 0.38);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: default;
}

.ba-credits-dialog *,
.ba-credits-dialog *::before,
.ba-credits-dialog *::after {
  box-sizing: border-box;
}

.ba-credits-head {
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
  border-bottom: 1px solid #e2e8f0;
  padding: 18px 22px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-shrink: 0;
}

.ba-credits-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.ba-credits-title {
  margin: 0 0 4px;
  font-size: 1.28rem;
  font-weight: 900;
  color: #0b162c;
  line-height: 1.2;
}

.ba-credits-sub {
  margin: 0;
  font-size: 0.86rem;
  color: #475569;
  line-height: 1.45;
  max-width: 680px;
}

.ba-credits-close {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ba-credits-close i {
  pointer-events: none;
}

.ba-credits-close:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0b162c;
}

.ba-credits-body {
  padding: 18px 22px 22px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ba-credits-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.ba-credit-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-top: 3px solid #d97706;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ba-credit-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ba-credit-monogram {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #0b162c;
  color: #fde68a;
  border: 2px solid #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.ba-credit-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid #f59e0b;
  background: #0b162c;
  flex-shrink: 0;
  display: block;
}

.ba-credit-ident {
  min-width: 0;
}

.ba-credit-name {
  margin: 0 0 2px;
  font-size: 1.05rem;
  font-weight: 900;
  color: #0b162c;
  line-height: 1.2;
}

.ba-credit-role {
  font-size: 0.77rem;
  font-weight: 800;
  color: #b45309;
  line-height: 1.3;
}

.ba-credit-bio {
  margin: 0;
  font-size: 0.84rem;
  color: #334155;
  line-height: 1.5;
}

.ba-credit-works-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.ba-credit-works {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.ba-credit-work-pill {
  font-size: 0.73rem;
  font-weight: 700;
  color: #0b162c;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 3px 8px;
  line-height: 1.35;
}

.ba-credit-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.ba-credit-site-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 800;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 4px 10px;
  text-decoration: none;
  line-height: 1.35;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ba-credit-site-link:hover {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #0b162c;
}

.ba-credits-sources {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 15px;
}

.ba-credits-sources-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0b162c;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ba-credits-sources-title i {
  color: #d97706;
}

.ba-credits-sources-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.79rem;
  color: #475569;
  line-height: 1.5;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 16px;
}

.ba-credits-foot {
  padding: 12px 22px 16px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.ba-credits-close-footer {
  min-height: 44px;
  padding: 8px 20px;
  border-radius: 10px;
  border: 1px solid #0b162c;
  background: #0b162c;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease;
}

.ba-credits-close-footer:hover {
  background: #172554;
}

@media (max-width: 720px) {
  .ba-credits-backdrop {
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }
  .ba-credits-dialog {
    max-height: 100%;
    border-radius: 14px;
  }
  .ba-credits-head {
    padding: 14px 16px 12px;
  }
  .ba-credits-title {
    font-size: 1.12rem;
  }
  .ba-credits-body {
    padding: 14px 16px 16px;
  }
  .ba-credits-foot {
    padding: 10px 16px 12px;
  }
  .ba-credits-close-footer {
    width: 100%;
  }
  .ba-credits-grid,
  .ba-credits-sources-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .ba-credits-sub {
    display: none;
  }
}
