/* tiptap.css - Tiptap editor styles */

/* Editor container */
.tiptap-editor-wrapper {
  max-width: 100%;
  margin: 0;
}

/* Toolbar - vertical, fixed left center */
.tiptap-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  background: var(--color-cirrus);
  border-right: 1px solid var(--color-nimbus-light);
  box-shadow: 4px 0 8px rgba(0, 0, 0, 0.05), 0 4px 8px rgba(0, 0, 0, 0.05), 0 -4px 8px rgba(0, 0, 0, 0.05);
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  border-radius: 0 8px 8px 0;
}

/* Toolbar groups */
.tiptap-toolbar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Toolbar separator */
.tiptap-toolbar-separator {
  width: 32px;
  height: 1px;
  background: var(--color-nimbus-light);
  margin: 4px 0;
}

/* Toolbar buttons */
.tiptap-toolbar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-cumulonimbus-dark);
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Ubuntu Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tiptap-toolbar-button:hover {
  background: var(--color-cloud-medium);
}

.tiptap-toolbar-button.is-active {
  background: var(--color-nimbus-medium);
  color: var(--color-cumulonimbus-dark);
}

/* Editor content */
.tiptap {
  outline: none;
  min-height: 400px;
  padding: 16px;
  font-family: monospace;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-cumulonimbus-dark);
}

/* Placeholder */
.tiptap p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: var(--color-nimbus-medium);
  pointer-events: none;
  height: 0;
}

/* Typography */
.tiptap h1 {
  font-family: 'Noto Serif', serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  margin: 24px 0 16px;
  color: var(--color-cumulonimbus-dark);
}

.tiptap h2 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  margin: 20px 0 12px;
  color: var(--color-cumulonimbus-dark);
}

.tiptap h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  margin: 16px 0 8px;
  color: var(--color-cumulonimbus-dark);
}

.tiptap p {
  margin: 0 0 12px;
}

.tiptap ul,
.tiptap ol {
  padding-left: 24px;
  margin: 12px 0;
}

.tiptap li {
  margin: 4px 0;
}

.tiptap code {
  font-family: 'Ubuntu Mono', 'Courier New', monospace;
  background: var(--color-nimbus-light);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 14px;
}

.tiptap pre {
  font-family: 'Ubuntu Mono', 'Courier New', monospace;
  background: var(--color-nimbus-light);
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 12px 0;
}

.tiptap pre code {
  background: none;
  padding: 0;
}

.tiptap blockquote {
  border-left: 3px solid var(--color-iris);
  padding-left: 16px;
  margin: 16px 0;
  color: var(--color-nimbus-dark);
  font-style: italic;
}

.tiptap a {
  color: var(--color-iris);
  text-decoration: underline;
  cursor: pointer;
}

.tiptap a:hover {
  color: var(--color-viola);
}

.tiptap img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
}

.tiptap strong {
  font-weight: 600;
}

.tiptap em {
  font-style: italic;
}

/* Read-only mode */
.tiptap[contenteditable="false"] {
  cursor: default;
}

/* Tag styling - match #word pattern */
.tiptap p {
  /* This will be handled by a custom Tiptap extension or post-processing */
}

/* Tag highlight class (applied dynamically) */
.tiptap-tag {
  color: var(--color-iris);
  font-weight: 500;
}
