/* ═══════════════════════════════════════════════════════
   BLOG GRUPO SALBA — blog.css
   Compatible con Bootstrap 5 + main.css existente
   Color de marca: #f5504d (rojo Salba)
═══════════════════════════════════════════════════════ */

:root {
  --salba-red:       #f5504d;
  --salba-red-dark:  #d93c39;
  --salba-red-soft:  rgba(245, 80, 77, 0.08);
  --salba-red-border:rgba(245, 80, 77, 0.25);
  --bg-page:         #f8f9fb;
  --bg-card:         #ffffff;
  --bg-dark:         #0d1117;
  --bg-dark-card:    #161b27;
  --text-main:       #1a1f2e;
  --text-muted:      #6b7385;
  --text-light:      #9aa0b0;
  --border-color:    #e4e7ef;
  --shadow-sm:       0 2px 8px rgba(0,0,0,0.06);
  --shadow-md:       0 4px 20px rgba(0,0,0,0.10);
  --radius:          10px;
}

/* ─── BODY ─── */
body { background: var(--bg-page); color: var(--text-main); }

/* ─── PROGRESS BAR ─── */
.blog-progress {
  position: fixed; top: 0; left: 0; z-index: 9999;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--salba-red), #ff8c8a);
  transition: width 0.1s linear;
}

/* ─── BREADCRUMB ─── */
.blog-breadcrumb {
  font-size: 0.8rem;
  color: var(--text-light);
  padding: 0.8rem 0 0;
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
}
.blog-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.blog-breadcrumb a:hover { color: var(--salba-red); }
.blog-breadcrumb .sep { color: var(--text-light); }
.blog-breadcrumb .current { color: var(--salba-red); font-weight: 500; }

/* ─── ARTICLE HERO ─── */
.blog-hero {
  background: var(--bg-dark);
  padding: 3.5rem 0 3rem;
  margin-top: 70px;
  position: relative;
  overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute; top: -80px; right: -100px;
  width: 450px; height: 450px;
  background: radial-gradient(circle, rgba(245,80,77,0.12) 0%, transparent 65%);
  pointer-events: none;
}
.blog-hero .blog-breadcrumb { color: rgba(255,255,255,0.35); }
.blog-hero .blog-breadcrumb a { color: rgba(255,255,255,0.45); }
.blog-hero .blog-breadcrumb a:hover { color: var(--salba-red); }
.blog-hero .blog-breadcrumb .current { color: rgba(255,255,255,0.7); }

.blog-category-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--salba-red-soft);
  border: 1px solid var(--salba-red-border);
  color: var(--salba-red);
  padding: 0.3rem 0.85rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.blog-hero .blog-category-badge {
  background: rgba(245,80,77,0.15);
  border-color: rgba(245,80,77,0.35);
}

.blog-hero h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.blog-hero h1 em {
  font-style: normal;
  color: var(--salba-red);
}
.blog-hero .lead-text {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.6);
  max-width: 640px;
  line-height: 1.7;
  margin-bottom: 1.8rem;
}

/* Meta */
.article-meta-row {
  display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
}
.meta-avatar-circle {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--salba-red-dark), var(--salba-red));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.meta-author-name { font-size: 0.87rem; font-weight: 600; color: rgba(255,255,255,0.85); }
.meta-author-role { font-size: 0.75rem; color: rgba(255,255,255,0.4); }
.meta-dot { color: rgba(255,255,255,0.2); }
.meta-item { font-size: 0.8rem; color: rgba(255,255,255,0.45); }

/* ─── MAIN LAYOUT ─── */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar { display: none; }
}

/* ─── ARTICLE BODY ─── */
.blog-article {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2.5rem 2.5rem 2rem;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 576px) { .blog-article { padding: 1.5rem 1.2rem; } }

.blog-article h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 2.5rem 0 0.9rem;
  padding-left: 0.9rem;
  border-left: 3px solid var(--salba-red);
  line-height: 1.3;
}
.blog-article h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 1.8rem 0 0.6rem;
}
.blog-article p {
  color: #3d4354;
  margin-bottom: 1.1rem;
  line-height: 1.8;
}
.blog-article strong { color: var(--text-main); }
.blog-article em { color: var(--salba-red); font-style: normal; font-weight: 600; }
.blog-article a { color: var(--salba-red); text-decoration: none; border-bottom: 1px solid var(--salba-red-border); }
.blog-article a:hover { border-color: var(--salba-red); }
.blog-article ul, .blog-article ol { padding-left: 1.4rem; margin-bottom: 1.1rem; color: #3d4354; }
.blog-article li { margin-bottom: 0.45rem; line-height: 1.75; }
.blog-article li::marker { color: var(--salba-red); }

/* ─── HIGHLIGHT BOXES ─── */
.box-tip, .box-warn, .box-info, .box-formula {
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  margin: 1.8rem 0;
  display: flex; gap: 0.8rem;
}
.box-icon { font-size: 1.15rem; flex-shrink: 0; margin-top: 0.1rem; }
.box-body { font-size: 0.92rem; line-height: 1.7; }
.box-body strong { font-weight: 700; }

.box-tip  { background: #f0f9ff; border: 1px solid #bae0fd; }
.box-tip  .box-body { color: #2c6e9f; }
.box-tip  .box-body strong { color: #1a4f77; }

.box-warn { background: #fffbec; border: 1px solid #fde68a; }
.box-warn .box-body { color: #7c5e10; }
.box-warn .box-body strong { color: #5a430a; }

.box-info { background: var(--salba-red-soft); border: 1px solid var(--salba-red-border); }
.box-info .box-body { color: #8b2020; }
.box-info .box-body strong { color: var(--salba-red-dark); }

.box-formula {
  background: #f3f4f8;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--salba-red);
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--text-main);
  display: block;
  overflow-x: auto;
}
.box-formula .formula-label {
  font-family: inherit;
  font-size: 0.7rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
  font-style: normal;
}

/* ─── DATA TABLE ─── */
.blog-table { width: 100%; border-collapse: collapse; margin: 1.8rem 0; font-size: 0.88rem; }
.blog-table th {
  background: #f3f4f8;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
}
.blog-table td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--border-color); color: #3d4354; }
.blog-table tr:hover td { background: #fafbfc; }
.blog-table .badge-green  { background: #d1fae5; color: #065f46; }
.blog-table .badge-yellow { background: #fef3c7; color: #92400e; }
.blog-table .badge-red    { background: #fee2e2; color: #991b1b; }
.blog-table .badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ─── INLINE CTA ─── */
.blog-cta-inline {
  background: linear-gradient(135deg, #1a0a0a 0%, #2d0d0d 100%);
  border: 1px solid rgba(245,80,77,0.3);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2.5rem 0;
  text-align: center;
}
.blog-cta-inline h4 { color: #fff; font-size: 1.05rem; margin-bottom: 0.4rem; }
.blog-cta-inline p  { color: rgba(255,255,255,0.5); font-size: 0.88rem; margin-bottom: 1.2rem; }
.btn-salba {
  display: inline-block;
  background: var(--salba-red);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.65rem 1.5rem;
  border-radius: 6px;
  text-decoration: none !important;
  border: none !important;
  transition: background 0.2s, transform 0.15s;
}
.btn-salba:hover { background: var(--salba-red-dark); transform: translateY(-1px); }

/* ─── ARTICLE TAGS ─── */
.article-tags {
  padding-top: 1.8rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.tag-lbl { font-size: 0.78rem; color: var(--text-light); font-weight: 600; }
.art-tag {
  background: #f3f4f8;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.art-tag:hover { border-color: var(--salba-red); color: var(--salba-red); }

/* ─── SIDEBAR ─── */
.blog-sidebar { position: sticky; top: 82px; }
.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.3rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-sm);
}
.sidebar-heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.9rem;
}

/* TOC */
.toc-nav { list-style: none; padding: 0; }
.toc-nav li { border-bottom: 1px solid var(--border-color); }
.toc-nav li:last-child { border-bottom: none; }
.toc-nav a {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.83rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, padding-left 0.2s;
  border: none !important;
}
.toc-nav a:hover, .toc-nav a.active { color: var(--salba-red); padding-left: 0.35rem; }

/* Related */
.related-link {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none !important;
  border-left: none !important;
}
.related-link:last-child { border-bottom: none; }
.rel-num {
  font-size: 1.3rem; font-weight: 700;
  color: var(--border-color);
  min-width: 26px; flex-shrink: 0; line-height: 1;
}
.rel-title { font-size: 0.82rem; color: var(--text-muted); line-height: 1.4; transition: color 0.2s; }
.related-link:hover .rel-title { color: var(--salba-red); }
.rel-cat { font-size: 0.7rem; color: var(--text-light); margin-top: 0.15rem; }

/* Sidebar CTA */
.sidebar-cta-card {
  background: linear-gradient(135deg, #fff5f5, #fff);
  border: 1px solid var(--salba-red-border);
  border-radius: var(--radius);
  padding: 1.3rem;
  text-align: center;
}
.sidebar-cta-card h5 { font-size: 0.92rem; color: var(--text-main); margin-bottom: 0.35rem; }
.sidebar-cta-card p  { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; }
.btn-outline-salba {
  display: block;
  border: 2px solid var(--salba-red);
  color: var(--salba-red) !important;
  text-align: center;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-size: 0.83rem;
  font-weight: 700;
  text-decoration: none !important;
  transition: background 0.2s, color 0.2s;
}
.btn-outline-salba:hover { background: var(--salba-red); color: #fff !important; }

/* ─── BLOG INDEX PAGE ─── */
.blog-index-hero {
  background: var(--bg-dark);
  padding: 4rem 0 3rem;
  margin-top: 70px;
}
.blog-index-hero h1 { color: #fff; font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; }
.blog-index-hero h1 em { color: var(--salba-red); font-style: normal; }
.blog-index-hero p { color: rgba(255,255,255,0.55); font-size: 1rem; }

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex; flex-direction: column; height: 100%;
  text-decoration: none !important; color: inherit !important;
}
.blog-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.blog-card-banner {
  height: 7px;
  background: linear-gradient(90deg, var(--salba-red), #ff8c8a);
}
.blog-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.blog-card-cat {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--salba-red);
  margin-bottom: 0.6rem;
}
.blog-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 0.6rem;
}
.blog-card-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1rem;
}
.blog-card-meta {
  font-size: 0.75rem;
  color: var(--text-light);
  display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap;
  border-top: 1px solid var(--border-color);
  padding-top: 0.8rem; margin-top: auto;
}
.blog-card-read-more {
  font-size: 0.8rem;
  color: var(--salba-red);
  font-weight: 600;
  margin-top: 0.6rem;
  display: inline-block;
}

/* Category filter pills */
.cat-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.cat-pill {
  padding: 0.35rem 0.9rem;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.cat-pill:hover, .cat-pill.active {
  background: var(--salba-red);
  border-color: var(--salba-red);
  color: #fff;
}
