/* Related Posts AdSanity Lite Enhanced Styles */

.rpa-enhanced-container {
    margin: 40px 0;
    padding: 30px 0;
    border-top: 2px solid #e1e5e9;
    clear: both;
}

.rpa-enhanced-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 30px 0;
    text-align: center;
    position: relative;
}

.rpa-enhanced-title::after {
    content: '';
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* Grid Layout (Default) */
.rpa-layout-grid .rpa-posts-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    align-items: start;
}

/* List Layout */
.rpa-layout-list .rpa-posts-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rpa-layout-list .rpa-post-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.rpa-layout-list .rpa-post-thumbnail {
    flex-shrink: 0;
    width: 120px;
}

.rpa-layout-list .rpa-post-content {
    flex: 1;
    padding: 0;
}

/* Post Item Styling */
.rpa-post-item {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    height: fit-content;
}

.rpa-post-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #cbd5e0;
}

/* Thumbnail Styling */
.rpa-post-thumbnail {
    position: relative;
    overflow: hidden;
    background: #f7fafc;
}

.rpa-layout-grid .rpa-post-thumbnail {
    height: 200px;
}

.rpa-layout-list .rpa-post-thumbnail {
    height: 100px;
    border-radius: 8px;
}

.rpa-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.rpa-post-item:hover .rpa-post-thumbnail img {
    transform: scale(1.05);
}

.rpa-no-thumbnail {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    color: #a0aec0;
    font-size: 14px;
    font-weight: 500;
}

.rpa-no-thumbnail svg {
    margin-bottom: 8px;
    opacity: 0.6;
}

/* Content Styling */
.rpa-post-content {
    padding: 20px;
}

.rpa-layout-list .rpa-post-content {
    padding: 0;
}

.rpa-post-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.rpa-post-title a {
    color: #2d3748;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
}

.rpa-post-title a:hover {
    color: #667eea;
}

.rpa-post-date {
    display: block;
    color: #718096;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    font-style: normal;
}

.rpa-post-excerpt {
    color: #4a5568;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

/* Ad Container Styling */
.rpa-ad-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    margin: 10px 0;
    position: relative;
}

.rpa-ad-label {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #e2e8f0;
    color: #718096;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 4px;
}

.rpa-ad-content {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rpa-ad-placeholder {
    color: #a0aec0;
    font-style: italic;
    font-size: 16px;
}

/* No Posts Message */
.rpa-no-posts-wrapper {
    text-align: center;
    padding: 40px 20px;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

.rpa-no-posts {
    color: #718096;
    font-style: italic;
    margin: 0;
    font-size: 16px;
}

/* Auto-inserted wrapper */
.rpa-auto-inserted {
    margin-top: 50px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .rpa-enhanced-title {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    .rpa-layout-grid .rpa-posts-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .rpa-layout-list .rpa-post-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .rpa-layout-list .rpa-post-thumbnail {
        width: 100%;
        height: 160px;
    }
    
    .rpa-post-content {
        padding: 15px;
    }
    
    .rpa-post-title {
        font-size: 16px;
    }
    
    .rpa-enhanced-container {
        margin: 30px 0;
        padding: 20px 0;
    }
}

@media (max-width: 480px) {
    .rpa-enhanced-title {
        font-size: 20px;
    }
    
    .rpa-layout-grid .rpa-post-thumbnail {
        height: 160px;
    }
    
    .rpa-post-content {
        padding: 12px;
    }
    
    .rpa-ad-container {
        padding: 20px 15px;
        margin: 15px 0;
    }
}

/* Print styles */
@media print {
    .rpa-ad-container {
        display: none;
    }
    
    .rpa-post-item {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .rpa-enhanced-container {
        border-top-color: #4a5568;
    }
    
    .rpa-enhanced-title {
        color: #e2e8f0;
    }
    
    .rpa-post-item {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .rpa-post-title a {
        color: #e2e8f0;
    }
    
    .rpa-post-title a:hover {
        color: #90cdf4;
    }
    
    .rpa-post-date {
        color: #a0aec0;
    }
    
    .rpa-post-excerpt {
        color: #cbd5e0;
    }
}