/* ============================================================
 * editorial-polish.css · 2026-05-10
 * Westlaw/LexisNexis-style polish bundle. 10 fixes to differentiate
 * from Claude/Tailwind defaults toward editorial legal-pro feel.
 * Loaded AFTER style.css so cascades win.
 * ============================================================ */

/* ─── 1. Branded ::selection (no más default browser blue) ─── */
::selection { background: #1b3a6b; color: #ffffff; text-shadow: none; }
::-moz-selection { background: #1b3a6b; color: #ffffff; text-shadow: none; }

/* ─── 5. Custom focus ring (keyboard nav only, no aparece al click) ─── */
:focus-visible {
  outline: 2px solid #2a4f9e;
  outline-offset: 2px;
  border-radius: 4px;
  transition: outline-color .15s;
}
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline-color: #1b3a6b;
}

/* ─── 6. Custom scrollbar (Webkit + Firefox) ─── */
* { scrollbar-width: thin; scrollbar-color: #c0c5cf transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #c0c5cf;
  border-radius: 999px;
  border: 2px solid #fbfaf7;
}
*::-webkit-scrollbar-thumb:hover { background: #1b3a6b; }
*::-webkit-scrollbar-corner { background: transparent; }

/* ─── 7. <details> chevron animado custom + smooth-scroll ─── */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
details > summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding-right: 24px;
  user-select: none;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #1b3a6b;
  border-bottom: 2px solid #1b3a6b;
  transform: translateY(-70%) rotate(45deg);
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
details[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }

/* ─── 8. Branded blockquote / cite (legal-quote feel) ─── */
blockquote, .doc-cite, cite.legal {
  margin: 14px 0;
  padding: 10px 16px 10px 18px;
  border-left: 3px solid #1b3a6b;
  background: linear-gradient(180deg, #f4f7fc 0%, transparent 100%);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 15.5px;
  font-style: italic;
  color: #232730;
  line-height: 1.55;
  border-radius: 0 6px 6px 0;
  position: relative;
}
blockquote::before {
  content: "❝";
  position: absolute;
  left: -2px;
  top: -8px;
  font-size: 24px;
  color: #c98a17;
  font-family: serif;
  font-style: normal;
  line-height: 1;
}
blockquote cite, blockquote .source {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-style: normal;
  color: #565c6a;
  letter-spacing: 0.01em;
}
blockquote cite::before { content: "— "; }

/* ─── 9. Tabular-nums + slashed-zero global ─── */
table, .doc-meta-bottom strong, .stat-num, .meta, .fecha, .vistas,
.fallo-rit, .doc-rit, .nv-trend-rit, .doc-meta-bottom td,
.doc-cell strong, [class*="-num"], [class*="-fecha"], [class*="-rit"] {
  font-variant-numeric: tabular-nums slashed-zero;
}

/* ─── 10. Branded loading spinner (pulse-radar dot ámbar) ─── */
.loading, .nv-loading, .spinner, .loader, [data-loading], .thinking {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #565c6a;
  font-family: "Inter", sans-serif;
}
.loading::before, .nv-loading::before, [data-loading]::before, .thinking::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c98a17;
  box-shadow: 0 0 0 0 rgba(201,138,23,0.6);
  animation: nv-loading-pulse 1.4s infinite;
  flex-shrink: 0;
}
@keyframes nv-loading-pulse {
  0% { box-shadow: 0 0 0 0 rgba(201,138,23,0.6); transform: scale(1); }
  70% { box-shadow: 0 0 0 10px rgba(201,138,23,0); transform: scale(1.15); }
  100% { box-shadow: 0 0 0 0 rgba(201,138,23,0); transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .loading::before, .nv-loading::before, [data-loading]::before, .thinking::before { animation: none; }
}

/* ─── 3. Print stylesheet (legal-pro feel for printed sentencias) ─── */
@media print {
  /* Hide chrome */
  header, footer, nav, .oc-header, .oc-footer-minimal,
  .main-tabs, #facil-promo-banner, #hero-hint, .pv4-hero-cta,
  .nv-skip-link, .gate-overlay, .pv4-bonus-popup-overlay,
  .nv-chat-suggestions-row, .chat-input-area, .chat-input-wrap,
  .action-list, .aside-card, .oc-doc-sidebar, .copy-btn, .action-btn,
  #trending-widget, #continue-widget, #nv-recientes-widget,
  .gates-banner, .nv-jurisp-md-styles {
    display: none !important;
  }

  body { background: white !important; color: #000 !important; font-size: 11pt; }
  body * { color: #000 !important; box-shadow: none !important; }

  .oc-doc-main, .fallo-detalle, main, .container, .panel-content {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    grid-template-columns: 1fr !important;
  }

  /* Print typography editorial */
  h1, .oc-doc-title, .fallo-caratula-title {
    font-family: "Source Serif 4", Georgia, serif !important;
    font-size: 18pt !important;
    color: #000 !important;
    page-break-after: avoid;
  }
  h2, h3, .resumen-long-sec h3 {
    font-family: "Source Serif 4", Georgia, serif !important;
    page-break-after: avoid;
  }
  p, .doc-content, .md-body, .resumen-long-sec p, .fallo-md-body {
    font-family: "Source Serif 4", Georgia, serif !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
    orphans: 3;
    widows: 3;
  }

  /* Ensure full content visible */
  details, details[open] { display: block !important; }
  details summary::after { display: none !important; }
  details .fallo-texto-body, details .texto-pre, details .md-body { display: block !important; }

  /* Page break helpers */
  .page-break-before { page-break-before: always; }
  .page-break-after { page-break-after: always; }

  /* Footer with URL on each page */
  @page {
    margin: 1.6cm 1.4cm;
    @bottom-right {
      content: "Página " counter(page) " de " counter(pages);
      font-family: "Inter", sans-serif;
      font-size: 9pt;
      color: #565c6a;
    }
    @bottom-left {
      content: "OficioyCircular · NormaViva SpA";
      font-family: "Inter", sans-serif;
      font-size: 9pt;
      color: #565c6a;
    }
  }

  /* URL en links */
  a[href^="http"]::after {
    content: " ⟨" attr(href) "⟩";
    font-size: 9pt;
    color: #565c6a;
    font-style: italic;
  }
  a[href^="/"]::after {
    content: " ⟨tax.normaviva.cl" attr(href) "⟩";
    font-size: 9pt;
    color: #565c6a;
    font-style: italic;
  }

  /* Tablas con borders sutiles */
  table { border-collapse: collapse; width: 100%; }
  th, td { border: 0.5pt solid #565c6a; padding: 4pt 8pt; }
}


