/**
 * NicheRocket — Tema Starter CSS
 * Estilos custom + variables de color del sitio
 * Complementa Tailwind CSS (cargado vía CDN)
 */

/* === Reset y base === */
html { scroll-behavior: smooth; }
body { min-height: 100vh; }

/* === Tipografía del artículo === */
.article-content h2 {
    font-family: var(--font-heading, 'Merriweather', serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: #1f2937;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f3f4f6;
    scroll-margin-top: 80px;
}

.article-content h3 {
    font-family: var(--font-heading, 'Merriweather', serif);
    font-size: 1.3rem;
    font-weight: 600;
    color: #374151;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    scroll-margin-top: 80px;
}

.article-content p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
    color: #374151;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.article-content strong { color: #1f2937; }

.article-content a {
    color: var(--primary, #2563eb);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
.article-content a:hover { text-decoration-thickness: 2px; }

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.article-content th {
    background: #f9fafb;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e5e7eb;
}
.article-content td {
    padding: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.article-content blockquote {
    border-left: 4px solid var(--primary, #2563eb);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: #f9fafb;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #4b5563;
}

/* === Bloque de producto === */
.product-box {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    background: #fff;
    position: relative;
    transition: box-shadow 0.2s;
}
.product-box:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }

.product-badge {
    position: absolute;
    top: -8px;
    left: 16px;
    padding: 2px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.product-badge-top { background: var(--primary, #2563eb); color: #fff; }
.product-badge-budget { background: var(--accent, #f59e0b); color: #1f2937; }

.product-box-inner { display: flex; gap: 1.5rem; }
@media (max-width: 640px) {
    .product-box-inner { flex-direction: column; align-items: center; text-align: center; }
}

.product-image { flex-shrink: 0; }
.product-image img { width: 160px; height: 160px; object-fit: contain; }

.product-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.product-title a { color: #1f2937; text-decoration: none; }
.product-title a:hover { color: var(--primary, #2563eb); }

.product-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }

.stars { display: inline-flex; align-items: center; gap: 1px; }
.stars .star { display: inline-block; vertical-align: middle; }
.rating-number { color: #6b7280; font-size: 0.85rem; margin-left: 4px; }
.reviews-count { color: #9ca3af; font-size: 0.8rem; }

/* Precio sin verificar: muestra CTA a Amazon */
.product-price-dynamic .check-price-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: #d97706; font-weight: 600; font-size: 0.95rem;
    text-decoration: none;
}
.product-price-dynamic .check-price-link:hover { color: #b45309; text-decoration: underline; }
.product-price-dynamic .check-price-icon { flex-shrink: 0; opacity: 0.8; }

/* Anchor links: offset = header sticky (64px) + holgura */
.article-content h2, .article-content h3 {
    scroll-margin-top: 96px;
}

/* Grid de productos en artículos vs/comparison (fichas tipo card verticales) */
.product-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
}
.product-grid-compact .product-box {
    margin: 0;
    padding: 1.25rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}
/* Layout interno vertical tipo card */
.product-grid-compact .product-box-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    flex: 1;
}
.product-grid-compact .product-image {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 140px;
    background: #f9fafb;
    border-radius: 8px;
    padding: 0.5rem;
}
.product-grid-compact .product-image img {
    max-width: 100%;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
}
.product-grid-compact .product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: left;
}
.product-grid-compact .product-title {
    font-size: 0.95rem;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-grid-compact .product-meta {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}
.product-grid-compact .product-pros {
    font-size: 0.82rem;
    margin: 0.5rem 0 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-grid-compact .product-pros li { margin-bottom: 0.15rem; }
.product-grid-compact .product-score {
    align-self: flex-start;
    font-size: 0.85rem;
    padding: 0.15rem 0.5rem;
}
.product-grid-compact .product-score .score-value { font-size: 1rem; }
.product-grid-compact .product-cta {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: auto;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
}
.product-grid-compact .product-badge {
    top: -10px;
    font-size: 0.65rem;
    padding: 3px 10px;
}
@media (max-width: 640px) {
    .product-grid-compact {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.prime-badge, .prime-badge-sm {
    background: #0066c0;
    color: #fff;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 700;
}

.product-price { margin: 0.5rem 0; }
.price-current { font-size: 1.5rem; font-weight: 700; color: #1f2937; }
.price-original { font-size: 0.9rem; color: #9ca3af; text-decoration: line-through; }
.price-discount { font-size: 0.85rem; color: #dc2626; font-weight: 600; }

.product-pros { list-style: none; padding: 0; margin: 0.75rem 0; }
.product-pros li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    color: #4b5563;
}
.product-pros li::before { content: '+'; position: absolute; left: 0; color: #10b981; font-weight: 700; }

.product-score {
    display: inline-flex;
    align-items: baseline;
    background: var(--primary, #2563eb);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    margin: 0.5rem 0;
}
.score-value { font-size: 1.4rem; font-weight: 700; }
.score-label { font-size: 0.75rem; margin-left: 2px; opacity: 0.8; }

.product-cta {
    display: inline-block;
    background: var(--accent, #f59e0b);
    color: #1f2937;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    margin-top: 0.75rem;
    transition: all 0.2s;
}
.product-cta:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* === Tabla comparativa === */
.comparison-table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}
.comparison-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.comparison-table th {
    background: #f9fafb;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}
.comparison-table td { padding: 1rem; border-top: 1px solid #f3f4f6; vertical-align: middle; }
.comparison-table .product-cell { display: flex; align-items: center; gap: 0.75rem; min-width: 240px; }
.table-product-img { width: 50px; height: 50px; object-fit: contain; flex-shrink: 0; }
.table-product-name { font-weight: 600; }
.table-badge { font-size: 0.6rem; padding: 1px 6px; border-radius: 3px; font-weight: 700; text-transform: uppercase; margin-left: 0.5rem; }
.badge-top { background: var(--primary, #2563eb); color: #fff; }
.badge-budget { background: var(--accent, #f59e0b); color: #1f2937; }
.top-pick-row { background: rgba(37, 99, 235, 0.03); }
.budget-pick-row { background: rgba(245, 158, 11, 0.03); }
.table-cta {
    display: inline-block;
    background: var(--accent, #f59e0b);
    color: #1f2937;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
    white-space: nowrap;
}
.table-cta:hover { filter: brightness(1.1); }
.price-cell { font-weight: 700; white-space: nowrap; }

/* === Caja del autor === */
.author-box {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    margin: 2rem 0;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}
@media (max-width: 640px) { .author-box { flex-direction: column; text-align: center; align-items: center; } }
.author-box-photo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.author-box-name { font-weight: 700; margin-bottom: 0.25rem; }
.author-box-name a { color: #1f2937; text-decoration: none; }
.author-box-name a:hover { color: var(--primary, #2563eb); }
.author-box-bio { font-size: 0.875rem; color: #6b7280; margin-bottom: 0.5rem; }
.author-box-link { font-size: 0.8rem; color: var(--primary, #2563eb); text-decoration: none; }
.author-box-link:hover { text-decoration: underline; }

/* === Redes sociales del autor === */
.author-social { display: flex; gap: 0.5rem; margin: 0.5rem 0; }
.social-link {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #6b7280;
    text-decoration: none;
}
.social-link:hover { border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); }

/* === TOC === */
.toc ol { list-style: none; counter-reset: toc-counter; padding: 0; }
.toc ol li { counter-increment: toc-counter; }
.toc ol li a::before {
    content: counter(toc-counter) ". ";
    color: var(--primary, #2563eb);
    font-weight: 600;
}

/* === AdSense === */
.adsense-container { margin: 2rem 0; text-align: center; min-height: 50px; }

/* === Utilidades === */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === Animaciones sutiles === */
@media (prefers-reduced-motion: no-preference) {
    .product-box, .bg-white { transition: box-shadow 0.2s ease; }
}

/* === Stretched link: tarjeta de artículo entera clickable === */
.article-card {
    cursor: pointer;
    position: relative;
    isolation: isolate;
}
.article-card .stretched-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background-color: transparent;
}
.article-card .relative.z-10 { position: relative; z-index: 2; }
.article-card:hover .stretched-link { color: var(--color-primary, #2563eb); }

/* === Stat Callout refinado === */
/* Inline styles en articles.content proveen el gradient específico del sitio
   (rosa peluchestop / azul juguetes-de). Este CSS mejora tipografía,
   espaciado, sombras y añade efectos decorativos via ::before / ::after. */
.stat-callout {
    position: relative !important;
    padding: 2.75rem 2rem !important;
    margin: 2.75rem 0 !important;
    border-radius: 1.25rem !important;
    text-align: center;
    box-shadow: 0 20px 40px -15px rgba(0,0,0,0.25), 0 8px 16px -8px rgba(0,0,0,0.12) !important;
    overflow: hidden;
    color: #fff !important;
    isolation: isolate;
}
/* Efecto brillo diagonal decorativo */
.stat-callout::before {
    content: "";
    position: absolute;
    top: -100%;
    right: -20%;
    width: 80%;
    height: 300%;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 60%);
    pointer-events: none;
    transform: rotate(-12deg);
    z-index: 0;
}
/* Círculo decorativo esquina superior-izquierda */
.stat-callout::after {
    content: "";
    position: absolute;
    top: -40px;
    left: -40px;
    width: 140px;
    height: 140px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
/* Número estadístico grande */
.stat-callout p:first-of-type {
    font-size: 3.5rem !important;
    font-weight: 900 !important;
    margin: 0 0 0.85rem 0 !important;
    line-height: 1 !important;
    letter-spacing: -0.03em;
    text-shadow: 0 4px 20px rgba(0,0,0,0.18);
    position: relative;
    z-index: 1;
    font-family: var(--font-heading, 'Merriweather', serif);
}
/* Texto descriptivo */
.stat-callout p:last-of-type {
    font-size: 1.05rem !important;
    line-height: 1.65 !important;
    font-weight: 500 !important;
    max-width: 44rem;
    margin: 0 auto !important;
    opacity: 0.96 !important;
    position: relative;
    z-index: 1;
    color: #fff !important;
}
/* Responsive móvil */
@media (max-width: 640px) {
    .stat-callout {
        padding: 2rem 1.25rem !important;
        border-radius: 1rem !important;
        margin: 2rem 0 !important;
    }
    .stat-callout p:first-of-type {
        font-size: 2.75rem !important;
    }
    .stat-callout p:last-of-type {
        font-size: 0.95rem !important;
    }
    .stat-callout::after {
        width: 90px;
        height: 90px;
        top: -25px;
        left: -25px;
    }
}

/* === Verdict box refinado === */
.verdict-box {
    border-radius: 0.75rem !important;
    padding: 1.75rem !important;
    margin: 2rem 0 !important;
    box-shadow: 0 4px 12px -4px rgba(0,0,0,0.08);
    border-left-width: 5px !important;
    border-left-style: solid !important;
}
.verdict-box ul {
    padding-left: 1.25rem !important;
    margin: 0 !important;
}
.verdict-box ul li {
    margin-bottom: 0.75rem !important;
    line-height: 1.75 !important;
}
.verdict-box ul li:last-child { margin-bottom: 0 !important; }

/* === Expert tip + Warning box refinados === */
.expert-tip, .warning-box {
    border-radius: 0.75rem !important;
    padding: 1.25rem 1.5rem !important;
    margin: 2rem 0 !important;
    border-left-width: 5px !important;
    border-left-style: solid !important;
}
.expert-tip { box-shadow: 0 2px 8px -2px rgba(245, 158, 11, 0.15); }
.warning-box { box-shadow: 0 2px 8px -2px rgba(220, 38, 38, 0.15); }
.expert-tip p, .warning-box p { margin: 0 !important; }
.expert-tip p:first-of-type, .warning-box p:first-of-type { margin-bottom: 0.5rem !important; }

/* === Article meta update (badge autor-fecha) === */
.article-meta-update {
    background: #f9fafb;
    border-left: 3px solid #e5e7eb;
    padding: 0.75rem 1rem !important;
    border-radius: 0 0.5rem 0.5rem 0;
    font-size: 0.9rem !important;
    color: #6b7280 !important;
    font-style: italic !important;
    margin: -0.5rem 0 1.5rem 0 !important;
}
.article-meta-update strong { color: #374151 !important; }

/* ======================================================================
   Home intro editorial (#home-intro) — sección dinámica bajo el hero
   ====================================================================== */
#home-intro {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    padding: 3.5rem 0 !important;
    border-top: none !important;
    position: relative;
}
#home-intro::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary, #78350f), var(--accent, #d97706));
    border-radius: 0 0 4px 4px;
}
#home-intro > div {
    max-width: 56rem !important;
}
#home-intro h2 {
    font-size: 1.85rem !important;
    line-height: 1.25 !important;
    color: #111827 !important;
    margin-bottom: 1.5rem !important;
    position: relative;
    padding-bottom: 0.75rem;
}
#home-intro h2::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent, #d97706);
    border-radius: 2px;
}
#home-intro p {
    font-size: 1.05rem !important;
    line-height: 1.8 !important;
    color: #374151 !important;
    margin-bottom: 1.25rem !important;
}
#home-intro p:last-child {
    margin-bottom: 0 !important;
    padding-top: 1rem;
    border-top: 1px dashed #e5e7eb;
    font-style: italic;
    color: #4b5563 !important;
}
#home-intro a {
    color: var(--primary, #78350f);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: border-color .15s ease, color .15s ease;
}
#home-intro a:hover {
    color: var(--accent, #d97706);
    border-bottom-color: var(--accent, #d97706);
}
#home-intro strong { color: #111827; }
@media (min-width: 768px) {
    #home-intro { padding: 5rem 0 !important; }
    #home-intro h2 { font-size: 2.25rem !important; }
}

/* ======================================================================
   Category intro (#category-intro) — bajo el header de la categoría
   ====================================================================== */
#category-intro {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    padding: 3rem 0 !important;
    border-top: none !important;
}
#category-intro > div {
    max-width: 56rem !important;
}
#category-intro > div > p:first-child {
    font-size: 1.15rem !important;
    line-height: 1.75 !important;
    color: #1f2937 !important;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border-left: 4px solid var(--accent, #d97706);
    border-radius: 0 0.5rem 0.5rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    margin-bottom: 2.5rem !important;
}
#category-intro h2 {
    font-size: 1.6rem !important;
    color: #111827 !important;
    margin-top: 2.5rem !important;
    margin-bottom: 1.25rem !important;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #fde68a;
    display: inline-block;
}
#category-intro h2:first-of-type::before {
    content: '✓ ';
    color: #16a34a;
    font-weight: 700;
}
#category-intro h2:nth-of-type(2)::before {
    content: '❓ ';
    margin-right: 0.25rem;
}
#category-intro ul {
    list-style: none !important;
    padding-left: 0 !important;
    display: grid;
    gap: 0.75rem;
    margin-bottom: 2rem !important;
}
#category-intro ul li {
    background: #fff;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    border-left: 3px solid var(--accent, #d97706);
    line-height: 1.65;
    transition: box-shadow .15s ease, transform .15s ease;
}
#category-intro ul li:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
    transform: translateY(-1px);
}
#category-intro ul li strong {
    color: #111827;
    display: inline-block;
    margin-right: 0.25rem;
}
#category-intro h3 {
    font-size: 1.1rem !important;
    color: #1f2937 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.5rem !important;
    padding: 0.75rem 1rem;
    background: #fef3c7;
    border-radius: 0.5rem 0.5rem 0 0;
    border-left: 4px solid var(--accent, #d97706);
}
#category-intro h3 + p {
    background: #fff;
    padding: 1rem 1.25rem !important;
    margin-top: 0 !important;
    margin-bottom: 0.75rem !important;
    border: 1px solid #fde68a;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    line-height: 1.75;
    color: #374151 !important;
}
@media (min-width: 640px) {
    #category-intro ul { grid-template-columns: 1fr 1fr; }
}

/* ======================================================================
   Sección "Sobre el autor" en home — card con identidad visual
   ====================================================================== */
.author-card-home {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-radius: 1rem;
    padding: 2rem !important;
    margin-top: 3rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.04);
    position: relative;
    overflow: hidden;
}
.author-card-home::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(217,119,6,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.author-card-home h2 {
    font-size: 1.6rem !important;
    color: #78350f !important;
    margin-bottom: 1.5rem !important;
    position: relative;
    padding-bottom: 0.5rem;
    display: inline-block;
}
.author-card-home h2::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 50px;
    height: 3px;
    background: #d97706;
    border-radius: 2px;
}
.author-card-home .author-photo {
    width: 11rem !important;     /* 176px mobile */
    height: 11rem !important;
    border: 5px solid #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,.12), 0 0 0 1px rgba(217,119,6,.15);
    object-fit: cover;
    border-radius: 50%;
}
@media (min-width: 768px) {
    .author-card-home .author-photo {
        width: 14rem !important;  /* 224px desktop */
        height: 14rem !important;
    }
}
.author-card-home h3 {
    font-size: 1.25rem !important;
    color: #111827 !important;
    margin-bottom: 0.25rem !important;
}
.author-card-home .author-creds {
    display: inline-block;
    background: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    color: #78350f;
    border: 1px solid #fde68a;
    margin-bottom: 1rem;
    font-style: normal !important;
}
.author-card-home p {
    color: #374151 !important;
    line-height: 1.75;
}
.author-card-home a.author-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #78350f;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 1rem;
    transition: background .15s ease;
}
.author-card-home a.author-link:hover {
    background: #92400e;
}

/* ======================================================================
   Bloque "Te puede interesar" (.related-articles inline en article)
   ====================================================================== */
.related-articles {
    border-radius: 0.75rem !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    margin: 2rem 0 !important;
}
.related-articles p:first-child {
    font-size: 1.05rem !important;
    margin-bottom: 0.75rem !important;
}
.related-articles ul {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
}
.related-articles ul li {
    padding: 0.4rem 0 !important;
    border-bottom: 1px dashed rgba(0,0,0,.06);
    margin: 0 !important;
}
.related-articles ul li:last-child {
    border-bottom: none;
}
.related-articles ul li::before {
    content: '→ ';
    font-weight: 700;
    margin-right: 0.25rem;
}
.related-articles ul li a {
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid transparent;
    transition: border-color .15s ease;
}
.related-articles ul li a:hover {
    border-bottom-color: currentColor;
}

/* ======================================================================
   Página /autor — rediseño completo con hero + card flotante + stats
   ====================================================================== */
.author-hero {
    background: linear-gradient(135deg, var(--primary, #78350f) 0%, var(--secondary, #451a03) 100%);
    color: #fff;
    padding: 4rem 0 7rem;
    position: relative;
    overflow: hidden;
}
.author-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.08) 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(255,255,255,.05) 0%, transparent 50%);
    pointer-events: none;
}
.author-hero-eyebrow {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
    opacity: 0.85;
    margin-bottom: 0.75rem;
    color: var(--accent, #fcd34d);
}
.author-hero-title {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.75rem;
}
.author-hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}
@media (min-width: 768px) {
    .author-hero { padding: 5rem 0 8rem; }
    .author-hero-title { font-size: 3.5rem; }
}

.author-page-wrap {
    max-width: 56rem;
    margin: 0 auto;
    padding: 0 1rem 4rem;
}

/* Card principal del autor — sobresale 80px sobre el hero */
.author-main-card {
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 12px 36px -6px rgba(0,0,0,.12), 0 4px 12px -2px rgba(0,0,0,.06);
    padding: 2rem;
    margin-top: -5rem;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(0,0,0,.04);
}
.author-main-card-inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    text-align: center;
}
@media (min-width: 768px) {
    .author-main-card { padding: 3rem; margin-top: -6rem; }
    .author-main-card-inner {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
        gap: 2.5rem;
    }
}

.author-photo-wrap {
    flex-shrink: 0;
}
.author-photo-large {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
@media (min-width: 768px) {
    .author-photo-large { width: 180px; height: 180px; }
}

.author-info { flex: 1; min-width: 0; }
.author-name {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 1.9rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}
@media (min-width: 768px) {
    .author-name { font-size: 2.3rem; }
}

.author-creds-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    justify-content: center;
}
@media (min-width: 768px) {
    .author-creds-list { justify-content: flex-start; }
}
.author-cred-pill {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #78350f;
    border: 1px solid #fcd34d;
    border-radius: 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
}

.author-bio {
    color: #374151;
    line-height: 1.75;
    font-size: 1rem;
    margin-bottom: 1.25rem;
}
.author-bio p { margin-bottom: 1rem; }
.author-bio p:last-child { margin-bottom: 0; }

.author-social-wrap {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}
@media (min-width: 768px) {
    .author-social-wrap { justify-content: flex-start; }
}

/* Stats grid en la card del autor */
.author-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #f3f4f6;
}
@media (min-width: 640px) {
    .author-stats { grid-template-columns: repeat(3, 1fr); }
}
.author-stat {
    text-align: center;
    padding: 1rem 0.5rem;
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
    border-radius: 0.75rem;
    border: 1px solid #fde68a;
}
.author-stat-num {
    display: block;
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 2.25rem;
    font-weight: 700;
    color: #78350f;
    line-height: 1;
    margin-bottom: 0.5rem;
}
.author-stat-label {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    line-height: 1.3;
}

/* Sección de artículos del autor */
.author-articles-section {
    margin-top: 4rem;
}
.author-articles-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.author-articles-title {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
    line-height: 1.25;
}
@media (min-width: 768px) {
    .author-articles-title { font-size: 2.1rem; }
}
.author-articles-subtitle {
    color: #6b7280;
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ============================================================
   Calculadoras interactivas (.nr-calc)
   Componente reutilizable embebido en el contenido de artículos.
   ============================================================ */
.nr-calc {
    background: linear-gradient(135deg, #fef9f3 0%, #fff8ee 100%);
    border: 1px solid #f4d9b4;
    border-left: 5px solid #c08552;
    border-radius: 14px;
    padding: 1.75rem 1.5rem;
    margin: 2.25rem 0;
    box-shadow: 0 2px 8px rgba(192, 133, 82, 0.08);
}
.nr-calc__title {
    font-family: var(--font-heading, 'Merriweather', Georgia, serif);
    font-weight: 700;
    font-size: 1.35rem;
    color: #5a3a1e;
    margin: 0 0 0.35rem;
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nr-calc__title::before {
    content: "🧮";
    font-size: 1.4rem;
}
.nr-calc__intro {
    font-size: 0.95rem;
    color: #6b4a2a;
    margin: 0 0 1.25rem;
    line-height: 1.5;
}
.nr-calc__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
@media (min-width: 640px) {
    .nr-calc__grid { grid-template-columns: 1fr 1fr; }
}
.nr-calc__field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.nr-calc__field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #5a3a1e;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.nr-calc__field input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
    background: #fff;
    border: 1px solid #e0c8a4;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #2a1a0c;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.nr-calc__field input[type="number"]:focus {
    outline: none;
    border-color: #c08552;
    box-shadow: 0 0 0 3px rgba(192, 133, 82, 0.18);
}
.nr-calc__field input[type="number"]::-webkit-outer-spin-button,
.nr-calc__field input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.nr-calc__field .nr-calc__hint {
    font-size: 0.78rem;
    color: #8a6a4a;
    font-weight: 400;
    margin: 0;
}
.nr-calc__results {
    background: #fff;
    border: 1px solid #f4d9b4;
    border-radius: 10px;
    padding: 1.1rem 1.25rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
@media (min-width: 640px) {
    .nr-calc__results { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}
.nr-calc__result {
    text-align: center;
}
.nr-calc__result-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #8a6a4a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.nr-calc__result-value {
    display: block;
    font-family: var(--font-heading, 'Merriweather', Georgia, serif);
    font-size: 1.65rem;
    font-weight: 700;
    color: #c08552;
    line-height: 1.1;
}
.nr-calc__result--primary .nr-calc__result-value {
    color: #8b4513;
    font-size: 1.95rem;
}
.nr-calc__result--verdict .nr-calc__result-value {
    font-size: 1.05rem;
    line-height: 1.3;
    color: #166534;
}
.nr-calc__note {
    font-size: 0.8rem;
    color: #8a6a4a;
    margin: 0.85rem 0 0;
    font-style: italic;
    text-align: center;
}

/* ============================================================
   Sidebar TOC — wrap natural sin truncar texto
   ============================================================ */
.sidebar-toc-list li {
    word-break: normal;
    overflow-wrap: anywhere;
    hyphens: auto;
}
.sidebar-toc-list li a {
    display: inline;
    line-height: 1.4;
}
.sidebar-toc {
    scrollbar-width: thin;
}
