/**
 * ContentFactory Media Blocks — Front-end Styles
 *
 * Minimal CSS so galleries look reasonable out-of-the-box and integrate
 * cleanly with Flatsome's grid. Override freely in your child theme.
 */

/* ── Shared wrapper ──────────────────────────────────────────────────────── */
.cf-media {
    margin: 1.5rem 0;
    line-height: 0; /* collapse figure gaps */
}

.cf-media__item {
    margin: 0;
    overflow: hidden;
    position: relative;
}

.cf-media__link {
    display: block;
    line-height: 0;
}

.cf-media__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.cf-media__item:hover .cf-media__img {
    transform: scale( 1.03 );
}

.cf-media__caption {
    line-height: 1.4;
    font-size: 0.8rem;
    color: #666;
    padding: 4px 2px 0;
}

/* ── hero_grid ────────────────────────────────────────────────────────────── */
/*
 * Up to 4 images: 1 large image on the left + smaller images stacked right.
 * Falls back to a simple two-column grid for fewer images.
 */
.cf-variant-hero_grid {
    display: grid;
    gap: 6px;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto;
}

.cf-variant-hero_grid .cf-media__item:first-child {
    grid-row: span 2;
}

@media ( max-width: 600px ) {
    .cf-variant-hero_grid {
        grid-template-columns: 1fr;
    }
    .cf-variant-hero_grid .cf-media__item:first-child {
        grid-row: span 1;
    }
}

/* ── inline_3 ─────────────────────────────────────────────────────────────── */
/*
 * Three equal-width columns (all images same size).
 */
.cf-variant-inline_3 {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat( 3, 1fr );
}

@media ( max-width: 600px ) {
    .cf-variant-inline_3 {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── slider ───────────────────────────────────────────────────────────────── */
/*
 * Horizontal scroll strip — no JS required, native CSS scroll snap.
 * Works seamlessly alongside Flatsome's built-in slider components.
 */
.cf-variant-slider {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.cf-variant-slider .cf-media__item {
    flex: 0 0 min( 340px, 80vw );
    scroll-snap-align: start;
    max-height: 280px;
}

.cf-variant-slider .cf-media__img {
    max-height: 280px;
}
