/* ==========================================================================
   KodigoDev — Estilos de página de artículo / plantilla de contenido
   Reutiliza las variables y componentes base de style.css
   ========================================================================== */

/* ---------- Banner del artículo ---------- */
.article-hero {
  background:
    radial-gradient(circle at 85% 20%, rgba(43,89,255,.08), transparent 45%),
    var(--bg-alt);
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
}
.article-hero__inner { max-width: 800px; margin-inline: auto; text-align: center; }
.article__cat {
  display: inline-block; background: var(--secondary); color: #fff;
  font-weight: 600; font-size: .78rem; letter-spacing: .5px;
  padding: 6px 16px; border-radius: 30px; margin-bottom: 18px;
}
.article__title {
  font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.15; margin-bottom: 20px;
}
.article__meta {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 22px;
  color: var(--muted); font-size: .92rem;
}
.article__meta span { display: inline-flex; align-items: center; gap: 8px; }
.article__meta i { color: var(--primary); }

/* ---------- Cuerpo ---------- */
.article-wrap { max-width: 760px; margin: 0 auto; padding: 0 4%; }

.article__cover {
  margin: -30px auto 44px; max-width: 900px; padding: 0 4%;
}
.article__cover img {
  width: 100%; border-radius: 20px; box-shadow: var(--shadow-md);
  aspect-ratio: 16/8; object-fit: cover;
}

.prose { color: var(--text); font-size: 1.075rem; line-height: 1.8; counter-reset: pun; }
.prose p { margin-bottom: 22px; }
.prose h2 {
  font-size: 1.6rem; margin: 44px 0 18px; padding-top: 8px;
}
.prose h2 .num { color: var(--primary); }
.prose strong { color: var(--navy); }
.prose a { color: var(--primary); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.prose .lead { font-size: 1.2rem; color: var(--navy); font-weight: 500; line-height: 1.7; }

/* Cita destacada / callout */
.callout {
  background: var(--primary-light); border-left: 5px solid var(--primary);
  border-radius: 0 14px 14px 0; padding: 22px 26px; margin: 34px 0;
  font-size: 1.1rem; color: var(--navy); font-style: italic;
}
.callout i { color: var(--primary); margin-right: 8px; }

/* ---------- Lista de juegos de palabras ---------- */
.puns { list-style: none; margin: 32px 0; display: grid; gap: 16px; }
.puns li {
  counter-increment: pun; position: relative;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 24px 22px 78px; box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.puns li:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.puns li::before {
  content: counter(pun); position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--primary); color: #fff;
  font-family: "Nunito", sans-serif; font-weight: 800; font-size: 1.15rem;
  box-shadow: 0 6px 14px rgba(30,115,183,.35);
}
.puns li:nth-child(3n+2)::before { background: var(--secondary); box-shadow: 0 6px 14px rgba(240,127,19,.35); }
.puns li:nth-child(3n)::before { background: var(--navy); box-shadow: 0 6px 14px rgba(11,28,57,.3); }
.puns li p { margin: 0; color: var(--text); }
.puns li .tag { display: block; margin-top: 6px; font-size: .82rem; color: var(--muted); }

/* ---------- Tarjeta "mito vs realidad" ---------- */
.myth {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 24px 26px; margin: 22px 0; box-shadow: var(--shadow-sm);
}
.myth h3 { font-size: 1.2rem; color: var(--navy); margin-bottom: 14px; }
.myth__row { display: flex; gap: 12px; align-items: flex-start; margin-top: 10px; }
.myth__row i { flex-shrink: 0; margin-top: 4px; font-size: 1rem; }
.myth__row p { margin: 0; }
.myth__bad i { color: #e5484d; }
.myth__good i { color: #16a34a; }
.myth__row strong { color: var(--navy); }

/* ---------- Empresa (listado numerado con subtítulo) ---------- */
.puns li .co { font-family: "Nunito", sans-serif; font-weight: 700; color: var(--navy); font-size: 1.05rem; display: block; margin-bottom: 2px; }

/* ---------- Compartir / navegación ---------- */
.share { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 46px 0 10px; padding-top: 28px; border-top: 1px solid var(--border); }
.share span { font-weight: 600; color: var(--navy); font-family: "Nunito", sans-serif; }
.share a {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-light); color: var(--primary); transition: background .25s, color .25s, transform .25s;
}
.share a:hover { background: var(--primary); color: #fff; transform: translateY(-3px); }

.article-foot-nav { margin: 40px 0 10px; }
.back-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; color: var(--primary); font-size: 1rem;
  transition: gap .25s;
}
.back-link:hover { gap: 15px; }

/* ---------- Caja de autor ---------- */
.author-box {
  display: flex; align-items: center; gap: 18px; margin: 40px 0;
  background: var(--bg-alt); border-radius: 16px; padding: 24px;
}
.author-box__avatar {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: #fff; display: grid; place-items: center;
  font-family: "Nunito", sans-serif; font-weight: 800; font-size: 1.5rem;
}
.author-box strong { color: var(--navy); font-family: "Nunito", sans-serif; display: block; }
.author-box p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }

/* ---------- Artículos relacionados ---------- */
.related { margin: 52px 0 10px; padding-top: 30px; border-top: 1px solid var(--border); }
.related h2 { font-size: 1.5rem; margin-bottom: 22px; }
.related__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.rel-card {
  display: block; background: #fff; border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.rel-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: transparent; }
.rel-card__img { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.rel-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.rel-card:hover .rel-card__img img { transform: scale(1.06); }
.rel-card__img .post-card__cat { position: absolute; top: 12px; left: 12px; }
.rel-card__body { padding: 18px 20px 20px; }
.rel-card__body h3 { font-size: 1.02rem; line-height: 1.35; margin-bottom: 12px; color: var(--navy); }
.rel-card__body .link-more { font-size: .88rem; }
@media (max-width: 560px) { .related__grid { grid-template-columns: 1fr; } }

/* ---------- CTA final ---------- */
.article-cta {
  background: linear-gradient(120deg, var(--primary), #3a9bd8);
  border-radius: 20px; padding: 40px; text-align: center; color: #fff;
  margin: 50px 0 10px; box-shadow: 0 20px 45px rgba(30,115,183,.3);
}
.article-cta h3 { color: #fff; font-size: 1.5rem; margin-bottom: 10px; }
.article-cta p { color: rgba(255,255,255,.9); margin-bottom: 22px; }
.article-cta .btn { background: var(--navy); box-shadow: none; }
.article-cta .btn:hover { background: #050e1f; }

.article-section { padding: 30px 0 80px; }

@media (max-width: 560px) {
  .puns li { padding: 20px 18px 20px 68px; }
  .puns li::before { width: 38px; height: 38px; left: 14px; }
  .article__cover { margin-top: -10px; }
  .article-hero { padding: 40px 0 32px; }
  .prose { font-size: 1.02rem; }
  .prose h2 { font-size: 1.35rem; margin: 34px 0 14px; }
  .callout { padding: 18px 20px; font-size: 1.02rem; }
  .article-cta { padding: 30px 22px; }
  .article-cta h3 { font-size: 1.25rem; }
  .article__cover img { aspect-ratio: 16/10; }
}

/* Cualquier tabla o bloque ancho dentro del artículo se desplaza solo,
   en vez de forzar scroll horizontal en toda la página */
.prose table { display: block; width: 100%; overflow-x: auto; }
