/* ======================================================
   BLOG & POST — LinkeContrata (mobile-first)
   Depende de variables ya definidas en /index.css
   ====================================================== */

/* ====== Layout unificado con index (para sticky correcto) ====== */
.blog-page .layout,
.post-page .layout {
  display: flex;
  justify-content: center;
  align-items: stretch;          /* columnas a misma altura visual */
  gap: 16px;
  margin: 0 auto;
  padding: 0 10px;
  max-width: calc(1200px + 320px + 16px); /* 1200 main + 160 + 160 + gap */
}

.blog-page .main-content,
.blog-page .content,
.post-page .main-content,
.post-page .content {
  flex: 1 1 auto;
  max-width: 1200px;
  min-width: 0;
  padding: 0 20px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  overflow: visible;              /* crítico para sticky */
}

/* ===== Laterales: sticky en el ASIDE (más robusto) ===== */
.blog-page .ads,
.post-page .ads {
  width: 160px;
  position: sticky;               /* el aside mismo es sticky */
  top: var(--nav-h);              /* respeta la altura dinámica del header */
  align-self: flex-start;         /* clave en layouts flex */
  overflow: visible;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  z-index: 20;                    /* por encima del contenido cuando “pega” */
}

/* El contenedor interno ya NO es sticky */
.blog-page .ad-slot,
.post-page .ad-slot {
  position: static;               /* antes: sticky */
  width: 160px;
  min-height: 600px;              /* reserva 160x600 sin CLS */
  margin: 10px auto;
  background: #fff;
  border-radius: 8px;
}

.blog-page .ad-slot > ins.adsbygoogle,
.post-page .ad-slot > ins.adsbygoogle {
  display: block !important;
  width: 160px !important;
  min-height: 600px !important;
}

/* Evita que ancestros rompan sticky */
.blog-page .layout, .blog-page .main-content, .blog-page .content,
.post-page .layout, .post-page .main-content, .post-page .content {
  overflow: visible !important;
  transform: none !important;
  contain: none !important;
}

/* Ocultar laterales en ≤1200px igual que index */
@media (max-width: 1200px) {
  .blog-page .left-ad, .blog-page .right-ad,
  .post-page .left-ad, .post-page .right-ad { display: none !important; }

  .blog-page .layout, .post-page .layout {
    flex-direction: column;
    gap: 0;
    padding: 0;
    max-width: 1200px;
  }
  .blog-page .main-content, .blog-page .content,
  .post-page .main-content, .post-page .content { padding: 0 10px; }
}

/* ===== Navbar: micro-ajustes con scope de página (a la par del index.css) ===== */
.blog-page header,
.post-page header {
  padding: var(--nav-pad-y) 5%;
}
.blog-page header.scrolled,
.post-page header.scrolled {
  padding: var(--nav-pad-y-scrolled) 5%;
}

/* Logo compacto en blog/post (usa variables globales) */
.blog-page .logo img,
.post-page .logo img {
  height: var(--logo-h);
}
@media (max-width: 900px) {
  .blog-page .logo img,
  .post-page .logo img { height: var(--logo-h-sm); }
}

/* ======================================================
   LISTADO (Blog)
   ====================================================== */
.blog-page .content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* ---------- HERO ---------- */
.blog-page .blog-hero {
  text-align: center;
  margin-bottom: 20px;
}
.blog-page .blog-hero h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 8px;
  color: var(--lc-primary-dark);
}
.blog-page .blog-hero p {
  color: var(--lc-text-muted);
  font-size: 1rem;
}
@media (min-width: 601px) {
  .blog-page .blog-hero h1 { font-size: 2.2rem; }
}

/* ---------- Filtros (chips) ---------- */
.blog-page .blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 16px 0 8px;
}
@media (max-width: 900px) {
  .blog-page .blog-filters {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 6px;
    mask-image: linear-gradient(to right, transparent 0, black 24px, black calc(100% - 24px), transparent 100%);
  }
}
.blog-page .chip {
  border: 1px solid var(--lc-border);
  background: var(--lc-surface);
  color: var(--lc-text);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: box-shadow .2s, transform .1s, border-color .2s, background .2s, color .2s;
  flex: 0 0 auto;
}
.blog-page .chip:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, .07); }
.blog-page .chip.active {
  border-color: transparent;
  background: var(--lc-primary);
  color: #fff;
  box-shadow: 0 2px 12px rgba(10, 102, 194, .25);
}
.blog-page .chip:focus-visible {
  outline: 3px solid var(--lc-accent);
  outline-offset: 2px;
}
.blog-page .chip.active:hover { background: #0b5db0; }

/* ---------- Grid de tarjetas ---------- */
.blog-page .blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 18px;
}
@media (min-width: 521px) {
  .blog-page .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}
@media (min-width: 1025px) {
  .blog-page .blog-grid {
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 22px;
  }
}

/* Tarjeta */
.blog-page .blog-card {
  background: var(--lc-surface);
  border: 1px solid var(--lc-border);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
  outline: none;
}
@media (hover: hover) and (pointer: fine) {
  .blog-page .blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(10, 102, 194, 0.14);
  }
}

.blog-page .blog-card .thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: #e9eef6;
  transition: transform .25s ease;
}
@media (hover: hover) and (pointer: fine) {
  .blog-page .blog-card:hover .thumb { transform: scale(1.01); }
}

.blog-page .blog-card .card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 1025px) {
  .blog-page .blog-card .card-body { padding: 14px 14px 16px; }
}

.blog-page .pill {
  align-self: flex-start;
  background: rgba(10, 102, 194, .10);
  color: var(--lc-primary-dark);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 6px 10px;
  border-radius: 999px;
  letter-spacing: .2px;
  margin-right: 6px;
}

.blog-page .blog-card h2 {
  font-size: 1.02rem;
  line-height: 1.35;
}
@media (min-width: 1025px) {
  .blog-page .blog-card h2 { font-size: 1.1rem; }
}
.blog-page .blog-card h2 a {
  color: var(--lc-text);
  text-decoration: none;
}
.blog-page .blog-card h2 a:hover {
  color: var(--lc-primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.blog-page .excerpt {
  color: var(--lc-text-muted);
  font-size: .92rem;
}
@media (min-width: 1025px) {
  .blog-page .excerpt { font-size: .95rem; }
}

.blog-page .meta {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--lc-text-muted);
  font-size: .85rem;
}

/* CTA */
.blog-page .btn-go {
  display: inline-block;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--lc-primary);
  color: #fff !important;
  text-align: center;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  transition: transform .1s, background .2s, box-shadow .2s;
  box-shadow: 0 6px 12px rgba(10, 102, 194, .2);
}
.blog-page .btn-go:hover {
  background: #0b5db0;
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(10, 102, 194, .28);
}
.blog-page .btn-go:active { transform: scale(0.98); }

/* ---------- Paginación ---------- */
.blog-page .pager {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  row-gap: 6px;
}
.blog-page .pager a {
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid var(--lc-border);
  background: var(--lc-surface);
  color: var(--lc-text);
  font-weight: 600;
  min-width: 40px;
  text-align: center;
}
.blog-page .pager a.active,
.blog-page .pager a:hover {
  background: var(--lc-primary);
  color: #fff;
  border-color: transparent;
}

/* ======================================================
   DETALLE (Post)
   ====================================================== */
.post-page .article-header {
  max-width: 820px;
  margin: 0 auto 14px;
  padding-left: 8px;
  padding-right: 8px;
}
.post-page .breadcrumb {
  font-size: .9rem;
  color: var(--lc-text-muted);
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}
.post-page .breadcrumb a { color: var(--lc-primary); }

.post-page .post-title {
  font-size: 1.6rem;
  line-height: 1.2;
  margin-bottom: 6px;
  color: var(--lc-primary-dark);
}
@media (min-width: 601px) {
  .post-page .post-title { font-size: 2rem; }
}

.post-page .post-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--lc-text-muted);
  font-size: .9rem;
  flex-wrap: wrap;
  row-gap: 4px;
}

/* Hero (corrige inline max-height en móvil) */
.post-page figure { margin: 16px 0; }
#hero-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #e9eef6;
  border-radius: 12px;
}
@media (max-width: 900px) {
  #hero-img {
    max-height: none !important;
    height: auto !important;
    width: 100% !important;
  }
}
.post-page figcaption {
  text-align: center;
  font-size: .9rem;
  color: var(--lc-text-muted);
  margin-top: 6px;
}

/* Cuerpo */
.post-page .article-body {
  max-width: 820px;
  margin: 8px auto 0;
  color: var(--lc-text);
  font-size: 1.02rem;
  line-height: 1.75;
  letter-spacing: .1px;
  padding: 0 8px;
}
@media (min-width: 801px) {
  .post-page .article-body {
    font-size: 1.05rem;
    line-height: 1.75;
  }
}
.post-page .article-body p { margin: 12px 0; }

.article-body a { color: var(--lc-primary); }

.article-body h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 6px;
  color: var(--lc-primary-dark);
}
.post-page .article-body h2 {
  font-size: 1.32rem;
  line-height: 1.3;
  margin: 20px 0 10px;
  color: var(--lc-primary-dark);
}
@media (min-width: 801px) {
  .post-page .article-body h2 { font-size: 1.45rem; }
}
.post-page .article-body h3 {
  font-size: 1.12rem;
  margin: 16px 0 8px;
  color: var(--lc-primary-dark);
}
@media (min-width: 801px) {
  .post-page .article-body h3 { font-size: 1.2rem; }
}

/* Listas */
.post-page .article-body ul,
.post-page .article-body ol {
  padding-left: 1.1rem;
  margin: 10px 0 14px;
}
.post-page .article-body li { margin: 6px 0; }

/* Imágenes del cuerpo */
.post-page .article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

/* Citas y código */
.post-page .article-body blockquote {
  margin: 14px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--lc-primary);
  background: rgba(10,102,194,.06);
  border-radius: 8px;
  color: var(--lc-primary-dark);
}
.post-page .article-body pre,
.post-page .article-body code,
.post-page .article-body kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
.post-page .article-body pre {
  background: #0b0f14;
  color: #e4e9ef;
  padding: 14px;
  border-radius: 10px;
  overflow: auto;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.post-page .article-body code:not(pre code) {
  background: rgba(10,102,194,.1);
  color: var(--lc-primary-dark);
  padding: 2px 6px;
  border-radius: 6px;
}

/* Tablas responsivas */
.post-page .article-body table {
  display: block;
  width: max-content;
  max-width: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: separate;
  border-spacing: 0;
  margin: 14px 0;
  border: 1px solid var(--lc-border);
  border-radius: 12px;
}
.post-page .article-body thead th {
  text-align: left;
  background: rgba(10,102,194,.08);
  color: var(--lc-primary-dark);
  padding: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.post-page .article-body tbody td {
  padding: 10px;
  border-top: 1px solid var(--lc-border);
  white-space: nowrap;
}
.post-page .article-body tbody tr:nth-child(even) { background: rgba(0,0,0,.02); }

/* details/summary */
.post-page .article-body details {
  border: 1px solid var(--lc-border);
  background: var(--lc-surface);
  border-radius: 12px;
  margin: 12px 0;
  overflow: hidden;
}
.post-page .article-body summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  list-style: none;
  position: relative;
}
.post-page .article-body summary::marker { display: none; }
.post-page .article-body summary::after {
  content: "▾";
  position: absolute;
  right: 14px;
  transition: transform .2s ease;
}
.post-page .article-body details[open] summary::after { transform: rotate(180deg); }
.post-page .article-body details > *:not(summary) { padding: 0 14px 14px; }

/* Compartir */
.post-page .share {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.post-page .share a {
  border: 1px solid var(--lc-border);
  border-radius: 10px;
  padding: 8px 10px;
  text-decoration: none;
  color: var(--lc-text);
  background: var(--lc-surface);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  min-height: 40px;
  min-width: 44px;
  transition: background .2s, color .2s, transform .1s, box-shadow .2s;
}
.post-page .share a:hover {
  background: rgba(10,102,194,.1);
  color: var(--lc-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(10,102,194,.12);
}

/* Relacionados */
.post-page .related {
  max-width: 1000px;
  margin: 28px auto 0;
  padding-left: 16px;
  padding-right: 16px;
}
.post-page .related h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--lc-primary-dark);
}
.post-page .related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
@media (min-width: 521px) {
  .post-page .related-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
}
.post-page .related-card {
  background: var(--lc-surface);
  border: 1px solid var(--lc-border);
  border-radius: 12px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .08);
  overflow: hidden;
}
.post-page .related-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.post-page .related-card a {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--lc-text);
  border-top: 1px solid var(--lc-border);
  transition: color .2s, background .2s;
}
.post-page .related-card a:hover,
.post-page .related-card a:focus-visible {
  background: rgba(10,102,194,.06);
  color: var(--lc-primary-dark);
  text-decoration: none;
}

/* Contenedor del botón de regreso */
.post-page .back-row {
  max-width: 820px;
  margin: 26px auto 34px;
  padding: 0 8px;
  display: flex;
  justify-content: center;
}

/* Botón de regreso — versión mejorada */
.post-page .btn-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--lc-surface);
  color: var(--lc-primary-dark) !important;
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--lc-border);
  box-shadow: 0 4px 12px rgba(10,102,194,.08);
  transition: background .2s, color .2s, transform .12s, box-shadow .2s, border-color .2s;
  line-height: 1;
  min-height: 44px;         /* buen target táctil */
  min-width: 44px;
  -webkit-tap-highlight-color: transparent;
}

.post-page .btn-back i { font-size: 1rem; }

.post-page .btn-back:hover {
  background: rgba(10,102,194,.08);
  color: var(--lc-primary-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(10,102,194,.16);
  border-color: rgba(10,102,194,.35);
}

.post-page .btn-back:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(10,102,194,.12);
}

.post-page .btn-back:focus-visible {
  outline: 3px solid var(--lc-accent);
  outline-offset: 3px;
}

/* En pantallas pequeñas, que luzca como CTA ancho */
@media (max-width: 520px) {
  .post-page .back-row { padding: 0 12px; }
  .post-page .btn-back {
    width: 100%;
    justify-content: center;
    padding: 14px 18px;
    font-size: 1rem;
  }
}

/* Modo oscuro: contraste y sombra más sutil */
@media (prefers-color-scheme: dark) {
  .post-page .btn-back {
    background: rgba(255,255,255,.04);
    border-color: rgba(255,255,255,.12);
    box-shadow: 0 4px 12px rgba(0,0,0,.35);
    color: #e7edf6 !important;
  }
  .post-page .btn-back:hover {
    background: rgba(10,102,194,.18);
    border-color: rgba(10,102,194,.5);
    color: #fff !important;
  }
}

/* ======================================================
   ADS — In-article (reserva sin CLS)
   ====================================================== */
.ads-in-article {
  background: linear-gradient(180deg, #fafbfd, #f7f9fc);
  margin: 20px 0;
  padding: 20px 0;
  text-align: center;
  border: 1px solid var(--lc-border);
  border-radius: 12px;
  display: grid;
  place-items: center;
  min-height: 260px; /* 300x250 */
}
@media (max-width: 480px) {
  .ads-in-article {
    min-height: 120px; /* 320x100 */
    padding: 14px 0;
  }
}

/* (Opcional) Ad dentro de card — solo móvil */
.only-mobile { display: none; }
@media (max-width: 768px) {
  .only-mobile { display: block; }
  .ad-in-card { margin: 8px 0; padding: 0; }
  .ad-in-card ins { width: 100%; display: block; }
}

/* ======================================================
   Accesibilidad y preferencias
   ====================================================== */
.blog-page a:focus-visible,
.blog-page button:focus-visible,
.post-page a:focus-visible,
.post-page button:focus-visible {
  outline: 3px solid var(--lc-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Modo oscuro — refinamientos */
@media (prefers-color-scheme: dark) {
  .post-page .article-body pre {
    background: #0a0d12;
    color: #e7edf6;
  }
  .post-page .article-body blockquote { background: rgba(10,102,194,.14); }
  .blog-page .chip.active { box-shadow: 0 2px 12px rgba(10, 102, 194, .35); }
  .post-page .related-card { box-shadow: 0 5px 14px rgba(0,0,0,.35); }
}

/* ===== HOTFIXES con scope (evita fugas globales) ===== */
.blog-page .main-content, .blog-page .content,
.post-page .main-content, .post-page .content { min-width: 0; }

.blog-page .layout > *, .post-page .layout > * { min-width: 0; }

/* =========================================================
   Mobile Fix Pack — BLOG & POST (v20251107)
   Mantiene desktop intacto, mejora ≤ 900px y ≤ 520px
   ========================================================= */

/* ——— Contenido principal con padding seguro ——— */
@media (max-width: 900px) {
  .blog-page .content,
  .post-page .content,
  .blog-page .main-content,
  .post-page .main-content {
    padding: 0 12px 20px;
  }
}

/* ——— Blog: hero y filtros ——— */
@media (max-width: 900px) {
  .blog-page .blog-hero { margin-bottom: 14px; }
  .blog-page .blog-hero h1 { font-size: 1.6rem; }
  .blog-page .blog-hero p { font-size: .95rem; }
  .blog-page .blog-filters { gap: 8px; margin: 12px 0 6px; }
  .blog-page .chip { font-size: .9rem; padding: 8px 12px; }
}

/* ——— Blog: grilla de tarjetas ——— */
@media (max-width: 900px) {
  .blog-page .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .blog-page .blog-card .card-body { padding: 10px; gap: 8px; }
  .blog-page .blog-card h2 { font-size: 1rem; }
  .blog-page .excerpt { font-size: .9rem; }
}
@media (max-width: 520px) {
  .blog-page .blog-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ——— Post: cabecera y hero ——— */
@media (max-width: 900px) {
  .post-page .article-header {
    margin: 0 auto 10px;
    padding-left: 6px; padding-right: 6px;
  }
  .post-page .post-title {
    font-size: 1.5rem;
    margin-bottom: 6px;
  }
  #hero-img {
    aspect-ratio: 16 / 9;
    height: auto !important;  /* ignora inline max-height */
    max-height: none !important;
  }
}

/* ——— Post: cuerpo ——— */
@media (max-width: 900px) {
  .post-page .article-body {
    font-size: 1rem;
    line-height: 1.7;
    padding: 0 6px;
  }
  .post-page .article-body h2 { font-size: 1.22rem; }
  .post-page .article-body h3 { font-size: 1.08rem; }
  .post-page .article-body pre {
    padding: 12px;
    font-size: .95rem;
  }
}

/* ——— Post: relacionados ——— */
@media (max-width: 900px) {
  .post-page .related {
    margin-top: 22px;
    padding-left: 8px; padding-right: 8px;
  }
  .post-page .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}
@media (max-width: 520px) {
  .post-page .related-grid { grid-template-columns: 1fr; }
}

/* ——— Botón volver ——— */
@media (max-width: 520px) {
  .post-page .back-row { padding: 0 8px; }
  .post-page .btn-back {
    width: 100%;
    justify-content: center;
    padding: 14px 18px;
    font-size: 1rem;
  }
}

/* ——— Ads: asegurar ocultamiento y que no dejen hueco ——— */
@media (max-width: 1200px) {
  .blog-page .left-ad, .blog-page .right-ad,
  .post-page .left-ad, .post-page .right-ad {
    display: none !important;
  }
}

/* ——— Tablas en móvil: scroll suave ——— */
@media (max-width: 520px) {
  .post-page .article-body table {
    max-width: 100%;
    border-radius: 10px;
  }
}


/* --- Post Hero: control 100% por CSS --- */
:root { --post-hero-max: 520px; }

.post-page figure { margin: 16px 0; }

.post-page #hero-img{
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #e9eef6;
  border-radius: 12px;
  /* En desktop permitimos un tope visual (si quieres recorte suave) */
  max-height: var(--post-hero-max);
}

/* Mobile: sin tope, que fluya */
@media (max-width: 900px){
  .post-page #hero-img{
    max-height: none !important;
    height: auto !important;
  }
}


/* Medios fluidos dentro del post */
.post-page .article-body img,
.post-page .article-body svg,
.post-page .article-body video {
  max-width: 100%;
  height: auto;
  display: block;
}


/* --- FIX fuerte para móviles chicos (<640px) --- */

/* 1) Tablas: que nunca excedan el ancho del contenedor */
.post-page .article-body table{
  display:block;
  width:100%;           /* en lugar de width: max-content; */
  max-width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: separate;
  border-spacing: 0;
  margin: 14px 0;
  border:1px solid var(--lc-border);
  border-radius:12px;
}

/* 2) Celdas: permiten wrap y no “ensancha” la página */
.post-page .article-body thead th,
.post-page .article-body tbody td{
  white-space: normal;   /* antes tenías nowrap; sólo úsalo si es imprescindible */
  word-break: break-word;
  overflow-wrap: anywhere;
  padding:10px;
}

/* 3) Texto largo/URLs/código inline: evitar overflow */
.post-page .article-body,
.post-page .article-body p,
.post-page .article-body li,
.post-page .article-body code:not(pre code){
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* 4) Grid de relacionados: 1 columna un poquito antes (<=640px) */
@media (max-width: 640px){
  .post-page .related-grid{ grid-template-columns: 1fr; gap: 12px; }
}

/* 5) Hero: sin tope en móviles chicos (por si algún inline se cuela) */
@media (max-width: 640px){
  #hero-img{
    max-height:none !important;
    height:auto !important;
    width:100% !important;
  }
}

/* 6) Contenedor principal: bloquear desbordes laterales en pantallas muy angostas */
@media (max-width: 640px){
  .post-page .layout,
  .post-page .main-content,
  .post-page .content{
    max-width:100%;
    overflow-x:hidden;
  }
}
