/**
 * idf-markdown-editor v0.1.2 - Editor-Optik (Toolbar + Textfeld + Vorschau)
 *
 * v0.1.2 (#201): font-size-Literale auf Tokens (13px -> var(--font-sm)
 * 2x, 11px -> var(--font-xs)); render-identisch (Audit L5/L-E3).
 *
 * v0.1.1 (#199): Mono-Stack auf var(--font-mono) umgestellt (H6);
 * Radius-Fallbacks von 6px auf den Token-Ist-Wert 4px korrigiert (L-E4,
 * rein Fallback-Hygiene, Token ist auf jeder Seite geladen).
 *
 * Nur Token-Farben (var(--...)), Figtree erbt von idf-core. Die Vorschau
 * bekommt zusaetzlich .idf-markdown-preview (Typografie aus idf-markdown.css).
 */

.idf-mde {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Toolbar: kleine Icon-Buttons wie in einem Text-Editor. */
.idf-mde-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.idf-mde-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 4px);
  background: var(--white);
  color: var(--ink);
  font-size: var(--font-sm);
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.idf-mde-btn:hover {
  background: var(--bg-hover, #f8f8f8);
  border-color: var(--mid);
}
.idf-mde-btn:active { transform: translateY(0.5px); }
.idf-mde-sep {
  width: 1px;
  height: 20px;
  margin: 0 3px;
  background: var(--line);
}

/* Textfeld: Monospace, damit die Markdown-Syntax klar lesbar ist. */
.idf-mde-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 130px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 4px);
  background: var(--white);
  color: var(--ink);
  /* #199 H6: --font-mono-Token. Superset-Stack ergänzt SFMono/Menlo
     (macOS) gegenüber dem alten lokalen Stack (Report-Auflösung). */
  font-family: var(--font-mono, ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace);
  font-size: var(--font-sm);
  line-height: 1.6;
}
.idf-mde-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

/* Vorschau: dezent abgesetzt, damit klar ist „so wird es gedruckt". */
.idf-mde-preview-label {
  margin-bottom: 4px;
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mid);
}
.idf-mde-preview {
  padding: 10px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm, 4px);
  background: var(--bg);
  min-height: 40px;
}
.idf-mde-preview:empty::before {
  content: 'noch nichts';
  color: var(--mid);
  font-style: italic;
}
