/**
 * Juan Balanzar Bibiano
 * https://balanzar.mx
 * ASEC — content.css
 *
 * Tipografía editorial heredable para el contenido creado desde el editor de
 * WordPress (entradas y páginas). El tema solo traía estilos por clase para
 * las plantillas a medida, por lo que cualquier entrada nueva (encabezados,
 * párrafos, listas, citas, imágenes, tablas, etc.) salía con los estilos por
 * defecto del navegador y desentonaba con el sitio.
 *
 * Estas reglas se limitan a los envoltorios de contenido del editor:
 *   - .asec-page-editor-content  (texto libre que envuelve asec_render_editor_content)
 *   - .asec-prose                (fallback de single.php / page.php)
 * De este modo NO afectan a las secciones a medida ni al formulario ASECsor,
 * que conservan su propio diseño.
 *
 * Todo usa las variables de :root definidas en main.css, así que el estilo del
 * sitio se hereda automáticamente a cualquier entrada que se cree.
 */

.asec-page-editor-content,
.asec-prose {
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.75;
}

/* Ritmo vertical homogéneo entre bloques del editor. */
.asec-page-editor-content > .wrap > *,
.asec-prose > * {
  margin-top: 0;
  margin-bottom: 1.15em;
}
.asec-page-editor-content > .wrap > *:last-child,
.asec-prose > *:last-child {
  margin-bottom: 0;
}

/* --- Encabezados (misma familia/peso que el resto del sitio) --- */
.asec-page-editor-content :where(h1, h2, h3, h4, h5, h6),
.asec-prose :where(h1, h2, h3, h4, h5, h6) {
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  color: var(--navy-ink);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin-top: 1.8em;
  margin-bottom: .5em;
}
.asec-page-editor-content :where(h1, h2, h3, h4, h5, h6):first-child,
.asec-prose :where(h1, h2, h3, h4, h5, h6):first-child {
  margin-top: 0;
}
.asec-page-editor-content h1, .asec-prose h1 { font-size: clamp(30px, 4vw, 44px); }
.asec-page-editor-content h2, .asec-prose h2 { font-size: clamp(26px, 3.2vw, 36px); }
.asec-page-editor-content h3, .asec-prose h3 { font-size: clamp(22px, 2.6vw, 28px); }
.asec-page-editor-content h4, .asec-prose h4 { font-size: 21px; }
.asec-page-editor-content h5, .asec-prose h5 { font-size: 18px; }
.asec-page-editor-content h6, .asec-prose h6 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- Párrafos y enlaces --- */
.asec-page-editor-content p,
.asec-prose p { margin: 0 0 1.15em; }

.asec-page-editor-content a,
.asec-prose a {
  color: var(--coral);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color .15s ease;
}
.asec-page-editor-content a:hover,
.asec-prose a:hover { color: var(--coral-2); }

.asec-page-editor-content strong,
.asec-prose strong { color: var(--navy-ink); font-weight: 700; }

/* --- Listas --- */
.asec-page-editor-content :where(ul, ol),
.asec-prose :where(ul, ol) {
  margin: 0 0 1.15em;
  padding-left: 1.4em;
}
.asec-page-editor-content li,
.asec-prose li { margin: .35em 0; }
.asec-page-editor-content li::marker,
.asec-prose li::marker { color: var(--coral); }
.asec-page-editor-content :where(ul, ol) :where(ul, ol),
.asec-prose :where(ul, ol) :where(ul, ol) { margin: .35em 0; }

/* --- Citas --- */
.asec-page-editor-content blockquote,
.asec-prose blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  border-left: 4px solid var(--coral);
  color: var(--navy-ink);
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-size: 1.18em;
  line-height: 1.5;
  font-style: italic;
}
.asec-page-editor-content blockquote p:last-child,
.asec-prose blockquote p:last-child { margin-bottom: 0; }
.asec-page-editor-content blockquote cite,
.asec-prose blockquote cite {
  display: block;
  margin-top: .6em;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 12.5px;
  font-style: normal;
  letter-spacing: .02em;
  color: var(--muted);
}

/* --- Imágenes y figuras --- */
.asec-page-editor-content :where(img, figure, .wp-block-image),
.asec-prose :where(img, figure, .wp-block-image) {
  max-width: 100%;
  height: auto;
}
.asec-page-editor-content :where(img, figure img, .wp-block-image img),
.asec-prose :where(img, figure img, .wp-block-image img) {
  display: block;
  border-radius: var(--radius);
}
.asec-page-editor-content figure,
.asec-prose figure { margin: 1.8em 0; }
.asec-page-editor-content figcaption,
.asec-prose figcaption,
.asec-page-editor-content .wp-element-caption,
.asec-prose .wp-element-caption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* --- Código --- */
.asec-page-editor-content :where(code, kbd, pre),
.asec-prose :where(code, kbd, pre) {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
.asec-page-editor-content :not(pre) > code,
.asec-prose :not(pre) > code {
  background: var(--bg-2);
  padding: .15em .4em;
  border-radius: 6px;
  font-size: .88em;
  color: var(--navy-ink);
}
.asec-page-editor-content pre,
.asec-prose pre {
  background: var(--navy-ink);
  color: #f3f5f9;
  padding: 20px 22px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}
.asec-page-editor-content pre code,
.asec-prose pre code { background: none; padding: 0; color: inherit; }

/* --- Tablas --- */
.asec-page-editor-content table,
.asec-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 15px;
}
.asec-page-editor-content :where(th, td),
.asec-prose :where(th, td) {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.asec-page-editor-content th,
.asec-prose th {
  color: var(--navy-ink);
  font-weight: 700;
  background: var(--bg-2);
}

/* --- Separadores --- */
.asec-page-editor-content hr,
.asec-prose hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 2.4em 0;
}

/* --- Botones nativos del editor (Gutenberg) con el look del tema --- */
.asec-page-editor-content .wp-block-button__link,
.asec-prose .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease;
}
.asec-page-editor-content .wp-block-button__link:hover,
.asec-prose .wp-block-button__link:hover {
  transform: translateY(-1px);
  background: var(--coral-2);
  color: #fff;
}

/* Alineaciones nativas de WordPress. */
.asec-page-editor-content .aligncenter,
.asec-prose .aligncenter { margin-left: auto; margin-right: auto; }
.asec-page-editor-content .alignright,
.asec-prose .alignright { float: right; margin: 0 0 1em 1.5em; }
.asec-page-editor-content .alignleft,
.asec-prose .alignleft { float: left; margin: 0 1.5em 1em 0; }
