.moduletable:has(.phocagalleryrandom-grid) {
    display: grid;
}
.phocagalleryrandom-grid {
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-block: 0.5em;
    container-type: inline-size;
    container-name: phocarandom;
}

.phocagalleryrandom-item {
    flex-grow: 1;
    flex-basis: 31%;
    padding: 0;
    display: grid;
    overflow: hidden;
    position: relative;
    border-radius: 0.4em;
}


.phocagalleryrandom-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.phocagalleryrandom-item__image {
    transition: 400ms;
}
@media (pointer: fine) {
    .phocagalleryrandom-item__image:hover {
        transform: scale(1.03);
        box-shadow: 0px 0px 8px 1px hwb(0deg 55.84% 42.91%);
    }
}
.phocagalleryrandom-item__title {
    font-size: 0.9rem;
    bottom: 0;
    position: absolute;
    padding: 0.5em;
    background: #ccc;
    opacity: 0.76;
    width: 100%;
    box-shadow: 0 4px 11px 7px;
}
.phocagalleryrandom_btn {
    padding: 0.5em;
    background-color: #ccc;
    place-self: end;
    display: inline-block;
    margin-block: 0.5em;
}
/* --- Media Query für mobile Displays --- */
@media (max-width: 768px) { 
    .phocagalleryrandom-grid {
        flex-wrap: nowrap; 
        overflow-x: auto;   
        -webkit-overflow-scrolling: touch; /* Verbessert das Scrolling-Erlebnis auf iOS */
        gap: 0.8em; 
        padding-bottom: 1em; 
    }

    .phocagalleryrandom-item {
        flex: 0 0 auto; 
        width: 70%; 
        max-width: 250px; 
        grid-template-rows: 180px auto; 
    }

}