/* ==========================================================================
   JesusBZ - Post & R Project Enhancement Theme
   Author: Jesús Benjamín Zerpa | Economist & Data Scientist
   Estética: Futuristic Light / Clean Corporate FinTech for R Markdown Pages
   Hard Overrides against Bootstrap 3 Cerulean Gradients & Dated Styles
   ========================================================================== */

@import url("futuristic-corporate.css");

/* Page Background & Typography */
html, body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif !important;
  line-height: 1.75 !important;
  font-size: 16px !important;
  -webkit-font-smoothing: antialiased;
}

/* Main Post Paper Container */
.main-container, .container-fluid.main-container {
  max-width: 1040px !important;
  margin: 20px auto 40px auto !important;
  padding: 2.5rem 2.5rem 5rem 2.5rem !important;
  background-color: #ffffff !important;
  border-radius: 12px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.06), 0 4px 10px -2px rgba(15, 23, 42, 0.03) !important;
}

/* Headings */
h1, h2, h3, h4, h5, h6, .section h1, .section h2, .section h3 {
  color: #091e42 !important;
  font-weight: 800 !important;
  letter-spacing: -0.025em !important;
  margin-top: 2rem !important;
  margin-bottom: 0.85rem !important;
  text-shadow: none !important;
}

h1, h1.title, .section h1 { 
  font-size: 2.2rem !important; 
  line-height: 1.25 !important;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.85rem;
  margin-bottom: 1.5rem !important;
}

h2, .section h2 { 
  font-size: 1.65rem !important; 
  border-bottom: 1px solid #e2e8f0 !important; 
  padding-bottom: 0.5rem !important; 
}

h3, .section h3 { font-size: 1.35rem !important; }
h4, .section h4 { font-size: 1.15rem !important; }

/* Paragraphs and Text */
p, div, span {
  font-family: inherit;
}

p {
  color: #334155 !important;
  font-size: 1.025rem !important;
  line-height: 1.8 !important;
  margin-bottom: 1.25rem !important;
}

/* Links */
a {
  color: #0052cc !important;
  text-decoration: none !important;
  font-weight: 600;
  transition: color 0.15s ease;
}

a:hover {
  color: #0747a6 !important;
  text-decoration: underline !important;
}

/* ==========================================================================
   KILL CERULEAN BLUE GRADIENT NAVBAR
   ========================================================================== */
.navbar-default, 
.navbar-inverse, 
.navbar,
.navbar-fixed-top {
  background-image: none !important;
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: 0 2px 10px -1px rgba(15, 23, 42, 0.05) !important;
  min-height: 64px !important;
  filter: none !important;
}

.navbar-default .navbar-brand, 
.navbar-brand {
  color: #091e42 !important;
  font-weight: 800 !important;
  font-size: 1.15rem !important;
  letter-spacing: -0.02em !important;
  text-shadow: none !important;
  padding: 20px 15px !important;
  height: 64px !important;
  line-height: 24px !important;
}

.navbar-default .navbar-nav > li > a, 
.navbar-nav > li > a {
  position: relative !important;
  color: #334155 !important;
  font-weight: 600 !important;
  font-size: 0.925rem !important;
  text-shadow: none !important;
  padding: 20px 14px !important;
  height: 64px !important;
  line-height: 24px !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  background-image: none !important;
  background-color: transparent !important;
}

.navbar-default .navbar-nav > li > a::after,
.navbar-nav > li > a::after {
  content: '';
  position: absolute;
  bottom: 12px;
  left: 14px;
  right: 14px;
  height: 2.5px;
  background: #0052cc;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.navbar-default .navbar-nav > li > a:hover::after,
.navbar-default .navbar-nav > .active > a::after {
  transform: scaleX(1);
}

.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:focus,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-nav > li > a:hover {
  color: #0052cc !important;
  transform: translateY(-1px);
  background-color: transparent !important;
  background-image: none !important;
}

/* Caret & Dropdown */
.navbar-nav .caret {
  border-top-color: #64748b !important;
  border-bottom-color: #64748b !important;
}

.dropdown-menu {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.1) !important;
  padding: 0.5rem 0 !important;
}

.dropdown-menu > li > a {
  padding: 8px 18px !important;
  font-size: 0.9rem !important;
  color: #334155 !important;
  text-shadow: none !important;
  background-image: none !important;
}

.dropdown-menu > li > a:hover {
  background-color: #eff6ff !important;
  color: #0052cc !important;
  background-image: none !important;
}

/* ==========================================================================
   High-Definition Images & Visual Perfection
   ========================================================================== */
img {
  border-radius: 10px !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.08) !important;
  border: 1px solid #e2e8f0 !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 1.5rem auto !important;
  display: block;
}

img:hover {
  box-shadow: 0 10px 28px -4px rgba(15, 23, 42, 0.14) !important;
  transform: translateY(-2px);
}

.imgRedonda {
  border-radius: 9999px !important;
  border: 3px solid #0052cc !important;
  box-shadow: 0 4px 16px rgba(0, 82, 204, 0.2) !important;
  width: 90px !important;
  height: 90px !important;
}

/* ==========================================================================
   Futuristic IDE Syntax Highlighting on Deep Dark Background (#0b0f19)
   ========================================================================== */
/* Prevent double border/padding when knitr wraps <pre> in <div class="sourceCode"> */
div.sourceCode {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 1.5rem 0 !important;
  box-shadow: none !important;
  position: relative !important;
}

div.sourceCode > pre,
pre.sourceCode,
pre:not(.sourceCode) {
  background-color: #0b0f19 !important;
  color: #f1f5f9 !important;
  border: 1px solid #1e293b !important;
  border-radius: 10px !important;
  padding: 1.35rem 1.25rem 1.25rem 1.25rem !important;
  font-family: "JetBrains Mono", "Fira Code", Menlo, Monaco, Consolas, monospace !important;
  font-size: 0.88rem !important;
  line-height: 1.65 !important;
  overflow-x: auto !important;
  margin: 0 !important;
  box-shadow: 0 8px 24px -4px rgba(11, 15, 25, 0.25) !important;
  position: relative !important;
}

/* Guard: strictly ONE copy button per code block */
div.sourceCode > .btn-copy-code,
.btn-copy-code ~ .btn-copy-code,
.btn-copy-code + .btn-copy-code,
div.sourceCode .btn-copy-code ~ .btn-copy-code {
  display: none !important;
}

pre code, code.sourceCode {
  color: #f1f5f9 !important;
  background-color: transparent !important;
  font-family: inherit !important;
  padding: 0 !important;
  border: none !important;
}

/* Syntax Highlighting Tokens (Futuristic Quant Theme) */
code span.kw { color: #c084fc !important; font-weight: 700 !important; } /* Keywords: neon purple */
code span.dt { color: #38bdf8 !important; } /* DataType: electric cyan */
code span.dv, code span.bn, code span.fl { color: #fbbf24 !important; font-weight: 600 !important; } /* Numbers: neon gold */
code span.ch, code span.st { color: #34d399 !important; } /* Strings: neon mint / emerald */
code span.co, code span.do, code span.cv { color: #64748b !important; font-style: italic !important; } /* Comments: muted slate */
code span.ot { color: #38bdf8 !important; } /* Other */
code span.al { color: #f43f5e !important; font-weight: bold !important; } /* Alert */
code span.fu { color: #60a5fa !important; font-weight: 600 !important; } /* Functions: bright blue */
code span.cf { color: #f472b6 !important; font-weight: 700 !important; } /* ControlFlow: pink */
code span.op { color: #94a3b8 !important; } /* Operators */
code span.va { color: #e2e8f0 !important; } /* Variables */
code span.cn { color: #38bdf8 !important; font-weight: 600 !important; } /* Constants */
code span.sc { color: #a78bfa !important; } /* SpecialChar */
code span.ss { color: #34d399 !important; } /* SpecialString */

/* Inline Code */
code {
  background-color: #f1f5f9 !important;
  color: #0052cc !important;
  border-radius: 4px !important;
  padding: 0.15rem 0.4rem !important;
  font-family: "JetBrains Mono", "Fira Code", monospace !important;
  font-size: 0.88em !important;
  border: 1px solid #e2e8f0 !important;
}

/* Copy Code Floating Button */
div.sourceCode > .btn-copy-code {
  display: none !important;
}

.btn-copy-code {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 10;
}

.btn-copy-code:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-copy-code.copied {
  background: #059669;
  color: #ffffff;
  border-color: #10b981;
}

.btn-copy-code svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

/* ==========================================================================
   Modern Social Sharing Strip (Replaces old round buttons)
   ========================================================================== */
.corporate-share-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin: 3rem 0 2rem 0;
  box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

.share-box-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #091e42;
  letter-spacing: -0.01em;
}

.share-buttons-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-share-corporate {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.55rem 1.15rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none !important;
}

.btn-share-corporate svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.btn-share-corporate.linkedin {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}
.btn-share-corporate.linkedin:hover {
  background: #0284c7;
  color: #ffffff;
}

.btn-share-corporate.twitter-x {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}
.btn-share-corporate.twitter-x:hover {
  background: #0f172a;
  color: #ffffff;
}

.btn-share-corporate.whatsapp {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}
.btn-share-corporate.whatsapp:hover {
  background: #16a34a;
  color: #ffffff;
}

.btn-share-corporate.copylink {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}
.btn-share-corporate.copylink:hover,
.btn-share-corporate.copylink.copied {
  background: #0052cc;
  color: #ffffff;
  border-color: #0052cc;
}

/* ==========================================================================
   Post Navigation / Related Articles with Motion
   ========================================================================== */
.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0;
}

.related-post-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none !important;
}

.related-post-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 14px 30px -4px rgba(0, 82, 204, 0.15);
  border-color: #0052cc;
}

.related-post-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.related-post-content {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.related-post-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #091e42;
  line-height: 1.35;
}

.related-post-desc {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.5;
}

/* ==========================================================================
   Plotly & Interactive Widgets
   ========================================================================== */
.html-widget, .plotly {
  width: 100% !important;
  margin: 2rem 0 !important;
  border-radius: 10px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06) !important;
  background-color: #ffffff !important;
  overflow: hidden;
}

/* ==========================================================================
   Tables & Dataframes
   ========================================================================== */
table, .table {
  width: 100% !important;
  border-collapse: collapse !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  border: 1px solid #e2e8f0 !important;
  margin: 1.75rem 0 !important;
  font-size: 0.9rem !important;
}

table th, .table th {
  background-color: #091e42 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  padding: 0.85rem 1rem !important;
  text-align: left !important;
  border: none !important;
}

table td, .table td {
  padding: 0.75rem 1rem !important;
  border-top: 1px solid #e2e8f0 !important;
  color: #334155 !important;
}

table tr:nth-child(even) td, .table tr:nth-child(even) td {
  background-color: #f8fafc !important;
}

table tr:hover td, .table tr:hover td {
  background-color: #eff6ff !important;
}

/* ==========================================================================
   Audio Testimonial Cards
   ========================================================================== */
audio {
  width: 100% !important;
  max-width: 480px !important;
  height: 44px !important;
  border-radius: 9999px !important;
  margin: 0.75rem 0 1.25rem 0 !important;
  outline: none !important;
  box-shadow: 0 2px 8px rgba(0, 82, 204, 0.12) !important;
}

.audio-testimonial-card {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #0052cc;
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0 2rem 0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.testimonial-author-badge {
  font-weight: 800;
  color: #091e42;
  font-size: 1.1rem;
  display: block;
}

.testimonial-university-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0052cc;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.65rem;
  display: block;
  font-family: "JetBrains Mono", monospace;
}

.testimonial-quote {
  font-size: 0.975rem;
  color: #475569;
  font-style: italic;
  margin-bottom: 0.85rem;
  line-height: 1.6;
}

/* ==========================================================================
   Disqus Thread Card
   ========================================================================== */
#disqus_thread {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 2.25rem !important;
  margin-top: 3.5rem !important;
  margin-bottom: 3.5rem !important;
  box-shadow: 0 6px 20px -4px rgba(15, 23, 42, 0.06) !important;
  position: relative;
  min-height: 180px;
}

#disqus_thread::before {
  content: "Comentarios y Discusión Técnica de la Comunidad";
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: #091e42;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

/* ==========================================================================
   KILL MARKETING BANNERS EVERYWHERE
   ========================================================================== */
.separator a[href*="jesusbezerpa.github.io"],
a[href*="jesusbezerpa.github.io"] img[src*="banner"],
img[src*="banner1"],
img[src*="banner2"],
img[src*="banner3"],
img[src*="banner4"],
img[src*="banner5"],
.banner-container,
div[class*="banner"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ==========================================================================
   FIX COLLISION: SCROLL TO TOP VS. AI COPILOT
   ========================================================================== */
#movetop, 
#scrollTopBtn, 
.btn-scroll-top, 
.w3l-footer-22-main #movetop {
  position: fixed !important;
  bottom: 96px !important;
  right: 32px !important;
  left: auto !important;
  z-index: 9990 !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  background: #091e42 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  line-height: 44px !important;
  text-align: center !important;
  cursor: pointer !important;
}

#movetop:hover, 
#scrollTopBtn:hover, 
.btn-scroll-top:hover, 
.w3l-footer-22-main #movetop:hover {
  background: #0052cc !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 6px 18px rgba(0, 82, 204, 0.4) !important;
  color: #ffffff !important;
}

/* Code block futuristic border glow */
pre, .sourceCode {
  transition: border-color 0.25s ease, box-shadow 0.25s ease !important;
}

pre:hover, .sourceCode:hover {
  border-color: rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 10px 30px -4px rgba(56, 189, 248, 0.15) !important;
}


/* Dividers */
hr {
  border: 0 !important;
  height: 1px !important;
  background: #e2e8f0 !important;
  margin: 2.5rem 0 !important;
}

@media (max-width: 768px) {
  .main-container, .container-fluid.main-container {
    padding: 1.5rem 1rem 3rem 1rem !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }
  h1, h1.title, .section h1 { font-size: 1.7rem !important; }
  h2, .section h2 { font-size: 1.35rem !important; }
  #disqus_thread { padding: 1.25rem !important; }
}

/* ==========================================================================
   RELATED WORKS CAROUSEL (END OF EACH POST, BEFORE COMMENTS)
   ========================================================================== */
.pc-section {
  margin: 3rem 0 2.5rem 0;
  padding: 1.75rem 0 0.5rem 0;
  border-top: 1px solid #e2e8f0;
  position: relative;
}
.pc-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.pc-kicker {
  display: inline-block;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0052cc;
  background: rgba(0, 82, 204, 0.07);
  border: 1px solid rgba(0, 82, 204, 0.18);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  margin-bottom: 0.45rem;
}
.pc-heading {
  margin: 0 !important;
  font-size: 1.45rem !important;
  font-weight: 800 !important;
  color: #091e42 !important;
  letter-spacing: -0.01em;
  border: none !important;
  padding: 0 !important;
}
.pc-controls { display: flex; gap: 0.5rem; flex-shrink: 0; }
.pc-nav {
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #091e42;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(9, 30, 66, 0.06);
  transition: all 0.2s ease;
}
.pc-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pc-nav:hover { background: #0052cc; border-color: #0052cc; color: #ffffff; transform: translateY(-2px); }

.pc-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0.6rem 0 1.1rem 0;
  cursor: grab;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 4%, #000 96%, transparent);
}
.pc-viewport::-webkit-scrollbar { display: none; }
.pc-viewport:active { cursor: grabbing; }

.pc-track {
  display: flex;
  gap: 1.1rem;
  width: max-content;
  animation: pcMarquee 60s linear infinite;
  will-change: transform;
}
.pc-viewport:hover .pc-track,
.pc-track.paused { animation-play-state: paused !important; }
@keyframes pcMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-50% - 0.55rem)); }
}

.pc-card {
  width: 260px;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none !important;
  color: inherit !important;
  box-shadow: 0 3px 12px rgba(9, 30, 66, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.pc-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 82, 204, 0.4);
  box-shadow: 0 14px 28px rgba(0, 82, 204, 0.12);
}
.pc-media { position: relative; height: 140px; overflow: hidden; background: #0b0f19; }
.pc-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(9, 30, 66, 0.05) 30%, rgba(11, 15, 25, 0.6) 100%);
}
/* Override global post img rules */
.pc-card img.pc-img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: block !important;
  transition: transform 0.5s ease !important;
}
.pc-card:hover img.pc-img { transform: scale(1.07) !important; }
.pc-num, .pc-cat {
  position: absolute; z-index: 2;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em;
  color: #ffffff;
}
.pc-num { top: 9px; left: 9px; background: rgba(9, 30, 66, 0.85); border: 1px solid rgba(255,255,255,0.2); border-radius: 4px; padding: 0.15rem 0.45rem; }
.pc-cat { bottom: 9px; left: 9px; background: #0052cc; border-radius: 999px; padding: 0.15rem 0.55rem; text-transform: uppercase; }
.pc-body { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; justify-content: space-between; gap: 0.7rem; flex-grow: 1; }
.pc-title {
  margin: 0 !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  color: #091e42 !important;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pc-card:hover .pc-title { color: #0052cc !important; }
.pc-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  border-top: 1px solid #eef2f7; padding-top: 0.6rem;
  font-size: 0.74rem; color: #64748b;
}
.pc-tags { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-go { display: inline-flex; align-items: center; gap: 0.3rem; color: #0052cc; font-weight: 700; white-space: nowrap; transition: gap 0.2s ease; }
.pc-card:hover .pc-go { gap: 0.5rem; }
.pc-go svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 640px) {
  .pc-heading { font-size: 1.2rem !important; }
  .pc-card { width: 220px; }
  .pc-media { height: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  .pc-track { animation: none; }
}

/* ==========================================================================
   Hide Disqus "Recommendations" widget (TAMBIEN EN PORTAFOLIO) - static strip
   Comments iframe (disqus.com/embed/comments) stays visible.
   ========================================================================== */
#disqus_thread iframe[src*="disqus.com/recommendations"],
#disqus_thread iframe[src*="/recommendations/"],
#disqus_recommendations,
iframe[src*="disqus.com/recommendations"] {
  display: none !important;
  height: 0 !important;
  visibility: hidden !important;
}

/* ==========================================================================
   UNIFIED EXECUTIVE RESEARCH PAPER VISUAL SYSTEM (ALL 14 POSTS)
   ========================================================================== */
.main-container, .container-fluid.main-container {
  max-width: 1060px !important;
  width: calc(100% - 48px) !important;
  margin: 28px auto 60px auto !important;
  padding: 2.75rem 3.25rem 4rem 3.25rem !important;
  border-radius: 16px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.07) !important;
}

/* Normalize legacy Blogger/RStudio inline font-size spans to clean executive prose */
.main-container div[style*="text-align: justify"],
.main-container span[style*="font-size: large"],
.main-container span[style*="font-size: medium"] {
  font-size: 1.025rem !important;
  line-height: 1.82 !important;
  color: #334155 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif !important;
}

.main-container strong,
.main-container b {
  color: #091e42 !important;
  font-weight: 700 !important;
}

.study-hero-panel strong,
.study-hero-panel b {
  color: #ffffff !important;
}

/* Executive Hero Panel */
.study-hero-panel {
  background: linear-gradient(135deg, #091e42 0%, #0f172a 55%, #1e3a8a 100%) !important;
  color: #ffffff !important;
  border-radius: 14px !important;
  padding: 2.25rem 2.4rem !important;
  margin-bottom: 2rem !important;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  box-shadow: 0 14px 34px -6px rgba(9, 30, 66, 0.35) !important;
}

.study-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.95rem;
}

.study-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "JetBrains Mono", Consolas, monospace !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0 !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.study-badge.primary {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #ffffff !important;
  border: none;
}

.study-badge.emerald {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7 !important;
  border-color: rgba(16, 185, 129, 0.4);
}

.study-badge.amber {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a !important;
  border-color: rgba(245, 158, 11, 0.4);
}

.study-hero-panel .study-hero-title {
  color: #ffffff !important;
  font-size: 1.9rem !important;
  line-height: 1.25 !important;
  font-weight: 800 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16) !important;
  padding-bottom: 0.95rem !important;
  margin-top: 0 !important;
  margin-bottom: 0.95rem !important;
  letter-spacing: -0.02em !important;
}

.study-hero-panel p {
  color: #cbd5e1 !important;
  font-size: 1.01rem !important;
  line-height: 1.72 !important;
  margin-bottom: 1.15rem !important;
}

.study-hero-panel code {
  background: rgba(15, 23, 42, 0.55) !important;
  color: #93c5fd !important;
  border-color: rgba(147, 197, 253, 0.3) !important;
}

.study-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.85rem !important;
  color: #94a3b8 !important;
}

.study-dl-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.btn-study-dl {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.2s ease;
  text-decoration: none !important;
}

.btn-study-dl:hover {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff !important;
  text-decoration: none !important;
  transform: translateY(-1px);
}

/* 4-Column Executive KPI Grid */
.kpi-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.5rem 0 2.15rem 0;
}

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

@media (max-width: 540px) {
  .kpi-grid-4 {
    grid-template-columns: 1fr;
  }
}

.kpi-metric-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.15rem 1.2rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.08);
}

.kpi-metric-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: #0052cc;
}

.kpi-metric-card.emerald::before { background: #10b981; }
.kpi-metric-card.amber::before   { background: #f59e0b; }
.kpi-metric-card.purple::before  { background: #8b5cf6; }

.kpi-metric-label {
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b !important;
  margin-bottom: 0.35rem;
  display: block;
}

.kpi-metric-value {
  font-size: 1.48rem !important;
  font-weight: 800 !important;
  color: #091e42 !important;
  line-height: 1.18 !important;
  font-family: "JetBrains Mono", Consolas, monospace !important;
}

.kpi-metric-delta {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: #dcfce7;
  color: #15803d !important;
}

.kpi-metric-delta.blue {
  background: #dbeafe;
  color: #1d4ed8 !important;
}

.kpi-metric-delta.amber {
  background: #fef3c7;
  color: #b45309 !important;
}

.kpi-metric-sub {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem !important;
  color: #64748b !important;
  line-height: 1.4 !important;
}

/* Executive Synthesis Callout Boxes (.callout-quant) */
.callout-quant {
  background: #f8fafc !important;
  border-left: 4px solid #0052cc !important;
  border-radius: 0 10px 10px 0 !important;
  padding: 1.2rem 1.4rem !important;
  margin: 1.65rem 0 !important;
  border-top: 1px solid #e2e8f0 !important;
  border-right: 1px solid #e2e8f0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03) !important;
}

.callout-quant.emerald {
  border-left-color: #10b981 !important;
  background: #f0fdf4 !important;
}

.callout-quant.amber {
  border-left-color: #f59e0b !important;
  background: #fffbeb !important;
}

.callout-quant h4 {
  margin-top: 0 !important;
  margin-bottom: 0.5rem !important;
  font-size: 1.04rem !important;
  font-weight: 800 !important;
  color: #091e42 !important;
}

.callout-quant p {
  margin-bottom: 0 !important;
  font-size: 0.96rem !important;
  line-height: 1.72 !important;
  color: #1e293b !important;
}

/* Modernized .code-box (Table of Contents box in R posts) */
.code-box {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  border-left: 4px solid #0052cc !important;
  border-radius: 10px !important;
  padding: 1.2rem 1.5rem !important;
  margin: 1.25rem 0 2rem 0 !important;
  line-height: 1.9 !important;
}

/* ==========================================================================
   Ensure RStudio <a class="sourceLine"> never inherits link blue (#0052cc)
   ========================================================================== */
pre a.sourceLine,
code a.sourceLine,
pre a.sourceLine:hover,
code a.sourceLine:hover {
  color: #e2e8f0 !important;
  text-decoration: none !important;
  font-weight: 400 !important;
  pointer-events: none !important;
}

/* ==========================================================================
   UNIFIED SITE FOOTER OVERRIDES (Identical across all pages & posts)
   ========================================================================== */
.site-footer {
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  padding: 3.5rem 0 2rem 0 !important;
  margin-top: 3rem !important;
  width: 100% !important;
}

.site-footer .site-container {
  max-width: 1240px !important;
  margin: 0 auto !important;
  padding: 0 1.5rem !important;
}

.site-footer .footer-brand-title {
  font-size: 1.2rem !important;
  font-weight: 800 !important;
  color: #091e42 !important;
}

.site-footer p.footer-brand-desc {
  font-size: 0.9rem !important;
  color: #64748b !important;
  line-height: 1.6 !important;
  max-width: 440px !important;
  margin-bottom: 0 !important;
}

.site-footer .footer-license-box {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.75rem !important;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  padding: 0.85rem !important;
  font-size: 0.8rem !important;
  color: #334155 !important;
  line-height: 1.5 !important;
  margin-top: 0.5rem !important;
  max-width: 440px !important;
}

.site-footer .footer-license-box img {
  width: 88px !important;
  height: 31px !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: block !important;
  flex-shrink: 0 !important;
  transform: none !important;
}

.site-footer .footer-license-box a {
  color: #0052cc !important;
  font-weight: 500 !important;
  font-size: 0.8rem !important;
}

.site-footer h4.footer-col-title {
  font-size: 0.925rem !important;
  font-weight: 700 !important;
  color: #091e42 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace !important;
  margin-top: 0 !important;
  margin-bottom: 1rem !important;
  border: none !important;
  padding: 0 !important;
}

.site-footer .footer-links-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.65rem !important;
}

.site-footer .footer-links-list li {
  margin: 0 !important;
  padding: 0 !important;
}

.site-footer .footer-links-list a {
  font-size: 0.9rem !important;
  color: #334155 !important;
  font-weight: 400 !important;
  text-decoration: none !important;
}

.site-footer .footer-links-list a:hover {
  color: #0052cc !important;
  text-decoration: none !important;
}

.site-footer .footer-bottom-strip {
  border-top: 1px solid #e2e8f0 !important;
  padding-top: 1.75rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 1rem !important;
  font-size: 0.825rem !important;
  color: #64748b !important;
}


/* ==========================================================================
   processanimateR Interactive Process Maps (Playback Controls & Legend)
   ========================================================================== */
.processanimateR.html-widget {
  position: relative !important;
  box-sizing: content-box !important;
  line-height: 0 !important;
}

.processanimateR.html-widget > svg:not(.processanimater-legend-svg) {
  display: block !important;
  line-height: normal !important;
}

.processanimateR.html-widget svg.processanimater-control {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  overflow: visible !important;
}

.processanimateR.html-widget .pa-play-pause-btn:hover .pa-btn-bg {
  filter: brightness(1.1);
}

.processanimateR.html-widget .pa-restart-btn:hover .pa-restart-bg {
  fill: #e2e8f0 !important;
  stroke: #94a3b8 !important;
}
