/* aieo/competition-status: a competition's state as a badge, then the date that goes with it ("Until 30 November"),
   on one line in the block's own place: under a card's title in a list (AIEO_Competition_CPT::card_status() prints it
   there in place of the publication date) or wherever a page places the block. The badge sits in its block's flow,
   never positioned against an ancestor it cannot know (Offers 16-F23: it had landed at the top of the page, under the
   sticky header, where no card held it). */

.aieo-comp-status {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin: 6px 0 0;
	font-size: 0.8rem;
	line-height: 1.5;
}

/* The status badge: a translucent pill tinted by state (green = active, red = ended, amber = coming).
   The base hue is a CSS variable so it can be themed or set from the admin:
   --aieo-comp-badge-live / --aieo-comp-badge-ended / --aieo-comp-badge-before.
   The `color-mix` adds the glass transparency to whatever base colour is set;
   the plain rgba line above it is the fallback for browsers without color-mix.
   The tint is the state's hue mixed half and half with black, 90% opaque (11.3.3): at 55% of
   the bare hue the white label fell to about 1.5:1 wherever the badge sat on a
   light page or photo; mixed, it holds 4.5:1 over white, black or a photo. The
   hues default to the theme's success / danger / warning. */
.aieo-comp-status__badge {
	display: inline-block;
	flex: none;
	margin: 0;
	padding: 5px 12px;
	border-radius: var(--wp--custom--rooster--shape--badge, 999px);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-size: 0.7rem;
	line-height: 1.3;
	white-space: nowrap;
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.4);
	background: rgba(123, 79, 6, 0.9);
	background: color-mix(in srgb, color-mix(in srgb, var(--aieo-comp-badge-before, var(--wp--preset--color--warning, #f59e0b)) 50%, #000) 90%, transparent);
}
.aieo-comp-status--live .aieo-comp-status__badge {
	background: rgba(17, 99, 47, 0.9);
	background: color-mix(in srgb, color-mix(in srgb, var(--aieo-comp-badge-live, var(--wp--preset--color--success, #22c55e)) 50%, #000) 90%, transparent);
}
.aieo-comp-status--ended .aieo-comp-status__badge {
	background: rgba(120, 34, 34, 0.9);
	background: color-mix(in srgb, color-mix(in srgb, var(--aieo-comp-badge-ended, var(--wp--preset--color--danger, #ef4444)) 50%, #000) 90%, transparent);
}
.aieo-comp-status--before .aieo-comp-status__badge {
	background: rgba(123, 79, 6, 0.9);
	background: color-mix(in srgb, color-mix(in srgb, var(--aieo-comp-badge-before, var(--wp--preset--color--warning, #f59e0b)) 50%, #000) 90%, transparent);
}

/* The date beside the badge. */
.aieo-comp-status__date { color: var(--wp--preset--color--muted, #6b7280); }
