/* Shared card gallery styles (Gallery Maker, Related Viruses) */
.gallery { display: flex; flex-wrap: wrap; }
.gallery:before, .gallery:after { display: none; }
.gallery > [class*="col-"] { display: flex; margin-bottom: 24px; }

/* Card */
.gallery-card {
    width: 100%;
    padding: 16px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}
.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, .18);
}

.gallery-card.no-box,
.gallery-card.no-box:hover {
    background: transparent;
    box-shadow: none;
    transform: none;
}

/* Fixed image area (must match maxPicW in Gallery_Maker.js) */
.gallery-media {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-media img {
    object-fit: contain;
}

/* Same-size images: fill the image area */
.gallery-uniform .gallery-media img {
    width: 100%;
    height: 100%;
}

/* Missing image placeholder */
.gallery-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border: 1px dashed #ccc;
    border-radius: 4px;
    color: #999;
    font-size: .9em;
}

/* Text Styles */
.gallery-title {
    margin: 12px 0 6px;
    font-weight: bold;
}
.gallery-desc {
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

/* Related Viruses section headings */
.related-heading { margin: 24px 0 16px; }
.related-empty { margin-bottom: 24px;}

/* Very narrow screens: one card per row */
@media (max-width: 480px) {
    .gallery > [class*="col-"] {
        width: 100%;
    }
}