/* MEJORAS DE UX / USABILIDAD AÑADIDAS RECIENTEMENTE */

/* Mejoras de accesibilidad (Focus Rings) para navegacion por teclado */
a:focus-visible, 
button:focus-visible, 
input:focus-visible {
    outline: 3px solid var(--primary-red) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(255, 56, 1, 0.2) !important;
    border-radius: 4px;
}

/* Efectos de Hover mejorados para botones - Microinteracciones */
.btn {
    position: relative;
    overflow: hidden;
    transform: translateY(0);
}

.btn:active {
    transform: translateY(2px) !important;
}

/* Transiciones más fluidas para tarjetas */
.article-card, .issue-card, .articulo-card, .dual-sections .about-journal-card, .dual-sections .call-to-action-card {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease !important;
    will-change: transform, box-shadow;
}

.article-card:hover, .issue-card:hover, .articulo-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 15px 30px rgba(0, 0, 102, 0.12) !important;
    border-color: rgba(0, 0, 102, 0.1) !important;
}

/* Indicador de carga para imágenes */
img {
    position: relative;
}

img::before {
    content: "Cargando...";
    display: block;
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--light-gray);
    color: var(--dark-gray);
    display: flex; align-items: center; justify-content: center;
}

/* Scroll To Top Button UX */
#btn-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: none; /* Oculto por defecto, se muestra con JS */
    background-color: var(--primary-red);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 9999;
    transition: background-color 0.3s, transform 0.3s, opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

#btn-back-to-top.show {
    opacity: 1;
}

#btn-back-to-top:hover {
    background-color: var(--primary-blue);
    transform: translateY(-5px);
}

/* Mejor contraste y legibilidad en textos principales */
body {
    color: #1a1a24;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mejoras de padding en móviles para enlaces touch */
@media (max-width: 768px) {
    nav ul li a, .top-bar-links a {
        padding: 12px 15px; /* Fácil de tocar con los dedos según normativas UX */
    }
    
    .btn {
        padding: 14px 24px;
        min-width: 140px; /* Tamaño mínimo táctil */
    }

    #btn-back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}
