/* ============================================================
   OLDBIKE — Rich Text Editor (gaya TinyMCE, buatan sendiri)
   Tema gahar: hitam pekat + merah. Mobile-first.
   ============================================================ */

.rte {
  border: 1px solid var(--line, #2b2320);
  border-radius: var(--radius, 12px);
  background: #100d0c;
  overflow: hidden;
}

.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: #1a1512;
  border-bottom: 1px solid var(--line, #2b2320);
}

.rte-btn {
  min-width: 36px;
  min-height: 36px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text, #f3ece2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.rte-btn:hover { background: #2a211d; }
.rte-btn:active { transform: translateY(1px); }
.rte-btn.on {
  background: var(--red-dark, #9c1c12);
  border-color: var(--red, #d92b1f);
  color: #fff;
}
.rte-btn.wide { font-size: 12px; letter-spacing: .02em; }

.rte-sep {
  width: 1px;
  align-self: stretch;
  margin: 4px 2px;
  background: var(--line, #2b2320);
}

.rte-area {
  min-height: 220px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 14px 16px;
  color: var(--text, #f3ece2);
  font-size: 15px;
  line-height: 1.7;
  outline: none;
  overflow-wrap: anywhere;
}
.rte-area:empty::before {
  content: attr(data-placeholder);
  color: var(--muted, #a89c8d);
  pointer-events: none;
}

/* Tipografi di dalam editor — mirip tampilan situs */
.rte-area p { margin: 0 0 1em; }
.rte-area h2 { font-size: 1.45em; margin: 1.1em 0 .5em; color: #fff; }
.rte-area h3 { font-size: 1.2em; margin: 1em 0 .45em; color: #fff; }
.rte-area h4 { font-size: 1.05em; margin: .9em 0 .4em; color: #fff; }
.rte-area ul, .rte-area ol { margin: 0 0 1em; padding-left: 1.4em; }
.rte-area li { margin-bottom: .3em; }
.rte-area blockquote {
  margin: 0 0 1em;
  padding: 10px 14px;
  border-left: 4px solid var(--red, #d92b1f);
  background: #181210;
  color: #e8ded2;
  font-style: italic;
}
.rte-area a { color: var(--orange, #ff7a1a); }
.rte-area img { max-width: 100%; height: auto; border-radius: 8px; }
.rte-area hr { border: 0; border-top: 2px solid var(--red, #d92b1f); margin: 1.2em 0; }

.rte-source {
  display: none;
  width: 100%;
  min-height: 220px;
  max-height: 60vh;
  padding: 14px 16px;
  border: 0;
  background: #0a0908;
  color: #d5f0d5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}
.rte.src-mode .rte-source { display: block; }
.rte.src-mode .rte-area { display: none; }

.rte-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  border-top: 1px solid var(--line, #2b2320);
  background: #141110;
  color: var(--muted, #a89c8d);
  font-size: 12px;
}
.rte-statusbar .src-hint { font-style: italic; }

/* Pratinjau isi di modal panel admin */
.rte-preview p { margin: 0 0 1em; }
.rte-preview h2 { font-size: 1.3em; margin: 1em 0 .5em; }
.rte-preview h3 { font-size: 1.15em; margin: .9em 0 .45em; }
.rte-preview ul, .rte-preview ol { padding-left: 1.4em; margin: 0 0 1em; }
.rte-preview blockquote {
  margin: 0 0 1em;
  padding: 10px 14px;
  border-left: 4px solid var(--red, #d92b1f);
  background: #181210;
  font-style: italic;
}
.rte-preview a { color: var(--orange, #ff7a1a); }
.rte-preview img { max-width: 100%; height: auto; border-radius: 8px; }
