/* SmartCMS Related Posts - Fixed by Tags */

.smartcms-related-posts {
    margin: 40px 0 0 0;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    border-top: 4px solid #3498db;
}

.smartcms-related-title {
    margin: 0 0 25px 0;
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.smartcms-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.smartcms-related-item {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.smartcms-related-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.smartcms-related-thumbnail {
    display: block;
    overflow: hidden;
    position: relative;
    padding-bottom: 60%; /* 5:3 ratio */
}

.smartcms-related-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.smartcms-related-item:hover .smartcms-related-thumbnail img {
    transform: scale(1.08);
}

.smartcms-related-content {
    padding: 18px;
}

.smartcms-related-item-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 600;
}

.smartcms-related-item-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.smartcms-related-item-title a:hover {
    color: #3498db;
}

.smartcms-related-excerpt {
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.smartcms-related-meta {
    font-size: 13px;
    color: #7f8c8d;
}

.smartcms-related-date {
    display: inline-block;
}

/* Layout: List */
.smartcms-layout-list .smartcms-related-grid {
    display: block;
}

.smartcms-layout-list .smartcms-related-item {
    display: flex;
    margin-bottom: 15px;
    border-radius: 6px;
}

.smartcms-layout-list .smartcms-related-item:last-child {
    margin-bottom: 0;
}

.smartcms-layout-list .smartcms-related-thumbnail {
    flex-shrink: 0;
    width: 150px;
    padding-bottom: 0;
    height: 100px;
}

.smartcms-layout-list .smartcms-related-thumbnail img {
    position: relative;
    height: 100%;
}

.smartcms-layout-list .smartcms-related-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.smartcms-layout-list .smartcms-related-item-title {
    margin-bottom: 5px;
}

/* Layout: Compact */
.smartcms-layout-compact .smartcms-related-grid {
    display: block;
}

.smartcms-layout-compact .smartcms-related-item {
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    border-left: 3px solid #3498db;
}

.smartcms-layout-compact .smartcms-related-item:last-child {
    margin-bottom: 0;
}

.smartcms-layout-compact .smartcms-related-thumbnail {
    display: none;
}

.smartcms-layout-compact .smartcms-related-content {
    padding: 0;
    width: 100%;
}

.smartcms-layout-compact .smartcms-related-item-title {
    margin: 0;
    font-size: 15px;
}

.smartcms-layout-compact .smartcms-related-meta {
    display: inline-block;
    margin-left: 10px;
}

.smartcms-layout-compact .smartcms-related-excerpt {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .smartcms-related-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .smartcms-related-posts {
        padding: 20px 15px;
        margin: 30px -15px 0;
        border-radius: 0;
    }
    
    .smartcms-related-title {
        font-size: 20px;
    }
    
    /* List layout mobile */
    .smartcms-layout-list .smartcms-related-item {
        flex-direction: column;
    }
    
    .smartcms-layout-list .smartcms-related-thumbnail {
        width: 100%;
        height: 150px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .smartcms-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Admin editor style */
.smartcms-related-refresh {
    padding: 10px 12px;
    border-top: 1px solid #ddd;
}

.smartcms-related-refresh strong {
    color: #23282d;
}
