/* ═══════════════════════════════════════════════════════════════
   saas_blog_styles.css  —  Diseño editorial para artículos de blog
   Cargar DESPUÉS de saas_styles.css y saas_fixes.css.
   Todos los selectores usan .blog-page como raíz para máxima
   especificidad sin !important innecesario.
═══════════════════════════════════════════════════════════════ */

/* ── READING PROGRESS BAR ───────────────────────────────────────── */
#blog-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #7C5CBF, #C9A8E8);
  z-index: 2000;
  transition: width .08s linear;
  pointer-events: none;
}

/* ── SHARE BAR ──────────────────────────────────────────────────── */
.blog-share-bar {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 500;
}
.blog-share-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(124,92,191,.2);
  box-shadow: 0 2px 10px rgba(40,13,71,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  color: #7C5CBF;
  line-height: 1;
}
.blog-share-btn:hover {
  background: #7C5CBF;
  color: white;
  border-color: #7C5CBF;
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(124,92,191,.3);
}
@media (max-width: 1100px) { .blog-share-bar { display: none; } }

/* ── HERO ───────────────────────────────────────────────────────── */
.blog-article-hero {
  background: linear-gradient(155deg, #280D47 0%, #2e1065 55%, #351B69 100%);
  padding: 120px 24px 72px;
  position: relative;
  overflow: hidden;
}
.blog-article-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 85% 20%, rgba(201,168,232,.1) 0%, transparent 65%),
    radial-gradient(ellipse 40% 50% at 10% 90%, rgba(124,92,191,.12) 0%, transparent 60%);
  pointer-events: none;
}
.blog-article-hero::after {
  content: '';
  position: absolute; inset: 0;
  opacity: .04;
  background-image:
    linear-gradient(rgba(201,168,232,.8) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,168,232,.8) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.blog-article-hero > .container {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
}

.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.5);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .02em;
  margin-bottom: 28px;
  transition: color .2s;
  text-decoration: none;
}
.blog-back:hover { color: rgba(255,255,255,.9); }

.blog-article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.blog-cat-tag {
  display: inline-block;
  background: rgba(201,168,232,.2);
  border: 1px solid rgba(201,168,232,.35);
  color: #C9A8E8;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 50px;
}
.blog-read-time {
  font-size: 13px;
  color: rgba(255,255,255,.42);
}
.blog-seo-tag {
  font-size: 12px;
  color: rgba(255,255,255,.28);
  letter-spacing: .03em;
}
.blog-article-hero h1 {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.18;
  letter-spacing: -.02em;
  margin: 0 0 18px;
  max-width: 760px;
}
.blog-article-subtitle {
  font-size: 17px;
  color: rgba(255,255,255,.55);
  line-height: 1.65;
  font-weight: 300;
  max-width: 620px;
  margin: 0;
}

/* Override .container width for blog cover */
.blog-cover-wrap.container {
  max-width: 800px;
  padding: 0 24px;
}

/* ── COVER IMAGE ────────────────────────────────────────────────── */
.blog-cover-wrap {
  max-width: 800px;
  margin: -36px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}
.blog-cover-img {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(40,13,71,.35);
  background: #ede9f6;
}
.blog-cover-img img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.blog-cover-img:hover img { transform: scale(1.02); }
.blog-cover-img.img-placeholder {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.blog-cover-img.img-placeholder::after {
  content: '📷';
  font-size: 40px;
  opacity: .25;
}
.blog-cover-caption {
  background: rgba(40,13,71,.75);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,.6);
  font-size: 12px;
  font-style: italic;
  padding: 9px 18px;
  text-align: center;
}

/* Override .container width for blog article body */
article.blog-article.container,
.blog-article.container {
  max-width: 800px;
  padding: 0 24px;
}

/* ── ARTICLE BODY ───────────────────────────────────────────────── */
.blog-article {
  max-width: 800px;
  margin: 60px auto 80px;
  padding: 0 24px;
}
/* Clear floats from images */
.blog-article-inner::after {
  content: '';
  display: table;
  clear: both;
}

/* Paragraphs */
.blog-article-inner > p,
.blog-article-inner p {
  font-size: 16.5px;
  line-height: 1.82;
  color: #2a2040;
  margin-bottom: 22px;
  font-weight: 400;
}
.blog-lead {
  font-size: 18px !important;
  line-height: 1.78 !important;
  color: #1A1428 !important;
  font-weight: 400 !important;
  border-left: 4px solid #7C5CBF;
  padding-left: 22px !important;
  margin-bottom: 36px !important;
}

/* Headings */
.blog-article-inner h2 {
  font-size: clamp(19px, 2.4vw, 25px);
  font-weight: 700;
  color: #351B69;
  letter-spacing: -.015em;
  line-height: 1.25;
  margin: 52px 0 16px;
  padding-top: 0;
}
.blog-article-inner h2::before {
  content: '';
  display: block;
  width: 30px;
  height: 3px;
  background: linear-gradient(90deg, #7C5CBF, #C9A8E8);
  border-radius: 2px;
  margin-bottom: 12px;
}
.blog-article-inner h3 {
  font-size: 18px;
  font-weight: 600;
  color: #351B69;
  margin: 32px 0 10px;
}
.blog-article-inner strong { color: #1A1428; font-weight: 600; }
.blog-article-inner em     { color: #351B69; font-style: italic; }

/* ── LISTS ──────────────────────────────────────────────────────── */
.blog-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 4px 0 28px !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.blog-list li {
  font-size: 15.5px;
  line-height: 1.72;
  color: #2a2040;
  padding: 15px 20px 15px 52px;
  background: #F4F2F9;
  border-radius: 10px;
  border-left: 3px solid #7C5CBF;
  position: relative;
  transition: background .18s, border-color .18s;
  list-style: none !important;
}
.blog-list li:hover {
  background: #ede8f8;
  border-color: #351B69;
}
.blog-list li::before {
  content: '→';
  position: absolute;
  left: 18px;
  top: 15px;
  color: #7C5CBF;
  font-size: 14px;
  font-weight: 700;
}

/* Ordered list variant */
.blog-list-ol {
  counter-reset: blog-ol;
}
.blog-list-ol li {
  counter-increment: blog-ol;
  padding-left: 62px;
}
.blog-list-ol li::before {
  content: counter(blog-ol);
  left: 15px;
  top: 12px;
  width: 26px;
  height: 26px;
  background: #7C5CBF;
  color: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ── HIGHLIGHT / QUOTE BLOCK ────────────────────────────────────── */
.blog-highlight {
  background: linear-gradient(135deg, #f0ebff 0%, #e8dffa 100%);
  border: 1px solid rgba(124,92,191,.18);
  border-radius: 14px;
  padding: 28px 32px 28px 36px;
  margin: 36px 0;
  position: relative;
  overflow: hidden;
}
.blog-highlight::before {
  content: '\201C';
  position: absolute;
  top: -14px; left: 18px;
  font-size: 96px;
  font-family: Georgia, serif;
  color: rgba(124,92,191,.1);
  line-height: 1;
  pointer-events: none;
}
.blog-highlight p {
  font-size: 16px !important;
  line-height: 1.75 !important;
  color: #351B69 !important;
  font-style: italic;
  margin-bottom: 0 !important;
  position: relative;
  z-index: 1;
}

/* ── INLINE IMAGES ──────────────────────────────────────────────── */
.blog-img-wrap {
  margin: 36px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(40,13,71,.1);
  background: #ede9f6;
}
.blog-img-wrap img {
  width: 100%;
  display: block;
  transition: transform .4s ease;
}
.blog-img-wrap:hover img { transform: scale(1.015); }
.blog-img-wrap.img-placeholder {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.blog-img-wrap.img-placeholder::after {
  content: '📷';
  font-size: 36px;
  opacity: .2;
}
.blog-img-right {
  float: right;
  width: 45%;
  margin: 6px 0 24px 32px;
}
@media (max-width: 640px) {
  .blog-img-right { float: none; width: 100%; margin: 28px 0; }
}
.blog-img-caption {
  background: #f0ebff;
  color: rgba(53,27,105,.6);
  font-size: 12px;
  font-style: italic;
  padding: 8px 16px;
  text-align: center;
  border-top: 1px solid rgba(124,92,191,.1);
}

/* ── CTA BLOCK ──────────────────────────────────────────────────── */
.blog-cta-block {
  background: linear-gradient(135deg, #351B69 0%, #4a1a8a 100%);
  border-radius: 16px;
  padding: 36px 40px;
  margin: 52px 0 0;
  display: flex;
  gap: 22px;
  align-items: flex-start;
  box-shadow: 0 12px 40px rgba(40,13,71,.25);
  position: relative;
  overflow: hidden;
}
.blog-cta-block::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 90% 50%, rgba(201,168,232,.1) 0%, transparent 70%);
  pointer-events: none;
}
.blog-cta-icon {
  font-size: 26px;
  opacity: .65;
  flex-shrink: 0;
  margin-top: 3px;
}
.blog-cta-content {
  position: relative;
  z-index: 1;
}
.blog-cta-content h3 {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: white !important;
  margin: 0 0 10px !important;
}
.blog-cta-content p {
  font-size: 14.5px !important;
  color: rgba(255,255,255,.62) !important;
  line-height: 1.65 !important;
  margin-bottom: 0 !important;
}
.blog-cta-content .btn-primary {
  background: white !important;
  color: #351B69 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  padding: 11px 24px !important;
  border-radius: 50px !important;
  border: none !important;
  cursor: pointer;
  transition: all .2s;
  margin-top: 20px !important;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
  display: inline-flex;
  align-items: center;
}
.blog-cta-content .btn-primary:hover {
  background: #ede9fe !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
}
@media (max-width: 640px) {
  .blog-cta-block { flex-direction: column; padding: 28px 24px; }
}

/* ── RELATED ARTICLES ───────────────────────────────────────────── */
.blog-related-section {
  background: #F4F2F9;
  padding: 64px 24px 72px;
  border-top: 1px solid rgba(124,92,191,.1);
}
.blog-related-inner {
  max-width: 800px;
  margin: 0 auto;
}
.blog-related-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7C5CBF;
  margin-bottom: 28px;
}
.blog-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 680px) {
  .blog-related-grid { grid-template-columns: 1fr; }
}
.blog-related-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(124,92,191,.1);
  box-shadow: 0 2px 10px rgba(40,13,71,.06);
  transition: all .22s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.blog-related-card:hover {
  box-shadow: 0 8px 28px rgba(40,13,71,.13);
  transform: translateY(-3px);
  border-color: rgba(124,92,191,.25);
}
.blog-related-card-img {
  aspect-ratio: 16 / 9;
  background: #ede9f6;
  overflow: hidden;
}
.blog-related-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.blog-related-card:hover .blog-related-card-img img { transform: scale(1.05); }
.blog-related-card-body {
  padding: 16px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.blog-related-card-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #7C5CBF;
  margin-bottom: 8px;
}
.blog-related-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #1A1428;
  line-height: 1.45;
  margin-bottom: 10px;
  flex: 1;
}
.blog-related-card-time {
  font-size: 12px;
  color: #6B7280;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .blog-article-hero { padding: 100px 20px 52px; }
  .blog-cover-wrap   { padding: 0 20px; }
  .blog-article      { padding: 0 20px; margin-top: 44px; }
}
@media (max-width: 580px) {
  .blog-article-hero { padding: 88px 16px 44px; }
  .blog-article-hero h1 { font-size: 22px; }
  .blog-article-subtitle { font-size: 15px; }
  .blog-lead { font-size: 16px !important; padding-left: 16px !important; }
  .blog-cover-wrap { margin-top: -20px; padding: 0 16px; }
  .blog-article { padding: 0 16px; margin-top: 36px; }
  .blog-article-inner > p,
  .blog-article-inner p { font-size: 15.5px; }
  .blog-cta-block { padding: 24px 20px; }
  .blog-related-section { padding: 48px 16px; }
}
