/* VivaDecora Related Posts - Module Styles */

.vrp-related-module {
    margin: 30px 0;
    padding: 25px;
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.vrp-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #333;
    line-height: 1.3;
}

.vrp-subtitle {
    font-size: 16px;
    color: #666;
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.vrp-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.vrp-post-item {
    display: flex;
    flex-direction: column;
    background: #fafafa;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e8e8e8;
}

.vrp-post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #d0d0d0;
}

.vrp-thumbnail-wrapper {
    width: 100%;
    height: 150px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vrp-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.vrp-post-item:hover .vrp-thumbnail {
    transform: scale(1.05);
}

.vrp-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.vrp-post-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
    line-height: 1.4;
    margin: 0 0 10px 0;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vrp-post-title:hover,
.vrp-post-title:focus,
.vrp-post-title:visited {
    color: #3498db;
    text-decoration: none !important;
}

.vrp-excerpt-link {
    text-decoration: none;
    color: inherit;
}

.vrp-excerpt-link:hover,
.vrp-excerpt-link:focus,
.vrp-excerpt-link:visited {
    text-decoration: none !important;
    color: inherit;
}

.vrp-excerpt {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin: 0 0 10px 0;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vrp-source {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-top: auto;
    align-self: flex-start;
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 12px;
}

.vrp-no-posts {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Responsividade para tema Newspaper */
@media (max-width: 768px) {
    .vrp-related-module {
        margin: 20px 0;
        padding: 20px 15px;
        border-radius: 6px;
    }
    
    .vrp-title {
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    .vrp-subtitle {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .vrp-posts-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .vrp-post-item {
        flex-direction: row;
        max-height: 120px;
    }
    
    .vrp-thumbnail-wrapper {
        width: 100px;
        min-width: 100px;
        height: 100px;
        margin: 10px;
        border-radius: 4px;
        overflow: hidden;
    }
    
    .vrp-content {
        padding: 10px 15px 10px 0;
    }
    
    .vrp-post-title {
        font-size: 15px;
        margin-bottom: 6px;
        -webkit-line-clamp: 2;
    }
    
    .vrp-excerpt-link {
        display: none;
    }
    
    .vrp-source {
        font-size: 11px;
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    .vrp-related-module {
        margin: 15px 0;
        padding: 15px 10px;
    }
    
    .vrp-title {
        font-size: 18px;
    }
    
    .vrp-thumbnail-wrapper {
        width: 80px;
        min-width: 80px;
        height: 80px;
        margin: 6px;
    }
    
    .vrp-content {
        padding: 6px 8px 6px 0;
    }
    
    .vrp-post-title {
        font-size: 15px;
        -webkit-line-clamp: 2;
        margin-bottom: 4px;
    }
    
    .vrp-excerpt-link {
        display: none;
    }
}

/* Compatibilidade com tema Newspaper */
.td-post-content .vrp-related-module {
    max-width: 100%;
    clear: both;
}

.td-post-content .vrp-posts-list {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

.td-post-content .vrp-post-item {
    list-style: none !important;
}

.td-post-content .vrp-post-item::before {
    display: none !important;
}

/* Integração suave com conteúdo existente */
.single-post .vrp-related-module {
    border-top: 2px solid #f1f1f1;
    margin-top: 40px;
    padding-top: 30px;
}

/* Estados de loading */
.vrp-loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.vrp-loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    border-top-color: #3498db;
    animation: vrp-spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes vrp-spin {
    to { transform: rotate(360deg); }
}

/* Print styles */
@media print {
    .vrp-related-module {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .vrp-post-item:hover {
        transform: none;
        box-shadow: none;
    }
}