/* ============================================================
   Reconocerme — Blog
   Extiende styles.css (mismos tokens). Estilos para el índice
   del blog (.blog-*) y las páginas de artículo (.post-*).
   ============================================================ */

/* ============ Barra de progreso de lectura ============ */

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--violet), var(--violet-deep));
  z-index: 1200;
  pointer-events: none;
}

/* ============ Índice del blog ============ */

.blog-hero {
  position: relative;
  padding: calc(var(--header-h) + 4.5rem) 0 3.5rem;
  overflow: hidden;
}

.blog-hero::before {
  content: "";
  position: absolute;
  top: -180px;
  right: -160px;
  width: 480px;
  height: 480px;
  background: radial-gradient(closest-side, var(--violet-wash), transparent 72%);
  border-radius: 50%;
  pointer-events: none;
}

.blog-hero-inner {
  max-width: 780px;
}

.blog-hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  margin-bottom: 1.1rem;
}

.blog-hero .lead {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 60ch;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
  margin-top: 3rem;
}

.blog-card {
  grid-column: span 1;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: var(--rule-soft);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-soft);
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
}

.blog-card-visual {
  background: var(--violet-wash);
  padding: 1.6rem 2rem 0.8rem;
  display: flex;
  justify-content: center;
}

.blog-card-visual img {
  width: 100%;
  max-width: 300px;
  height: auto;
  transition: transform 0.6s var(--ease-out);
}

.blog-card:hover .blog-card-visual img {
  transform: translateY(-4px) rotate(-1deg);
}

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

.blog-card-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--violet-deep);
  margin-bottom: 0.7rem;
}

.blog-card h2,
.blog-card h3 {
  font-size: 1.28rem;
  margin-bottom: 0.6rem;
}

.blog-card p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  flex: 1;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.1rem;
  font-size: 0.82rem;
  color: var(--ink-mute);
}

.blog-card-meta::before {
  content: "❧";
  color: var(--olive);
  font-size: 0.9rem;
}

/* Tarjeta destacada: ocupa todo el ancho, layout horizontal */
.blog-card-featured {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: stretch;
}

.blog-card-featured .blog-card-visual {
  flex: 0 0 42%;
  align-items: center;
  padding: 2.5rem;
}

.blog-card-featured .blog-card-visual img {
  max-width: 420px;
}

.blog-card-featured .blog-card-body {
  padding: 2.4rem 2.6rem;
  justify-content: center;
}

.blog-card-featured h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.blog-card-featured p {
  flex: 0 1 auto;
  font-size: 1.02rem;
}

/* ============ Página de artículo ============ */

.post-hero {
  position: relative;
  padding: calc(var(--header-h) + 3.5rem) 0 3rem;
  overflow: hidden;
}

.post-hero::before {
  content: "";
  position: absolute;
  top: -160px;
  right: -140px;
  width: 440px;
  height: 440px;
  background: radial-gradient(closest-side, var(--violet-wash), transparent 72%);
  border-radius: 50%;
  pointer-events: none;
}

.post-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 3rem;
  align-items: center;
}

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--ink-mute);
  margin-bottom: 1.4rem;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.breadcrumbs li + li::before {
  content: "›";
  margin-right: 0.45rem;
  color: var(--ink-mute);
}

.breadcrumbs a {
  color: var(--ink-soft);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--violet-deep);
  text-decoration: underline;
}

.post-hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.1rem);
  margin-bottom: 1.1rem;
}

.post-lead {
  font-size: 1.13rem;
  color: var(--ink-soft);
  max-width: 62ch;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.5rem;
  font-size: 0.88rem;
  color: var(--ink-mute);
}

.post-meta .avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--violet-soft);
}

.post-meta strong {
  display: block;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
}

.post-meta .dot {
  color: var(--violet);
}

.post-hero-visual {
  position: relative;
}

.post-hero-visual .post-blob {
  background: var(--violet-wash);
  border-radius: var(--blob);
  animation: blob-drift 14s ease-in-out infinite;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-hero-visual img {
  width: 100%;
  max-width: 380px;
  height: auto;
}

/* ---- Cuerpo del artículo ---- */

.post-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
  font-size: 1.06rem;
  line-height: 1.85;
}

.post-body > * + * {
  margin-top: 1.35rem;
}

.post-body h2 {
  font-size: clamp(1.55rem, 3vw, 1.95rem);
  margin-top: 3.2rem;
  padding-top: 2.2rem;
  border-top: var(--rule-soft);
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.post-body h3 {
  font-size: 1.25rem;
  margin-top: 2.2rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.post-body a {
  color: var(--violet-deep);
  text-decoration: underline;
  text-decoration-color: var(--violet-soft);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.3s ease;
}

.post-body a:hover {
  text-decoration-color: var(--violet-deep);
}

.post-body ul,
.post-body ol {
  padding-left: 1.4rem;
}

.post-body li + li {
  margin-top: 0.55rem;
}

.post-body li::marker {
  color: var(--violet);
}

.post-body blockquote {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--violet-deep);
  border-left: 3px solid var(--violet-soft);
  padding: 0.4rem 0 0.4rem 1.5rem;
  margin: 2.4rem 0;
}

.post-body figure {
  margin: 2.6rem 0;
}

.post-body figure .post-blob {
  background: var(--violet-wash);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  display: flex;
  justify-content: center;
}

.post-body figure img {
  max-width: 340px;
  width: 100%;
  height: auto;
}

.post-body figcaption {
  font-size: 0.85rem;
  color: var(--ink-mute);
  text-align: center;
  margin-top: 0.8rem;
}

/* Índice de contenidos */
.toc {
  background: var(--white);
  border: var(--rule-soft);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  box-shadow: var(--shadow-soft);
  margin: 2.4rem 0;
}

.toc-title {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--olive-deep);
  margin-bottom: 0.9rem;
}

.toc ol {
  list-style: none;
  padding: 0;
  columns: 2;
  column-gap: 2rem;
}

.toc li {
  margin: 0 0 0.55rem;
  break-inside: avoid;
  font-size: 0.96rem;
}

.toc a {
  text-decoration: none;
  color: var(--ink-soft);
}

.toc a:hover {
  color: var(--violet-deep);
  text-decoration: underline;
}

.toc li::before {
  content: "❧";
  color: var(--violet);
  margin-right: 0.55rem;
  font-size: 0.85rem;
}

/* Caja de puntos clave */
.key-box {
  background: var(--violet-wash);
  border-radius: var(--radius);
  padding: 1.8rem 2rem;
  margin: 2.4rem 0;
}

.key-box h2,
.key-box h3,
.key-box .key-box-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 0.9rem;
  padding: 0;
  border: none;
  color: var(--violet-deep);
}

.key-box ul {
  list-style: none;
  padding: 0;
}

.key-box li {
  padding-left: 1.6rem;
  position: relative;
}

.key-box li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--violet);
}

/* Caja de nota / aviso (ayuda, crisis, disclaimer) */
.note-box {
  background: var(--olive-soft);
  border-radius: var(--radius);
  padding: 1.5rem 1.8rem;
  margin: 2.4rem 0;
  font-size: 0.98rem;
  color: var(--olive-deep);
}

.note-box strong {
  color: var(--ink);
}

/* Tabla comparativa */
.post-table-wrap {
  overflow-x: auto;
  margin: 2.4rem 0;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: var(--rule-soft);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.97rem;
  box-shadow: var(--shadow-soft);
}

.post-body th,
.post-body td {
  padding: 0.9rem 1.1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: var(--rule-soft);
}

.post-body th {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.02rem;
  background: var(--violet-wash);
  color: var(--ink);
}

.post-body tr:last-child td {
  border-bottom: none;
}

/* Tarjeta de la autora (E-E-A-T) */
.author-card {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  background: var(--white);
  border: var(--rule-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.8rem 2rem;
  margin: 3rem 0;
}

.author-card img {
  width: 92px;
  height: 92px;
  border-radius: var(--blob);
  object-fit: cover;
  flex-shrink: 0;
}

.author-card h3,
.author-card .author-card-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.4rem;
  padding: 0;
  border: none;
}

.author-card p {
  font-size: 0.94rem;
  color: var(--ink-soft);
  margin: 0;
}

.author-card a {
  color: var(--violet-deep);
}

/* Referencias */
.post-refs {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: var(--rule);
}

.post-refs h2 {
  border: none;
  padding-top: 0;
  margin-top: 0;
  font-size: 1.4rem;
}

.post-refs ol {
  margin-top: 1.2rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.65;
}

.post-refs li + li {
  margin-top: 0.7rem;
}

.post-refs a {
  word-break: break-word;
}

/* Artículos relacionados */
.related {
  padding: 4rem 0 5rem;
}

.related .section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
  margin-top: 2.4rem;
}

/* Sección de blog en la portada */
.blog-teaser-more {
  text-align: center;
  margin-top: 2.6rem;
}

/* Enlace "toda la información" bajo cada servicio de la portada */
.service-more {
  margin-top: 0.9rem;
  font-size: 0.93rem;
}

.service-more a {
  color: var(--violet-deep);
  text-decoration: underline;
  text-decoration-color: var(--violet-soft);
  text-underline-offset: 3px;
}

.service-more a:hover {
  text-decoration-color: var(--violet-deep);
}

/* ============ Responsive ============ */

@media (max-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .blog-card-featured .blog-card-visual {
    flex-basis: 38%;
    padding: 1.8rem;
  }
}

@media (max-width: 768px) {
  .blog-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .blog-card-featured {
    flex-direction: column;
  }

  .blog-card-featured .blog-card-visual img {
    max-width: 300px;
  }

  .post-hero-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .post-hero-visual {
    order: -1;
    max-width: 340px;
    margin: 0 auto;
  }

  .post-hero-visual .post-blob {
    padding: 1.4rem;
  }

  .toc ol {
    columns: 1;
  }

  .author-card {
    flex-direction: column;
    text-align: center;
  }

  .post-body {
    font-size: 1.02rem;
  }
}
