/* Shared marketplace listing card. Used by the browse grid and publish review.
   Restrained treatment: byline below title, inline metadata tags, kebab on
   hover, suppressed zero-stat row. The featured-hero slot is the only one
   wearing the full amber bracket frame; cards stay quiet so the hero stands
   out. */

.marketplace-card {
    border: 1px solid #1f1f1f;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    position: relative;
    transition: border-color 150ms ease, transform 150ms ease;
}

.marketplace-card:hover {
    border-color: #3a3a3a;
}

.marketplace-card[data-href] { cursor: pointer; }
.marketplace-card[data-href]:hover { border-color: #FFBF00; }
.marketplace-card[data-href]:hover .marketplace-card-title { color: #ffd24d; }

/* The card clips its contents (cover zoom) by default, which would also clip
   the absolutely-positioned actions dropdown. On mobile the card is a short
   row and the menu always overruns its bottom edge, so let the menu escape
   only while it's open, and lift the card so the dropdown paints above
   neighbours. */
.marketplace-card:has(.marketplace-card-menu-btn[aria-expanded="true"]) {
    overflow: visible;
    z-index: 5;
}

.marketplace-card--preview {
    max-width: 360px;
    margin: 0 auto;
}

.marketplace-card-topbar {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 10px;
    color: #6a6a6a;
    font-size: 11px;
    letter-spacing: 0.08em;
}

.marketplace-card-time {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6a6a6a;
}

.marketplace-card-menu {
    color: #6a6a6a;
    font-size: 16px;
    line-height: 1;
}

.marketplace-card-menu-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.marketplace-card-menu-btn {
    width: 26px;
    height: 26px;
    border: 1px solid transparent;
    background: transparent;
    color: #8c8c8c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.marketplace-card-menu-btn:hover,
.marketplace-card-menu-btn:focus-visible,
.marketplace-card-menu-btn[aria-expanded="true"] {
    border-color: #3a3a3a;
    background: #161616;
    color: #FFBF00;
    outline: none;
}

.marketplace-card-actions-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 4;
    min-width: 170px;
    border: 1px solid #333333;
    background: #0f0f0f;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    padding: 5px;
}

.marketplace-card-actions-menu a,
.marketplace-card-actions-menu button {
    width: 100%;
    border: 0;
    background: transparent;
    color: #d8d8d8;
    display: flex;
    align-items: center;
    gap: 10px;
    font: inherit;
    font-size: 12px;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    padding: 9px 10px;
    cursor: pointer;
}

.marketplace-card-actions-menu a:hover,
.marketplace-card-actions-menu button:hover,
.marketplace-card-actions-menu a:focus-visible,
.marketplace-card-actions-menu button:focus-visible {
    background: #1c1c1c;
    color: #FFBF00;
    outline: none;
}

.marketplace-card-cover {
    aspect-ratio: 16 / 10;
    background: #050505;
    display: block;
    overflow: hidden;
    position: relative;
}

.marketplace-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 320ms ease;
}

.marketplace-card:hover .marketplace-card-cover img { transform: scale(1.03); }

.marketplace-card-body {
    border-top: 1px solid #1a1a1a;
    background: #111111;
    padding: 14px 14px 16px;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Title + kebab on one row: title grows, the menu sits flush right and does
   not shrink. */
.marketplace-card-titlerow {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.marketplace-card-titlerow .marketplace-card-menu-wrap {
    flex: 0 0 auto;
}

.marketplace-card-title {
    color: #FFBF00;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-style: italic;
    font-weight: normal;
    font-size: 19px;
    line-height: 1.18;
    margin: 0;
    overflow-wrap: anywhere;
}

.marketplace-card-titlerow .marketplace-card-title {
    flex: 1 1 auto;
    min-width: 0;
}

/* Byline now lives below the title. Artwork + identity lead; recency is meta. */
.marketplace-card-byline {
    color: #6a6a6a;
    font-size: 11px;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -2px 0 2px;
    min-width: 0;
}

.marketplace-card-author {
    color: #b7b7b7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.marketplace-card-byline-sep {
    color: #3a3a3a;
}

.marketplace-card-summary {
    color: #b7b7b7;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

/* Inline metadata: no border, divider separator. Single line, clipped when
   the card is too narrow; visually distinct from filter pills above the
   grid. */
.marketplace-card-tags {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0;
    min-width: 0;
    overflow: hidden;
}

.marketplace-card-tag {
    color: #8c8c8c;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 0;
    border: none;
}

.marketplace-card-tag + .marketplace-card-tag {
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid #2a2a2a;
}

/* One row: tags left, stats pinned right (margin-left auto on the stats, so
   a stats-only foot still lands right), everything on the same vertical
   center line under a dashed rule. renderCard always has the heart in the
   foot; the legacy render() emits the foot only when it has content, so the
   rule never dangles on an empty card. */
.marketplace-card-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px dashed #1a1a1a;
}

.marketplace-card-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #8c8c8c;
    font-size: 12px;
    flex-shrink: 0;
    margin-left: auto;
}

.marketplace-card-stats .stat-likes,
.marketplace-card-stats .stat-forks {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.marketplace-card-stats[hidden] { display: none; }

/* Like heart. Shared with the listing detail page (.mp-listing-stats .heart in
   marketplace_listing_page.css); the button lives on the card, so its base
   styling lives here in the card component, not the page CSS. */
.marketplace-card .heart {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 8px;
    background: transparent;
    border: 1px solid var(--text-dim, #8c8c8c);
    color: var(--text-dim, #8c8c8c);
    cursor: pointer;
    font: inherit;
}

.marketplace-card .heart.heart-filled {
    color: #FFBF00;
    border-color: #FFBF00;
}

.marketplace-card .heart[disabled] {
    opacity: 0.6;
    cursor: wait;
}

/* Mobile list-row layout. Cover square on the left, title + tight meta on the
   right. Topbar (kebab), summary, and stats are hidden so each row stays
   compact and a single screen can show many. */
@media (max-width: 640px) {
    .marketplace-card {
        flex-direction: row;
        align-items: stretch;
    }
    .marketplace-card-topbar { display: none; }

    .marketplace-card-cover {
        aspect-ratio: auto;
        width: 96px;
        height: auto;
        flex-shrink: 0;
        align-self: stretch;
        border-right: 1px solid #1a1a1a;
    }
    .marketplace-card:hover .marketplace-card-cover img { transform: none; }

    .marketplace-card-body {
        border-top: 0;
        padding: 10px 12px 10px 12px;
        gap: 4px;
        min-width: 0;
    }
    .marketplace-card-title {
        font-size: 15px;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .marketplace-card-byline {
        font-size: 10px;
        margin: 0;
    }
    .marketplace-card-summary {
        font-size: 11.5px;
        line-height: 1.4;
        color: #8c8c8c;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .marketplace-card-foot {
        padding-top: 2px;
        gap: 8px;
        border-top: 0;
    }
    .marketplace-card-stats {
        gap: 10px;
        font-size: 10.5px;
        color: #6a6a6a;
    }
    /* Compact heart for the list row; the desktop 44px tap target would
       double the row's height. */
    .marketplace-card .heart {
        min-width: 36px;
        min-height: 30px;
        padding: 0 6px;
        gap: 4px;
    }
    .marketplace-card-tag {
        font-size: 10px;
        letter-spacing: 0.06em;
    }
}
