/* HBC Trombinoscope : reprend les couleurs du thème (variables --hbc-*), avec des valeurs de secours. */

/* ---------- Bouton « Voir l'équipe en photo » ---------- */

.hbc-team-photo-btn {
	gap: 0.5rem;
}

.hbc-team-photo-btn__count {
	min-width: 1.4rem;
	border-radius: 999px;
	background: var(--hbc-blue, #2B3BB0);
	padding: 0.05rem 0.4rem;
	color: #fff;
	font-size: 0.72rem;
	font-weight: 900;
	text-align: center;
}

/* ---------- Visionneuse plein écran (à la Google Photos) ---------- */

.hbc-viewer-open {
	overflow: hidden;
}

.hbc-viewer {
	position: fixed;
	inset: 0;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	border: 0;
	background: #0d0f1a;
	padding: 0;
	color: #fff;
}

.hbc-viewer[open] {
	display: grid;
	grid-template-columns: minmax(0, 1fr); /* la bande de vignettes défile au lieu d'élargir la visionneuse */
	grid-template-rows: auto minmax(0, 1fr) auto;
}

.hbc-viewer::backdrop {
	background: #0d0f1a;
}

.hbc-viewer__top {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem clamp(0.75rem, 2vw, 1.25rem);
	padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
}

.hbc-viewer__title {
	min-width: 0;
	flex: 1 1 auto;
	margin: 0;
	overflow: hidden;
	font-size: 1rem;
	font-weight: 800;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hbc-viewer__count {
	margin: 0;
	color: rgb(255 255 255 / 70%);
	font-size: 0.9rem;
	font-variant-numeric: tabular-nums;
}

.hbc-viewer__icon,
.hbc-viewer__nav {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 2.75rem;
	height: 2.75rem;
	border: 0;
	border-radius: 50%;
	background: transparent;
	padding: 0;
	color: #fff;
	cursor: pointer;
	transition: background 150ms ease;
}

.hbc-viewer__icon:hover,
.hbc-viewer__icon:focus-visible,
.hbc-viewer__nav:hover,
.hbc-viewer__nav:focus-visible {
	background: rgb(255 255 255 / 14%);
	color: #fff;
	box-shadow: none;
	transform: none;
}

.hbc-viewer__stage {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	min-height: 0;
	padding-inline: clamp(0.25rem, 2vw, 1rem);
}

.hbc-viewer__figure {
	display: grid;
	place-items: center;
	height: 100%;
	min-height: 0;
	margin: 0;
}

.hbc-viewer__img {
	max-width: 100%;
	max-height: calc(100vh - 11rem);
	max-height: calc(100dvh - 11rem);
	border-radius: 0.4rem;
	object-fit: contain;
	user-select: none;
}

.hbc-viewer__img.is-loading {
	opacity: 0.4;
}

.hbc-viewer__caption {
	margin-top: 0.5rem;
	color: rgb(255 255 255 / 80%);
	font-size: 0.88rem;
	text-align: center;
}

.hbc-viewer__nav {
	width: 3.25rem;
	height: 3.25rem;
	background: rgb(255 255 255 / 8%);
}

.hbc-viewer__thumbs {
	min-width: 0;
	display: flex;
	justify-content: safe center;
	gap: 0.4rem;
	overflow-x: auto;
	padding: 0.6rem 1rem;
	padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
	scrollbar-width: thin;
}

.hbc-viewer__season {
	flex: 0 0 auto;
	align-self: center;
	padding: 0 0.35rem 0 0.75rem;
	color: rgb(255 255 255 / 65%);
	font-size: 0.72rem;
	font-weight: 800;
	white-space: nowrap;
}

.hbc-viewer__season:first-child {
	padding-left: 0;
}

.hbc-viewer__thumb {
	flex: 0 0 auto;
	width: 4.5rem;
	height: 3.25rem;
	overflow: hidden;
	border: 2px solid transparent;
	border-radius: 0.4rem;
	background: #1c2033;
	padding: 0;
	opacity: 0.55;
	cursor: pointer;
	transition: opacity 150ms ease, border-color 150ms ease;
}

.hbc-viewer__thumb:hover {
	background: #1c2033;
	box-shadow: none;
	opacity: 0.9;
	transform: none;
}

.hbc-viewer__thumb.is-active {
	border-color: #fff;
	opacity: 1;
}

.hbc-viewer__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Une seule photo : ni flèches, ni vignettes */
.hbc-viewer.is-single .hbc-viewer__nav,
.hbc-viewer.is-single .hbc-viewer__thumbs {
	visibility: hidden;
}

.hbc-viewer.is-single .hbc-viewer__thumbs {
	padding-block: 0;
}

@media (max-width: 620px) {
	/* Sur smartphone : on glisse du doigt, les flèches se font discrètes par-dessus la photo */
	.hbc-viewer__stage {
		grid-template-columns: minmax(0, 1fr);
		padding-inline: 0;
	}

	.hbc-viewer__figure {
		grid-column: 1;
		grid-row: 1;
	}

	.hbc-viewer__nav {
		position: absolute;
		z-index: 1;
		top: 50%;
		width: 2.5rem;
		height: 2.5rem;
		background: rgb(13 15 26 / 55%);
		transform: translateY(-50%);
	}

	.hbc-viewer__nav:hover,
	.hbc-viewer__nav:focus-visible {
		transform: translateY(-50%);
	}

	.hbc-viewer__nav--prev {
		left: 0.4rem;
	}

	.hbc-viewer__nav--next {
		right: 0.4rem;
	}

	.hbc-viewer__img {
		border-radius: 0;
		max-height: calc(100dvh - 9rem);
	}

	.hbc-viewer__thumb {
		width: 3.5rem;
		height: 2.6rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hbc-viewer__thumb {
		transition: none;
	}
}

/* Bouton photo : même gabarit que les petits boutons du site, à la suite de la compétition */
.hbc-page-heading .hbc-team-photo-btn {
	min-height: 0;
	padding: 0.6rem 1.1rem;
	font-size: 0.85rem;
	line-height: 1.2;
}
