/* ============================================================
 * editorial-premium.css · 2026-05-10
 * Bundle premium UI: NProgress · reading progress · anchor # · skeletons
 * Tippy theme override
 * Pair: editorial-premium.js
 * ============================================================ */

/* ─── NProgress: barra de carga top-of-page (estilo YouTube/Medium) ─── */
#nprogress {
  pointer-events: none;
  position: relative;
  z-index: 99999;
}
#nprogress .bar {
  background: #1b3a6b;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  z-index: 99999;
}
#nprogress .peg {
  display: block;
  position: absolute;
  right: 0px;
  width: 100px;
  height: 100%;
  box-shadow: 0 0 10px #1b3a6b, 0 0 5px #2a4f9e;
  opacity: 1.0;
  transform: rotate(3deg) translate(0px, -4px);
}
.nprogress-custom-parent { overflow: hidden; position: relative; }
.nprogress-custom-parent #nprogress .bar { position: absolute; }

/* ─── Reading progress bar (solo /fallo/* y /oficio/*) ─── */
.nv-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: #1b3a6b;
  z-index: 99998;
  transition: width .12s linear;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(15,33,71,0.15);
}

/* ─── Anchor # on hover (h2/h3/h4) ─── */
.nv-h-anchor {
  position: relative;
  scroll-margin-top: 84px;
}
.nv-h-anchor .nv-anchor-link {
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  color: #c0c5cf;
  text-decoration: none;
  font-weight: 400;
  font-size: 0.85em;
  font-family: "JetBrains Mono", monospace;
  padding: 0 4px;
  transition: opacity .15s, color .15s;
}
.nv-h-anchor:hover .nv-anchor-link,
.nv-h-anchor:focus-within .nv-anchor-link {
  opacity: 1;
}
.nv-h-anchor .nv-anchor-link:hover {
  color: #1b3a6b;
}
.nv-h-anchor .nv-anchor-link.copied::after {
  content: " ¡copiado!";
  font-size: 11px;
  color: #2f7a55;
  font-family: "Inter", sans-serif;
  margin-left: 4px;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .nv-h-anchor .nv-anchor-link { left: auto; right: 0; opacity: 0.4; position: static; transform: none; margin-left: 6px; }
}

/* ─── Skeleton loaders shimmer ─── */
.nv-skeleton {
  display: inline-block;
  height: 1em;
  width: 100%;
  background: linear-gradient(
    90deg,
    #ecedf2 0%,
    #f6f7fa 50%,
    #ecedf2 100%
  );
  background-size: 200% 100%;
  animation: nv-skel-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
  vertical-align: middle;
}
.nv-skeleton-block {
  display: block;
  width: 100%;
  height: 14px;
  margin: 6px 0;
  background: linear-gradient(90deg, #ecedf2 0%, #f6f7fa 50%, #ecedf2 100%);
  background-size: 200% 100%;
  animation: nv-skel-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}
.nv-skeleton-block.short { width: 60%; }
.nv-skeleton-block.tall { height: 22px; }
.nv-skeleton-block.title { height: 28px; width: 70%; margin-bottom: 14px; }
@keyframes nv-skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .nv-skeleton, .nv-skeleton-block { animation: none; background: #ecedf2; }
}

/* ─── Tippy.js theme override (navy + serif + sin border genérico) ─── */
.tippy-box[data-theme~='nv'] {
  background-color: #0f2147;
  color: #f6f7fa;
  font-family: "Inter", sans-serif;
  font-size: 12.5px;
  line-height: 1.5;
  border-radius: 6px;
  padding: 4px 2px;
  box-shadow: 0 4px 14px rgba(15,33,71,0.25), 0 1px 4px rgba(0,0,0,0.08);
  letter-spacing: 0.01em;
}
.tippy-box[data-theme~='nv'] .tippy-content {
  padding: 6px 10px;
  max-width: 320px;
}
.tippy-box[data-theme~='nv'] .tippy-arrow { color: #0f2147; }
.tippy-box[data-theme~='nv'] strong {
  color: #fbbf24;
  font-weight: 600;
}
.tippy-box[data-theme~='nv'] .nv-tt-meta {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  color: rgba(246,247,250,0.65);
  font-variant-numeric: tabular-nums slashed-zero;
}
.tippy-box[data-theme~='nv'] code {
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 3px;
}

/* RIT badge subtle hover hint */
.nv-rit-tt { cursor: help; border-bottom: 1px dotted #c0c5cf; transition: border-color .15s; }
.nv-rit-tt:hover { border-bottom-color: #1b3a6b; }
