/**
 * Stylesheet cho khu vực ảnh dư ở cuối bài viết (Dùng chung cho cả frontend và trong Visual Editor)
 */

.aid-extra-images-section {
    margin: 40px 0 25px 0;
    border-top: 1px dashed #cbd5e1;
    padding-top: 25px;
    clear: both;
    width: 100%;
}

.aid-extra-heading {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    line-height: 1.4;
}

.aid-extra-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

/* Các lớp số lượng cột */
.aid-cols-1 {
    grid-template-columns: 1fr;
}

.aid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.aid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.aid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Thẻ bọc từng ảnh dư */
.aid-extra-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.aid-extra-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    border-color: #cbd5e1;
}

.aid-extra-item img,
.aid-extra-item a img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
}

/* Caption dùng chung */
.aid-extra-caption {
    font-size: 0.875rem;
    color: #64748b;
    margin: 12px 0 0 0;
    font-style: italic;
    text-align: center;
    line-height: 1.4;
    word-break: break-word;
}

/* Responsive hiển thị trên thiết bị di động */
@media (max-width: 768px) {
    .aid-extra-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
        gap: 15px;
    }
    
    .aid-extra-images-section {
        margin-top: 30px;
        padding-top: 20px;
    }
}

@media (max-width: 480px) {
    .aid-extra-grid {
        grid-template-columns: 1fr !important;
    }
}