/**
 * MARKETPLACE-CARD-SYSTEM-1A — Marketplace-only additions to the shared card.
 * Markup: inc/apt-marketplace-card.php (apt_marketplace_card_render()),
 *         templates/apt-marketplace-grid.php (Marketplace root grid).
 * The shared anatomy (.apt-rqc*) comes from apt-request-card.css.
 */

/* ---------- Status pills (real Sold / Featured / listing type only) ---------- */

.apt-mktc .apt-mktc__pill--sold {
	background: #B42318;
	color: #FFFFFF;
}

.apt-mktc .apt-mktc__pill--featured {
	background: #F79009;
	color: #FFFFFF;
}

.apt-mktc .apt-mktc__pill--type {
	background: #1A2E52;
	color: #FFFFFF;
}

/* ---------- Price ---------- */

.apt-mktc .apt-mktc__price {
	margin: 0;
}

/* ---------- Seller row ---------- */

.apt-mktc .apt-mktc__seller .apt-rqc__requester-id {
	align-items: flex-start;
}

.apt-mktc .apt-mktc__seller .apt-rqc__requester-name {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

/* ACADP's archive stylesheet targets generic elements inside `.acadp`;
   keep the shared card's own typography and link colours. */
.apt-mktc-archive .apt-mktc a,
.apt-mktc-archive .apt-mktc a:hover {
	text-decoration: none;
}

.apt-mktc-archive .apt-mktc .apt-rqc__cta,
.apt-mktc-archive .apt-mktc .apt-rqc__cta:hover,
.apt-mktc-archive .apt-mktc .apt-rqc__cta:focus-visible {
	color: #FFFFFF;
}

.apt-mktc-archive .apt-mktc a.apt-rqc__requester-id {
	color: inherit;
}

/* The Marketplace page's kit heading rules otherwise win over the shared
   card title (16px / 400). Restore the shared card title exactly. */
.apt-mktc-archive .apt-mktc .apt-rqc__title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.35;
	color: var( --apt-rqc-text );
}

/* =========================================================
   Marketplace root grid — columns follow the grid's own container
   width, not the viewport (same principle as the Home Request/Service
   grids). The Marketplace content container tops out at ~1120px, so the
   widest layout is 3 columns (~360px cards); never 4 narrow cards:
     container < 560px     1 column
     560px – 939px         2 columns
     >= 940px              3 columns
   Without container-query support: auto-fill columns of at least 300px.
   ========================================================= */

.apt-mktc-archive {
	container-type: inline-size;
	container-name: apt-mkt-cards;
}

.apt-mktc-archive .apt-mktc-archive__grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( min( 100%, 300px ), 1fr ) );
	gap: 1.25rem;
	align-items: stretch;
}

@container apt-mkt-cards ( max-width: 559.98px ) {
	.apt-mktc-archive .apt-mktc-archive__grid {
		grid-template-columns: minmax( 0, 1fr );
	}
}

@container apt-mkt-cards ( min-width: 560px ) and ( max-width: 939.98px ) {
	.apt-mktc-archive .apt-mktc-archive__grid {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@container apt-mkt-cards ( min-width: 940px ) {
	.apt-mktc-archive .apt-mktc-archive__grid {
		grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	}
}
