/* ============================================================
   AbogadoPE — polish.css
   Capa de mejora visual. Se carga al final, despues de
   styles.css y del <style> propio de cada pagina.
   Additiva: no elimina reglas existentes, solo mejora.
   ============================================================ */

:root { --ease: cubic-bezier(.4, 0, .2, 1); }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }

/* ── Foco accesible ─────────────────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid rgba(199, 133, 10, .5);
    outline-offset: 2px;
    border-radius: 6px;
}

::selection { background: rgba(199, 133, 10, .22); }

/* ── Scrollbar sutil (WebKit) ───────────────────────────── */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border: 3px solid #fff; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Header con blur y navegacion ejecutiva ─────────────── */
.header {
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    backdrop-filter: saturate(160%) blur(12px);
    box-shadow: 0 2px 12px rgba(15, 43, 74, .05);
}
.header-inner {
    max-width: 1200px;
    width: min(1200px, calc(100% - 40px));
    padding: 0;
    height: 70px;
    gap: 16px;
}
.header .nav {
    gap: 3px;
    flex-wrap: nowrap;
}
.header .nav > a:not(.btn-cta),
.header .nav-item > a {
    padding: 8px 10px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 13.5px;
    font-weight: 600;
    color: #1e3346;
    transition: background .14s, color .14s;
}
.header .nav > a:not(.btn-cta):hover,
.header .nav-item:hover > a {
    background: #f5f4ef;
    color: #0F2B4A;
}
.header .nav > a[href*="actualidad-juridica"] {
    background: #f8f6f0;
    border: 1px solid #e5decb;
    color: #132f46;
    font-weight: 700;
}
.header .nav > a[href*="actualidad-juridica"]::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .18);
    display: inline-block;
    margin-right: 5px;
    vertical-align: middle;
}
.header .nav .btn-cta {
    margin-left: 6px;
    white-space: nowrap;
    padding: 9px 15px;
    font-size: 12.5px;
    border-radius: 6px;
}

/* ── Enlaces "ver todos": la flecha se desliza ──────────── */
.link-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap .2s var(--ease), color .2s var(--ease);
}
.link-more:hover { text-decoration: none; gap: 11px; }

/* ── Encabezados de seccion con barra de acento ─────────── */
.section-header h2,
.section-v2-header h2 { position: relative; padding-left: 16px; }

.section-header h2::before,
.section-v2-header h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: .92em;
    background: var(--accent);
    border-radius: 3px;
}

/* ── Tarjetas: elevacion y zoom de imagen ───────────────── */
.article-card,
.home-ncard,
.cat-img-card,
.testimonial-card,
.service-row {
    transition: transform .28s var(--ease),
                box-shadow .28s var(--ease),
                border-color .28s var(--ease);
}

.article-card:hover,
.home-ncard:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 34px rgba(15, 43, 74, .16);
    border-color: rgba(199, 133, 10, .45);
}

.cat-img-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 38px rgba(15, 43, 74, .22);
}

.article-card .article-img img,
.home-ncard-img img,
.cat-img-card img {
    transition: transform .6s var(--ease);
}

.article-card:hover .article-img img,
.home-ncard:hover .home-ncard-img img,
.cat-img-card:hover img { transform: scale(1.06); }

/* ── Botones: transicion uniforme ───────────────────────── */
.btn-cta,
.btn-outline {
    transition: transform .2s var(--ease),
                box-shadow .2s var(--ease),
                background-color .2s var(--ease),
                color .2s var(--ease),
                border-color .2s var(--ease);
}

/* ── Estadisticas: numeros con acento ───────────────────── */
.stat-num { color: var(--accent); }
.stat-item { transition: transform .25s var(--ease); }
.stat-item:hover { transform: translateY(-3px); }

/* ── Hero del inicio: mas profundidad ───────────────────── */
.hero-split {
    position: relative;
    background:
        radial-gradient(1100px 520px at 86% -12%, rgba(199, 133, 10, .22), transparent 60%),
        linear-gradient(135deg, #0F2B4A 0%, #12314f 55%, #0b2340 100%);
}
.hero-img-main { box-shadow: 0 24px 50px rgba(0, 0, 0, .35); }
.hero-float-card { box-shadow: 0 18px 40px rgba(0, 0, 0, .26); }

/* ── Paginas internas: banda de encabezado de marca ─────── */
.page-header {
    background: linear-gradient(135deg, #0F2B4A 0%, #12314f 100%) !important;
    border-bottom: none !important;
}

.page-header h1 { color: #FFFFFF; }

.page-header p,
.page-header .breadcrumb,
.page-header .breadcrumb a { color: rgba(255, 255, 255, .78); }

.page-header .breadcrumb a:hover { color: var(--accent); }

.page-header .tag { background: rgba(255, 255, 255, .14); color: #FFFFFF; }
.page-header .tag--accent { background: rgba(199, 133, 10, .92); color: #FFFFFF; }

/* ── Contenido interno: tarjeta y tipografia ───────────── */
.main-content {
    box-shadow: 0 1px 3px rgba(15, 43, 74, .06), 0 12px 30px rgba(15, 43, 74, .05);
}

.main-content h2 { scroll-margin-top: 90px; }

.main-content blockquote,
.info-box { border-radius: 10px; }

/* ── Pasos numerados ────────────────────────────────────── */
.step-number { box-shadow: 0 6px 14px rgba(15, 43, 74, .22); }

/* ── FAQ: apertura suave ────────────────────────────────── */
.faq-item { transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.faq-item:hover { box-shadow: 0 4px 14px rgba(15, 43, 74, .07); }

/* ── Footer: enlaces con desplazamiento ─────────────────── */
.footer-col a { transition: transform .18s var(--ease), color .18s var(--ease); }
.footer-col a:hover { transform: translateX(3px); }

/* ── Barra Ejecutiva de Progreso de Lectura ─────────────── */
.ed-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #C7850A 0%, #f59e0b 55%, #0F2B4A 100%);
    z-index: 10005;
    pointer-events: none;
    transition: width .08s linear;
    box-shadow: 0 1px 6px rgba(199, 133, 10, .45);
}

/* ── Micro-interacciones y Scroll-Reveal Ejecutivo ──────── */
.ed-scroll-item {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .48s cubic-bezier(.22, .61, .36, 1),
                transform .48s cubic-bezier(.22, .61, .36, 1),
                box-shadow .24s var(--ease),
                border-color .24s var(--ease);
}
.ed-scroll-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.editorial .ed-card,
.editorial .ed-news-card,
.editorial .ed-guide-card,
.editorial .ed-step-card,
.editorial .ed-stat-box {
    transition: transform .24s var(--ease),
                box-shadow .24s var(--ease),
                border-color .24s var(--ease);
}
.editorial .ed-card:hover,
.editorial .ed-news-card:hover,
.editorial .ed-guide-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(19, 47, 70, .09);
    border-color: #c5b89e;
}

/* ── Buscador Ejecutivo Rápido (Ctrl+K / Command Palette) ─ */
.ed-cmd-fab {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9990;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 999px;
    background: rgba(15, 43, 74, .94);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .16);
    font: 600 .8rem/1 Arial, sans-serif;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(15, 43, 74, .28);
    backdrop-filter: blur(10px);
    transition: transform .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease);
}
.ed-cmd-fab:hover {
    transform: translateY(-2px);
    background: #132f46;
    box-shadow: 0 14px 32px rgba(15, 43, 74, .38);
}
.ed-cmd-fab svg { width: 15px; height: 15px; stroke: #f59e0b; flex-shrink: 0; }
.ed-cmd-fab kbd {
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .14);
    font: 700 .68rem/1 monospace;
    color: #f8fafc;
}
@media (max-width: 768px) {
    .ed-cmd-fab kbd { display: none; }
    .ed-cmd-fab { bottom: 18px; left: 16px; padding: 10px 13px; font-size: .76rem; }
}

.ed-cmd-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10010;
    background: rgba(11, 25, 42, .62);
    backdrop-filter: blur(5px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 8vh 16px 24px;
}
.ed-cmd-backdrop.is-open { display: flex; animation: edFadeIn .16s ease-out; }
@keyframes edFadeIn { from { opacity: 0; } to { opacity: 1; } }

.ed-cmd-box {
    width: 100%;
    max-width: 660px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #d7dee5;
    box-shadow: 0 28px 70px rgba(11, 25, 42, .35);
    overflow: hidden;
}
.ed-cmd-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid #e5e9ed;
    background: #fcfcfa;
}
.ed-cmd-head svg { width: 20px; height: 20px; color: #C7850A; flex-shrink: 0; }
.ed-cmd-input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font: 600 1rem/1.3 Arial, sans-serif;
    color: #0F2B4A;
}
.ed-cmd-close {
    padding: 4px 9px;
    border: 1px solid #d5dce2;
    border-radius: 5px;
    background: #fff;
    color: #64748b;
    font: 700 .72rem/1 Arial, sans-serif;
    cursor: pointer;
}
.ed-cmd-results {
    max-height: 62vh;
    overflow-y: auto;
    padding: 10px;
}
.ed-cmd-group {
    padding: 8px 10px 4px;
    font: 700 .68rem/1.2 Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: #A56C12;
}
.ed-cmd-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #132f46;
    transition: background .12s;
}
.ed-cmd-item:hover, .ed-cmd-item.is-selected {
    background: #f5f4ef;
}
.ed-cmd-item-title {
    font: 600 .9rem/1.3 Arial, sans-serif;
    color: #0F2B4A;
}
.ed-cmd-item-sub {
    font: 400 .76rem/1.3 Arial, sans-serif;
    color: #64748b;
    margin-top: 2px;
}
.ed-cmd-badge {
    padding: 4px 8px;
    border-radius: 4px;
    background: #eae6dc;
    color: #132f46;
    font: 700 .68rem/1 Arial, sans-serif;
    white-space: nowrap;
}

/* ── Ancla rápida en subtítulos H2 de guías ─────────────── */
.ed-h2-anchor {
    opacity: 0;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #d8dee4;
    background: #f8fafc;
    color: #64748b;
    font: 600 .72rem/1 Arial, sans-serif;
    cursor: pointer;
    vertical-align: middle;
    transition: opacity .15s, color .15s, border-color .15s;
}
h2:hover .ed-h2-anchor { opacity: 1; }
.ed-h2-anchor:hover { color: #C7850A; border-color: #C7850A; }

/* ── Respeto a reduce-motion ────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
    .ed-scroll-item { opacity: 1 !important; transform: none !important; }
}
