/* --- EA-CMS: ESTILOS GLOBALES --- */
/* Esto permite que el sticky funcione pero evita que la web se mueva de lado */
html, body {
    overflow-x: clip !important; 
    height: auto;
    position: relative;
}
/* --- RESET GLOBAL Y TIPOGRAFÍA --- */
body {
    font-family: 'Inter', sans-serif !important;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

h1, h2, h3, h4, .font-black {
    letter-spacing: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 3px;
}

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

/* Tarjetas de Archivo/Categoría */
.archive-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.archive-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.document-card {
    min-height: 100%;
}

.document-card-title,
.document-card-description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.document-card-title {
    line-clamp: 3;
    -webkit-line-clamp: 3;
}

.document-card-description {
    line-clamp: 4;
    -webkit-line-clamp: 4;
}

.document-thumb {
    aspect-ratio: 3 / 4;
    background:
        linear-gradient(180deg, #ffffff, #f8fafc);
}

.document-filter-panel {
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.document-category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.document-category-count {
    border-radius: 999px;
    padding: 0.15rem 0.45rem;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.65rem;
}

.document-category-link.bg-white .document-category-count {
    background: #e2e8f0;
    color: #0f172a;
}

.home-document-card {
    min-height: 100%;
}

.home-document-card h4 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-document-card p {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-carousel-title,
.post-carousel-excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-carousel-title {
    line-clamp: 3;
    -webkit-line-clamp: 3;
    min-height: 3.75em;
    max-height: 3.75em;
}

.post-carousel-title a {
    display: block;
}

.post-carousel-excerpt {
    line-clamp: 3;
    -webkit-line-clamp: 3;
    min-height: 4.65em;
}

/* Tarjetas de la Barra Lateral */
.sidebar-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
}

/* Área de Contenido (Artículos y Páginas) */
.content-area p,
.prose p {
    margin-top: 0;
    margin-bottom: 0.9rem;
    line-height: 1.75;
    color: #334155;
}

.content-area p:last-child,
.prose p:last-child {
    margin-bottom: 0;
}
.content-area a,
.prose a {
    color: #2563eb;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: rgba(37, 99, 235, 0.35);
    text-underline-offset: 0.15em;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.content-area a:hover,
.prose a:hover {
    color: #0f172a;
    text-decoration-color: rgba(15, 23, 42, 0.45);
}
.content-area h2, .prose h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    letter-spacing: 0;
}

.content-area img {
    border-radius: 1.5rem;
    margin: 2rem 0;
}
/*Listas y viñetas*/
.content-area ul,
.content-area ol,
.prose ul,
.prose ol {
    margin: 0.75rem 0 1rem 1.25rem;
    padding-left: 1.25rem;
    line-height: 1.65;
}

.content-area ul,
.prose ul {
    list-style-type: disc;
}

.content-area ol,
.prose ol {
    list-style-type: decimal;
}

.content-area li,
.prose li {
    margin-bottom: 0.45rem;
    padding-left: 0.15rem;
}

.content-area li:last-child,
.prose li:last-child {
    margin-bottom: 0;
}

/* Efectos de Microscopía (Galería Técnica) */
.microscopy-grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    aspect-ratio: 1/1;
}

.microscopy-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(15, 23, 42, 0.9));
    padding: 1rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.microscopy-grid-item:hover .microscopy-overlay {
    opacity: 1;
}

/* Estilos de Formulario (Admin y Contacto) */
.form-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: #334155;
    background-color: #f8fafc;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Patrón de fondo (Background Pattern) */
.bg-pattern {
    background-color: #f8fafc;
    background-image: radial-gradient(#cbd5e1 0.5px, transparent 0.5px);
    background-size: 20px 20px;
}

/* Glassmorphism para investigación */
.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s ease;
}
/* Asegurar que las imágenes dentro del contenido respeten el diseño */
.content-area img {
    max-width: 100%;
    height: auto;
    border-radius: 2rem; /* El estilo de tu sitio */
    margin: 1.5rem 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
/* Prevenir desbordamiento de contenido en post.php */
.content-area {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.content-area img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

.content-area table {
    display: block;
    width: 100% !important;
    overflow-x: auto; /* Si la tabla es muy ancha, que tenga su propio scroll interno y no mueva toda la página */
    border-collapse: collapse;
}

.content-area iframe {
    max-width: 100% !important;
}

.content-area .video-embed {
    width: 100%;
    margin: 2rem 0;
    border-radius: 1rem;
    overflow: hidden;
    background: #000;
    line-height: 0;
}

.content-area .video-embed iframe {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    border: 0;
    display: block;
}
/* Forzar los 15px (0.9375em) en todo el cuerpo del post */
.content-area,
.content-area p,
.content-area span,
.content-area li {
    font-size: 0.9375em !important;
    line-height: 1.65 !important;
}

/* IMPORTANTE: Esto permite que la barra lateral se mueva libremente */
html, body {
    overflow-x: clip !important;
    height: auto !important;
    overflow-y: visible !important;
}

/* Evitar que el main bloquee el sticky */
main {
    overflow: visible !important;
}

.js-sticky-sidebar-scroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.js-sticky-sidebar-scroll::-webkit-scrollbar {
    display: none;
}
/* Forzar que el popup tenga altura 
.ginline {
    width: 100% !important;
    max-width: 900px !important;
    height: 506px !important;
    background: #000 !important;
}
.gslide-inline iframe {
    height: 506px !important;
}*/
@media (max-width: 768px) {
    .ginline, .gslide-inline iframe {
        height: 250px !important;
    }
}
/* =========================================
   POSTS IMPORTADOS · RESPONSIVE MOBILE
========================================= */

@media (max-width: 768px) {
    .content-area {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .content-area *,
    .content-area [style] {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .content-area [style*="width"] {
        width: auto !important;
    }

    .content-area img,
    .content-area iframe,
    .content-area video,
    .content-area embed,
    .content-area object {
        max-width: 100% !important;
        height: auto !important;
    }

    .content-area table {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
    }

    .content-area p,
    .content-area li,
    .content-area a,
    .content-area span {
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }
}