/* Pencil marks for the site's own controls and editorial UI. */
:root {
  --icon-theme: url('/assets/notebook/icons/moon.svg');
  --icon-close: url('/assets/notebook/icons/close.svg');
}
:root[data-theme="dark"] { --icon-theme: url('/assets/notebook/icons/sun.svg'); }
[data-theme="dark"] .nb-home img[src^="/assets/notebook/icons/"] {
  filter: brightness(0) invert(.9);
}

:is(.nb-theme, .theme-toggle, .cnt-theme-btn, .nb-menu, .clear-search) {
  color: var(--ink);
  font-size: 0;
}
:is(.nb-theme, .theme-toggle, .cnt-theme-btn, .nb-menu, .clear-search)::before,
.nb-catalogue-controls .search-control::before,
.nb-catalogue .card-meta::before,
.sidebar-tools [data-copy-link]::before,
.path-link > [aria-hidden="true"]::before {
  content: '';
  display: block;
  width: 19px;
  height: 19px;
  background: currentColor;
  mask: var(--pencil-icon) center / contain no-repeat;
  pointer-events: none;
}
:is(.nb-theme, .theme-toggle, .cnt-theme-btn, .nb-menu, .clear-search)::before { margin-inline: auto; }
:is(.nb-theme, .theme-toggle, .cnt-theme-btn) { --pencil-icon: var(--icon-theme); }
.nb-menu { --pencil-icon: url('/assets/notebook/icons/menu.svg'); width: 38px; padding: 0; }
.nb-menu[aria-expanded="true"], .clear-search { --pencil-icon: var(--icon-close); }
.clear-search::before { width: 16px; height: 16px; }

.cnt-nav-back svg { display: none; }
.cnt-nav-back::before {
  content: '';
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: url('/assets/notebook/icons/back.svg') center / contain no-repeat;
}

.nb-catalogue-controls .search-control::before {
  --pencil-icon: url('/assets/notebook/icons/search.svg');
  position: absolute;
  inset-inline-start: 11px;
  bottom: 12px;
  z-index: 1;
}
.nb-catalogue .card-meta {
  position: relative;
  padding-inline-start: 20px;
}
.nb-catalogue .card-meta::before {
  --pencil-icon: url('/assets/notebook/icons/document.svg');
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
}

.sidebar-tools [data-copy-link] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sidebar-tools [data-copy-link]::before {
  --pencil-icon: url('/assets/notebook/icons/link.svg');
  flex: 0 0 15px;
  height: 15px;
}
.path-link > [aria-hidden="true"] { font-size: 0; }
.path-link > [aria-hidden="true"]::before {
  --pencil-icon: url('/assets/notebook/icons/external.svg');
  width: 16px;
  height: 16px;
}

.nb-home .link-card-icon { color: var(--ink); }
.nb-home .link-card-icon img { width: 22px; height: 22px; }
