/* ------------------------------------------------------------------------------------------------------------ Lisitng cards -- */

/* equal-height cards */
#lsw>.swiper-wrapper>.swiper-slide {
    height: auto;
    display: flex;
}

#lsw .car {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#lsw .car .bd {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

#lsw .car .bd .btn {
    margin-top: auto;
}

/* button always at the bottom */

/* equal-size image box */
#lsw .car .im {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

#lsw .car-gallery,
#lsw .car-gallery .swiper-wrapper,
#lsw .car-gallery .swiper-slide {
    width: 100%;
    height: 100%;
}

#lsw .car-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#lsw .car .vb,
#lsw .car .fav {
    z-index: 5;
}

/* gallery dots + arrows */
#lsw .car-gallery .swiper-pagination {
    bottom: 8px;
}

#lsw .car-gallery .swiper-pagination-bullet {
    background: #fff;
    opacity: .6;
}

#lsw .car-gallery .swiper-pagination-bullet-active {
    opacity: 1;
}

#lsw .cg-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    opacity: 0;
    transition: opacity .2s;
}

#lsw .cg-prev {
    inset-inline-start: 8px;
}

#lsw .cg-next {
    inset-inline-end: 8px;
}

#lsw .im:hover .cg-btn {
    opacity: 1;
}

@media (hover: none) {
    #lsw .cg-btn {
        display: none;
    }
}

/* phones: swipe only */

/* spec chips */
#lsw .specs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 26px;
}

#lsw .specs span {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--s2, #eee);
    color: var(--t, inherit);
}

/* pre-init layout for the card sliders */
#lsw:not(.swiper-initialized),
#blog-swiper:not(.swiper-initialized) {
    --n: 1.15;
    --g: 14px;
    overflow: hidden;
}

@media (min-width: 480px) {

    #lsw:not(.swiper-initialized),
    #blog-swiper:not(.swiper-initialized) {
        --n: 1.5;
        --g: 16px;
    }
}

@media (min-width: 768px) {

    #lsw:not(.swiper-initialized),
    #blog-swiper:not(.swiper-initialized) {
        --n: 2.3;
        --g: 20px;
    }
}

@media (min-width: 1024px) {

    #lsw:not(.swiper-initialized),
    #blog-swiper:not(.swiper-initialized) {
        --n: 3.2;
        --g: 24px;
    }
}

@media (min-width: 1280px) {

    #lsw:not(.swiper-initialized),
    #blog-swiper:not(.swiper-initialized) {
        --n: 4;
        --g: 24px;
    }
}

#lsw:not(.swiper-initialized)>.swiper-wrapper,
#blog-swiper:not(.swiper-initialized)>.swiper-wrapper {
    gap: var(--g);
}

#lsw:not(.swiper-initialized)>.swiper-wrapper>.swiper-slide,
#blog-swiper:not(.swiper-initialized)>.swiper-wrapper>.swiper-slide {
    width: calc((100% - var(--g) * (var(--n) - 1)) / var(--n));
}

/* inner image gallery: show only the first photo until it starts */
.car-gallery:not(.swiper-initialized) .swiper-slide:not(:first-child) {
    display: none;
}


#blog-swiper .car .im {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

#blog-swiper .car .im img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
