/*
 * Jersey Bulls FC — Content cards (NewsCard + MediaCard)
 *
 * Photo/video-led cards — the photography & video patterns called out in the
 * brief. Adapted from the Juventus/PSG teardown: image hover-zoom, category
 * tags, overlay editorial cards, play affordance + duration badge.
 *
 * Markup: template-parts/card-news.php, card-media.php · tokens: css/tokens.css
 */

/* ============================================================
 * NewsCard
 * ============================================================ */

/* Dark editorial photo tile — square, flat, no shadow. The image is the card. */
.bulls-news-card {
	position: relative;
	background: var(--t-panel);
	border-radius: var(--radius-lg);
	overflow: hidden;
	height: 100%;
}

.bulls-news-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

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

.bulls-news-card__media {
	position: relative;
	aspect-ratio: var(--ar-card);
	overflow: hidden;
	/* Dark placeholder so lazy-loaded images don't flash near-white on the dark canvas before they paint. */
	background: var(--t-panel);
}

.bulls-news-card__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform var(--motion-slower) var(--ease-emphasis);
}

/* No-featured-image fallback — branded crest watermark, not a bare gradient
   (P0, design/26 PSG comparison). */
.bulls-news-card__image--placeholder { background: var(--grad-ink); position: relative; }
.bulls-news-card__image--placeholder::after {
	content: "";
	position: absolute;
	inset: 0;
	background: url("../../images/crest-white.svg") no-repeat center 45% / 32% auto;
	opacity: var(--opacity-watermark-strong);
}

.bulls-news-card:hover .bulls-news-card__image { transform: scale(1.05); }

.bulls-news-card:hover { box-shadow: var(--shadow-lift); }

.bulls-news-card__scrim {
	position: absolute;
	inset: 0;
	background: var(--scrim-bottom);
}

.bulls-news-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	padding: var(--space-5);
}

.bulls-news-card__tag {
	align-self: flex-start;
	font-family: var(--ff-mono);
	font-size: var(--fs-50);
	letter-spacing: var(--ls-wider);
	text-transform: uppercase;
	color: var(--c-bulls-red);
	background: var(--c-bulls-red-50);
	padding: 2px var(--space-2);
	border-radius: var(--radius-sm);
}

.bulls-news-card__title {
	margin: 0;
	font-family: var(--ff-display);
	font-size: var(--fs-500);
	line-height: var(--lh-snug);
	letter-spacing: var(--ls-snug);
	text-transform: uppercase;
	font-weight: var(--fw-bold);
	color: var(--t-fg);
}

/* Meta row — kicker + date sit ABOVE the headline (Juventus puts the date above
   the title); the date reads as a mono caps meta to pair with the kicker. */
.bulls-news-card__meta {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	flex-wrap: wrap;
}

.bulls-news-card__date {
	font-family: var(--ff-mono);
	font-size: var(--fs-50);
	letter-spacing: var(--ls-wide);
	text-transform: uppercase;
	color: var(--t-fg-muted);
}

/* ----- Overlay variant — text sits over the image ----- */

/* The body is absolutely positioned, so the link must be the containing block —
   without this it escaped to a far ancestor and the card collapsed to bare media. */
.bulls-news-card--overlay .bulls-news-card__link {
	position: relative;
	height: 100%;
}

.bulls-news-card--overlay .bulls-news-card__media {
	aspect-ratio: var(--ar-card);
	height: 100%;
}

/* A11Y-08: denser bottom gradient so white text + meta always read over any photo.
   The --scrim-bottom-strong token reaches ~55% opacity at 45% height; on bright
   imagery the white@50% meta failed contrast (~1.3:1). Extend the opaque band
   taller (65% of the card height) and raise the base stop to 0.96 so even the
   faintest meta chip stays ≥4.5:1 against the darkened scrim. */
.bulls-news-card--overlay .bulls-news-card__scrim {
	background: linear-gradient(
		to top,
		rgba(10, 10, 10, 0.96) 0%,
		rgba(10, 10, 10, 0.78) 35%,
		rgba(10, 10, 10, 0.45) 65%,
		rgba(10, 10, 10, 0) 85%
	);
}

.bulls-news-card--overlay .bulls-news-card__body {
	position: absolute;
	inset: auto 0 0 0;
	z-index: 1;
	color: var(--c-white);
	padding: var(--space-5);
	gap: var(--space-1);
}

.bulls-news-card--overlay .bulls-news-card__title { color: var(--c-white); }
/* A11Y-08: raise date from white@50% to white@82% — white@50% over a 96% dark
   scrim is ~22:1 theoretically, but in practice bright photos show through the
   scrim edges. white@82% guarantees legibility at all scrim densities. */
.bulls-news-card--overlay .bulls-news-card__date { color: var(--c-white-82); }

/* Showcase button affordance — Juventus card CTA (solid white, dark text,
   sharp corners, measured 46px tall / 700). A span, not a link: the whole
   card is already the anchor. */
.bulls-news-card__cta {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	box-sizing: border-box;   /* no global reset — keep min-height = rendered height */
	margin-top: var(--space-3);
	padding: var(--space-2) var(--space-4);
	min-height: 46px;   /* Juventus card CTA measures 46px */
	background: var(--c-white);
	color: var(--c-ink-900);
	font-family: var(--ff-display);
	font-size: var(--fs-75);
	font-weight: var(--fw-bold);
	letter-spacing: var(--ls-wide);
	text-transform: uppercase;
	border-radius: var(--radius-md);
	transition: background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
}
.bulls-news-card:hover .bulls-news-card__cta,
.bulls-news-card__link:focus-visible .bulls-news-card__cta {
	background: var(--c-bulls-red);
	color: var(--c-white);
}

/* Eyebrow = plain letterspaced caps (sparing red), not a filled pill. */
.bulls-news-card--overlay .bulls-news-card__tag {
	align-self: flex-start;
	color: var(--c-bulls-red-300);
	background: none;
	padding: 0;
	border-radius: var(--radius-md);
}

/* ============================================================
 * MediaCard
 * ============================================================ */

.bulls-media-card {
	transition: transform var(--motion-base) var(--ease-out);
}

.bulls-media-card__link {
	display: block;
	text-decoration: none;
	color: inherit;
}

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

.bulls-media-card__thumb {
	position: relative;
	aspect-ratio: var(--ar-video);
	overflow: hidden;
	border-radius: var(--radius-md);
	background: var(--t-panel);
}

.bulls-media-card__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform var(--motion-slower) var(--ease-emphasis);
}

.bulls-media-card__image--placeholder { background: var(--grad-ink); position: relative; }
.bulls-media-card__image--placeholder::after {
	content: "";
	position: absolute;
	inset: 0;
	background: url("../../images/crest-white.svg") no-repeat center 45% / 32% auto;
	opacity: var(--opacity-watermark-strong);
}

.bulls-media-card:hover .bulls-media-card__image { transform: scale(1.05); }
.bulls-media-card:hover { box-shadow: var(--shadow-lift); }

.bulls-media-card__scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(10, 10, 10, 0.4) 0%, rgba(10, 10, 10, 0) 50%);
}

.bulls-media-card__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: var(--radius-pill);
	background: var(--c-white-18);
	border: 2px solid var(--c-white);
	color: var(--c-white);
	backdrop-filter: blur(2px);
	transition: background var(--motion-fast) var(--ease-out), transform var(--motion-base) var(--ease-out);
}

.bulls-media-card__play svg { width: 24px; height: 24px; margin-left: 2px; }

.bulls-media-card:hover .bulls-media-card__play {
	background: var(--c-bulls-red);
	border-color: var(--c-bulls-red);
	transform: translate(-50%, -50%) scale(1.08);
}

.bulls-media-card__duration {
	position: absolute;
	right: var(--space-3);
	bottom: var(--space-3);
	font-family: var(--ff-mono);
	font-size: var(--fs-50);
	color: var(--c-white);
	background: var(--overlay-ink);
	padding: 2px var(--space-2);
	border-radius: var(--radius-sm);
}

.bulls-media-card__title {
	margin: var(--space-3) 0 0;
	font-family: var(--ff-display);
	font-size: var(--fs-300);
	line-height: var(--lh-snug);
	text-transform: uppercase;
	font-weight: var(--fw-bold);
	color: var(--t-fg);
}

/* ============================================================
 * Reduced motion
 * ============================================================ */

@media (prefers-reduced-motion: reduce) {
	.bulls-news-card,
	.bulls-news-card__image,
	.bulls-media-card__image,
	.bulls-media-card__play {
		transition: none;
	}
	.bulls-news-card:hover,
	.bulls-news-card:hover .bulls-news-card__image,
	.bulls-media-card:hover .bulls-media-card__image { transform: none; }
	.bulls-media-card:hover .bulls-media-card__play { transform: translate(-50%, -50%); }
}
