/* ============================================
   RICH TEXT EDITOR
   Adapted from the SOP policy editor's toolbar/behavior, restyled to
   match this site's paper/ink/seal-red palette.
   ============================================ */

.rte-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
}

.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px;
  background: var(--paper-deep);
  border-bottom: 1px solid var(--line);
}

.rte-btn {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}

.rte-btn:hover {
  background: var(--paper);
}

.rte-btn-active {
  background: rgba(163, 52, 42, 0.12);
  border-color: var(--seal-red-soft);
  color: var(--seal-red);
}

.rte-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.rte-btn svg {
  vertical-align: middle;
  color: currentColor;
}

.rte-size-select {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 6px;
  font-family: var(--font-ui);
  font-size: 13px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}

.rte-content {
  min-height: 240px;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink);
  outline: none;
}

.rte-content h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 1.2em 0 0.5em;
}

.rte-content ul,
.rte-content ol {
  margin: 8px 0;
  padding-left: 24px;
}

.rte-content a {
  color: var(--seal-red);
  cursor: pointer;
}

.rte-content sup {
  vertical-align: super;
  font-size: 0.75em;
}

.rte-content sub {
  vertical-align: sub;
  font-size: 0.75em;
}

.rte-content hr {
  border: none;
  border-top: 2px solid var(--line);
  margin: 20px 0;
}

/* ============================================
   COLUMN LAYOUTS (inside the editable content)
   ============================================ */
.rte-col-layout {
  display: flex;
  gap: 20px;
  margin: 10px 0 16px;
}

.rte-col {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
}

/* Only show the column boundary while editing — helps whoever's composing
   see where each column starts/ends. The published article view (outside
   the editor) doesn't get this dashed border. */
.rte-content .rte-col {
  border: 1px dashed var(--line);
  border-radius: 6px;
}

.rte-col.rte-valign-top {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.rte-col.rte-valign-middle {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.rte-col.rte-valign-bottom {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* ============================================
   LINK INSERT MODAL
   ============================================ */
.rte-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(43, 38, 34, 0.45);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.rte-modal-box {
  background: var(--white);
  border-radius: 10px;
  padding: 22px 24px;
  width: 380px;
  max-width: 90%;
  box-shadow: 0 12px 32px rgba(43, 38, 34, 0.2);
}

.rte-modal-box h3 {
  margin: 0 0 14px;
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--ink);
}

.rte-modal-box label {
  display: block;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.rte-modal-box input[type="text"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 14px;
  background: var(--paper);
  color: var(--ink);
}

.rte-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.rte-modal-insert {
  background: var(--seal-red);
  color: var(--white);
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
}

.rte-modal-insert:hover {
  background: var(--seal-red-soft);
}

.rte-modal-cancel {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink);
}