/**
 * related_articles.css - Estilos para el componente de artículos relacionados
 */

/* =============================================================================
   SECCIÓN DE ARTÍCULOS RELACIONADOS
   ============================================================================= */

.related-articles-section {
    margin-top: 40px;
    padding: 30px 0;
    border-top: 1px solid #e0e0e0;
}

.dark-mode .related-articles-section {
    border-top-color: #404040;
}

.related-articles-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Título de la sección */
.related-articles-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
}

.dark-mode .related-articles-title {
    color: #e4e4e4;
}

.related-articles-title svg {
    flex-shrink: 0;
    color: #007bff;
}

/* Grid de artículos */
.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

@media (min-width: 768px) {
    .related-articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .related-articles-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* =============================================================================
   TARJETA DE ARTÍCULO RELACIONADO
   ============================================================================= */

.related-article-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dark-mode .related-article-card {
    background: #2d2d2d;
    border-color: #404040;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.related-article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.dark-mode .related-article-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

/* Enlace del artículo */
.related-article-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Imagen del artículo */
.related-article-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background-color: #f0f0f0;
    position: relative;
}

.dark-mode .related-article-image {
    background-color: #3d3d3d;
}

.related-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-article-card:hover .related-article-image img {
    transform: scale(1.05);
}

/* Contenido del artículo */
.related-article-content {
    padding: 15px;
}

/* Título del artículo */
.related-article-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark-mode .related-article-title {
    color: #e4e4e4;
}

.related-article-card:hover .related-article-title {
    color: #007bff;
}

.dark-mode .related-article-card:hover .related-article-title {
    color: #58a6ff;
}

/* Descripción del artículo */
.related-article-description {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark-mode .related-article-description {
    color: #b0b0b0;
}

/* Botón "Leer más" */
.related-article-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #007bff;
    transition: gap 0.2s ease;
}

.related-article-more svg {
    transition: transform 0.2s ease;
}

.related-article-card:hover .related-article-more {
    gap: 8px;
}

.related-article-card:hover .related-article-more svg {
    transform: translateX(3px);
}

/* =============================================================================
   VARIANTE COMPACTA
   ============================================================================= */

.related-articles-section.compact .related-articles-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.related-articles-section.compact .related-article-image {
    height: 120px;
}

.related-articles-section.compact .related-article-content {
    padding: 12px;
}

.related-articles-section.compact .related-article-title {
    font-size: 14px;
}

/* =============================================================================
   VARIANTE CON IMÁGENES PEQUEÑAS
   ============================================================================= */

.related-articles-section.small-images .related-article-card {
    display: flex;
    flex-direction: row;
}

.related-articles-section.small-images .related-article-image {
    width: 100px;
    height: auto;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .related-articles-section.small-images .related-article-card {
        flex-direction: column;
    }

    .related-articles-section.small-images .related-article-image {
        width: 100%;
        height: 160px;
    }
}

/* =============================================================================
   EFECTO DE CARGA (SKELETON)
   ============================================================================= */

.related-article-card.loading {
    pointer-events: none;
}

.related-article-card.loading .related-article-image,
.related-article-card.loading .related-article-title,
.related-article-card.loading .related-article-description {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
}

.dark-mode .related-article-card.loading .related-article-image,
.dark-mode .related-article-card.loading .related-article-title,
.dark-mode .related-article-card.loading .related-article-description {
    background: linear-gradient(
        90deg,
        #2d2d2d 0%,
        #3d3d3d 50%,
        #2d2d2d 100%
    );
    background-size: 200% 100%;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* =============================================================================
   ANIMACIÓN DE ENTRADA
   ============================================================================= */

.related-article-card {
    animation: fade-in-up 0.5s ease backwards;
}

.related-article-card:nth-child(1) {
    animation-delay: 0.1s;
}

.related-article-card:nth-child(2) {
    animation-delay: 0.2s;
}

.related-article-card:nth-child(3) {
    animation-delay: 0.3s;
}

.related-article-card:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================================================
   ACCESIBILIDAD
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
    .related-article-card,
    .related-article-image img,
    .related-article-more,
    .related-article-more svg {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus visible para navegación por teclado */
.related-article-link:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.related-article-link:focus:not(:focus-visible) {
    outline: none;
}

/* =============================================================================
   RESPONSIVE ADICIONAL
   ============================================================================= */

@media (max-width: 480px) {
    .related-articles-section {
        padding: 20px 0;
    }

    .related-articles-title {
        font-size: 20px;
    }

    .related-articles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .related-article-content {
        padding: 12px;
    }
}
