/* Trend Co-Pilot rich-text draft editor — hand-written styles for the TipTap
   wrapper in editor-src/index.js. Uses the site's CSS variables with safe
   fallbacks so it inherits the app theme. Loaded as a plain <link>. */

.tcp-tt {
  border: 1px solid var(--line, #e4e0d8);
  border-radius: 12px;
  background: var(--bg-card, #fff);
  overflow: hidden;
}

/* ── toolbar ───────────────────────────────────────────────── */
.tcp-tt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line, #e4e0d8);
  background: var(--bg-soft, #faf8f4);
  position: sticky;
  top: 0;
  z-index: 2;
}
.tcp-tt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink, #2b2b2b);
  font: 600 13px/1 "Inter", system-ui, sans-serif;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.tcp-tt-btn:hover { background: var(--hover, #efeae1); }
.tcp-tt-btn:focus-visible {
  outline: 2px solid var(--accent, #6c5ce7);
  outline-offset: 1px;
}
.tcp-tt-btn.is-active {
  background: color-mix(in srgb, var(--accent, #6c5ce7) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent, #6c5ce7) 35%, transparent);
  color: var(--accent, #6c5ce7);
}
.tcp-tt-btn:disabled { opacity: .35; cursor: default; }
.tcp-tt-btn b, .tcp-tt-btn i, .tcp-tt-btn u, .tcp-tt-btn s { font-style: normal; }
.tcp-tt-btn i { font-style: italic; }
.tcp-tt-btn svg { display: block; }
.tcp-tt-div {
  width: 1px;
  align-self: stretch;
  margin: 4px 4px;
  background: var(--line, #e4e0d8);
}

/* ── inline URL prompt (no native dialogs) ─────────────────── */
.tcp-tt-prompt[hidden] { display: none; }
.tcp-tt-prompt {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid var(--line, #e4e0d8);
  background: var(--bg-soft, #faf8f4);
}
.tcp-tt-prompt-input {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line, #d8d3c9);
  border-radius: 8px;
  background: var(--bg-card, #fff);
  color: var(--ink, #2b2b2b);
  font: 400 13px/1 "Inter", system-ui, sans-serif;
}
.tcp-tt-prompt-input:focus-visible {
  outline: 2px solid var(--accent, #6c5ce7);
  outline-offset: 0;
  border-color: var(--accent, #6c5ce7);
}
.tcp-tt-prompt-btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line, #d8d3c9);
  border-radius: 8px;
  background: var(--bg-card, #fff);
  color: var(--ink, #2b2b2b);
  font: 600 13px/1 "Inter", system-ui, sans-serif;
  cursor: pointer;
}
.tcp-tt-prompt-btn.apply {
  background: var(--accent, #6c5ce7);
  border-color: var(--accent, #6c5ce7);
  color: #fff;
}

/* ── editable content (ProseMirror) ────────────────────────── */
.tcp-tt-content .ProseMirror {
  min-height: 320px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 18px 20px;
  outline: none;
  color: var(--ink, #2b2b2b);
  font: 400 16px/1.7 "Inter", Georgia, serif;
}
.tcp-tt-content .ProseMirror > * + * { margin-top: .85em; }
.tcp-tt-content .ProseMirror h2 { font-size: 1.5em; font-weight: 700; line-height: 1.25; margin-top: 1.3em; }
.tcp-tt-content .ProseMirror h3 { font-size: 1.25em; font-weight: 700; line-height: 1.3; margin-top: 1.1em; }
.tcp-tt-content .ProseMirror h4 { font-size: 1.08em; font-weight: 700; margin-top: 1em; }
.tcp-tt-content .ProseMirror ul,
.tcp-tt-content .ProseMirror ol { padding-left: 1.4em; }
.tcp-tt-content .ProseMirror li > p { margin: 0; }
.tcp-tt-content .ProseMirror blockquote {
  border-left: 3px solid var(--accent, #6c5ce7);
  padding-left: 14px;
  color: var(--ink-soft, #6b6b6b);
  font-style: italic;
}
.tcp-tt-content .ProseMirror a { color: var(--accent, #6c5ce7); text-decoration: underline; }
.tcp-tt-content .ProseMirror code {
  background: var(--hover, #efeae1);
  padding: .12em .35em;
  border-radius: 5px;
  font: .88em "JetBrains Mono", ui-monospace, monospace;
}
.tcp-tt-content .ProseMirror pre {
  background: #1e1e2e;
  color: #e6e6f0;
  padding: 14px 16px;
  border-radius: 10px;
  overflow-x: auto;
}
.tcp-tt-content .ProseMirror pre code { background: none; padding: 0; color: inherit; }
.tcp-tt-content .ProseMirror img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}
.tcp-tt-content .ProseMirror img.ProseMirror-selectednode {
  outline: 2px solid var(--accent, #6c5ce7);
}
.tcp-tt-content .ProseMirror hr {
  border: none;
  border-top: 1px solid var(--line, #e4e0d8);
  margin: 1.4em 0;
}
/* placeholder-ish: empty editor shows nothing distracting */
.tcp-tt-content .ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  color: var(--ink-soft, #9a948a);
  float: left;
  height: 0;
  pointer-events: none;
}

@media (max-width: 640px) {
  .tcp-tt-content .ProseMirror { padding: 14px; font-size: 15px; }
  .tcp-tt-btn { min-width: 30px; height: 30px; }
}
