/* BLOOOW · Business marketplace cards — information/footer refresh, October 2026
   Scoped to /business/ so Events/Offers, catalog, related cards and the
   public listing-detail page retain their existing styles.
   Loaded after experience-v6.css to avoid another cascade override.
*/

.business-index-page {
    --card-art-surface: #101217;
    --card-art-outline: rgba(255, 255, 255, .055);
}

:root[data-theme="light"] .business-index-page {
    --card-art-surface: #edf0f5;
    --card-art-outline: rgba(20, 25, 34, .075);
}

/* Give images and text room on typical monitors; very wide monitors can
   still display five cards. Prevent a crowded 5-up grid on small desktops. */
.business-index-page .listing-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 15px;
}

.business-index-page .marketplace-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .045);
    text-decoration: none;
    transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.business-index-page .marketplace-card:hover,
.business-index-page .marketplace-card:focus-visible {
    transform: translateY(-2px);
    border-color: var(--blue-line);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .16);
}

.business-index-page .marketplace-card-body,
.business-index-page .marketplace-card:hover .marketplace-card-body,
.business-index-page .marketplace-card:focus-visible .marketplace-card-body {
    background: var(--surface);
    color: var(--text);
}

/* A derivative is now a true proportional WebP; the frame, not the image
   file, supplies the shared aspect ratio. Existing 4:3 derivatives continue
   to render safely until the optional rebuild command is run. */
.business-index-page .marketplace-card-media {
    position: relative;
    flex: none;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 3;
    isolation: isolate;
    overflow: hidden;
    background: var(--card-art-surface);
    border-bottom: 1px solid var(--card-art-outline);
    box-shadow: none;
}

/* A very soft duplicate fills the unused space around a full poster/logo;
   no visible cropping of the real foreground asset. */
.business-index-page .marketplace-card-media.has-listing-art::before {
    content: "";
    position: absolute;
    inset: -12px;
    z-index: 0;
    background: var(--listing-art) center / cover no-repeat;
    filter: blur(22px) saturate(.72) brightness(.48);
    opacity: .54;
    transform: scale(1.09);
    pointer-events: none;
}

:root[data-theme="light"] .business-index-page .marketplace-card-media.has-listing-art::before {
    filter: blur(22px) saturate(.76) brightness(1.12);
    opacity: .34;
}

.business-index-page .marketplace-card-media.has-listing-art::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.015), rgba(0,0,0,.10));
    pointer-events: none;
}

:root[data-theme="light"] .business-index-page .marketplace-card-media.has-listing-art::after {
    background: linear-gradient(180deg, rgba(255,255,255,.045), transparent);
}

.business-index-page .marketplace-card-media img {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    margin: 0;
    padding: 0;
    max-width: none;
    object-fit: contain;
    object-position: center;
    background: transparent;
    filter: none;
    transform: none !important;
    transition: none;
}

/* Photos can opt in to a frame-filling crop in Django Admin. All existing
   uploads stay on the safe 'show full image' setting by default. */
.business-index-page .marketplace-card-media.media-fit-cover img {
    object-fit: cover;
    transform: scale(1) !important;
    transition: transform 220ms ease;
}

@media (hover: hover) {
    .business-index-page .marketplace-card:hover .marketplace-card-media.media-fit-cover img {
        transform: scale(1.025) !important;
    }
}

.business-index-page .marketplace-card .listing-image-fallback {
    position: relative;
    z-index: 1;
    background: transparent;
    color: #e4e8f5;
    font-size: .72rem;
    letter-spacing: .17em;
}

/* Content first: a one-line title takes one line (not a reserved two-line
   slot). Business profiles display their actual subcategory, never a price. */
.business-index-page .marketplace-card-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 11px 14px 10px;
}

.business-index-page .listing-card-details {
    min-width: 0;
    padding-bottom: 9px;
}

.business-index-page .listing-type-label {
    margin: 0 0 5px;
    color: var(--blue-strong);
    font-size: .63rem;
    line-height: 1.2;
    font-weight: 850;
    letter-spacing: .08em;
    opacity: 1;
}

.business-index-page .listing-title {
    min-height: 0;
    margin: 0;
    color: var(--text);
    font-size: .98rem;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -.02em;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.business-index-page .listing-advertiser,
.business-index-page .listing-subcategory {
    display: block;
    min-width: 0;
    margin: 5px 0 0;
    color: var(--muted-strong);
    font-size: .72rem;
    line-height: 1.35;
    font-weight: 500;
    opacity: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.business-index-page .listing-subcategory {
    color: var(--muted);
}

.business-index-page .listing-price {
    margin: 6px 0 0;
    color: var(--text);
    font-size: .84rem;
    line-height: 1.3;
    font-weight: 780;
    overflow-wrap: anywhere;
}

.business-index-page .listing-price-soft {
    color: var(--muted-strong);
    font-weight: 700;
}

.business-index-page .listing-price-free {
    color: var(--blue-strong);
}

/* One compact, aligned footer for both location and engagement. A row's cards
   can vary in detail length, while all footers stay on the same baseline. */
.business-index-page .listing-card-footer {
    min-width: 0;
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--line);
}

.business-index-page .listing-card-details + .listing-card-footer {
    margin-top: auto;
}

.business-index-page .listing-location {
    min-width: 0;
    flex: 1 1 auto;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: .69rem;
    line-height: 1.3;
    font-weight: 500;
    opacity: 1;
}

.business-index-page .listing-location > span:last-child {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.business-index-page .listing-meta-icon {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    margin: 0;
}

.business-index-page .listing-engagement {
    flex: 0 0 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    color: var(--muted);
    font-size: .66rem;
    line-height: 1.3;
    font-weight: 550;
    opacity: 1;
}

.business-index-page .listing-engagement > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.business-index-page .listing-eye-icon,
.business-index-page .listing-heart-icon {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Badge positions/styles are inherited from the existing verification and
   Spotlight system; keep both visible above the media/backdrop. */
.business-index-page .marketplace-card-media .listing-card-badge {
    z-index: 3;
}

@media (min-width: 1880px) {
    .business-index-page .listing-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 1179px) and (min-width: 821px) {
    .business-index-page .listing-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 13px;
    }
}

@media (max-width: 820px) and (min-width: 641px) {
    .business-index-page .listing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

/* Keep horizontal mobile cards and a single-line footer. Long location
   labels truncate gracefully instead of pushing views/likes below them. */
@media (max-width: 640px) {
    .business-index-page .listing-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .business-index-page .marketplace-card {
        display: grid;
        grid-template-columns: clamp(112px, 34%, 136px) minmax(0, 1fr);
        min-height: 142px;
        height: auto;
        border-radius: 13px;
    }

    .business-index-page .marketplace-card-media {
        min-height: 142px;
        height: 100%;
        aspect-ratio: auto;
        border-bottom: none;
        border-right: 1px solid var(--card-art-outline);
    }

    .business-index-page .marketplace-card-media.has-listing-art::before {
        filter: blur(17px) saturate(.72) brightness(.48);
        opacity: .56;
    }

    .business-index-page .marketplace-card-body {
        min-height: 142px;
        padding: 10px 12px 9px;
    }

    .business-index-page .listing-type-label {
        margin-bottom: 4px;
        font-size: .61rem;
    }

    .business-index-page .listing-title {
        font-size: .88rem;
        line-height: 1.23;
    }

    .business-index-page .listing-advertiser,
    .business-index-page .listing-subcategory {
        margin-top: 4px;
        font-size: .69rem;
    }

    .business-index-page .listing-price {
        margin-top: 5px;
        font-size: .79rem;
    }

    .business-index-page .listing-card-details {
        padding-bottom: 8px;
    }

    .business-index-page .listing-card-footer {
        padding-top: 7px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .business-index-page .listing-location {
        min-width: 0;
        flex: 1 1 auto;
        font-size: .67rem;
        gap: 4px;
        white-space: nowrap;
    }

    .business-index-page .listing-location > span:last-child {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .business-index-page .listing-engagement {
        min-width: max-content;
        flex: 0 0 auto;
        gap: 8px;
        font-size: .64rem;
        white-space: nowrap;
    }

    .business-index-page .listing-meta-icon {
        width: 12px;
        height: 12px;
        flex-basis: 12px;
    }

    .business-index-page .listing-eye-icon,
    .business-index-page .listing-heart-icon {
        width: 12px;
        height: 12px;
        flex-basis: 12px;
    }
}

@media (max-width: 365px) {
    .business-index-page .marketplace-card {
        grid-template-columns: 108px minmax(0, 1fr);
    }
    .business-index-page .marketplace-card-body {
        padding-inline: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .business-index-page .marketplace-card,
    .business-index-page .marketplace-card-media img {
        transition: none !important;
        transform: none !important;
    }
}
