/* ═══════════════════════════════════════════
   KMF Blog — CSS adicional para WordPress
   Se complementa con style.css del tema principal
═══════════════════════════════════════════ */

/* Reset WordPress defaults */
* { box-sizing: border-box; }
body { margin: 0; padding: 0; background: var(--crema); }
img { max-width: 100%; height: auto; }
a { transition: color 0.2s; }

/* ── ARCHIVE / LISTADO ─────────────────────── */
.blog-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
  margin-bottom: 3rem;
}

.blog-archive-card {
  background: var(--white);
  border: 1px solid #e0eaf4;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s, box-shadow 0.25s;
}
.blog-archive-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(56,189,248,0.12);
}

.blog-archive-thumb {
  display: block;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--base), #1a6494);
}
.blog-archive-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}
.blog-archive-card:hover .blog-archive-thumb img { transform: scale(1.04); }

.blog-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-archive-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-archive-cats {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.blog-archive-cat-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--azul-dark);
  text-decoration: none;
  background: rgba(56,189,248,0.08);
  border: 1px solid rgba(56,189,248,0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  transition: background 0.2s;
}
.blog-archive-cat-tag:hover { background: rgba(56,189,248,0.18); }

.blog-archive-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.35;
  margin: 0 0 0.75rem;
  flex: 1;
}
.blog-archive-title a {
  color: var(--base);
  text-decoration: none;
}
.blog-archive-title a:hover { color: var(--azul-dark); }

.blog-archive-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 0 1.25rem;
}

.blog-archive-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f0f4f8;
  padding-top: 0.75rem;
  margin-top: auto;
}
.blog-archive-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.blog-archive-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--azul-dark);
  text-decoration: none;
}
.blog-archive-link:hover { color: var(--base); }

/* Paginación */
.blog-pagination {
  text-align: center;
  margin-top: 2.5rem;
}
.blog-pagination .nav-links { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.blog-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid #e0eaf4;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--base);
  text-decoration: none;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.blog-pagination .page-numbers:hover,
.blog-pagination .page-numbers.current {
  background: var(--base);
  border-color: var(--base);
  color: #fff;
}
.blog-pagination .page-numbers.prev,
.blog-pagination .page-numbers.next { width: auto; padding: 0 1rem; }

/* Estado vacío */
.blog-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--white);
  border-radius: 20px;
  border: 1px solid #e0eaf4;
}
.blog-empty-icon { margin-bottom: 1.25rem; }
.blog-empty-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--base);
  margin-bottom: 0.75rem;
}
.blog-empty-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 480px;
  margin: 0 auto 1.5rem;
}

/* ── SINGLE POST / CONTENIDO ───────────────── */

/* Fondo blanco para el área del artículo — máximo contraste */
.kmf-single section { background: #ffffff; }

/* Columna editorial estrecha — estilo periodístico */
.kmf-post-content {
  font-family: 'DM Sans', Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.9;
  color: #1a2332;           /* casi negro — contraste AAA */
  max-width: 680px;
  margin: 0 auto;
}

/* Lead / primer párrafo destacado */
.kmf-post-content > p:first-of-type {
  font-size: 1.18rem;
  line-height: 1.75;
  color: #0E4D72;
  font-weight: 500;
  border-left: 4px solid #38BDF8;
  padding-left: 1.25rem;
  margin-bottom: 2rem;
}

.kmf-post-content p {
  margin: 0 0 1.4rem;
  color: #1a2332;
}

/* Títulos estilo revista médica */
.kmf-post-content h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.65rem;
  color: #0E4D72;
  margin: 3rem 0 0.85rem;
  line-height: 1.2;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #38BDF8;
}
.kmf-post-content h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.22rem;
  color: #0E4D72;
  margin: 2.25rem 0 0.65rem;
  line-height: 1.3;
}
.kmf-post-content h4 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #0E4D72;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 1.75rem 0 0.5rem;
}

.kmf-post-content strong {
  color: #0E4D72;
  font-weight: 700;
}
.kmf-post-content em { font-style: italic; color: #334155; }
.kmf-post-content a {
  color: #0EA5E9;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.kmf-post-content a:hover { color: #0E4D72; }

/* Listas con estilo limpio */
.kmf-post-content ul,
.kmf-post-content ol {
  margin: 0 0 1.4rem 0;
  padding-left: 1.6rem;
}
.kmf-post-content li {
  margin-bottom: 0.6rem;
  color: #1a2332;
  line-height: 1.7;
}
.kmf-post-content ul li::marker { color: #38BDF8; font-size: 1.1rem; }
.kmf-post-content ol li::marker {
  color: #0E4D72;
  font-weight: 700;
  font-size: 0.95rem;
}

/* Cita destacada — estilo periodístico */
.kmf-post-content blockquote {
  position: relative;
  border-left: none;
  background: #F0F7FF;
  margin: 2.25rem 0;
  padding: 1.75rem 1.75rem 1.75rem 2rem;
  border-radius: 12px;
  border-left: 5px solid #0EA5E9;
}
.kmf-post-content blockquote::before {
  content: '"';
  position: absolute;
  top: -0.5rem;
  left: 1rem;
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  color: #38BDF8;
  line-height: 1;
  opacity: 0.4;
}
.kmf-post-content blockquote p {
  margin: 0;
  font-size: 1.08rem;
  font-style: italic;
  color: #0E4D72;
  font-weight: 500;
  line-height: 1.7;
}

/* Separador elegante */
.kmf-post-content hr {
  border: none;
  margin: 3rem auto;
  width: 60px;
  height: 3px;
  background: linear-gradient(to right, #38BDF8, #0EA5E9);
  border-radius: 2px;
}

/* Imágenes */
.kmf-post-content img {
  border-radius: 10px;
  margin: 2rem 0;
  box-shadow: 0 4px 20px rgba(14,77,114,0.1);
  width: 100%;
}
.kmf-post-content .wp-block-image figcaption {
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Callout / caja destacada */
.kmf-post-content .wp-block-group,
.kmf-post-content .kmf-callout {
  background: #F0F7FF;
  border: 1.5px solid #bfdbfe;
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  margin: 2rem 0;
}
.kmf-post-content .wp-block-group p,
.kmf-post-content .kmf-callout p {
  margin: 0;
  color: #1a2332;
}

/* Tabla simple */
.kmf-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: 0.92rem;
}
.kmf-post-content th {
  background: #0E4D72;
  color: #fff;
  font-weight: 600;
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}
.kmf-post-content td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #e0eaf4;
  color: #1a2332;
}
.kmf-post-content tr:nth-child(even) td { background: #F8FAFC; }

/* ── RESPONSIVE ─────── */
@media (max-width: 768px) {
  .kmf-post-content { font-size: 1rem; }
  .kmf-post-content h2 { font-size: 1.4rem; margin-top: 2.25rem; }
  .kmf-post-content h3 { font-size: 1.1rem; }
  .kmf-post-content > p:first-of-type { font-size: 1.05rem; }
  .kmf-post-content blockquote { padding: 1.25rem 1.25rem 1.25rem 1.5rem; }
}

/* ── RESPONSIVE ───────────────────────────── */
@media (max-width: 768px) {
  .blog-archive-grid { grid-template-columns: 1fr; }
  .kmf-post-content h2 { font-size: 1.35rem; }
  .kmf-post-content h3 { font-size: 1.1rem; }
}
