/* Risevano custom rich editor (TinyMCE-like) + front-end content */

.re-native {
  display: none !important;
}

.re-editor {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.re-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.re-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0 0.4rem;
  border: 1px solid transparent;
  border-radius: 0.4rem;
  background: transparent;
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.re-tool:hover {
  background: #e2e8f0;
}

.re-tool--text {
  min-width: auto;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.re-sep {
  width: 1px;
  height: 1.35rem;
  margin: 0 0.15rem;
  background: #cbd5e1;
}

.re-select {
  height: 1.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  background: #fff;
  color: #0f172a;
  font-size: 0.75rem;
  padding: 0 0.35rem;
  max-width: 9.5rem;
}

.re-select--blocks {
  min-width: 7.5rem;
}

.re-select--spacing {
  min-width: 7rem;
  max-width: 10rem;
}

.re-fontsize {
  display: inline-flex;
  align-items: center;
  height: 1.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}

.re-fontsize__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 100%;
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.re-fontsize__btn:hover {
  background: #e2e8f0;
}

.re-fontsize__value {
  width: 2.75rem;
  height: 100%;
  border: 0;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.re-fontsize__value::-webkit-outer-spin-button,
.re-fontsize__value::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.re-spacing {
  position: relative;
  display: inline-flex;
}

.re-spacing__toggle.is-open,
.re-spacing.is-open .re-spacing__toggle {
  background: #e2e8f0;
}

.re-spacing__icon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  line-height: 1;
}

.re-spacing__icon-t {
  font-size: 0.78rem;
  font-weight: 800;
}

.re-spacing__icon-arrows {
  font-size: 0.55rem;
  line-height: 1;
  margin-top: -0.05rem;
}

.re-spacing__panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 40;
  width: 15.5rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.re-spacing__row + .re-spacing__row {
  margin-top: 0.85rem;
}

.re-spacing__label {
  margin-bottom: 0.4rem;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
}

.re-spacing__control {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.re-spacing__range {
  flex: 1;
  min-width: 0;
  accent-color: #64748b;
  cursor: pointer;
}

.re-spacing__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 1.45rem;
  padding: 0 0.35rem;
  border-radius: 0.4rem;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 700;
}

.re-spacing__divider {
  height: 1px;
  margin: 0.95rem 0 0.75rem;
  background: #e2e8f0;
}

.re-spacing__anchors {
  display: inline-flex;
  gap: 0.35rem;
}

.re-spacing__anchor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  background: transparent;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.re-spacing__anchor:hover {
  background: #f1f5f9;
}

.re-spacing__anchor.is-active {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #ddd6fe;
}

.re-surface h1,
.re-surface h2,
.re-surface h3,
.re-surface h4,
.re-surface h5,
.re-surface h6 {
  margin: 0.75em 0 0.4em;
  line-height: 1.25;
  font-weight: 800;
  color: #0f172a;
}

.re-surface h1 { font-size: 2rem; }
.re-surface h2 { font-size: 1.6rem; }
.re-surface h3 { font-size: 1.35rem; }
.re-surface h4 { font-size: 1.15rem; }
.re-surface h5 { font-size: 1.05rem; }
.re-surface h6 { font-size: 0.95rem; }

.re-surface p {
  margin: 0.55em 0;
}

.re-color {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.4rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  font-size: 0.65rem;
  font-weight: 800;
}

.re-color input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.re-surface,
.re-source {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  padding: 0.9rem 1rem;
  border: 0;
  outline: none;
  background: #fff;
  color: #0f172a;
  font-size: 0.95rem;
  line-height: 1.65;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: auto;
  overflow-wrap: anywhere !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  white-space: normal !important;
}

.re-source {
  white-space: pre-wrap !important;
  resize: vertical;
}

.re-surface p,
.re-surface div,
.re-surface li,
.re-surface h1,
.re-surface h2,
.re-surface h3,
.re-surface h4,
.re-surface h5,
.re-surface h6,
.re-surface span,
.re-surface a {
  max-width: 100% !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
}

.re-surface:focus,
.re-source:focus {
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.18);
}

.re-surface p,
.re-surface ul,
.re-surface ol,
.re-surface blockquote,
.re-surface pre,
.re-surface table {
  margin: 0.75em 0;
}

.re-surface ul,
.re-surface ol {
  padding-left: 1.35rem;
}

.re-surface blockquote {
  border-left: 3px solid #2e4dfe;
  padding-left: 0.85rem;
  color: #475569;
}

.re-surface table {
  width: 100%;
  border-collapse: collapse;
}

.re-surface th,
.re-surface td {
  border: 1px solid #cbd5e1;
  padding: 0.4rem 0.55rem;
}

.re-surface img,
.re-surface video,
.re-surface iframe {
  max-width: 100%;
  height: auto;
  border-radius: 0.55rem;
}

.re-surface iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
}

.re-pagebreak {
  border: 0;
  border-top: 2px dashed #94a3b8;
  margin: 1.25rem 0;
}

.re-status {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0.35rem 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
}

.re-editor.is-source .re-toolbar .re-tool:not(.re-tool--text),
.re-editor.is-source .re-select,
.re-editor.is-source .re-color {
  opacity: 0.45;
  pointer-events: none;
}

.re-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
}

.re-modal {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 0.9rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  padding: 1rem;
}

.re-modal__title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.re-modal__body {
  display: grid;
  gap: 0.65rem;
}

.re-modal__field {
  display: grid;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}

.re-modal__field input,
.re-modal__field textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f172a;
}

.re-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.re-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.1rem;
  padding: 0.4rem 0.8rem;
  border-radius: 0.55rem;
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.re-btn--ghost {
  border-color: #e2e8f0;
  background: #fff;
  color: #0f172a;
}

.re-btn--primary {
  background: #0f766e;
  color: #fff;
}

/* Front-end rendered HTML */
.rich-content {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  line-height: 1.7;
  color: inherit;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

.rich-content,
.rich-content * {
  max-width: 100%;
  overflow-wrap: anywhere !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  white-space: normal !important;
}

.rich-content pre,
.rich-content code {
  white-space: pre-wrap !important;
}

.rich-content > *:first-child {
  margin-top: 0;
}

.rich-content > *:last-child {
  margin-bottom: 0;
}

.rich-content p,
.rich-content ul,
.rich-content ol,
.rich-content blockquote,
.rich-content pre,
.rich-content table {
  margin: 0.85em 0;
}

.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4,
.rich-content h5,
.rich-content h6 {
  margin: 1.1em 0 0.45em;
  line-height: 1.25;
  font-weight: 800;
}

.rich-content ul,
.rich-content ol {
  padding-left: 1.35rem;
}

.rich-content blockquote {
  border-left: 3px solid #2e4dfe;
  padding: 0.25rem 0 0.25rem 1rem;
  color: #475569;
}

.rich-content img,
.rich-content video,
.rich-content iframe {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
}

.rich-content iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 220px;
}

.rich-content table {
  width: 100%;
  border-collapse: collapse;
}

.rich-content th,
.rich-content td {
  border: 1px solid rgba(148, 163, 184, 0.55);
  padding: 0.5rem 0.7rem;
  vertical-align: top;
}

.rich-content a {
  color: #2e4dfe;
  text-decoration: underline;
}

.rich-content pre {
  overflow-x: auto;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.875rem;
}

.rich-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
