/*
 * Jersey Bulls FC — PlayerCard
 *
 * Juventus-style squad card: prominent player cut-out on a dark surface,
 * oversized squad-number watermark, forename + surname over a base scrim, and
 * an overlaid "Profile" action that resolves on hover/focus (always shown where
 * there's no hover — touch). Per-player sponsor shows persistently in the body.
 *
 * Markup: template-parts/card-player.php · tokens: css/tokens.css
 */

.bulls-player-card {
	container-type: inline-size;   /* fluid name type scales with card width, not viewport */
	position: relative;
	border-radius: var(--radius-lg);   /* sharp corners (radius-lg=0) — Juventus editorial card treatment */
	overflow: hidden;                  /* clip the cut-out to the card edges */
}

/* Thin red baseline keeps the single brand accent under each card. */
/* The card carries its OWN dark canvas: cut-out cards are white-on-dark by
   design, and on light-mode pages (squad grid) a transparent card body put
   white names on the near-white page canvas. Invisible on dark canvases. */
.bulls-player-card { background: var(--c-ink-900); }

.bulls-player-card::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: var(--c-bulls-red);
	z-index: 5;
}

/* ----- Media panel — the profile link; the whole photo is clickable. ----- */
.bulls-player-card__media {
	display: block;
	position: relative;
	aspect-ratio: var(--ar-card);
	overflow: hidden;
	background: var(--grad-ink-card);
	text-decoration: none;
	color: var(--c-text-inverse);
}

.bulls-player-card__media:focus-visible {
	outline: 2px solid var(--c-focus-ring);
	outline-offset: 2px;
}

/* Oversized squad-number watermark — behind the cut-out, anchored low-right. */
.bulls-player-card__number {
	position: absolute;
	right: -0.04em;
	bottom: -0.12em;
	margin: 0;
	font-family: var(--ff-display);
	font-size: 13rem;   /* intentional: oversized watermark jersey number — far above the scale ceiling (--fs-1000: 8rem) */
	line-height: 0.8;
	color: var(--c-white);
	opacity: var(--opacity-watermark-strong);
	pointer-events: none;
	z-index: 1;
}

/* Cut-out: enlarged + bottom-anchored so the figure dominates and the feet sit
   on the card base (Juve portrait treatment). Full colour; a hair of grade keeps
   the set cohesive, lifting fully on hover. */
.bulls-player-card__cutout {
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 116%;
	height: 116%;
	transform: translateX(-50%);
	object-fit: contain;
	object-position: bottom center;
	z-index: 2;
	/* grade lift — the cut-out PNGs read flat/dull against the dark card; lifted
	   13 Jun (client: players should be brighter) */
	filter: saturate(1.12) brightness(1.14) contrast(1.02);
	transition: transform var(--motion-slower) var(--ease-emphasis);
}

/* Featured-photo fallback (no theme cut-out): raw photos arrive at arbitrary
   ratios, so contain+116% renders players at wildly different sizes — fill the
   card box with a uniform top-anchored crop instead. */
.bulls-player-card__cutout--photo {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

.bulls-player-card__media:hover .bulls-player-card__cutout,
.bulls-player-card__media:focus-visible .bulls-player-card__cutout {
	transform: translateX(-50%) scale(1.04);
}

/* No-photo fallback — centred crest watermark so empty cards still look intentional. */
.bulls-player-card__cutout--placeholder {
	/* sized/positioned to match the visual mass of a real cut-out figure —
	   at 56% the crest dwarfed the players beside it */
	background: url("../../images/crest-white.svg") no-repeat center 58% / 38% auto;
	opacity: var(--opacity-watermark-strong);
}

.bulls-player-card__scrim {
	position: absolute;
	inset: 0;
	z-index: 3;
	background: var(--scrim-bottom);
	pointer-events: none;
}

/* ----- Overlaid "Profile" CTA (Juve-style) — resolves on hover/focus. ----- */
.bulls-player-card__cta {
	position: absolute;
	left: 50%;
	bottom: var(--space-12);
	transform: translate(-50%, 8px);
	z-index: 4;
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	padding: var(--space-2) var(--space-4);
	background: var(--c-bulls-red);
	border-radius: var(--radius-md);   /* follows the canonical .bulls-cta-button corner rule */
	color: var(--c-white);
	font-family: var(--ff-mono);
	font-size: var(--fs-50);
	letter-spacing: var(--ls-wide);
	text-transform: uppercase;
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--motion-base) var(--ease-out),
		transform var(--motion-base) var(--ease-out);
}
.bulls-player-card__cta-arrow { transition: transform var(--motion-base) var(--ease-out); }

.bulls-player-card__media:hover .bulls-player-card__cta,
.bulls-player-card__media:focus-visible .bulls-player-card__cta {
	opacity: 1;
	transform: translate(-50%, 0);
}
.bulls-player-card__media:hover .bulls-player-card__cta-arrow { transform: translateX(3px); }

/* No hover (touch) — keep the affordance visible so it's never gated behind hover. */
@media (hover: none) {
	.bulls-player-card__cta { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================================
 * Body — position, name, sponsor
 * ============================================================ */

.bulls-player-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	padding: var(--space-4) var(--space-4) var(--space-5);
}

.bulls-player-card__position {
	font-family: var(--ff-mono);
	font-size: var(--fs-50);
	letter-spacing: var(--ls-wider);
	text-transform: uppercase;
	color: var(--c-bulls-red-300) !important;
}

.bulls-player-card__name {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: var(--space-1);   /* a little air between forename and the larger surname (client 13 Jun) */
	line-height: 0.9;
}

.bulls-player-card__forename {
	font-family: var(--ff-sans);
	font-weight: var(--fw-medium);
	font-size: clamp(0.9rem, 7cqi, 1.15rem);   /* scales with card width */
	color: var(--c-white-50) !important;
}

.bulls-player-card__surname {
	font-family: var(--ff-display);
	font-size: clamp(1.65rem, 18cqi, 3rem);    /* the hero — scales with card width */
	line-height: 0.88;
	letter-spacing: var(--ls-tight);
	text-transform: uppercase;
	color: var(--c-white) !important;
}

/* Per-player sponsor — a non-league staple. Sits as a small badge in the card's
   top-left corner (over the photo) rather than cramped under the name (client 13 Jun). */
.bulls-player-card__sponsor {
	position: absolute;
	top: var(--space-3);
	left: var(--space-3);
	z-index: 5;   /* above the cut-out (2) / scrim (3) / cta (4) */
	display: flex;
	flex-direction: column;   /* "Sponsored by" label above the logo */
	align-items: flex-start;
	gap: 5px;
	margin: 0;
	font-family: var(--ff-mono);
	font-size: var(--fs-50);
}
/* "Sponsored by" eyebrow above the logo, legible over the photo. */
.bulls-player-card__sponsor-label {
	font-size: 0.625rem;
	letter-spacing: var(--ls-wider);
	text-transform: uppercase;
	color: var(--c-white);
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}
.bulls-player-card__sponsor-name {
	color: var(--c-white) !important;
	display: inline-flex;
	align-items: center;
	text-transform: uppercase;
	letter-spacing: var(--ls-wide);
	text-decoration: none;
	/* Text fallback (no logo) sits straight on the photo — shadow keeps it legible. */
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}
a.bulls-player-card__sponsor-name:hover,
a.bulls-player-card__sponsor-name:focus-visible { color: var(--c-bulls-red-300) !important; }

@media (prefers-reduced-motion: reduce) {
	.bulls-player-card__cutout,
	.bulls-player-card__cta { transition: none; }
	.bulls-player-card__media:hover .bulls-player-card__cutout { transform: translateX(-50%); }
}

/* Sponsor logo (optional, replaces the text name). Rendered on a small white
   chip in its natural colour: the imported sponsor marks are a mix of JPEGs and
   opaque PNGs, so the old white-treatment (brightness(0) invert(1)) turned them
   into solid white blocks. A white chip renders every format legibly. */
.bulls-player-card__sponsor-logo {
	display: block;
	box-sizing: border-box;
	/* Fixed chip so every sponsor logo reads at the same size/ratio regardless of
	   its own dimensions — the mark is contained + centred inside. (client 13 Jun) */
	width: 130px;
	height: 46px;
	object-fit: contain;
	background: #fff;
	border-radius: var(--radius-sm);
	padding: 6px 9px;
}

/* ----- Hover statline (apps / goals) — reveals with the Profile CTA. ----- */
.bulls-player-card__statline {
	position: absolute;
	left: var(--space-4);
	bottom: var(--space-4);
	z-index: 4;
	display: flex;
	gap: var(--space-4);
	opacity: 0;
	transform: translateY(6px);
	transition: opacity var(--motion-base) var(--ease-out), transform var(--motion-base) var(--ease-out);
	pointer-events: none;
}
.bulls-player-card__media:hover .bulls-player-card__statline,
.bulls-player-card__media:focus-visible .bulls-player-card__statline {
	opacity: 1;
	transform: translateY(0);
}
.bulls-player-card__stat {
	font-family: var(--ff-mono);
	font-size: var(--fs-50);
	letter-spacing: var(--ls-wide);
	text-transform: uppercase;
	color: var(--c-white-82);
}
.bulls-player-card__stat strong {
	display: block;
	font-family: var(--ff-display);
	font-size: var(--fs-400);
	line-height: 1;
	color: var(--c-white);
}
@media (hover: none) {
	/* touch devices: no hover — keep the card clean, stats live on the profile */
	.bulls-player-card__statline { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.bulls-player-card__statline { transition: none; transform: none; }
}
