/* ============================================================================
   card.css — competition card component + responsive card grid.
   Shared between homepage Featured Competitions section and the shop archive
   (/competitions/), so the same .dtr-card markup renders identically in both
   places. Gated in inc/enqueue.php to is_front_page() || is_home() || is_shop()
   || product taxonomies. Zero selector duplication with home.css.
   ============================================================================ */

/* --- Card grid (reused by .dtr-featured__grid and shop ul.products) -------- */
.dtr-card-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 600px)  { .dtr-card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .dtr-card-grid { grid-template-columns: repeat(3, 1fr); } }

/* WooCommerce shop archive uses <ul class="products">. Reset list chrome and
 * apply the same responsive grid so cards line up like the homepage. */
.woocommerce ul.products,
.woocommerce-page ul.products {
	display: grid;
	gap: 24px;
	grid-template-columns: 1fr;
	list-style: none;
	margin: 0 0 32px;
	padding: 0;
}
@media (min-width: 600px) {
	.woocommerce ul.products,
	.woocommerce-page ul.products { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
	.woocommerce ul.products,
	.woocommerce-page ul.products { grid-template-columns: repeat(3, 1fr); }
}
/* Each <li class="product"> is just a transparent wrapper around .dtr-card. */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
	list-style: none;
	margin: 0;
	padding: 0;
	width: auto;
	float: none;
	background: transparent;
	border: 0;
}
.woocommerce ul.products li.product::before,
.woocommerce-page ul.products li.product::before { content: none; }

/* --- Card ------------------------------------------------------------------ */
.dtr-card { background: var(--dtr-white); border: 1px solid var(--dtr-grey-100); border-radius: var(--dtr-radius-lg); overflow: hidden; box-shadow: var(--dtr-shadow-sm); transition: box-shadow var(--dtr-transition), transform var(--dtr-transition); display: flex; flex-direction: column; height: 100%; }
.dtr-card:hover { box-shadow: var(--dtr-shadow-md); transform: translateY(-2px); }
.dtr-card__media { position: relative; aspect-ratio: 4/3; overflow: hidden; display: block; background: var(--dtr-grey-100); }
/* The .woocommerce-js ul.products li.product a img Astra WC-compat rule has
 * specificity (0,4,3) and forces height:auto + margin:0 0 1em on archive card
 * images, which collapses height:100% and makes object-fit:cover ineffective.
 * The result is intrinsic-ratio images sitting inside the 4:3 box: any image
 * wider than 4:3 (e.g. the 1.83:1 cash banknote shot) leaves a grey gap below;
 * any image taller than 4:3 overflows and gets clipped. Override here by
 * matching the same Astra selector with extra .dtr-card__media qualifier
 * (specificity 0,5,3) so the cover behaviour wins on the archive too. The
 * first selector keeps the homepage working with its existing specificity. */
.dtr-card .dtr-card__media img,
.woocommerce-js ul.products li.product .dtr-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	margin: 0;
	display: block;
	box-shadow: none;
	transition: transform 0.6s ease;
}
.dtr-card:hover .dtr-card__media img { transform: scale(1.04); }
.dtr-card__media .dtr-badge { position: absolute; top: 12px; left: 12px; }
.dtr-card__media-placeholder { aspect-ratio: 4/3; background: linear-gradient(135deg, var(--dtr-beige), var(--dtr-cream)); }
.dtr-card__body { padding: 20px 20px 24px; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.dtr-card__title { font-size: 1.125rem; margin: 0; line-height: 1.25; text-transform: uppercase; letter-spacing: 0.02em; }
.dtr-card__title a { color: var(--dtr-primary); }
.dtr-card__excerpt { color: var(--dtr-grey-600); font-size: 0.9rem; margin: 0; min-height: 2.5em; }
.dtr-card__stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; margin: 0; padding: 12px; background: var(--dtr-cream); border-radius: var(--dtr-radius-md); }
.dtr-card__stats div { display: flex; flex-direction: column; }
.dtr-card__stats dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dtr-grey-600); margin: 0; }
.dtr-card__stats dd { margin: 0; font-family: var(--dtr-font-heading); font-weight: 700; color: var(--dtr-primary); font-size: 0.95rem; }
.dtr-card__sold-line { font-size: 0.8rem; color: var(--dtr-grey-600); margin: -4px 0 0; }

/* Card countdown lives inside a narrow .dtr-card__stats grid cell (~75-110px
 * on phones). The base .dtr-countdown__cell from chrome.css has min-width:36px
 * which forces 4*36 = 144px, so the cells wrap onto two rows below ~150px.
 * On mobile we make the dd a single-row flex container with smaller cells
 * (min-width:0, flex:1) so the four units stay on one line at any card width.
 * Desktop spec stays exactly as-is -- this rule only kicks in <=600px. */
@media (max-width: 600px) {
	.dtr-card__countdown {
		display: flex;
		flex-wrap: nowrap;
		gap: 4px;
		align-items: baseline;
	}
	.dtr-card__countdown .dtr-countdown__cell {
		min-width: 0;
		flex: 1 1 0;
		padding: 0;
	}
	.dtr-card__countdown .dtr-countdown__num { font-size: 0.9rem; }
	.dtr-card__countdown .dtr-countdown__label { font-size: 0.55rem; letter-spacing: 0.04em; }
}
.dtr-card__cta { margin-top: auto; }
.dtr-card--placeholder { position: relative; }
.dtr-card--placeholder::after { content: "PLACEHOLDER"; position: absolute; top: 12px; right: 12px; background: var(--dtr-beige); color: var(--dtr-primary); font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: var(--dtr-radius-pill); }

/* Ended ("Closed") competitions kept on listings: muted media, plain status. */
.dtr-card--ended .dtr-card__img { filter: grayscale(1); opacity: 0.72; }
.dtr-card--ended .dtr-card__media-placeholder { opacity: 0.72; }
.dtr-card__ended-label { font-weight: 700; color: var(--dtr-grey-600); text-transform: uppercase; letter-spacing: 0.04em; }
