/**
 * Multi-Image Display Styles
 * Styles for displaying 2 images in posts
 */

/* Override single image max-height for larger display */
.post-image img {
    max-height: 600px !important;
}

/* Grid layout for 2 images */
.post-images-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    border-radius: 12px;
    overflow: hidden;
}

.post-images-grid .post-image {
    margin: 0;
    border-radius: 0;
    overflow: hidden;
}

.post-images-grid .post-image:first-child {
    border-radius: 12px 0 0 12px;
}

.post-images-grid .post-image:last-child {
    border-radius: 0 12px 12px 0;
}

.post-images-grid .post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 350px;
    max-height: 600px;
}

/* Image preview in create post modal */
#imagePreview {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

/* Hide upload prompt when images are present */
#imagePreview:not([style*="display: none"]) ~ .upload-icon,
#imagePreview:not([style*="display: none"]) ~ .upload-text,
#imagePreview:not([style*="display: none"]) ~ .upload-hint {
    display: none !important;
}

/* Alternative: hide upload prompts when preview is active */
.image-upload-area.has-images .upload-icon,
.image-upload-area.has-images .upload-text,
.image-upload-area.has-images .upload-hint {
    display: none !important;
}

.image-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.image-preview-item img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.image-preview-item .remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.image-preview-item .remove-image:hover {
    background: rgba(255, 71, 87, 0.9);
    transform: scale(1.1);
}

.add-another-image {
    min-height: 150px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s ease;
}

.add-another-image:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.add-another-image i {
    font-size: 24px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.5);
}

.add-another-image div {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .post-images-grid {
        gap: 6px;
    }
    
    .post-images-grid .post-image img {
        min-height: 200px;
        max-height: 400px;
    }
    
    .post-image img {
        max-height: 400px !important;
    }
}

/* Single image in grid (fallback) */
.post-images-grid .post-image:only-child {
    grid-column: 1 / -1;
    border-radius: 12px;
}
