/**
 * Editor-only chrome for Drupal primary/secondary local tasks + local actions.
 * The WP theme's `.header` is position:absolute with z-index:100, so we lift
 * the tabs out of the header's stacking context and render them as a compact
 * floating pill in the upper-right of the viewport.
 */

/* Hide the entire admin bar for anonymous users and when there is no content. */
body:not(.user-logged-in) .writercom-admin-bar,
.writercom-admin-bar:not(:has(a)) {
  display: none !important;
}

.writercom-admin-bar {
  position: fixed;
  top: 52px; /* below admin toolbar */
  right: 16px;
  z-index: 1050;
  pointer-events: none; /* only the inner pill takes clicks */
}

body.toolbar-fixed .writercom-admin-bar { top: 84px; }
body.toolbar-tray-open.toolbar-horizontal .writercom-admin-bar { top: 128px; }

.writercom-admin-bar__inner {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: rgba(32, 32, 32, 0.92);
  color: #f6f6fe;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  font-family: 'Poppins', system-ui, sans-serif;
  backdrop-filter: blur(6px);
}

.writercom-admin-bar .block { margin: 0; }

.writercom-admin-bar h2,
.writercom-admin-bar .block__title,
.writercom-admin-bar .visually-hidden {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  overflow: hidden;
  height: 1px;
  width: 1px;
  word-wrap: normal;
}

.writercom-admin-bar ul.tabs,
.writercom-admin-bar ul.tabs--primary,
.writercom-admin-bar ul.tabs--secondary,
.writercom-admin-bar .action-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.writercom-admin-bar ul.tabs li,
.writercom-admin-bar .action-links li {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 0;
  background: transparent;
}

.writercom-admin-bar ul.tabs a,
.writercom-admin-bar .action-links a {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #f6f6fe;
  text-decoration: none;
  border-radius: 999px;
  line-height: 1.2;
  transition: background-color 120ms ease, color 120ms ease;
}

.writercom-admin-bar ul.tabs a:hover,
.writercom-admin-bar ul.tabs a:focus,
.writercom-admin-bar .action-links a:hover,
.writercom-admin-bar .action-links a:focus {
  background: rgba(246, 246, 254, 0.14);
  color: #ffffff;
  outline: 0;
}

.writercom-admin-bar ul.tabs .is-active > a,
.writercom-admin-bar ul.tabs a.is-active,
.writercom-admin-bar ul.tabs li.active > a {
  background: #ffffff;
  color: #202020;
}

.writercom-admin-bar .action-links a {
  background: #6c63ff;
  color: #ffffff;
}

.writercom-admin-bar .action-links a:hover,
.writercom-admin-bar .action-links a:focus {
  background: #534bff;
  color: #ffffff;
}

@media (max-width: 640px) {
  .writercom-admin-bar { right: 8px; top: 48px; }
  body.toolbar-fixed .writercom-admin-bar { top: 64px; }
}
