/* =============================================================
   POST CONTENT — Estilos del cuerpo de la entrada
   WordPress: aplica a .entry-content / .wp-block-post-content
   Todos los selectores van dentro de .post-content para
   no afectar al resto del sitio.
   ============================================================= */

.post-content {
  font-family: var(--f-body);
  font-size: 1.0625rem;   /* 17px — lectura cómoda */
  line-height: 1.75;
  color: var(--c-text);
}

/* ── Párrafos ─────────────────────────────────────────────────── */
.post-content p {
  margin-block: 0 1.5rem;
}

.post-content p:last-child { margin-bottom: 0; }

/* ── Cabeceras ───────────────────────────────────────────────── */
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-family: var(--f-heading);
  font-weight: normal;
  color: var(--c-dark);
  line-height: 1.15;
  margin-block: 2.5rem 0.875rem;
}

.post-content h2 { font-size: var(--text-4xl); }
.post-content h3 { font-size: var(--text-3xl); }
.post-content h4 { font-size: var(--text-2xl); }
.post-content h5 { font-size: var(--text-xl); font-family: var(--f-ui); font-weight: 700; letter-spacing: 0; }
.post-content h6 { font-size: var(--text-base); font-family: var(--f-ui); font-weight: 700; letter-spacing: 0; color: var(--c-text-2); }

/* Primera cabecera después del lede no necesita tanto margen superior */
.post-content > h2:first-child,
.post-content > h3:first-child {
  margin-top: 0;
}

/* ── Listas ──────────────────────────────────────────────────── */
.post-content ul,
.post-content ol {
  margin-block: 0 1.5rem;
  padding-left: 1.5rem;
}

.post-content ul { list-style: none; padding-left: 0; }

.post-content ul li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
}

.post-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.625rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--c-accent);
}

.post-content ol { list-style: decimal; }

.post-content ol li {
  padding-left: 0.375rem;
  margin-bottom: 0.5rem;
}

/* Listas anidadas */
.post-content ul ul,
.post-content ol ol,
.post-content ul ol,
.post-content ol ul {
  margin-block: 0.5rem 0;
}

/* ── Blockquote ──────────────────────────────────────────────── */
.post-content blockquote {
  margin-block: 2rem;
  margin-inline: 0;
  padding: 1.5rem 1.75rem;
  border-left: 4px solid var(--c-accent);
  background-color: var(--c-gray);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.post-content blockquote p {
  font-family: var(--f-heading);
  font-size: var(--text-2xl);
  line-height: 1.4;
  color: var(--c-dark);
  font-style: italic;
  margin-bottom: 0;
}

.post-content blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--f-ui);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--c-text-2);
  font-weight: 600;
}

.post-content blockquote cite::before { content: '— '; }

/* ── Código ──────────────────────────────────────────────────── */
.post-content code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Menlo, Consolas, monospace;
  font-size: 0.875em;
  background-color: var(--c-gray);
  color: #c7254e;
  padding: 0.15em 0.45em;
  border-radius: 3px;
  border: 1px solid var(--c-gray-2);
  white-space: nowrap;
}

.post-content pre {
  margin-block: 0 2rem;
  background-color: var(--c-dark);
  border-radius: var(--r-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.post-content pre code {
  display: block;
  padding: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: #e2e8f0;
  background: none;
  border: none;
  white-space: pre;
  border-radius: 0;
}

/* Número de línea opcional */
.post-content pre .line-number {
  display: inline-block;
  width: 2rem;
  color: #4a5568;
  user-select: none;
  text-align: right;
  margin-right: 1rem;
}

/* ── Imágenes y figuras ──────────────────────────────────────── */
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-sm);
  display: block;
  margin-block: 0 1.5rem;
}

.post-content figure {
  margin-block: 0 2rem;
  margin-inline: 0;
}

.post-content figure img {
  width: 100%;
  margin-bottom: 0;
}

.post-content figcaption {
  display: block;
  padding: 0.625rem 0.875rem;
  background-color: var(--c-gray);
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-family: var(--f-ui);
  font-size: 0.8125rem;
  color: var(--c-text-2);
  line-height: 1.5;
}

/* Imagen ancha (sale del contenedor de texto) */
.post-content .img-wide {
  width: calc(100% + 8rem);
  margin-inline: -4rem;
  max-width: none;
  border-radius: var(--r-sm);
}

/* ── Tablas ──────────────────────────────────────────────────── */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-block: 0 2rem;
  font-size: 0.9375rem;
  overflow-x: auto;
  display: block;
}

.post-content table thead {
  background-color: var(--c-dark);
  color: var(--c-white);
}

.post-content table th {
  padding: 0.75rem 1rem;
  font-family: var(--f-ui);
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: left;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.post-content table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--c-border);
  vertical-align: top;
  line-height: 1.5;
}

.post-content table tbody tr:hover {
  background-color: var(--c-gray);
}

.post-content table tbody tr:last-child td {
  border-bottom: none;
}

/* ── Énfasis y formato ───────────────────────────────────────── */
.post-content strong { font-weight: 700; color: var(--c-dark); }
.post-content em     { font-style: italic; }
.post-content mark   {
  background-color: rgba(46, 163, 241, 0.18);
  color: inherit;
  padding: 0.1em 0.25em;
  border-radius: 2px;
}
.post-content s, .post-content del { color: var(--c-text-2); }
.post-content abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}
.post-content kbd {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 0.8em;
  padding: 0.15em 0.45em;
  border: 1px solid var(--c-gray-2);
  border-bottom-width: 3px;
  border-radius: 3px;
  background-color: var(--c-gray);
  color: var(--c-dark);
}

/* ── Enlaces dentro del contenido ────────────────────────────── */
/* Texto negro + negrita para contraste AA (4.5:1); el azul queda
   como subrayado para no perder la identidad visual del enlace. */
.post-content a {
  color: var(--c-dark);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--c-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color var(--t), text-decoration-color var(--t);
}

.post-content a:hover {
  color: var(--c-accent-hover);
  text-decoration-color: var(--c-accent-hover);
}

/* ── Separador horizontal ────────────────────────────────────── */
.post-content hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin-block: 2.5rem;
}

/* ── Callout / Nota informativa ──────────────────────────────── */
.post-content .callout {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--r-sm);
  margin-block: 0 2rem;
  background-color: rgba(46, 163, 241, 0.08);
  border: 1px solid rgba(46, 163, 241, 0.25);
}

.post-content .callout__icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1.75;
}

.post-content .callout p {
  margin-bottom: 0;
  font-size: 0.9375rem;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .post-content { font-size: var(--text-base); }
  .post-content h2 { font-size: var(--text-3xl); }
  .post-content h3 { font-size: var(--text-2xl); }
  .post-content h4 { font-size: var(--text-xl);  }

  .post-content blockquote p  { font-size: var(--text-xl); }
  .post-content .img-wide     { width: 100%; margin-inline: 0; }

  .post-content pre code { font-size: 0.8rem; padding: 1.25rem; }
}
