/*
Theme Name: Valor UF - GeneratePress Child
Theme URI: https://valor-uf.cl
Description: Child theme for GeneratePress to match Valor UF SSG design.
Author: Antigravity
Template: generatepress
Version: 1.0.1
*/

/* 
 * We rely entirely on the CSS variables defined in /assets/css/core.min.css 
 * This ensures 100% color consistency between SSG and WordPress, including Dark Mode!
 */

/* ===== GLOBAL COLOR VARIABLE MAPPINGS FOR GENERATEPRESS ===== */
:root {
    --base: var(--bg-body) !important;
    --base-2: var(--bg-surface-alt) !important;
    --base-3: var(--bg-surface) !important;
    --contrast: var(--text-main) !important;
    --contrast-2: var(--text-muted) !important;
    --contrast-3: var(--border-color) !important;
}

body {
    background-color: var(--bg-body) !important;
    color: var(--text-main) !important;
    font-family: var(--font-base, 'Inter', sans-serif) !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-base, 'Inter', sans-serif) !important;
    color: var(--text-main) !important;
    line-height: 1.3 !important;
}
html.uf-dark h1, html.uf-dark h2, html.uf-dark h3, html.uf-dark h4, html.uf-dark h5, html.uf-dark h6 {
    color: #e2e8f0 !important;
}

/* Corregir color de Asistente IA que fue sobreescrito por el !important global */
#uf-ai-chat-widget .uf-widget-head {
    background: var(--primary) !important;
}
#uf-ai-chat-widget .uf-widget-head h2 {
    color: #ffffff !important;
}
html.uf-dark #uf-ai-chat-widget .uf-widget-head {
    background: rgba(59, 130, 246, 0.15) !important; /* Azul suave para modo oscuro */
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}
html.uf-dark #uf-ai-chat-widget .uf-widget-head h2 {
    color: #60a5fa !important;
}

a { color: var(--text-primary); transition: color 0.15s; }
a:hover { color: var(--primary-hover); }
html.uf-dark a { color: var(--text-primary); }
html.uf-dark a:hover { color: #93C5FD; }

/* ===== LAYOUT GRID IDÉNTICO AL SSG (.uf-layout) ===== */
/* El SSG usa CSS Grid con 2 columnas en desktop. GP usa #content + .right-sidebar dentro de .site-content. */
/* Aplicamos el grid del SSG directamente a .site-content para que WP use exactamente el mismo sistema. */

.grid-container {
    max-width: var(--container-width) !important;
    margin: 0 auto !important;
    padding: 0 clamp(8px, 4vw, 24px) !important;
}

.site-content {
    padding: 24px 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: var(--gap) !important;
    align-items: start !important;
}
@media (min-width: 992px) {
    .site-content {
        grid-template-columns: minmax(0, 1fr) var(--sidebar-width) !important;
    }
}

/* #primary (columna izquierda) y #right-sidebar (columna derecha) ocupan su columna del grid */
/* IMPORTANTE: GP aplica float:left + width:25%/75% que pelean con CSS Grid. Los matamos. */
#primary, .content-area {
    width: 100% !important;
    min-width: 0 !important;
    float: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
#right-sidebar, .is-right-sidebar {
    width: 100% !important;
    min-width: 0 !important;
    float: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Evitar que el clearfix de GeneratePress genere columnas fantasma en nuestro Grid */
.site-content::before,
.site-content::after {
    display: none !important;
}



/* ===== BLINDAR TAMAÑO Y POSICION DEL LOGO ===== */
/* Evitamos que .main-title de GP deforme nuestro layout de logo personalizado */
.site-branding .main-title {
    margin: 0 !important;
    line-height: 1 !important;
}

/* GP tiene reglas como `.main-title a { color: #222; }` que sobrescriben nuestro color primario heredado. Lo blindamos. */
.site-branding .main-title a.uf-logo-link {
    color: var(--primary) !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}
.site-branding .main-title a.uf-logo-link:hover {
    color: #002147 !important;
}
html.uf-dark .site-branding .main-title a.uf-logo-link {
    color: #f1f5f9 !important;
}
html.uf-dark .site-branding .main-title a.uf-logo-link:hover {
    color: #38bdf8 !important;
}

/* Forzar exactamente las mismas reglas tipográficas del SSG, por si GP intenta inyectar estilos globales */
.uf-logo-text {
    font-size: 1.45rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.03em !important;
    line-height: 1 !important;
}
.uf-logo-icon {
    flex-shrink: 0 !important;
    color: var(--primary) !important;
    width: 28px !important;
    height: 28px !important;
}
@media (min-width: 768px) {
    .uf-logo-text {
        font-size: 1.7rem !important;
    }
    .uf-logo-icon {
        width: 36px !important;
        height: 36px !important;
    }
}

.uf-logo-subtitle {
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    color: #64748b !important;
    margin-top: 3px !important;
    line-height: 1 !important;
}
@media (min-width: 768px) {
    .uf-logo-subtitle {
        font-size: 0.9rem !important;
    }
}
html.uf-dark .uf-logo-subtitle {
    color: #94a3b8 !important;
}

/* ===== NEUTRALIZAR INYECCIONES DE ESPACIADO DE GENERATEPRESS ===== */
/* GeneratePress inyecta line-height: 60px y paddings de 20px en los enlaces del menú. Esto deforma el header frente al SSG. */
.main-navigation .main-nav ul li a,
.main-navigation .main-nav ul li[class*="current-menu-"] > a {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 4px !important;
    line-height: normal !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    display: flex !important;
    align-items: center !important;
}

/* El SSG usa un gap estricto de 24px en desktop */
.main-nav {
    display: flex !important;
    gap: 24px !important;
    list-style: none !important;
    align-items: center !important;
}

/* Matar el line-height: 60px de GP en menu-bar-item */
.main-navigation .menu-bar-item > a {
    line-height: normal !important;
    padding: 0 !important;
}

/* GeneratePress a veces empuja los iconos a la derecha con margin-left: auto. Lo matamos. */
.main-navigation {
    flex: 0 1 auto !important;
    margin-left: 0 !important;
}
.inside-navigation {
    display: flex !important;
    gap: 16px !important;
    justify-content: flex-end !important;
}
.menu-bar-items {
    margin-left: 0 !important; /* Evitar que la luna vuele hacia la derecha */
}

/* Neutralizar las medidas que GP inyecta en los items del menu bar (como el botón de luna) */
.menu-bar-item a,
.menu-bar-items a {
    padding: 0 !important;
    line-height: normal !important;
    display: inline-flex !important;
    height: auto !important;
}

/* Forzar que el icono de la luna mida exactamente lo que pide el SSG (32px) y no se ensanche por GP */
.uf-theme-switch-icon {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Hacer header fijo idéntico al SSG */
.site-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 9999 !important;
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: var(--backdrop-blur) !important;
    -webkit-backdrop-filter: var(--backdrop-blur) !important;
    border-bottom: 1px solid var(--border-light) !important;
    padding: 8px 0 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 2px 4px rgba(0,0,0,0.02) !important;
    transition: background-color 0.1s, border-color 0.1s;
}

/* IMPORTANTE: Si el usuario está logueado en WP, la barra de administración empuja el body 32px hacia abajo.
   Si no bajamos el header, se desalineará todo el espaciado vertical. */
body.admin-bar .site-header {
    top: 32px !important;
}
@media screen and (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px !important;
    }
}

@media (min-width: 768px) {
    .site-header {
        padding: 16px 0 !important;
    }
}
html.uf-dark .site-header {
    background: rgba(15,23,42,.8) !important;
    border-bottom-color: rgba(255,255,255,.06) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,.2) !important;
}
@media (min-width: 768px) {
    .site-header {
        padding: 16px 0 !important;
    }
}
.inside-header {
    display: flex !important;
    padding: 0 clamp(8px, 4vw, 24px) !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
}

/* Blindar el ancho y padding del contenedor principal idéntico al SSG */
.grid-container {
    max-width: var(--container-width) !important;
    padding: 0 clamp(8px, 4vw, 24px) !important;
}

/* ===== BLINDAR ESPACIADO Y TIPOGRAFIA GLOBAL (BODY Y CONTENIDO) ===== */
/* El SSG original compensa el header fijo con un padding-top, y define reglas estrictas de renderizado tipográfico */
html, body {
    font-size: 16px !important; /* Neutralizar GP que inyecta 17px y rompe todas las escalas rem */
}
body {
    padding-top: 48px !important;
    font-family: var(--font-base) !important;
    font-variant-numeric: tabular-nums lining-nums !important;
    background-color: var(--bg-body) !important;
    color: var(--text-main) !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}
@media (min-width: 769px) {
    body {
        padding-top: 64px !important;
    }
}
.site-content {
    padding: 24px 0 !important;
}

/* Evitar que GeneratePress empuje todo hacia abajo con márgenes estructurales por defecto */
/* GP inyecta: .separate-containers .site-main { margin: 20px }
              .separate-containers .inside-right-sidebar { margin-top: 20px; margin-bottom: 20px }
              .separate-containers .site-main > * { margin-bottom: 20px }
              .post { margin: 0 0 2em }  */
#content, .site-main, .inside-right-sidebar, .inside-left-sidebar {
    margin: 0 !important;
}
.separate-containers .site-main,
.separate-containers.right-sidebar .site-main,
.separate-containers.no-sidebar .site-main {
    margin: 0 !important;
}
.separate-containers .inside-right-sidebar,
.separate-containers .inside-left-sidebar {
    margin: 0 !important;
}
.separate-containers .site-main > *,
.separate-containers .page-header,
.separate-containers .widget {
    margin-bottom: 0 !important;
}
/* GP .post { margin: 0 0 2em } agrega 2em debajo de cada artículo. Lo matamos. */
.post {
    margin: 0 !important;
}

/* Neutralizar los fondos blancos globales que inyecta GeneratePress en los contenedores padre */
body .site,
body .site-content,
body #page,
body .grid-container {
    background: transparent !important;
    background-color: transparent !important;
}

/* Neutralizar los contenedores de widgets de GeneratePress para evitar padding/fondo doble en el sidebar */
.sidebar .widget,
.widget-area .widget {
    padding: 0 !important;
    background: transparent !important;
    margin-bottom: 0 !important;
    border: none !important;
    font-size: inherit !important; /* GP fuerza 17px en sidebar widgets, nosotros heredamos 16px del body */
}

/* GP pone font-size:17px en .footer-widgets .widget y .sidebar .widget. Lo matamos. */
.footer-widgets .widget,
.sidebar .widget {
    font-size: 16px !important;
}

/* GP pone widget-title a font-weight:400 y font-size:20px. El SSG no usa widget-title pero si se filtra lo neutralizamos */
.widget-title {
    font-weight: 800 !important;
    font-size: 1rem !important;
}

/* Neutralizar márgenes internos de GP que inflan las cajas de artículo vs el SSG */
/* GP: .entry-content:not(:first-child) { margin-top: 2em } y p { margin-bottom: 1.5em } */
.separate-containers .comments-area,
.separate-containers .page-header,
.separate-containers .paging-navigation {
    padding: 0 !important;
}
.entry-content:not(:first-child),
.entry-summary:not(:first-child) {
    margin-top: 1em !important;
}

/* Hacer que la caja de la noticia en WP (.inside-article) sea un clon visual exacto de .uf-content-section del SSG */
/* IMPORTANTE: Sólo aplicamos esto a los posts (.post). Las páginas (.page) que contienen las calculadoras no deben tener padding extra ni fondos. */
.separate-containers .post .inside-article,
.post .inside-article {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    padding: 32px 24px !important;
    margin-bottom: 32px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03) !important;
    transition: background-color 0.1s, border-color 0.1s, box-shadow 0.1s;
    position: relative !important;
    overflow: hidden !important;
}

/* El "encabezado azul" emulado para igualar a las calculadoras del SSG (solo en posts) */
.post .inside-article::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 16px;
    background: var(--primary);
}

/* Las calculadoras y layouts completos (Pages o Posts que usen el grid del SSG) deben fluir directamente en el layout sin wrappers blancos ni títulos inyectados por WP */
.page .inside-article,
.inside-article:has(.uf-layout),
.inside-article:has(.uf-widget-box),
.inside-article:has(.uf-box-hero) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.page .entry-header,
.page .page-header,
.inside-article:has(.uf-layout) .entry-header,
.inside-article:has(.uf-box-hero) .entry-header {
    display: none !important;
}
.inside-article:has(.uf-layout)::before,
.inside-article:has(.uf-box-hero)::before {
    display: none !important;
}

@media (min-width: 768px) {
    .separate-containers .post .inside-article,
    .post .inside-article {
        padding: 48px !important;
    }
    .page .inside-article,
    .inside-article:has(.uf-layout),
    .inside-article:has(.uf-box-hero) {
        padding: 0 !important;
    }
}
html.uf-dark .separate-containers .post .inside-article,
html.uf-dark .post .inside-article {
    border-color: var(--border-color) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
}

/* ===== BLINDAR JERARQUÍA TIPOGRÁFICA DE GENERATEPRESS ===== */
/* GP a veces fuerza H1/H2 a peso 400 (regular). El SSG usa 800. Esto hacía que el texto plano pareciera muy grueso al no haber contraste. */
h1, h2, h3, h4, h5, h6,
.entry-title, .entry-content h1, .entry-content h2, .entry-content h3 {
    font-weight: 800 !important;
}

/* ===== NEUTRALIZAR COLORES Y GROSORES DE NAVEGACION DE GENERATEPRESS ===== */
/* GP inyecta background-color y color via inline CSS. Lo neutralizamos con !important */
.main-navigation,
.inside-navigation,
.main-navigation .main-nav > ul,
.main-navigation ul ul {
    background: transparent !important;
    background-color: transparent !important;
}
.main-navigation .main-nav ul li a,
.main-navigation .main-nav ul li[class*="current-menu-"] > a {
    color: var(--text-main) !important;
    background-color: transparent !important;
    font-weight: 500 !important;
}

html.uf-dark .main-navigation,
html.uf-dark .inside-navigation,
html.uf-dark .main-navigation .main-nav > ul {
    background: transparent !important;
    background-color: transparent !important;
}

/* Forzar que los links tomen los colores del SSG y no los de GP */
.main-navigation .main-nav ul li a,
.main-navigation .main-nav ul li[class*="current-menu-"] > a {
    color: var(--text-main) !important;
}
.main-navigation .main-nav ul li a:hover,
.main-navigation .main-nav ul li[class*="current-menu-"]:hover > a {
    color: var(--primary) !important;
}

html.uf-dark .main-navigation .main-nav ul li a,
html.uf-dark .main-navigation .main-nav ul li[class*="current-menu-"] > a {
    color: #e2e8f0 !important;
}
html.uf-dark .main-navigation .main-nav ul li a:hover,
html.uf-dark .main-navigation .main-nav ul li[class*="current-menu-"]:hover > a {
    color: #38bdf8 !important;
}

/* Ocultar el ícono SVG por defecto del dropdown de GeneratePress (raya negra) */
.main-navigation .dropdown-menu-toggle svg,
.main-navigation .dropdown-menu-toggle .gp-icon {
    display: none !important;
}

/* Forzar que el toggle de GP sea de tamaño 0 para que nuestro borde CSS dibuje el triángulo correcto y no una raya gigante */
.main-navigation .dropdown-menu-toggle {
    display: inline-block !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin-left: 6px !important;
    vertical-align: middle !important;
    border-top: 5px solid currentColor !important;
    border-left: 4px solid transparent !important;
    border-right: 4px solid transparent !important;
    border-bottom: 0 !important;
    background: transparent !important;
}
.main-navigation .dropdown-menu-toggle:before,
.main-navigation .dropdown-menu-toggle:after {
    display: none !important;
}

/* Forzar grosor del SVG de la luna/sol */
.uf-theme-switch-icon svg {
    stroke-width: 2 !important;
}

/* Fix dropdown sub-menu layout */
.main-navigation ul ul,
.main-navigation .main-nav ul ul,
.main-nav .sub-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    background: #ffffff !important; /* Forzar sólido, evitar transparencia de GP */
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
    min-width: 220px !important;
    width: auto !important;
    padding: 8px 0 !important;
    z-index: 9999 !important;
    display: block !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.15s, visibility 0.15s, transform 0.15s !important;
    pointer-events: none;
}
.main-navigation .main-nav ul li.menu-item-has-children:hover > ul,
.main-navigation .main-nav ul li.menu-item-has-children:focus-within > ul {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}
html.uf-dark .main-navigation ul ul,
html.uf-dark .main-navigation .main-nav ul ul,
html.uf-dark .main-nav .sub-menu {
    background: #1e293b !important;
    border-color: rgba(148,163,184,0.15) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
}
.main-navigation ul ul li a,
.main-nav .sub-menu .menu-item a {
    display: block !important;
    padding: 10px 20px !important;
    color: var(--text-main) !important;
    background: transparent !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
}
.main-navigation ul ul li a:hover,
.main-nav .sub-menu .menu-item a:hover {
    background: var(--bg-surface-alt) !important;
    color: var(--primary) !important;
}
html.uf-dark .main-navigation ul ul li a,
html.uf-dark .main-nav .sub-menu .menu-item a {
    color: #e2e8f0 !important;
}
html.uf-dark .main-navigation ul ul li a:hover,
html.uf-dark .main-nav .sub-menu .menu-item a:hover {
    background: rgba(56,189,248,0.1) !important;
    color: #38bdf8 !important;
}

/* 320px Mobile Fixes */
@media (max-width: 480px) {
    .site.grid-container {
        padding: 0 12px;
    }
    .inside-article, .sidebar .widget {
        padding: 16px;
    }
    .uf-financial-ticker {
        overflow-x: auto !important;
        white-space: nowrap !important;
        padding: 8px 12px !important;
        scrollbar-width: none;
    }
    .uf-financial-ticker::-webkit-scrollbar {
        display: none;
    }
    .uf-footer-container {
        padding: 0 16px !important;
    }
}

/* ===== BLINDAR EL FOOTER CONTRA GENERATEPRESS ===== */
/* GP añade márgenes por defecto a los p, ul, h1-h6 que rompen la cuadratura del SSG */
.uf-footer-col h3.uf-footer-heading {
    margin-top: 0 !important;
    margin-bottom: 16px !important;
}
.uf-footer-links {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
.uf-footer-links li {
    margin-bottom: 0 !important;
}
.uf-footer-brand p {
    margin-bottom: 16px !important;
}

/* Garantizar que el Grid del Footer se respete como en el SSG y no sea sobreescrito por un flexbox del tema */
.uf-footer-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    margin-bottom: 48px !important;
}
@media (min-width: 768px) {
    .uf-footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr !important;
    }
}

/* ===== ESTILOS PARA LA PAGINACIÓN (GENERATEPRESS) ===== */
/* GP por defecto saca los números sueltos sobre un fondo blanco feo. Vamos a darle estilo premium. */
.nav-links {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: center !important;
    margin: 40px 0 !important;
    background: transparent !important; /* Quitar el bloque blanco de GP */
    padding: 0 !important;
}
.nav-links .page-numbers {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 14px !important;
    border-radius: 8px !important;
    background: var(--bg-surface) !important;
    color: var(--text-main) !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    text-decoration: none !important;
    border: 1px solid var(--border-color) !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02) !important;
}
.nav-links .page-numbers:hover {
    background: var(--bg-surface-alt) !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    transform: translateY(-1px) !important;
}
.nav-links .page-numbers.current {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}
.nav-links .page-numbers.dots {
    border: none !important;
    background: transparent !important;
    color: var(--text-muted) !important;
    box-shadow: none !important;
}
html.uf-dark .nav-links .page-numbers {
    background: var(--bg-surface) !important;
    border-color: rgba(255,255,255,0.1) !important;
    color: #e2e8f0 !important;
}
html.uf-dark .nav-links .page-numbers:hover {
    background: rgba(255,255,255,0.05) !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
}
html.uf-dark .nav-links .page-numbers.current {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}

/* Ocultar el fondo blanco feo que envuelve la navegación en GP */
.paging-navigation {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-top: 40px !important;
}

/* ===== ESTILOS PARA EL BOTÓN VOLVER ARRIBA DE GENERATEPRESS ===== */
a.generate-back-to-top::before,
a.generate-back-to-top::after {
    display: none !important;
    content: none !important;
    opacity: 0 !important;
}

a.generate-back-to-top, 
a.generate-back-to-top:visited {
    bottom: 28px !important;
    right: 28px !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    background: var(--accent-red) url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='18 15 12 9 6 15'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center center !important;
    background-size: 22px !important;
    color: transparent !important; /* Hide potential text */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 16px rgba(139,26,26,0.3) !important;
    transition: opacity 0.1s ease, visibility 0.1s ease, transform 0.1s ease, background-color 0.05s ease !important;
    line-height: 1 !important;
    padding: 0 !important;
    border: none !important;
    text-decoration: none !important;
}

a.generate-back-to-top:hover, 
a.generate-back-to-top:focus {
    background-color: #6B0F0F !important;
    box-shadow: 0 6px 24px rgba(107,15,15,0.35) !important;
    transform: translateY(-2px) !important;
}

a.generate-back-to-top:active {
    transform: scale(0.92) !important;
}

a.generate-back-to-top * {
    display: none !important; /* Hide SVGs or spans GP might inject */
}

html.uf-dark a.generate-back-to-top,
html.uf-dark a.generate-back-to-top:visited {
    background: var(--accent-red) !important;
    box-shadow: 0 4px 16px rgba(220,64,64,0.3) !important;
}

html.uf-dark a.generate-back-to-top:hover,
html.uf-dark a.generate-back-to-top:focus {
    background: #EF5350 !important;
}

@media (max-width: 767px) {
    a.generate-back-to-top, 
    a.generate-back-to-top:visited {
        bottom: 16px !important;
        right: 16px !important;
        width: 40px !important;
        height: 40px !important;
        background: rgba(139, 26, 26, 0.95) !important;
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
    }
    html.uf-dark a.generate-back-to-top,
    html.uf-dark a.generate-back-to-top:visited {
        background: rgba(220, 64, 64, 0.95) !important;
    }
}

/* Fix global GeneratePress padding squishing our custom back to top button */
button.uf-scroll-top,
.uf-scroll-top {
    padding: 0 !important;
}

/* ===== ESTILOS PARA LAS TARJETAS DE NOTICIAS (POSTS) EN LA HOME / ARCHIVO ===== */
.post .inside-article h2.entry-title {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    margin-top: 10px !important;
    margin-bottom: 12px !important;
    line-height: 1.3 !important;
}
.post .inside-article h2.entry-title a {
    color: var(--text-main) !important;
    text-decoration: none !important;
    transition: color 0.1s ease;
}
.post .inside-article h2.entry-title a:hover {
    color: var(--primary) !important;
}
html.uf-dark .post .inside-article h2.entry-title a:hover {
    color: #38bdf8 !important;
}

/* Normalizar las fechas (meta-información de los posts) */
.post .entry-meta,
.post .posted-on {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px !important;
}
.post .posted-on time {
    color: var(--text-muted) !important;
}
.post .posted-on::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-size: cover;
    opacity: 0.85;
}
html.uf-dark .post .posted-on::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
}

/* Normalizar el botón Leer Más (read more) de las tarjetas */
.post .entry-summary a.read-more,
.post a.read-more,
.post a.read-more:visited,
.post .read-more-button {
    display: flex !important;
    width: max-content !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--primary) !important;
    color: #ffffff !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    border: 1px solid var(--primary) !important;
    text-decoration: none !important;
    transition: background-color 0.05s ease, border-color 0.05s ease, color 0.05s ease !important;
    box-shadow: 0 4px 12px rgba(9,63,138,0.12) !important;
    margin-top: 16px !important;
    cursor: pointer !important;
}
.post .entry-summary a.read-more:hover,
.post a.read-more:hover,
.post .read-more-button:hover {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(0,31,63,0.2) !important;
}

/* Modo Oscuro para el botón Leer Más */
html.uf-dark .post .entry-summary a.read-more,
html.uf-dark .post a.read-more,
html.uf-dark .post .read-more-button {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
}
html.uf-dark .post .entry-summary a.read-more:hover,
html.uf-dark .post a.read-more:hover,
html.uf-dark .post .read-more-button:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
    box-shadow: 0 6px 16px rgba(37,99,235,0.3) !important;
}
