/*!
 * Enatech Keys — Instructivos
 * Estilos del front público.
 *
 * Replica el sistema de diseño del child theme de WordPress
 * (enatech-keys-child/style.css): mismos tokens, tipografía DM Sans,
 * header blanco, cards de catálogo, footer con gradiente violeta.
 */

/* ==========================================================================
   1. TOKENS — espejo de enatech-keys-child/style.css
   ========================================================================== */

:root {
    /* Brand */
    --ek-purple:        #6852f4;
    --ek-purple-hover:  #5641d9;
    --ek-purple-light:  #ede9fe;
    --ek-purple-glow:   rgba(104, 82, 244, 0.15);

    /* Neutrales */
    --ek-white:         #ffffff;
    --ek-off-white:     #f8f8fc;
    --ek-gray-50:       #f9fafb;
    --ek-gray-100:      #f3f4f6;
    --ek-gray-200:      #e5e7eb;
    --ek-gray-300:      #d1d5db;
    --ek-gray-400:      #9ca3af;
    --ek-gray-500:      #6b7280;
    --ek-gray-600:      #4b5563;
    --ek-gray-700:      #374151;
    --ek-gray-800:      #1f2937;
    --ek-gray-900:      #111827;
    --ek-almost-black:  #0d0d0d;

    /* Tipografía */
    --ek-font-display:  'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ek-font-body:     'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Espaciado */
    --ek-container-max: 1200px;

    /* Radios */
    --ek-radius-sm:     6px;
    --ek-radius-md:     10px;
    --ek-radius-lg:     16px;
    --ek-radius-xl:     24px;

    /* Sombras */
    --ek-shadow-sm:     0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --ek-shadow-md:     0 4px 14px rgba(0,0,0,0.06);
    --ek-shadow-lg:     0 10px 40px rgba(0,0,0,0.08);
    --ek-shadow-card:   0 2px 12px rgba(104, 82, 244, 0.06);
    --ek-shadow-hover:  0 8px 30px rgba(104, 82, 244, 0.12);

    /* Transición */
    --ek-transition:    all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Gradiente institucional (hero interno + footer del theme) */
    --ek-gradient:      linear-gradient(402deg, #7902a0 30%, #4b418c 100%);
}


/* ==========================================================================
   2. BASE
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--ek-font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ek-gray-800);
    background-color: var(--ek-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.eki-main {
    flex: 1 0 auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--ek-font-display);
    color: var(--ek-gray-900);
    line-height: 1.25;
    margin: 0 0 0.6em;
    font-weight: 700;
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--ek-purple);
    text-decoration: none;
    transition: var(--ek-transition);
}

a:hover {
    color: var(--ek-purple-hover);
}

img {
    max-width: 100%;
    height: auto;
}

:focus-visible {
    outline: 3px solid var(--ek-purple-glow);
    outline-offset: 2px;
}

.eki-container {
    max-width: var(--ek-container-max);
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.eki-screen-reader {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.eki-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10000;
    background: var(--ek-purple);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 var(--ek-radius-md) 0;
}

.eki-skip-link:focus {
    left: 0;
    color: #fff;
}


/* ==========================================================================
   3. BOTONES — mismo lenguaje que el theme
   ========================================================================== */

.eki-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--ek-font-body);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: var(--ek-radius-md);
    background-color: var(--ek-purple);
    color: var(--ek-white);
    cursor: pointer;
    text-decoration: none;
    transition: var(--ek-transition);
}

.eki-btn:hover,
.eki-btn:focus-visible {
    background-color: var(--ek-purple-hover);
    color: var(--ek-white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(104, 82, 244, 0.3);
}

.eki-btn--ghost {
    background-color: transparent;
    color: var(--ek-purple);
    border: 2px solid var(--ek-purple);
    padding: 0.7rem 1.7rem;
}

.eki-btn--ghost:hover,
.eki-btn--ghost:focus-visible {
    background-color: var(--ek-purple);
    color: var(--ek-white);
}

.eki-btn--sm {
    padding: 0.55rem 1.1rem;
    font-size: 0.85rem;
}

.eki-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}


/* ==========================================================================
   4. HEADER
   ========================================================================== */

.eki-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background-color: var(--ek-white);
    border-bottom: 1px solid var(--ek-gray-100);
    transition: box-shadow 0.3s ease;
}

.eki-header.is-scrolled {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.eki-header-inner {
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 1.9rem;
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.eki-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-family: var(--ek-font-display);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--ek-gray-900);
    /* Base 0 y crecimiento igual que .eki-header-actions: los dos costados
       terminan del mismo ancho, así el menú del medio queda centrado en la
       barra sin depender del ancho del logo ni del CTA. */
    flex: 1 0 0%;
}

.eki-brand:hover {
    color: var(--ek-gray-900);
}

.eki-brand img {
    display: block;
    width: auto;
    height: 34.5px;
}

.eki-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--ek-radius-md);
    background: var(--ek-purple);
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.eki-brand-mark svg {
    width: 20px;
    height: 20px;
}

.eki-nav {
    display: flex;
    align-items: center;
    /* El menú va al centro; el CTA queda a la derecha. */
    flex: 0 0 auto;
    margin: 0 auto;
    padding-left: 18px;
}

.eki-nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.eki-nav a {
    display: block;
    font-family: var(--ek-font-body);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--ek-gray-600);
    padding: 0 1.2rem;
    transition: var(--ek-transition);
}

.eki-nav a:hover,
.eki-nav .is-current a {
    color: var(--ek-purple);
}

.eki-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex: 1 0 0%;
}

.eki-mobile-trigger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: none;
    border-radius: var(--ek-radius-sm);
    background: var(--ek-purple);
    color: var(--ek-white);
    cursor: pointer;
    transition: var(--ek-transition);
}

.eki-mobile-trigger:hover {
    background: var(--ek-purple-hover);
}

.eki-mobile-trigger svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: var(--ek-white);
    stroke-width: 2.2;
    stroke-linecap: round;
}


/* ==========================================================================
   5. MENÚ MOBILE (off-canvas con tabs, como en el theme)
   ========================================================================== */

.eki-mobile-panel {
    position: fixed;
    inset: 0;
    z-index: 1000;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear 0.3s;
}

.eki-mobile-panel.is-open {
    visibility: visible;
    pointer-events: auto;
    transition: visibility 0s linear 0s;
}

.eki-mobile-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.eki-mobile-panel.is-open .eki-mobile-overlay {
    opacity: 1;
}

.eki-mobile-drawer {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--ek-white);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.eki-mobile-panel.is-open .eki-mobile-drawer {
    transform: translateX(0);
}

.eki-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ek-gray-100);
}

.eki-mobile-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: var(--ek-gray-100);
    color: var(--ek-gray-700);
    cursor: pointer;
    transition: var(--ek-transition);
}

.eki-mobile-close:hover {
    background: var(--ek-purple-light);
    color: var(--ek-purple);
}

.eki-mobile-close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
}

.eki-tabs {
    padding: 0 1rem 2rem;
}

.eki-tabs-header {
    display: flex;
    border-bottom: 2px solid var(--ek-gray-200);
}

.eki-tab-btn {
    flex: 1;
    padding: 0.9rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-family: var(--ek-font-body);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ek-gray-400);
    cursor: pointer;
    transition: var(--ek-transition);
    margin-bottom: -2px;
}

.eki-tab-btn:hover {
    color: var(--ek-gray-600);
}

.eki-tab-btn.is-active {
    color: var(--ek-gray-900);
    border-bottom-color: var(--ek-purple);
}

.eki-tab-panel {
    display: none;
    padding: 0.5rem 0;
}

.eki-tab-panel.is-active {
    display: block;
}

.eki-mobile-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.eki-mobile-list li {
    border-bottom: 1px solid var(--ek-gray-100);
}

.eki-mobile-list li:last-child {
    border-bottom: none;
}

.eki-mobile-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.85rem 0.5rem;
    color: var(--ek-gray-800);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--ek-transition);
}

.eki-mobile-list a:hover {
    color: var(--ek-purple);
    padding-left: 0.8rem;
}

.eki-mobile-count {
    background: var(--ek-purple-light);
    color: var(--ek-purple);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
}

.eki-mobile-cta {
    margin-top: 1.25rem;
    width: 100%;
}


/* ==========================================================================
   6. HERO DE PÁGINA (idéntico a .ek-page-hero del theme)
   ========================================================================== */

.eki-page-hero {
    /* El degradado queda de fallback: se ve si la imagen no carga. Va también
       como segunda capa del background-image, detrás de la foto. */
    background: var(--ek-gradient);
    background-image:
        url('https://enatechkeys.com/wp-content/uploads/header-nosotros-v2.jpg'),
        var(--ek-gradient) !important;
    background-size: cover;
    background-position: center;
    padding: 2.8rem 0;
    text-align: center;
    position: relative;
}

/* El velo va siempre, no solo con la variante --image: desde que la foto se
   fija por CSS, el hero nunca queda sin imagen detrás del texto blanco. */
.eki-page-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(402deg, rgba(121, 2, 160, 0.82) 30%, rgba(75, 65, 140, 0.82) 100%);
}

.eki-page-hero .eki-container {
    position: relative;
    z-index: 2;
}

.eki-page-hero h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 0.8rem;
    color: #fff;
}

.eki-page-hero p {
    font-size: 1.15rem;
    color: #c6d9ff;
    margin: 0 auto;
}

/* ==========================================================================
   7. BREADCRUMBS
   ========================================================================== */

.eki-breadcrumbs {
    font-size: 0.85rem;
    color: var(--ek-gray-400);
    padding: 1.25rem 0 0;
}

.eki-breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.eki-breadcrumbs a {
    color: var(--ek-gray-500);
}

.eki-breadcrumbs a:hover {
    color: var(--ek-purple);
}

.eki-breadcrumbs li + li::before {
    content: '/';
    margin-right: 0.5rem;
    color: var(--ek-gray-300);
}

.eki-breadcrumbs li {
    display: flex;
    align-items: center;
}


/* ==========================================================================
   8. BARRA DE FILTROS DEL LISTADO
   ========================================================================== */

.eki-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 2.5rem 0 2rem;
}

.eki-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.eki-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--ek-gray-200);
    background: var(--ek-white);
    color: var(--ek-gray-600);
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--ek-transition);
    white-space: nowrap;
}

.eki-chip:hover {
    border-color: var(--ek-purple);
    color: var(--ek-purple);
    background: var(--ek-purple-light);
}

.eki-chip.is-active {
    background: var(--ek-purple);
    border-color: var(--ek-purple);
    color: var(--ek-white);
}

.eki-chip-count {
    font-size: 0.75rem;
    opacity: 0.8;
}

.eki-search {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 280px;
    flex: 0 1 320px;
}

.eki-search input[type="search"] {
    width: 100%;
    font-family: var(--ek-font-body);
    font-size: 0.9rem;
    color: var(--ek-gray-800);
    padding: 0.7rem 2.6rem 0.7rem 2.6rem;
    border: 1px solid var(--ek-gray-200);
    border-radius: 50px;
    background: var(--ek-white);
    transition: var(--ek-transition);
    -webkit-appearance: none;
    appearance: none;
}

.eki-search input[type="search"]:focus {
    border-color: var(--ek-purple);
    box-shadow: 0 0 0 4px var(--ek-purple-glow);
    outline: none;
}

.eki-search-icon {
    position: absolute;
    left: 0.9rem;
    width: 18px;
    height: 18px;
    stroke: var(--ek-gray-400);
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    pointer-events: none;
}

.eki-search-submit {
    position: absolute;
    right: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: var(--ek-purple);
    color: #fff;
    cursor: pointer;
    transition: var(--ek-transition);
}

.eki-search-submit:hover {
    background: var(--ek-purple-hover);
}

.eki-search-submit svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
    stroke-width: 2.4;
    fill: none;
    stroke-linecap: round;
}

.eki-results-note {
    width: 100%;
    font-size: 0.9rem;
    color: var(--ek-gray-500);
}

.eki-results-note strong {
    color: var(--ek-gray-800);
}


/* ==========================================================================
   9. GRILLA DE INSTRUCTIVOS
   ========================================================================== */

.eki-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    list-style: none;
    padding: 0;
}

.eki-card {
    display: flex;
    flex-direction: column;
    background: var(--ek-white);
    border: 1px solid var(--ek-gray-100);
    border-radius: var(--ek-radius-lg);
    overflow: hidden;
    box-shadow: var(--ek-shadow-card);
    transition: var(--ek-transition);
    height: 100%;
    color: inherit;
}

.eki-card:hover {
    border-color: var(--ek-purple-light);
    box-shadow: var(--ek-shadow-hover);
    transform: translateY(-4px);
    color: inherit;
}

.eki-card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    background: linear-gradient(150deg, var(--ek-purple-light) 0%, #f4f1ff 60%, var(--ek-white) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.eki-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.eki-card:hover .eki-card-media img {
    transform: scale(1.04);
}

.eki-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: var(--ek-radius-lg);
    background: var(--ek-white);
    box-shadow: var(--ek-shadow-md);
    color: var(--ek-purple);
}

.eki-card-icon svg {
    width: 34px;
    height: 34px;
    stroke: currentColor;
    stroke-width: 1.7;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.eki-card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.eki-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background-color: var(--ek-purple);
    color: var(--ek-white);
    border-radius: var(--ek-radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.3rem 0.65rem;
    line-height: 1.4;
}

.eki-badge--pdf {
    background-color: #dc2626;
}

.eki-badge--destacado {
    background-color: #f59e0b;
}

.eki-badge--borrador {
    background-color: var(--ek-gray-500);
}

.eki-badge svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    stroke-width: 2.4;
    fill: none;
}

.eki-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 1.1rem 1.2rem 0;
}

.eki-card-cat {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ek-purple);
    margin-bottom: 0.4rem;
}

.eki-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ek-gray-900);
    margin: 0 0 0.45rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.eki-card:hover .eki-card-title {
    color: var(--ek-purple);
}

.eki-card-text {
    font-size: 0.9rem;
    color: var(--ek-gray-500);
    line-height: 1.6;
    margin: 0 0 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.eki-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
    padding: 0.9rem 1.2rem 1.2rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ek-purple);
}

.eki-card-foot > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.eki-card-foot svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.25s ease;
}

.eki-card:hover .eki-card-foot svg {
    transform: translateX(4px);
}

.eki-card-meta {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ek-gray-400);
}


/* ==========================================================================
   10. ESTADO VACÍO
   ========================================================================== */

.eki-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--ek-gray-50);
    border: 1px dashed var(--ek-gray-200);
    border-radius: var(--ek-radius-lg);
    margin-bottom: 3rem;
}

.eki-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--ek-purple-light);
    color: var(--ek-purple);
    margin-bottom: 1.25rem;
}

.eki-empty-icon svg {
    width: 32px;
    height: 32px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.eki-empty h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.eki-empty p {
    color: var(--ek-gray-500);
    max-width: 460px;
    margin: 0 auto 1.5rem;
}


/* ==========================================================================
   11. PAGINACIÓN
   ========================================================================== */

.eki-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0 0 4rem;
}

.eki-pagination a,
.eki-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--ek-gray-200);
    border-radius: var(--ek-radius-sm);
    color: var(--ek-gray-600);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--ek-transition);
}

.eki-pagination a:hover {
    background: var(--ek-purple);
    border-color: var(--ek-purple);
    color: var(--ek-white);
}

.eki-pagination .is-current {
    background: var(--ek-purple);
    border-color: var(--ek-purple);
    color: var(--ek-white);
}

.eki-pagination .is-disabled {
    opacity: 0.4;
    pointer-events: none;
}


/* ==========================================================================
   12. INSTRUCTIVO — CABECERA Y CONTENIDO
   ========================================================================== */

.eki-article {
    padding: 0 0 4rem;
}

.eki-article-head {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 0 1.5rem;
    text-align: center;
}

.eki-article--pdf .eki-article-head {
    max-width: 1100px;
}

.eki-article-head h1 {
    font-size: clamp(1.8rem, 3.6vw, 2.6rem);
    margin-bottom: 0.75rem;
}

.eki-article-lead {
    font-size: 1.1rem;
    color: var(--ek-gray-500);
    line-height: 1.7;
    margin: 0 auto 1.25rem;
    max-width: 680px;
}

.eki-article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    font-size: 0.85rem;
    color: var(--ek-gray-400);
}

.eki-article-meta .eki-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.eki-article-meta svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.eki-article-cat {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ek-purple);
    background: var(--ek-purple-light);
    padding: 0.35rem 1rem;
    border-radius: 50px;
    margin-bottom: 1rem;
}

.eki-article-cover {
    max-width: 860px;
    margin: 0 auto 2rem;
    border-radius: var(--ek-radius-lg);
    overflow: hidden;
    box-shadow: var(--ek-shadow-lg);
}

.eki-article-cover img {
    display: block;
    width: 100%;
}

/* Contenido enriquecido — espejo de .ek-page-content */
.eki-content {
    /* max-width: 860px; */
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--ek-gray-700);
}

.eki-content > *:first-child {
    margin-top: 0;
}

.eki-content h2 {
    font-size: 1.6rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.eki-content h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
}

.eki-content h4 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
}

.eki-content p {
    margin-bottom: 1.25rem;
}

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

.eki-content li {
    margin-bottom: 0.5rem;
}

.eki-content a {
    color: var(--ek-purple);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.eki-content img {
    border-radius: var(--ek-radius-md);
    box-shadow: var(--ek-shadow-md);
    margin: 1.5rem 0;
}

.eki-content blockquote {
    margin: 1.75rem 0;
    padding: 1.1rem 1.5rem;
    border-left: 4px solid var(--ek-purple);
    background: var(--ek-purple-light);
    border-radius: 0 var(--ek-radius-md) var(--ek-radius-md) 0;
    color: var(--ek-gray-700);
    font-style: italic;
}

.eki-content blockquote p:last-child {
    margin-bottom: 0;
}

.eki-content pre {
    background: var(--ek-gray-900);
    color: #e5e7eb;
    padding: 1.15rem 1.35rem;
    border-radius: var(--ek-radius-md);
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 1.5rem 0;
}

.eki-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    background: var(--ek-gray-100);
    color: var(--ek-purple-hover);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

.eki-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.eki-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.eki-content th,
.eki-content td {
    border: 1px solid var(--ek-gray-200);
    padding: 0.7rem 0.9rem;
    text-align: left;
}

.eki-content th {
    background: var(--ek-gray-50);
    font-weight: 700;
    color: var(--ek-gray-800);
}

.eki-content hr {
    border: none;
    border-top: 1px solid var(--ek-gray-200);
    margin: 2.5rem 0;
}

.eki-content iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: var(--ek-radius-md);
    margin: 1.5rem 0;
}

.eki-content-empty {
    text-align: center;
    color: var(--ek-gray-400);
    font-style: italic;
    padding: 2rem 0;
}


/* ==========================================================================
   13. VISOR DE PDF
   ========================================================================== */

.eki-pdf {
    max-width: 1100px;
    margin: 0 auto;
    border: 1px solid var(--ek-gray-200);
    border-radius: var(--ek-radius-lg);
    overflow: hidden;
    box-shadow: var(--ek-shadow-md);
    background: var(--ek-white);
}

.eki-pdf-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.85rem 1.15rem;
    background: var(--ek-gray-50);
    border-bottom: 1px solid var(--ek-gray-200);
}

.eki-pdf-file {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.eki-pdf-file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--ek-radius-sm);
    background: #fee2e2;
    color: #dc2626;
    flex-shrink: 0;
}

.eki-pdf-file-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.9;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.eki-pdf-file-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--ek-gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 46vw;
}

.eki-pdf-file-size {
    font-size: 0.78rem;
    color: var(--ek-gray-400);
}

.eki-pdf-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.eki-pdf-frame {
    position: relative;
    background: var(--ek-gray-100);
}

.eki-pdf-frame iframe {
    display: block;
    width: 100%;
    height: min(78vh, 1000px);
    min-height: 560px;
    border: 0;
}

.eki-pdf-fallback {
    display: none;
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--ek-white);
}

.eki-pdf-fallback .eki-pdf-file-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
}

.eki-pdf-fallback .eki-pdf-file-icon svg {
    width: 30px;
    height: 30px;
}

.eki-pdf-fallback h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.eki-pdf-fallback p {
    color: var(--ek-gray-500);
    font-size: 0.95rem;
    max-width: 420px;
    margin: 0 auto 1.5rem;
}

.eki-pdf-fallback-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Cuando el navegador no puede mostrar PDF embebido (mobile). */
.eki-pdf.is-fallback .eki-pdf-frame iframe {
    display: none;
}

.eki-pdf.is-fallback .eki-pdf-fallback {
    display: block;
}


/* ==========================================================================
   14. NAVEGACIÓN INFERIOR Y RELACIONADOS
   ========================================================================== */

.eki-article-nav {
    max-width: 1100px;
    margin: 2.5rem auto 0;
    display: flex;
    justify-content: center;
}

.eki-related {
    background-color: var(--ek-gray-50);
    padding: 3.5rem 0 4rem;
}

.eki-section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.eki-section-header h2 {
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    margin-bottom: 0.6rem;
}

.eki-section-header p {
    color: var(--ek-gray-500);
    max-width: 560px;
    margin: 0 auto;
}

.eki-related .eki-grid {
    margin-bottom: 0;
}


/* ==========================================================================
   15. FOOTER
   ==========================================================================
   Los estilos del footer viven en assets/css/footer.css, que es el archivo
   canónico compartido con el plugin de WordPress (enatech-footer). Así el
   footer del subdominio y el del sitio principal salen del mismo lugar.
   ========================================================================== */


/* ==========================================================================
   16. BOTÓN FLOTANTE DE WHATSAPP
   ========================================================================== */

.eki-whatsapp {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    align-items: center;
}

.eki-whatsapp-tooltip {
    background: var(--ek-white);
    color: var(--ek-gray-700);
    padding: 0.5rem 1rem;
    border-radius: var(--ek-radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--ek-shadow-md);
    white-space: nowrap;
    margin-right: 0.8rem;
    opacity: 0;
    transform: translateX(10px);
    transition: var(--ek-transition);
    pointer-events: none;
}

.eki-whatsapp:hover .eki-whatsapp-tooltip {
    opacity: 1;
    transform: translateX(0);
}

.eki-whatsapp-btn {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(37, 211, 102, 0.35);
    transition: var(--ek-transition);
}

.eki-whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.45);
}

.eki-whatsapp-btn svg {
    width: 32px;
    height: 32px;
    fill: var(--ek-white);
}

.eki-whatsapp-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #25D366;
    animation: eki-wa-pulse 2s ease-out infinite;
}

@keyframes eki-wa-pulse {
    0%   { transform: scale(1);   opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0; }
}


/* ==========================================================================
   17. 404
   ========================================================================== */

.eki-404 {
    text-align: center;
    padding: 5rem 0 6rem;
}

.eki-404 .eki-code {
    font-size: clamp(4rem, 12vw, 7rem);
    font-weight: 700;
    line-height: 1;
    color: var(--ek-purple-light);
    margin-bottom: 0.5rem;
}

.eki-404 h1 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    margin-bottom: 0.75rem;
}

.eki-404 p {
    color: var(--ek-gray-500);
    max-width: 480px;
    margin: 0 auto 2rem;
}


/* ==========================================================================
   18. RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
    .eki-nav a {
        padding: 0 0.85rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 921px) {
    .eki-nav,
    .eki-header-actions .eki-btn {
        display: none;
    }

    .eki-mobile-trigger {
        display: inline-flex;
        width: 40px;
        height: 40px;
    }

    .eki-mobile-trigger svg {
        width: 20px;
    }

    .eki-header-inner {
        min-height: 63px;
        padding: 0 1.25rem;
    }

    /* Vale para el logo del header y para el del menú off-canvas. */
    .eki-brand img {
        height: 23px;
    }

    .eki-container {
        padding: 0 1.25rem;
    }

}

@media (max-width: 768px) {
    .eki-page-hero {
        padding: 2.5rem 0;
    }

    .eki-toolbar {
        margin: 2rem 0 1.5rem;
        gap: 1rem;
    }

    .eki-search {
        min-width: 100%;
        flex: 1 1 100%;
        order: -1;
    }

    .eki-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.35rem;
        margin: 0 -1.25rem;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .eki-filters::-webkit-scrollbar {
        display: none;
    }

    .eki-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.25rem;
    }

    .eki-content {
        font-size: 1rem;
    }

    /* En mobile los navegadores no renderizan PDF embebido de forma
       confiable: se muestra siempre la tarjeta de acceso directo. */
    .eki-pdf .eki-pdf-frame iframe {
        display: none;
    }

    .eki-pdf .eki-pdf-fallback {
        display: block;
    }

    .eki-pdf-file-name {
        max-width: 60vw;
    }

    .eki-whatsapp-btn {
        width: 52px;
        height: 52px;
    }

    .eki-whatsapp-btn svg {
        width: 28px;
        height: 28px;
    }

    .eki-whatsapp-tooltip {
        display: none;
    }

}

@media (max-width: 520px) {
    .eki-grid {
        grid-template-columns: 1fr;
    }


    .eki-pagination a,
    .eki-pagination span {
        min-width: 38px;
        padding: 0.45rem 0.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}