.fwpl-layout.listing--blog,
.fwpl-layout.galleries {
    display: grid;
    gap: var(--global-row-gutter-md, 24px);
    grid-template-columns: minmax(0, 1fr);
}

.fwpl-layout.listing--blog > .fwpl-result {
    min-width: 0;
    border: none;
    background-color: var(--global-palette9);
    padding: 0  var(--wp--preset--spacing--xs) var(--wp--preset--spacing--sm);
}

.fwpl-layout.listing--blog .listing-card__image {
    margin-inline: calc(-1 *var(--wp--preset--spacing--xs));
    margin-bottom: var(--wp--preset--spacing--sm);
}

.listing-card__image img {
    aspect-ratio: 1;
    object-fit: cover;
}

.fwpl-layout.galleries {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fwpl-layout.galleries > .fwpl-result {
    position: relative;
    min-width: 0;
    aspect-ratio: 3 / 2;
    border: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* The gallery archive follows the Inspiration Gallery Mobile frame wherever its mobile Filter button shows. */
@media screen and (max-width: 767px) {
    .post-type-archive-gallery_cpt #inner-wrap {
        background-color: var(--global-palette9);
    }

    .post-type-archive-gallery_cpt #inner-wrap h1 {
        margin-top: 6px;
        margin-bottom: 4px;
    }

    .post-type-archive-gallery_cpt #inner-wrap .modal-trigger {
        padding-top: 10px;
        padding-bottom: 10px;
        border: 2px solid var(--global-palette3);
        background-color: var(--global-palette9);
        color: var(--global-palette3);
        line-height: 20px;
    }

    .post-type-archive-gallery_cpt #inner-wrap .modal-trigger:hover,
    .post-type-archive-gallery_cpt #inner-wrap .modal-trigger:focus-visible {
        border-color: var(--global-palette3);
        background-color: var(--global-palette3);
        color: var(--global-palette9);
    }

    .post-type-archive-gallery_cpt #inner-wrap .modal-trigger:focus-visible {
        outline: 2px solid var(--global-palette3);
        outline-offset: 2px;
    }
}

@media screen and (max-width: 599px) {
    .fwpl-layout.galleries > .fwpl-result {
        aspect-ratio: 335 / 220;
    }
}

/* Horizontal Listing Specific Styles */

.fwpl-layout.horizontal {
    gap: 0 !important;
}

.fwpl-layout.horizontal .fwpl-result  {
    margin-bottom: var(--wp--preset--spacing--sm);
    padding: var(--wp--preset--spacing--sm);
    border-bottom: none;
    background-color: var(--global-palette9);
}
body .fwpl-layout.horizontal .fwpl-row {
   display: grid;
   position: relative;
   column-gap: var(--wp--preset--spacing--gap-md);
}

/* Default (desktop/tablet) layout: image + content */
body .fwpl-layout.horizontal .fwpl-row.listing-card--horizontal.listing-card--has-image {
   grid-template-columns: 20% 1fr;
}

/* No-image layout: content only */
body .fwpl-layout.horizontal .fwpl-row.listing-card--horizontal.listing-card--no-image {
   grid-template-columns: 1fr;
}

body .fwpl-layout.horizontal .listing-card--no-image .listing-card__image {
   display: none;
}

@media screen and (max-width: 600px) {
   body .fwpl-layout.horizontal .fwpl-row {
       grid-template-columns: 1fr;
   }

   .fwpl-layout.horizontal .listing-card__image img {
       width: 100%;
   }
}

.fwpl-layout.horizontal .listing-card__image {
   margin-bottom: 0;
}


/* End Horizontal Listing Specific Styles */
