.bdrf-related-films {
	margin: 24px 0;
}

/* Dark gray divider above the block, matching the line above "Related Topics".
   Scoped to the end-of-content placement only — the sidebar widget already has
   its own visual boundary (the theme's widget box), so an extra divider there
   would just look like a redundant double border.
   var(--bd-border) isn't confirmed yet — swap the fallback color (after the
   comma) for the theme's real divider color/variable once you have it. */
.bdrf-related-films--content {
	border-top: 1px solid var(--bd-border, rgba(255, 255, 255, 0.12));
	padding-top: 24px;
}

.bdrf-related-films__heading {
	/* Matches .bd-article__tags-label ("Related Topics") exactly. */
	display: block;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--bd-gray);
	margin-bottom: 0.5rem;
}

.bdrf-related-films__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 16px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Sidebar widget: narrower column, so keep cards small and let them stack more. */
.bdrf-related-films--widget .bdrf-related-films__grid {
	grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
	gap: 12px;
}

.bdrf-related-films__card {
	margin: 0;
}

.bdrf-related-films__link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.bdrf-related-films__poster {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 2 / 3;
	overflow: hidden;
	border-radius: 0; /* square corners, per request — no rounding anywhere on the card art */
	background: rgba(0, 0, 0, 0.35);
	margin-bottom: 8px;
}

.bdrf-related-films__poster img {
	/* !important on the sizing/fit properties: many WP themes ship a global
	   `img { height: auto; max-width: 100%; }` responsive-image rule, and if
	   that wins the cascade it silently overrides object-fit/height here —
	   the <img> reverts to its natural size and the fixed-height box just
	   clips whatever overflows, which looks exactly like cropping again. */
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	/* contain, not cover: the card box is a fixed 2:3 frame, but not every
	   source image actually is 2:3 (promo art, custom key art, etc. vary) —
	   cover would crop those, cutting off title logos baked into the art.
	   contain always shows the whole image, letterboxed on mismatched ratios. */
	object-fit: contain !important;
	transition: transform 0.2s ease;
}

.bdrf-related-films__link:hover .bdrf-related-films__poster img {
	transform: scale(1.04);
}

.bdrf-related-films__poster--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	background: linear-gradient(160deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.04));
	text-align: center;
}

.bdrf-related-films__placeholder-title {
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.3;
	opacity: 0.75;
}

.bdrf-related-films__meta {
	display: block;
}

.bdrf-related-films__title {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.3;
}

.bdrf-related-films__link:hover .bdrf-related-films__title {
	text-decoration: underline;
}

.bdrf-related-films__year {
	display: block;
	font-size: 0.78rem;
	opacity: 0.65;
	margin-top: 2px;
}
