/* public/styles/post/postEditor.css */

:root {
  --rte-border: #d0d4e4;
  --rte-bg: #f7f8fc;
  --rte-bg-2: #ffffff;
  --rte-text: #111827;
  --rte-muted: #6b7280;
  --rte-accent: #2373e0;
}

/* ===== Toolbar ===== */
.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--rte-bg);
  border: 1px solid var(--rte-border);
  border-radius: 10px;
}

.rte-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-right: 6px;
  margin-right: 6px;
  border-right: 1px solid rgba(208, 212, 228, 0.7);
}
.rte-group:last-child { border-right: 0; margin-right: 0; padding-right: 0; }

.rte-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--rte-text);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}
.rte-btn:hover {
  background: rgba(35, 115, 224, 0.08);
  border-color: rgba(35, 115, 224, 0.18);
}
.rte-btn:active { transform: translateY(1px); }
.rte-btn.is-active {
  background: rgba(35, 115, 224, 0.12);
  border-color: rgba(35, 115, 224, 0.3);
}
.rte-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.rte-sep {
  width: 1px;
  height: 22px;
  background: rgba(208, 212, 228, 0.9);
  margin: 0 2px;
}

.rte-select {
  border: 1px solid var(--rte-border);
  background: var(--rte-bg-2);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 13px;
}

.rte-label {
  font-size: 12px;
  color: var(--rte-muted);
  margin-left: 6px;
  margin-right: 2px;
}

.rte-range {
  width: 110px;
  accent-color: var(--rte-accent);
}

.rte-img-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rte-hint {
  font-size: 12px;
  color: var(--rte-muted);
}

/* ===== Editor ===== */
.content-editor {
  margin-top: 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 14px;
  min-height: 260px;
  line-height: 1.6;
  background: #fff;
  outline: none;
}

.content-editor:empty:before {
  content: attr(data-placeholder);
  color: #9ca3af;
}

.content-editor img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.content-editor img.rte-selected-img {
  outline: 2px solid var(--rte-accent);
  outline-offset: 2px;
}

/* Toolbar should feel like a document editor on mobile */
@media (max-width: 768px) {
  .rte-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 8px 8px;
    gap: 8px;
  }

  .rte-toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .rte-group {
    border-right: 0;
    margin-right: 0;
    padding-right: 0;
    gap: 6px;
  }

  .rte-btn {
    padding: 10px 10px;
    font-size: 14px;
    border: 1px solid rgba(208, 212, 228, 0.9);
    background: #fff;
  }

  .rte-select {
    padding: 9px 10px;
    font-size: 14px;
  }

  .rte-range { width: 120px; }

  .content-editor {
    padding: 12px;
    min-height: 240px;
  }
}
