/**
 * FlowGallery — Custom styles
 *
 * @copyright  (C) 2026 FlowAds. All rights reserved.
 * @license    GNU General Public License version 2 or later
 */

/* ------------------------------------------------------------------ */
/*  Grid layout (default)                                             */
/* ------------------------------------------------------------------ */
.flowgallery--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ------------------------------------------------------------------ */
/*  Masonry layout (CSS columns fallback)                             */
/* ------------------------------------------------------------------ */
.flowgallery--masonry {
    column-count: 4;
    column-gap: 10px;
}

.flowgallery--masonry > a {
    display: inline-block;
    width: 100%;
    break-inside: avoid;
    margin-bottom: 10px;
}

.flowgallery--masonry > a > img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* ------------------------------------------------------------------ */
/*  Justified layout (flexbox)                                        */
/* ------------------------------------------------------------------ */
.flowgallery--justified {
    display: flex;
    flex-wrap: wrap;
}

.flowgallery--justified > a {
    flex-grow: 1;
}

.flowgallery--justified > a > img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    vertical-align: bottom;
}

/* ------------------------------------------------------------------ */
/*  Common thumbnail styles                                           */
/* ------------------------------------------------------------------ */
.flowgallery a {
    display: inline-block;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
}

.flowgallery a img {
    display: block;
    transition: transform 0.3s ease;
}

.flowgallery a:hover img {
    transform: scale(1.05);
}

/* ------------------------------------------------------------------ */
/*  Error messages                                                    */
/* ------------------------------------------------------------------ */
.flowgallery-error {
    color: #c00;
    padding: 8px 12px;
    background: #fff0f0;
    border: 1px solid #fcc;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ------------------------------------------------------------------ */
/*  Lightbox slot / drawer (sub-html area)                            */
/* ------------------------------------------------------------------ */
.flowgallery-slot {
    padding: 8px 16px;
    text-align: center;
}

.flowgallery-slot__caption {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: #eee;
}

.flowgallery-slot__module {
    margin-top: 8px;
}

/* When both caption and module are present, add a subtle separator */
.flowgallery-slot__caption + .flowgallery-slot__module {
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* ------------------------------------------------------------------ */
/*  FlowAds slot inside lightbox (JS-driven, kept for compatibility)  */
/* ------------------------------------------------------------------ */
.flowgallery-flowads {
    padding: 10px;
    text-align: center;
}

.flowgallery-flowads--below {
    width: 100%;
    position: relative;
    z-index: 10;
}

.flowgallery-flowads--sidebar {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    z-index: 10;
}

/* ------------------------------------------------------------------ */
/*  Responsive                                                        */
/* ------------------------------------------------------------------ */
@media (max-width: 768px) {
    .flowgallery--masonry {
        column-count: 2;
    }

    .flowgallery-flowads--sidebar {
        position: relative;
        width: 100%;
        right: auto;
        top: auto;
        transform: none;
    }

    .flowgallery-slot {
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .flowgallery--masonry {
        column-count: 1;
    }
}
