/* Grid Layout */
.mosaic-gallery .isotope-wrapper {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
}

.mosaic-gallery .isotope-container {
    position: relative;
    margin: 0 auto;
}

.mosaic-gallery .tmb {
    position: relative;
    float: left;
}

/* Column Classes */
.mosaic-gallery .tmb-iso-w12 { width: 100%; }
.mosaic-gallery .tmb-iso-w6 { width: 50%; }
.mosaic-gallery .tmb-iso-w4 { width: 33.333%; }
.mosaic-gallery .tmb-iso-w3 { width: 25%; }

/* Gutter Handling */
.mosaic-gallery .tmb {
    padding: 15px;
}

.mosaic-gallery .no-gutter .tmb {
    padding: 0;
}

.mosaic-gallery .small-gutter .tmb {
    padding: 5px;
}

.mosaic-gallery .large-gutter .tmb {
    padding: 30px;
}

/* Responsive */
@media (max-width: 959px) {
    .mosaic-gallery .tmb-iso-w3,
    .mosaic-gallery .tmb-iso-w4 {
        width: 33.3333% !important;
    }
}

@media (max-width: 668px) {
    .mosaic-gallery .tmb-iso-w3,
    .mosaic-gallery .tmb-iso-w4 {
        width: 50% !important;
    }
}

@media (max-width: 479px) {
    .mosaic-gallery .tmb-iso-w3,
    .mosaic-gallery .tmb-iso-w4,
    .mosaic-gallery .tmb-iso-w6 {
        width: 100% !important;
    }
}

/* Entry Visuals */
.mosaic-gallery .t-entry-visual {
    position: relative;
    overflow: hidden;
    backface-visibility: hidden;
}

.mosaic-gallery .t-entry-visual-tc {
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

/* Hover Effects */
.mosaic-gallery .hover-wrap {
    display: block;
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s ease-in-out;
}

.mosaic-gallery .tmb:hover .hover-wrap {
    transform: scale(1.05);
}

/* Video Play Button */
.mosaic-gallery .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
}

.mosaic-gallery .play-button:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 15px 0 15px 25px;
    border-color: transparent transparent transparent white;
}

/* PhotoSwipe Customization */
.mosaic-gallery .pswp__bg {
    background: rgba(0, 0, 0, 0.9);
}

.mosaic-gallery .pswp__video-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1045;
}

.mosaic-gallery .pswp__video-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.mosaic-gallery .pswp__video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.mosaic-gallery {
    width: 100%;
    margin: 0 auto;
}

.mosaic-gallery .gallery-item {
    width: calc(33.333% - 20px);
    margin-bottom: 20px;
}

.mosaic-gallery .gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.mosaic-gallery .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
}

.mosaic-gallery .play-button:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 20px;
    border-color: transparent transparent transparent #ffffff;
}

.mosaic-gallery .youtube-preview-wrapper {
    position: relative;
    padding: 0;
    height: 100%;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    cursor: pointer;
}

.mosaic-gallery .youtube-preview-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.mosaic-gallery .tmb-content-holder {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Optional: Add a play button overlay */
.mosaic-gallery .youtube-preview-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.2);
    z-index: 1;
    transition: background 0.3s ease;
}

.mosaic-gallery .youtube-preview-wrapper:hover::after {
    background: rgba(0,0,0,0.4);
}