/* Rich-text editor for job descriptions, plus the read-side rendering.
 *
 * .rt-* is the editor. .jb-rich is what the sanitised HTML looks like once it is
 * on a public job page, and the two are kept visually in step so a recruiter
 * sees roughly what a candidate will.
 */

.rt-wrap {
  border: 1px solid var(--gray-300, #cbd5e1);
  border-radius: var(--r, 8px);
  background: #fff;
  overflow: hidden;
}
.rt-wrap:focus-within { border-color: var(--accent, #3b82f6); }

.rt-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--gray-200, #e2e8f0);
  background: var(--gray-50, #f8fafc);
  flex-wrap: wrap;
}
.rt-btn {
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--gray-600, #475569);
  font-family: var(--font, system-ui);
  font-size: .82rem;
  cursor: pointer;
  line-height: 1;
}
.rt-btn:hover { background: #fff; border-color: var(--gray-200, #e2e8f0); }
.rt-sep { width: 1px; height: 18px; background: var(--gray-200, #e2e8f0); margin: 0 5px; }

.rt-area {
  min-height: 200px;
  max-height: 460px;
  overflow-y: auto;
  padding: 14px 16px;
  font-size: .9rem;
  line-height: 1.65;
  color: var(--gray-800, #1e293b);
  outline: none;
}
.rt-area:empty::before {
  content: attr(data-placeholder);
  color: var(--gray-400, #94a3b8);
}

/* The textarea stays in the DOM as the posted field — see richtext.js. Hidden
 * with display:none rather than removed, so a form reset or a browser restoring
 * values still finds it. */
.rt-source { display: none; }

/* Shared block rhythm: editor and rendered output. */
.rt-area p, .jb-rich p { margin: 0 0 10px; }
.rt-area p:last-child, .jb-rich p:last-child { margin-bottom: 0; }
.rt-area h3, .jb-rich h3 { font-size: 1rem; font-weight: 700; margin: 16px 0 8px; }
.rt-area h4, .jb-rich h4 { font-size: .92rem; font-weight: 700; margin: 14px 0 6px; }
.rt-area ul, .rt-area ol, .jb-rich ul, .jb-rich ol { margin: 0 0 10px; padding-left: 22px; }
.rt-area li, .jb-rich li { margin-bottom: 4px; }
.rt-area blockquote, .jb-rich blockquote {
  margin: 0 0 10px;
  padding: 6px 0 6px 14px;
  border-left: 3px solid var(--gray-200, #e2e8f0);
  color: var(--gray-600, #475569);
}
.rt-area a, .jb-rich a { color: var(--navy-light, #2563eb); }

/* The job page renders these inside .jb-detail-section, which already sets its
 * own heading style; scope the overrides so the section's <h3> is untouched. */
.jb-rich > h3:first-child { margin-top: 0; }

.rt-hint {
  font-size: .72rem;
  color: var(--gray-400, #94a3b8);
  margin-top: 6px;
}
