/* retoor <retoor@molodetz.nl> */

.attachment-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.attachment-gallery-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-card-hover);
}

.attachment-gallery-item:hover {
    transform: scale(1.05);
}

.attachment-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-gallery-item:has(.gallery-video) {
    width: 100%;
    max-width: 480px;
    height: auto;
    aspect-ratio: 16 / 9;
    cursor: default;
    background: #000;
}

.attachment-gallery-item:has(.gallery-video):hover {
    transform: none;
}

.attachment-gallery-item .gallery-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.attachment-gallery-item .non-image {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-secondary);
}

.attachment-gallery-item .non-image .icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.attachment-gallery-item .non-image .name {
    font-size: 0.6875rem;
    word-break: break-all;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-gallery-item .non-image .size {
    font-size: 0.625rem;
    color: var(--text-muted);
}

.attachment-gallery-item .non-image:hover {
    color: var(--accent);
}

@media (max-width: 480px) {
    .attachment-gallery-item {
        width: 80px;
        height: 80px;
    }
}
