/*
 * Tipografía para contenido de ActionText / Trix.
 *
 * Se aplica al render final (ActionText envuelve la salida en
 * <div class="trix-content">) y también al editor mientras se escribe
 * (<trix-editor>), para que viñetas, encabezados y espaciados se vean
 * igual editando que publicado.
 *
 * Tailwind Preflight quita viñetas, márgenes y tamaños de encabezado, así
 * que aquí los devolvemos de forma explícita y contenida.
 */

.trix-content,
trix-editor {
  line-height: 1.6;
  overflow-wrap: break-word;
  word-break: break-word;
  color: inherit;
}

.trix-content > *:first-child,
trix-editor > *:first-child { margin-top: 0; }
.trix-content > *:last-child,
trix-editor > *:last-child  { margin-bottom: 0; }

.trix-content p,
trix-editor p { margin: 0 0 0.75em; }

.trix-content h1, .trix-content h2, .trix-content h3, .trix-content h4,
trix-editor h1, trix-editor h2, trix-editor h3, trix-editor h4 {
  font-weight: 700;
  line-height: 1.25;
  margin: 1.2em 0 0.5em;
}

.trix-content h1, trix-editor h1 { font-size: 1.6em; }
.trix-content h2, trix-editor h2 { font-size: 1.3em; }
.trix-content h3, trix-editor h3 { font-size: 1.12em; }
.trix-content h4, trix-editor h4 { font-size: 1em; text-transform: uppercase; letter-spacing: .03em; }

.trix-content ul, .trix-content ol,
trix-editor ul, trix-editor ol {
  margin: 0 0 0.75em;
  padding-left: 1.5em;
}

.trix-content ul, trix-editor ul { list-style: disc; }
.trix-content ol, trix-editor ol { list-style: decimal; }
.trix-content ul ul, trix-editor ul ul { list-style: circle; }
.trix-content ul ul ul, trix-editor ul ul ul { list-style: square; }

.trix-content li, trix-editor li { margin: 0.25em 0; padding-left: 0.15em; }
.trix-content li > ul, .trix-content li > ol,
trix-editor li > ul, trix-editor li > ol { margin: 0.25em 0; }

.trix-content a, trix-editor a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.trix-content strong, .trix-content b, trix-editor strong, trix-editor b { font-weight: 700; }
.trix-content em, .trix-content i, trix-editor em, trix-editor i { font-style: italic; }

.trix-content mark, trix-editor mark {
  background: #fde68a;
  color: inherit;
  padding: 0 0.15em;
  border-radius: 2px;
}

.trix-content blockquote, trix-editor blockquote {
  border-left: 3px solid #d1d5db;
  margin: 0 0 0.75em;
  padding: 0.1em 0 0.1em 0.9em;
  color: #4b5563;
}

.trix-content pre, trix-editor pre {
  background: #f3f4f6;
  border-radius: 6px;
  padding: 0.7em 0.9em;
  margin: 0 0 0.75em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  white-space: pre-wrap;
  overflow-x: auto;
}

.trix-content code, trix-editor code {
  background: #f3f4f6;
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}
.trix-content pre code, trix-editor pre code { background: transparent; padding: 0; }

.trix-content hr, trix-editor hr {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 1.2em 0;
}

.trix-content table, trix-editor table {
  border-collapse: collapse;
  margin: 0 0 0.75em;
  width: 100%;
}
.trix-content th, .trix-content td,
trix-editor th, trix-editor td {
  border: 1px solid #e5e7eb;
  padding: 0.4em 0.6em;
  text-align: left;
}
.trix-content th, trix-editor th { background: #f9fafb; font-weight: 700; }

/* --- el editor Trix en sí --- */
trix-editor {
  border: 0;
  min-height: 12em;
  padding: 0.75em 0.9em;
}

/* --- barra de herramientas de los editores mejorados (.rich-editor-field):
       una sola barra continua; si no cabe, scroll horizontal (no 2 líneas
       ni 4 recuadros sueltos) --- */
.rich-editor-field trix-toolbar { display: block; }

.rich-editor-field trix-toolbar .trix-button-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  overflow-x: auto;
  margin-bottom: 6px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
}

.rich-editor-field trix-toolbar .trix-button-group {
  display: flex;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.rich-editor-field trix-toolbar .trix-button-group + .trix-button-group {
  border-left: 1px solid #e5e7eb;
}

.rich-editor-field trix-toolbar .trix-button-group-spacer { display: none; }
/* sin adjuntos en estos editores (textos legales / info de evento) */
.rich-editor-field trix-toolbar .trix-button-group--file-tools { display: none; }

.rich-editor-field trix-toolbar .trix-button {
  border: 0;
  padding: 0 0.5em;
  height: 2.2em;
  float: none;
}

.rich-editor-field trix-toolbar .trix-button--icon {
  width: 2.3em;
  max-width: none;
}
