/* Blog de Corvant: índice (/blog) y artículos. Tipos y colores del sistema v8 de styles.css.
   Rediseño 30-oct-2026: cabecera con foto grande, lectura a 18 px con columna lateral fija,
   ficha del autor, relacionados y franja final de auditoría. */

/* ---------- Base compartida ---------- */
/* El índice del blog usa el mismo ancho del menú (1240) para quedar alineado con el logo. */
body.single-post { overflow-x: clip; } /* overflow hidden en body rompe la columna fija (sticky) */
.articulo-cabecera, .blog-hero { position: relative; isolation: isolate; background: var(--white); }
.articulo-cabecera::before, .blog-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--rejilla-clara); background-size: 32px 32px; background-position: right -1px top -1px;
  -webkit-mask-image: radial-gradient(ellipse 75% 120% at 100% 0%, #000 25%, rgba(0, 0, 0, 0.4) 55%, transparent 85%);
  mask-image: radial-gradient(ellipse 75% 120% at 100% 0%, #000 25%, rgba(0, 0, 0, 0.4) 55%, transparent 85%);
}
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn-ghost svg, .art-enlaces svg { width: 16px; height: 16px; }

/* ---------- Cabecera del artículo ---------- */
.articulo-cabecera { padding: calc(var(--nav-h) + 3.5rem) 0 0; border-bottom: 1px solid var(--gray-line); }
.art-cab { max-width: var(--max-w); }
.migas { display: flex; flex-wrap: wrap; gap: 0.6rem; font-size: 0.85rem; color: var(--gray); margin-bottom: 2rem; }
.migas a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--gray-line); }
.migas a:hover { border-bottom-color: var(--orange); color: var(--ink); }
.articulo-cabecera h1 {
  margin-top: 1.25rem; max-width: 20ch;
  font-size: clamp(2.3rem, 5vw, 4.5rem); line-height: 1.02; letter-spacing: -0.025em; font-weight: 700;
}
.art-entrada { margin-top: 1.75rem; max-width: 58ch; font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; color: var(--ink-soft); }
.art-firma { display: flex; align-items: center; gap: 0.9rem; margin-top: 2.25rem; }
.art-firma-foto { width: 52px; height: 52px; object-fit: cover; object-position: 50% 12%; background: var(--black); flex-shrink: 0; border-bottom: 3px solid var(--orange); }
.art-firma-texto { display: flex; flex-direction: column; gap: 0.2rem; line-height: 1.3; }
.art-firma-nombre { font-family: var(--display); font-weight: 700; font-size: 1rem; color: var(--ink); text-decoration: none; }
.art-firma-nombre:hover { text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 3px; }
.art-firma-datos { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.88rem; color: var(--gray); }

.art-portada { max-width: var(--max-w); margin: 3.5rem auto 0; padding: 0 var(--gutter); }
.art-portada-marco { position: relative; aspect-ratio: 21 / 9; overflow: hidden; background: var(--black); }
.art-portada-marco img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; display: block; filter: grayscale(1) contrast(1.06); animation: art-foto-entra 1.4s var(--ease-out) both; }
.art-portada-marco::after { content: ""; position: absolute; left: 0; bottom: 0; width: 28px; height: 28px; background: var(--orange); }
@keyframes art-foto-entra { from { transform: scale(1.06); opacity: 0.7; } to { transform: scale(1); opacity: 1; } }

/* ---------- Cuerpo: lectura + columna lateral ---------- */
.art-layout { padding-top: 3.5rem; padding-bottom: 5rem; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) {
  .art-layout { grid-template-columns: minmax(0, 780px) 300px; justify-content: space-between; column-gap: 3.5rem; padding-top: 4.5rem; }
  .art-indice-movil { display: none; }
}
.art-principal { min-width: 0; }

.articulo-cuerpo { font-size: 1.125rem; line-height: 1.7; color: var(--ink); }
.articulo-cuerpo > p, .articulo-cuerpo > ul, .articulo-cuerpo > ol, .articulo-cuerpo > h2, .articulo-cuerpo > h3, .articulo-cuerpo > blockquote { max-width: 43rem; }
.articulo-cuerpo > p:first-child { font-size: 1.25rem; line-height: 1.6; color: var(--ink); }
.articulo-cuerpo p { margin: 0 0 1.35rem; }
.articulo-cuerpo h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.1rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.015em;
  margin: 3.5rem 0 1.25rem; padding-top: 1.75rem; border-top: 1px solid var(--gray-line);
  background: linear-gradient(var(--orange), var(--orange)) left top / 56px 3px no-repeat;
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}
.articulo-cuerpo h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; margin: 2.25rem 0 0.7rem; }
.articulo-cuerpo ul, .articulo-cuerpo ol { margin: 0 0 1.6rem; padding-left: 1.4rem; }
.articulo-cuerpo ul { list-style: square; }
.articulo-cuerpo ol { list-style: decimal; }
.articulo-cuerpo li { margin-bottom: 0.6rem; padding-left: 0.3rem; }
.articulo-cuerpo ul li::marker { color: var(--orange); }
.articulo-cuerpo ol li::marker { color: var(--ink); font-family: var(--display); font-weight: 700; }
.articulo-cuerpo a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.articulo-cuerpo a:hover { text-decoration-color: var(--ink); }
.articulo-cuerpo strong { font-weight: 700; }
.articulo-cuerpo em { font-style: normal; color: var(--gray); font-size: 0.92em; }
.articulo-cuerpo mark { background: var(--gray-bg); color: var(--ink); padding: 0 0.2rem; font-size: 0.9em; box-shadow: inset 0 -2px 0 var(--orange); }

/* Tablas: se desplazan dentro de su caja en celular */
.art-tabla { margin: 2rem 0 2.5rem; overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: 2px solid var(--ink); }
.art-tabla table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.97rem; line-height: 1.5; }
.art-tabla th, .art-tabla td { border-bottom: 1px solid var(--gray-line); padding: 0.85rem 0.9rem; text-align: left; vertical-align: top; }
.art-tabla th { font-family: var(--display); font-weight: 700; background: var(--gray-bg); font-size: 0.9rem; letter-spacing: 0.01em; }
.art-tabla tr:hover td { background: #FAFAFA; }

/* Infografías e imágenes del cuerpo */
.art-figura { margin: 2.75rem 0; padding: clamp(1rem, 3vw, 2.25rem); background: var(--gray-bg); border-top: 2px solid var(--ink); }
.art-figura img { width: 100%; height: auto; display: block; margin: 0 auto; max-width: 860px; }
.articulo-cuerpo > p > img { width: 100%; height: auto; display: block; }

/* Preguntas frecuentes */
.art-faq { margin-top: 3.5rem; counter-reset: faq; }
.art-faq > h2 { margin-top: 0; }
.art-faq-item { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); padding: 1.6rem 0 0.4rem; border-top: 1px solid var(--gray-line); }
.art-faq-item:last-child { border-bottom: 1px solid var(--gray-line); padding-bottom: 1rem; }
.art-faq-item::before {
  counter-increment: faq; content: counter(faq, decimal-leading-zero);
  grid-column: 1; grid-row: 1 / span 2; font-family: var(--display); font-weight: 700; font-size: 0.95rem; color: var(--orange); padding-top: 0.15rem;
}
.art-faq-item > * { grid-column: 2; }
.art-faq-item h3 { margin: 0 0 0.6rem; font-size: 1.2rem; }
.art-faq-resp { color: var(--ink-soft); max-width: 40rem; }

/* Índice plegable en celular y tableta */
.art-indice-movil { margin: 0 0 2.5rem; background: var(--gray-bg); border-top: 2px solid var(--ink); }
.art-indice-movil summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; font-family: var(--display); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
}
.art-indice-movil summary::-webkit-details-marker { display: none; }
.art-indice-movil summary::after { content: "+"; font-size: 1.4rem; line-height: 1; font-weight: 400; color: var(--orange); }
.art-indice-movil[open] summary::after { content: "\2212"; }
.art-indice-movil nav { padding: 0 1.25rem 1.25rem; }
.art-indice-movil ul, .art-indice ul { list-style: none; margin: 0; padding: 0; }
.art-indice-movil li { border-top: 1px solid var(--gray-line); }
.art-indice-movil a { display: block; padding: 0.7rem 0; color: var(--ink); text-decoration: none; font-size: 0.98rem; line-height: 1.4; }

/* Columna lateral fija */
.art-lateral { display: none; }
@media (min-width: 1100px) {
  .art-lateral { display: block; }
  .art-lateral-pegado { position: sticky; top: calc(var(--nav-h) + var(--aviso-h, 0px) + 1.75rem); display: flex; flex-direction: column; gap: 1.5rem; }
}
.art-lateral-titulo { font-family: var(--display); font-weight: 700; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 0.85rem; display: flex; align-items: center; gap: 0.6rem; }
.art-lateral-titulo::before { content: ""; width: 8px; height: 8px; background: var(--orange); }
.art-indice ul { border-left: 1px solid var(--gray-line); }
.art-indice a { display: block; padding: 0.42rem 0 0.42rem 1rem; margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.35; text-decoration: none; transition: color 0.2s, border-color 0.2s; }
.art-indice a:hover { color: var(--ink); border-left-color: var(--gray); }
.art-indice a.activo { color: var(--ink); font-weight: 700; border-left-color: var(--orange); }
.art-caja-auditoria { position: relative; isolation: isolate; overflow: hidden; background: var(--black); color: var(--white); padding: 1.6rem 1.5rem 1.5rem; }
.art-caja-auditoria::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--rejilla-oscura); background-size: 24px 24px; }
.art-caja-auditoria .art-lateral-titulo { color: var(--text-on-dark); }
.art-caja-titulo { font-family: var(--display); font-weight: 700; font-size: 1.35rem; line-height: 1.2; color: var(--white); margin: 0 0 1.25rem; }
.art-caja-auditoria .btn { width: 100%; justify-content: center; }
.art-enlaces { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--gray-line); }
.art-enlaces li { border-bottom: 1px solid var(--gray-line); }
.art-enlaces a { display: flex; justify-content: space-between; align-items: center; padding: 0.85rem 0; font-family: var(--display); font-weight: 700; font-size: 0.95rem; color: var(--ink); text-decoration: none; }
.art-enlaces a:hover { color: var(--orange); }

/* Ficha del autor */
.art-autor { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 2rem; align-items: center; margin-top: 4.5rem; padding: 2rem; background: var(--gray-bg); border-top: 2px solid var(--ink); }
.art-autor-foto { width: 140px; height: 175px; object-fit: cover; object-position: 50% 12%; background: var(--black); border-bottom: 4px solid var(--orange); }
.art-autor .eyebrow { margin: 0 0 0.6rem; }
.art-autor-nombre { font-family: var(--display); font-weight: 700; font-size: 1.6rem; line-height: 1.15; margin: 0 0 0.5rem; }
.art-autor-cargo { color: var(--ink-soft); margin: 0 0 1rem; max-width: 46ch; line-height: 1.5; }

/* Relacionados */
.art-relacionados { background: var(--gray-bg); padding: 5rem 0 5.5rem; border-top: 1px solid var(--gray-line); }
.art-relacionados-cab { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; margin-bottom: 2.25rem; flex-wrap: wrap; }
.art-relacionados-cab h2 { font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.05; letter-spacing: -0.02em; font-weight: 700; }
.art-relacionados-rejilla { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.art-relacionados .blog-tarjeta h3 { font-size: 1.25rem; line-height: 1.25; }
.art-relacionados .blog-tarjeta h3 a { color: var(--ink); text-decoration: none; }

/* Franja final */
.articulo-cta { position: relative; isolation: isolate; overflow: hidden; background: var(--black); color: var(--white); padding: 6rem 0; }
.articulo-cta::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: url('/images/texturas/isotipo-trazo.svg'), var(--rejilla-oscura);
  background-size: 360px 360px, 32px 32px, 32px 32px; background-position: right 6% center, right -1px top 0, right -1px top 0; background-repeat: no-repeat, repeat, repeat;
}
.art-cta-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 3rem; align-items: end; }
.articulo-cta h2 { color: var(--white); font-size: clamp(2.2rem, 4.6vw, 4rem); line-height: 1.02; letter-spacing: -0.02em; font-weight: 700; margin: 1.25rem 0 1rem; max-width: 16ch; }
.articulo-cta p { color: var(--text-on-dark); font-size: 1.15rem; margin: 0; max-width: 46ch; }
.art-cta-acciones { display: flex; flex-direction: column; gap: 0.75rem; min-width: 260px; }
.art-cta-acciones .btn { justify-content: center; }

/* ---------- Índice del blog ---------- */
.blog-hero { padding: calc(var(--nav-h) + 4.5rem) 0 4rem; border-bottom: 1px solid var(--gray-line); }
.blog-hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 4rem; align-items: end; }
.blog-hero h1 { margin-top: 1.25rem; font-size: clamp(2.6rem, 6.2vw, 5.5rem); line-height: 1.0; letter-spacing: -0.025em; max-width: 14ch; }
.blog-hero h1 em { color: var(--orange); }
.blog-hero-cifra { margin-top: 1.75rem; display: flex; align-items: baseline; gap: 0.6rem; font-family: var(--display); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.blog-hero-cifra strong { font-size: 3rem; letter-spacing: -0.02em; color: var(--ink); line-height: 1; }

.blog-lista { background: var(--gray-bg); padding: 3.5rem 0 6rem; }
.blog-destacado { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); background: var(--white); margin-bottom: 1.5rem; border: 1px solid var(--white); }
.blog-destacado:hover { border-color: var(--ink); }
.blog-destacado-img { display: block; position: relative; overflow: hidden; background: var(--black); min-height: 420px; }
.blog-destacado-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.06); transition: transform 0.8s var(--ease-out); }
.blog-destacado-img::after { content: ""; position: absolute; left: 0; bottom: 0; width: 24px; height: 24px; background: var(--orange); }
.blog-destacado:hover .blog-destacado-img img { transform: scale(1.03); }
.blog-destacado-texto { padding: clamp(1.75rem, 3.5vw, 3.25rem); display: flex; flex-direction: column; justify-content: center; gap: 1.1rem; }
.blog-destacado-texto .blog-tarjeta-meta { margin: 0; }
.blog-destacado h2 { font-size: clamp(1.8rem, 2.8vw, 2.6rem); line-height: 1.08; letter-spacing: -0.02em; font-weight: 700; }
.blog-destacado h2 a { color: var(--ink); text-decoration: none; }
.blog-destacado h2 a:hover { text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 5px; }
.blog-destacado p { color: var(--ink-soft); line-height: 1.6; }
.blog-destacado .btn { align-self: flex-start; margin-top: 0.5rem; }

.blog-rejilla { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.blog-tarjeta { background: var(--white); border: 1px solid var(--white); padding: 0 1.5rem 1.75rem; display: flex; flex-direction: column; gap: 0.75rem; overflow: hidden; transition: border-color 0.2s; }
.blog-tarjeta:hover { border-color: var(--ink); }
.blog-tarjeta-img { display: block; position: relative; margin: 0 -1.5rem 0.5rem; aspect-ratio: 16 / 10; background: var(--black); overflow: hidden; }
.blog-tarjeta-img img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(1) contrast(1.06); transition: transform 0.8s var(--ease-out); }
.blog-tarjeta:hover .blog-tarjeta-img img { transform: scale(1.04); }
.blog-tarjeta h2 { font-size: 1.3rem; line-height: 1.22; font-weight: 700; letter-spacing: -0.01em; }
.blog-tarjeta h2 a { color: var(--ink); text-decoration: none; }
.blog-tarjeta h2 a:hover, .art-relacionados .blog-tarjeta h3 a:hover { text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 4px; }
.blog-tarjeta p { font-size: 0.95rem; color: var(--ink-soft); line-height: 1.55; }
.blog-tarjeta-meta { margin-top: 1rem; font-family: var(--display); font-size: 0.7rem !important; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft) !important; }

.blog-paginas { margin-top: 2.5rem; }
.blog-paginas .nav-links { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.blog-paginas .page-numbers { display: inline-flex; min-width: 2.5rem; height: 2.5rem; padding: 0 0.85rem; align-items: center; justify-content: center; border: 1px solid var(--gray-line); background: var(--white); color: var(--ink); font-weight: 700; text-decoration: none; }
.blog-paginas .page-numbers.current { background: var(--black); color: var(--white); border-color: var(--black); }
.blog-paginas a.page-numbers:hover { border-color: var(--orange); color: var(--ink); }

/* ---------- Tableta ---------- */
@media (max-width: 1099px) {
  .art-relacionados-rejilla, .blog-rejilla { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .art-relacionados-rejilla > :nth-child(3) { display: none; }
  .blog-destacado { grid-template-columns: 1fr; }
  .blog-destacado-img { min-height: 0; aspect-ratio: 16 / 9; }
  .art-cta-grid { grid-template-columns: 1fr; align-items: start; }
  .art-cta-acciones { flex-direction: row; flex-wrap: wrap; min-width: 0; }
}
@media (max-width: 860px) {
  .blog-hero-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .art-portada-marco { aspect-ratio: 16 / 9; }
}

/* ---------- Celular ---------- */
@media (max-width: 700px) {
  .articulo, .blog-indice { --gutter: 20px; }
  .articulo-cabecera { padding-top: calc(var(--nav-h) + 2.25rem); }
  .migas { margin-bottom: 1.25rem; }
  .articulo-cabecera h1 { font-size: clamp(2rem, 8.6vw, 2.6rem); line-height: 1.06; }
  .art-entrada { font-size: 1.08rem; margin-top: 1.25rem; }
  .art-firma { margin-top: 1.5rem; }
  .art-portada { margin-top: 2rem; padding: 0; }
  .art-portada-marco { aspect-ratio: 4 / 3; }
  .art-layout { padding-top: 2rem; padding-bottom: 3.5rem; }
  .articulo-cuerpo { font-size: 1.0625rem; line-height: 1.7; }
  .articulo-cuerpo > p:first-child { font-size: 1.15rem; }
  .articulo-cuerpo h2 { margin-top: 2.75rem; padding-top: 1.4rem; }
  .art-tabla { margin-right: calc(-1 * var(--gutter)); }
  .art-tabla table { font-size: 0.92rem; }
  .art-figura { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 1rem var(--gutter); }
  .art-faq-item { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .art-autor { grid-template-columns: 88px minmax(0, 1fr); gap: 1.1rem; padding: 1.4rem 1.25rem; align-items: start; }
  .art-autor-foto { width: 88px; height: 110px; }
  .art-autor-nombre { font-size: 1.3rem; }
  .art-relacionados { padding: 3.5rem 0 4rem; }
  .art-relacionados-rejilla, .blog-rejilla { grid-template-columns: 1fr; }
  .art-relacionados-rejilla > :nth-child(3) { display: flex; }
  .articulo-cta { padding: 4rem 0; }
  .articulo-cta::before { background-size: 220px 220px, 32px 32px, 32px 32px; background-position: right -40px bottom -30px, right -1px top 0, right -1px top 0; }
  .art-cta-acciones { flex-direction: column; }
  .art-cta-acciones .btn { width: 100%; }
  .blog-hero { padding: calc(var(--nav-h) + 2.5rem) 0 2.5rem; }
  .blog-hero h1 { font-size: clamp(2.3rem, 10vw, 3rem); }
  .blog-hero-cifra strong { font-size: 2.4rem; }
  .blog-lista { padding: 1.5rem 0 4rem; }
  .blog-destacado-texto { padding: 1.5rem 1.25rem 1.75rem; }
  .blog-destacado h2 { font-size: 1.65rem; }
  .blog-destacado .btn { width: 100%; justify-content: center; }
  .blog-tarjeta { padding: 0 1.25rem 1.5rem; }
  .blog-tarjeta-img { margin: 0 -1.25rem 0.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  .art-portada-marco img { animation: none; }
  .blog-tarjeta-img img, .blog-destacado-img img { transition: none; }
}
