/* ==========================================================================
 * Block 1 of 1 — Toolbar controls
 * Description: Shared header buttons; dark-mode invert for Lucide <img> icons
 * Version: 1.c
 * Revised: 11Jul26
 * ========================================================================== */

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Fit inside 40px border-box toolbar (1px bottom border → 39px content) */
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid transparent;
  color: var(--text);
  background: transparent;
  box-sizing: border-box;
}

/* No hover fill — keep chrome quiet */
.toolbar-btn:hover:not(:disabled) {
  background: transparent;
  border-color: transparent;
}

.toolbar-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toolbar-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.toolbar-icon {
  width: 20px;
  height: 20px;
  color: var(--text);
}

.library-brand-icon {
  color: var(--text);
}

/*
 * Lucide icons are loaded as <img> with black strokes — they do not inherit
 * CSS color. Invert in dark theme (explicit + system).
 */
html[data-theme='dark'] .toolbar-icon,
html[data-theme='dark'] .library-brand-icon,
html[data-theme='dark'] img.toolbar-icon,
html[data-theme='dark'] img.library-brand-icon {
  filter: invert(1);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) .toolbar-icon,
  html:not([data-theme='light']) .library-brand-icon,
  html:not([data-theme='light']) img.toolbar-icon,
  html:not([data-theme='light']) img.library-brand-icon {
    filter: invert(1);
  }
}

/* Cover icons already inverted for light-on-gradient — keep white in dark theme */
html[data-theme='dark'] .cover-icon,
html:not([data-theme='light']) .cover-icon {
  filter: brightness(0) invert(1);
}
