/* YTC BMA Finalists — structural base. Colours are placeholders; swap for
   the ICCA design tokens as needed. Mirrors the YTC Past Winners layout
   conventions so the two sections sit together consistently. */

.ytc-bma-finalists {
	position: relative;
}

/* Year tabs — pill row, active tab is a white pill */
.ytc-bma-finalists__tabs {
	display: flex;
	background: #E8F1F1;
	border-radius: 999px;
	padding: 4px;
	gap: 4px;
	margin-bottom: 32px;
	width: 100%;
	overflow-x: auto;
	overflow-y: hidden;

	/* Drag-to-scroll: no visible scrollbar, grab cursor on hover. */
	cursor: grab;
	scrollbar-width: none;    /* Firefox */
	-ms-overflow-style: none; /* old Edge/IE */
}
.ytc-bma-finalists__tabs::-webkit-scrollbar {
	display: none;            /* Chrome/Safari/new Edge */
}
.ytc-bma-finalists__tabs.is-dragging {
	cursor: grabbing;
	user-select: none; /* stops text being selected mid-drag */
}
.ytc-bma-finalists__tab {
	background: transparent;
	border: none;
	padding: 8px 16px;
	font-size: 14px;
	color: #71717A;
	white-space: nowrap;
	cursor: pointer;
	line-height: 24px;
	font-family: Montserrat, MontserratFallback, sans-serif;
}
.ytc-bma-finalists__tab.is-active {
	background: #fff;
	color: #18304D;
	font-weight: 600;
}

/* Panels — display is driven entirely by .is-active so the markup's
   visibility can't be fought over by another display rule. */
.ytc-bma-finalists__panel {
	display: none;
	grid-template-columns: repeat( var( --ytc-bma-columns, 3 ), 1fr );
	gap: 24px;
}
.ytc-bma-finalists__panel.is-active {
	display: grid;
}

/* Card */
.ytc-bma-finalists__card {
	display: flex;
	flex-direction: column;
	box-shadow: 0 0 25px 0 rgba(24, 48, 77, 0.13);
	padding: 32px;
	background: #fff;
	border-radius: 16px;
}

/* Featured image + play button overlay */
.ytc-bma-finalists__media {
	position: relative;
	border-radius: 12px;
	overflow: hidden;
	margin-bottom: 20px;
	line-height: 0; /* stops the inline-image gap under the thumbnail */
	border: solid 1px #E3E3E0;
}
.ytc-bma-finalists__media img {
	width: 100% !important;
	height: 180px !important;
	object-fit: cover;
	display: block;
	margin-bottom: 0 !important;
}
.ytc-bma-finalists__play {
	position: absolute;
	right: 12px;
	bottom: 12px;
	width: 48px;
	height: 48px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	line-height: 0;
}
.ytc-bma-finalists__play svg {
	width: 48px;
	height: 48px;
	display: block;
}

.ytc-bma-finalists__title {
	font-size: 18px !important;
	line-height: 24px !important;
	color: #18304D;
}

.ytc-bma-finalists__challenge {
	padding-bottom: 16px;
	font-size: 14px;
	color: #5d6b79;
}
.ytc-bma-finalists__challenge p:last-child {
	margin-bottom: 0;
}

.ytc-bma-finalists__download {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: auto; /* pins the button to the bottom so cards of differing height still line up */
	font-size: 14px;
	font-weight: 700;
	color: #61BB46;
	text-decoration: none;
}
.ytc-bma-finalists__download svg {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

.ytc-bma-finalists__empty {
	grid-column: 1 / -1;
	padding: 40px 0;
	text-align: center;
	color: #888;
}

/* Video lightbox */
.ytc-bma-finalists__lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.ytc-bma-finalists__lightbox[hidden] {
	display: none; /* explicit: an author display rule would otherwise beat [hidden] */
}
.ytc-bma-finalists__lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(9, 20, 33, 0.8);
}
.ytc-bma-finalists__lightbox-inner {
	position: relative;
	width: min( 960px, 100% );
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 12px;
	overflow: hidden;
}
.ytc-bma-finalists__lightbox-frame,
.ytc-bma-finalists__lightbox-frame iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}
.ytc-bma-finalists__lightbox-close {
	position: absolute;
	top: -44px;
	right: 0;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: #18304D;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
}

body.ytc-bma-lightbox-open {
	overflow: hidden; /* stops the page scrolling behind the open video */
}

@media ( max-width: 999px ) {
	.ytc-bma-finalists__panel {
		grid-template-columns: repeat( 2, 1fr );
	}
}
@media ( max-width: 640px ) {
	.ytc-bma-finalists__panel {
		grid-template-columns: 1fr;
	}
	.ytc-bma-finalists__lightbox-close {
		top: -40px;
	}
}

/* Winner badge — top-left of the card image. The media box is already
   position:relative and clips to its rounded corners, so this sits inside
   the image, over it. line-height is reset because the media box sets 0 to
   kill the inline-image gap. */
.ytc-bma-finalists__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	padding: 6px 14px;
	border-radius: 100px;
	background: #61BB46;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.02em;
}
