/* =============================================================================
   ECR — the shared "related content" components
   Working Group, event and news pages print their links to one another, their
   documents and their gallery with these same classes (inc/relations/,
   inc/working-groups/media.php). Replaces the .ecr-related-* rules that lived
   in the Customizer's Additional CSS with the snippets that printed them.
   ========================================================================== */

.ecr-rel,
.ecr-docs,
.ecr-gallery,
.ecr-wg-board {
	--rel-primary: var(--ecr-primary, #1866A5);
	--rel-text: var(--ecr-text, #1E293B);
	--rel-muted: #667085;
	--rel-border: var(--ecr-border, #E2E8F0);
	margin: 48px 0 0;
	color: var(--rel-text);
}

.ecr-rel-wrap { max-width: 820px; margin: 0 auto; }

/* The section heading: the Member strip's (css/mep.css .ecr-mep-strip__title). */
.ecr-rel .ecr-rel__title,
.ecr-docs .ecr-rel__title,
.ecr-gallery .ecr-rel__title,
.ecr-wg-board .ecr-rel__title {
	margin: 0 0 18px;
	font-size: .8125rem;
	line-height: 1.3;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .09em;
	color: var(--rel-primary);
	padding-bottom: 12px;
	border-bottom: 2px solid var(--rel-border);
}

/* --- cards ----------------------------------------------------------------- */
.ecr-rel__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 18px;
}

.ecr-rel__item { list-style: none; margin: 0; min-width: 0; display: flex; }

.ecr-rel-card {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	background: #FFFFFF;
	border: 1px solid var(--rel-border);
	border-radius: 18px;
	overflow: hidden;
	text-decoration: none;
	color: var(--rel-text);
	transition: transform .25s ease, box-shadow .25s ease;
}

.ecr-rel-card:hover,
.ecr-rel-card:focus-visible {
	transform: translateY(-2px);
	box-shadow: var(--ecr-shadow-hover, 0 20px 60px rgba(15, 23, 42, .12));
}

.ecr-rel-card:focus-visible { outline: 2px solid var(--rel-primary); outline-offset: 3px; }

.ecr-rel-card__media {
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #EFF6FF;
}

.ecr-rel-card__media .ecr-rel-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: 0;
}

.ecr-rel-card__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px 18px;
}

.ecr-rel-card--noimg .ecr-rel-card__body { border-top: 4px solid var(--rel-primary); }

.ecr-rel-card__date {
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--rel-primary);
}

.ecr-rel-card__title {
	font-size: 1rem;
	line-height: 1.4;
	font-weight: 700;
	overflow-wrap: anywhere;
}

.ecr-rel-card:hover .ecr-rel-card__title,
.ecr-rel-card:focus-visible .ecr-rel-card__title { color: var(--rel-primary); }

/* --- documents ------------------------------------------------------------- */
.ecr-docs__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ecr-docs__list li { list-style: none; margin: 0; }

.ecr-docs__link {
	display: flex;
	align-items: center;
	gap: 14px;
	justify-content: space-between;
	padding: 14px 18px;
	border: 1px solid var(--rel-border);
	border-radius: 14px;
	background: #FFFFFF;
	color: var(--rel-text);
	text-decoration: none;
	font-weight: 600;
	line-height: 1.4;
}

.ecr-docs__link:hover,
.ecr-docs__link:focus-visible { border-color: var(--rel-primary); color: var(--rel-primary); }

.ecr-docs__type {
	flex: 0 0 auto;
	font-size: .6875rem;
	font-weight: 700;
	letter-spacing: .08em;
	padding: 4px 10px;
	border-radius: 999px;
	background: #EFF6FF;
	color: var(--rel-primary);
}

/* --- gallery --------------------------------------------------------------- */
.ecr-gallery__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 12px;
}

.ecr-gallery__grid li { list-style: none; margin: 0; }
.ecr-gallery__item { margin: 0; }
.ecr-gallery__item a { display: block; border-radius: 12px; overflow: hidden; aspect-ratio: 1 / 1; }

.ecr-gallery__item .ecr-gallery__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
	transition: transform .3s ease;
}

.ecr-gallery__item a:hover .ecr-gallery__img { transform: scale(1.03); }

.ecr-gallery__item figcaption {
	font-size: .8125rem;
	line-height: 1.4;
	color: var(--rel-muted);
	margin-top: 6px;
}

/* --- the Member profile: role next to a Working Group ---------------------- */
.ecr-mep-related__role {
	display: block;
	margin-top: 6px;
	font-size: .75rem;
	font-weight: 700;
	color: #667085;
}

@media (max-width: 690px) {
	.ecr-rel__grid { grid-template-columns: 1fr; }
	.ecr-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
