/* Efecto fade-up */
.fade-up { opacity: 0; transform: translateY(20px); }
.fade-up.is-visible { opacity: 1; transform: translateY(0); transition: opacity .5s ease-out, transform .5s ease-out; }

/* Header y navegación principal */
.site-header,
body > header,
header.site-header {
    background: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .header-container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .header-container {
        padding: 0 2rem;
    }
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4f46e5;
    text-decoration: none;
}

.desktop-nav {
    display: none;
    align-items: center;
    gap: 1.5rem;
}

/* Forzar elementos horizontales en menú principal */
.desktop-nav > ul {
    display: flex !important;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
    align-items: center;
}

.desktop-nav > ul > li {
    display: inline-block;
    margin: 0;
    padding: 0;
    position: relative;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
    }
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #4f46e5;
}

.mobile-menu-btn {
    display: block;
    color: #374151;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}

.mobile-menu-btn:hover {
    color: #4f46e5;
}

.mobile-menu-btn svg {
    width: 1.5rem;
    height: 1.5rem;
}

.mobile-menu {
    display: none;
    padding-bottom: 1rem;
}

.mobile-menu.show {
    display: block;
}

@media (min-width: 768px) {
    .mobile-menu {
        display: none !important;
    }
}

.mobile-nav-link {
    display: block;
    padding: 0.5rem 0;
    color: #374151;
    text-decoration: none;
}

.mobile-nav-link:hover {
    color: #4f46e5;
}

/* Dropdown menu styles for desktop */
.desktop-nav .group:hover > ul,
.desktop-nav li:hover > ul {
    display: block !important;
    opacity: 1;
    visibility: visible;
}

.desktop-nav ul ul {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 0.375rem;
    display: none;
    opacity: 0;
    visibility: hidden;
    min-width: 200px;
    z-index: 110;
    flex-direction: column !important;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.desktop-nav ul ul li {
    display: block !important;
    margin: 0;
    padding: 0;
}

.desktop-nav ul ul li:first-child a {
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

.desktop-nav ul ul li:last-child a {
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.desktop-nav ul ul a {
    color: #374151 !important;
    padding: 0.75rem 1rem !important;
    display: block !important;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
}

.desktop-nav ul ul a:hover,
.desktop-nav ul ul a:focus {
    background-color: #f9fafb !important;
    color: #1f2937 !important;
}

.desktop-nav ul ul li:last-child a {
    border-bottom: none;
}

/* Asegurar que los items con submenús se vean correctamente */
.desktop-nav li.has-dropdown > a {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.desktop-nav li.has-dropdown > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.5rem;
    vertical-align: middle;
    border-top: 4px solid currentColor;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    flex-shrink: 0;
}

/* Posicionamiento relativo para los items padre */
.desktop-nav li,
.rne-nav li {
    position: relative;
}

/* Estilos para .rne-nav (usado en archive pages) - idéntico a .desktop-nav */
.rne-nav .group:hover > ul,
.rne-nav li:hover > ul {
    display: block !important;
    opacity: 1;
    visibility: visible;
}

.rne-nav ul ul {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 0.375rem;
    display: none;
    opacity: 0;
    visibility: hidden;
    min-width: 200px;
    z-index: 110;
    flex-direction: column !important;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.rne-nav ul ul li {
    display: block !important;
    margin: 0;
    padding: 0;
}

.rne-nav ul ul li:first-child a {
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

.rne-nav ul ul li:last-child a {
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.rne-nav ul ul a {
    color: #374151 !important;
    padding: 0.75rem 1rem !important;
    display: block !important;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
}

.rne-nav ul ul a:hover,
.rne-nav ul ul a:focus {
    background-color: #f9fafb !important;
    color: #1f2937 !important;
}

.rne-nav ul ul li:last-child a {
    border-bottom: none;
}

/* Flechas para .rne-nav también */
.rne-nav li.has-dropdown > a {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.rne-nav li.has-dropdown > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.5rem;
    vertical-align: middle;
    border-top: 4px solid currentColor;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    flex-shrink: 0;
}

.desktop-nav ul ul a {
    display: block !important;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.desktop-nav ul ul li:last-child a {
    border-bottom: none;
}

.desktop-nav ul ul a:hover {
    background-color: #f8fafc;
    color: #4f46e5;
}

/* Mobile dropdown styles */
.mobile-nav-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.mobile-menu-item {
    border-bottom: 1px solid #f3f4f6;
}

.mobile-menu-item:last-child {
    border-bottom: none;
}

.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-submenu.open {
    max-height: 500px;
}

.mobile-chevron {
    transition: transform 0.2s ease;
}

.mobile-chevron.rotated {
    transform: rotate(180deg);
}

/* Enhanced hover effects */
.nav-link {
    position: relative;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #4f46e5;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #4f46e5;
    transition: width 0.2s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Footer navigation styles */
.footer-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-nav li {
    margin: 0;
    padding: 0;
}

.footer-nav a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
    display: block;
}

.footer-nav a:hover {
    color: #ffffff;
}

/* Details/summary accesible */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] summary { color: #4f46e5; }

/* Pequeños ajustes del header sticky (iOS) */
@supports (backdrop-filter: blur(2px)) {
  header { backdrop-filter: saturate(180%) blur(6px); }
}

/* Tipografía base */
:root { --font-inter: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial; }
html { font-family: var(--font-inter); }

/* Prose styling para contenido de artículos */
.prose { color: #374151; line-height: 1.7; }
.prose h2 { 
  scroll-margin-top: 100px; 
  font-size: 1.875rem;
  font-weight: 700;
  color: #1f2937;
  margin-top: 2rem;
  margin-bottom: 1rem;
}
.prose h3 { 
  scroll-margin-top: 100px;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}
.prose p { margin-bottom: 1.25rem; }
.prose .lead { 
  font-size: 1.25rem; 
  color: #6b7280; 
  margin-bottom: 2rem;
  font-weight: 400;
}
.prose ul, .prose ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.prose li { margin-bottom: 0.5rem; }
.prose strong { font-weight: 600; color: #1f2937; }
.prose img { 
  border-radius: 0.5rem; 
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin: 1.5rem 0;
}

/* Details/summary accesible */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details[open] summary { color: #4f46e5; }

/* Sticky helper */
.sticky { position: sticky; }

/* Line clamp for text truncation */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Aspect ratio utilities */
.aspect-video {
  aspect-ratio: 16 / 9;
}

/* Card hover animations */
.transition-all {
  transition: all 0.2s ease-in-out;
}

.transition-colors {
  transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.transition-transform {
  transition: transform 0.2s ease-in-out;
}

/* Grid responsive improvements */
@media (max-width: 768px) {
  .grid.md\\:grid-cols-2.lg\\:grid-cols-3 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid.md\\:grid-cols-2.lg\\:grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .grid.md\\:grid-cols-2.lg\\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* SVG icon constraints to prevent gigantic icons */
svg {
  max-width: 100%;
  height: auto;
}

/* Specific icon size constraints */
.w-3.h-3 {
  width: 0.75rem !important;
  height: 0.75rem !important;
  min-width: 0.75rem;
  min-height: 0.75rem;
  max-width: 0.75rem;
  max-height: 0.75rem;
}

.w-4.h-4 {
  width: 1rem !important;
  height: 1rem !important;
  min-width: 1rem;
  min-height: 1rem;
  max-width: 1rem;
  max-height: 1rem;
}

.w-8.h-8 {
  width: 2rem !important;
  height: 2rem !important;
  min-width: 2rem;
  min-height: 2rem;
  max-width: 2rem;
  max-height: 2rem;
}

.w-12.h-12 {
  width: 3rem !important;
  height: 3rem !important;
  min-width: 3rem;
  min-height: 3rem;
  max-width: 3rem;
  max-height: 3rem;
}

/* Prevent flex-shrink from affecting icon sizes */
.flex-shrink-0 {
  flex-shrink: 0 !important;
}

/* Enhanced hover effects for cards */
.group:hover .group-hover\\:scale-110 {
  transform: scale(1.1);
}

/* Backdrop blur support */
.backdrop-blur-sm {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Enhanced transitions */
.transition-all {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animation for search results */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeInUp {
  animation: fadeInUp 0.5s ease-out;
}

/* Gradient text effect */
.gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Enhanced shadow effects */
.shadow-xl {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Improved line-clamp for better text truncation */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive typography scaling */
@media (max-width: 640px) {
  .text-4xl.md\\:text-5xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
}

/* Enhanced focus states for accessibility */
input:focus, 
button:focus, 
a:focus {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Tabla comparativa */
table { border-collapse: separate; border-spacing: 0; }

/* Fallback si no carga typography */
.prose h2 { font-size: 1.5rem; line-height: 1.3; font-weight: 700; margin: 1.25em 0 .75em; }
.prose h3 { font-size: 1.25rem; line-height: 1.35; font-weight: 600; margin: 1.1em 0 .6em; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1em 1.25rem; }

/* Caja TOC */
#rne-toc a { display:block; padding:6px 10px; border-radius:8px; }
#rne-toc a:hover { background:#eef2ff; }              /* indigo-50 */
#rne-toc a.font-semibold { background:#eef2ff; }      /* activo */
#rne-toc a.pl-4 { padding-left:1.5rem; font-size:.95em; }

/* Si tu header fijo mide ~72px */
.prose h2, .prose h3 { scroll-margin-top: 96px; }

/* TOC */
#rne-toc a { display:block; padding:6px 10px; border-radius:8px; }
#rne-toc a:hover { background:#eef2ff; }         /* indigo-50 */
#rne-toc a.font-semibold { background:#eef2ff; }
.prose h2, .prose h3 { scroll-margin-top: 96px; } /* para header sticky */

/* rne.css */
details[data-no-toc] summary { padding: 6px 10px; border-radius: 8px; }
details[data-no-toc] summary:hover { background: #eef2ff; }
details[data-no-toc] summary::after{
  content:"▾"; margin-left:8px; transition:transform .2s ease;
}
details[open][data-no-toc] summary::after{ transform: rotate(180deg); }


/* Borde degradado sutil en cards */
.rne-card.ring-gradient,
.rne-keyfacts.ring-gradient {
  position: relative;
  isolation: isolate;
}
.rne-card.ring-gradient::before,
.rne-keyfacts.ring-gradient::before{
  content:"";
  position:absolute; inset:0; border-radius:1rem; padding:1px;
  background: linear-gradient(135deg, rgba(99,102,241,.35), rgba(99,102,241,0) 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events:none;
}

/* Botón con brillo */
.rne-btn-shine{ position:relative; overflow:hidden; }
.rne-btn-shine::after{
  content:""; position:absolute; inset:auto -40% 0 -40%; top:-120%;
  transform: rotate(25deg);
  height:160%; background: linear-gradient(90deg, rgba(255,255,255,.0), rgba(255,255,255,.35), rgba(255,255,255,.0));
  animation: rneShine 2.4s linear infinite;
  pointer-events:none;
}
@keyframes rneShine{
  0%{ transform: translateX(-120%) rotate(25deg); }
  100%{ transform: translateX(120%) rotate(25deg); }
}

.widget { background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:12px; }
@media (max-width: 768px){
  .widget { padding:10px; }
}

:root{
  --rne-body:#0f172a;   /* slate-900 */
  --rne-muted:#475569;  /* slate-600 */
}
html{ font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji"; }
body{ color:var(--rne-body); font-feature-settings:"liga" 1, "kern" 1, "tnum" 1; }
.prose :where(p,li){ color:var(--rne-body); line-height:1.7; }
.prose :where(h1,h2,h3){ color:var(--rne-body); letter-spacing:-0.01em; }
.prose a{ text-decoration:none; }
.prose a:hover{ text-decoration:underline; }
.small-meta, .prose .small-meta{ color:var(--rne-muted); font-size:.85rem; }

/* ===== Summary card ===== */
.rne-summary-card{
  position:relative;
  border-radius:16px;
  padding:20px 20px 18px;
  background:linear-gradient(180deg,rgba(99,102,241,.06),rgba(99,102,241,.03));
  border:1px solid rgba(99,102,241,.15);
  box-shadow:0 1px 2px rgba(0,0,0,.04), 0 8px 24px -12px rgba(99,102,241,.35);
  margin-bottom:18px; /* deja aire antes del TOC */
}
.rne-summary-card::before{
  content:"";
  position:absolute; inset:0; border-radius:16px; padding:1px;
  background:linear-gradient(135deg,#6366f1 0%,#a78bfa 45%,transparent 100%);
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor; mask-composite:exclude;
  pointer-events:none;
}
.rne-summary-eyebrow{
  display:inline-flex; align-items:center; gap:.5rem;
  font-weight:700; font-size:.875rem; letter-spacing:.02em;
  color:#4338ca; background:#eef2ff; border:1px solid #c7d2fe;
  padding:.25rem .6rem; border-radius:9999px; margin-bottom:.6rem;
}
.rne-summary-body p{ margin:0 0 .8rem; }
.rne-summary-body p strong{ color:#0f172a; }

/* ===== TOC spacing & usability ===== */
/* Si usas mi shortcode [ron_toc], el wrapper tiene esta clase */
.rne-toc-box{ margin:22px 0 32px; } /* MÁS aire arriba y abajo */
.rne-toc-panel{ max-height:420px; overflow:auto; }
.rne-toc-box + *{ margin-top:18px; } /* asegura separación con lo que sigue */

/* Opcional: pequeños “chips” dentro del TOC si usas listas */
.rne-toc-panel a{
  display:block; padding:.45rem .6rem; border-radius:.5rem;
  text-decoration:none; color:#1f2937;
}
.rne-toc-panel a:hover{ background:#f3f4f6; }


/* Fuerza aire alrededor del TOC, incluso si hay colapso de márgenes */
.rne-toc-box{
  display: flow-root;           /* evita que colapsen los márgenes con lo de arriba/abajo */
  margin: 28px 0 36px;          /* más aire arriba y abajo */
  padding-top: 4px;             /* rompe aún más el colapso de margen superior */
}

/* Si el contenido siguiente está muy pegado, empújalo un poco más */
.rne-toc-box + *{
  margin-top: 25px !important;
}

/* Asegura separación entre la card de Summary y el TOC */
.rne-summary-card{ margin-bottom: 22px; }

/* Si el TOC cae dentro de .prose, también dale aire */
.prose .rne-toc-box{ margin-top: 28px; margin-bottom: 36px; }

/* Right rail fijo (sticky) en pantallas grandes */
@media (min-width: 1024px){
  .rne-rail-sticky{
    position: sticky;
    top: 96px;               /* ajusta según la altura de tu header */
    align-self: start;
    max-height: calc(100vh - 120px);
    overflow: auto;          /* scroll interno si es largo */
  }
}

/* Mejoras para el CTA */
.rne-cta-card {
  backdrop-filter: blur(10px);
}

/* Hover effects adicionales */
.group:hover .group-hover\\:scale-105 {
  transform: scale(1.05);
}

/* Asegura que el sidebar tenga buen espaciado */
aside.space-y-4 > * + * {
  margin-top: 1.5rem !important;
}

/* Mejora el look del compare link */
.compare-link {
  transition: all 0.2s ease-in-out;
}

.compare-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}





