/* TTH — Partenaires (onglets). Palette et rythme repris de la page d'accueil. */

.tthp {
	--tthp-paper: #ffffff;
	--tthp-band: #f6f9fc;
	--tthp-ink: #131f35;
	--tthp-body: #707070;
	--tthp-line: #e5e5e5;
	--tthp-red: #f50000;
	--tthp-font: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

	background: var(--tthp-paper);
	font-family: var(--tthp-font);
}

.tthp *,
.tthp *::before,
.tthp *::after {
	box-sizing: border-box;
}

.tthp__wrap {
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 20px;
}

/* ---------- Onglets ---------- */

.tthp__tabs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 10px;
	margin: 0 0 34px;
	padding: 0 0 2px;
	border-bottom: 1px solid var(--tthp-line);
}

.tthp__tab {
	position: relative;
	margin: 0;
	padding: 12px 10px 15px;
	border: 0;
	border-radius: 0;
	/* Le thème peint background:#161616 sur tout button:hover — d'où !important ici
	   et une couleur de survol explicite plus bas. */
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	font-family: var(--tthp-font);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--tthp-body);
	cursor: pointer;
	white-space: nowrap;
	transition: color 0.22s ease-out, background-color 0.22s ease-out;
	-webkit-appearance: none;
	appearance: none;
}

.tthp__tab::after {
	content: '';
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: -1px;
	height: 2px;
	background: var(--tthp-red);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.34s cubic-bezier(0.16, 1, 0.3, 1);
}

.tthp .tthp__tab:hover,
.tthp .tthp__tab:focus-visible {
	color: var(--tthp-ink) !important;
	background-color: var(--tthp-band) !important;
}

.tthp .tthp__tab:focus-visible {
	outline: 2px solid var(--tthp-ink);
	outline-offset: -3px;
}

.tthp__tab.is-active {
	color: var(--tthp-ink);
}

.tthp__tab.is-active::after {
	transform: scaleX(1);
}

/* ---------- Grille de marques ---------- */

/* Flex plutôt que grid : une catégorie filtrée reste centrée au lieu de laisser
   une rangée orpheline à gauche. */
.tthp__grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	--tthp-cols: 6;
}

.tthp__cell {
	flex: 0 0 calc(100% / var(--tthp-cols));
	max-width: calc(100% / var(--tthp-cols));
}

.tthp__grid:focus {
	outline: none;
}

.tthp__cell {
	position: relative;
	display: flex;
	background: var(--tthp-paper);
	outline: 1px solid var(--tthp-line);
	outline-offset: -1px;
	transition: background-color 0.24s ease-out;
}

/* Le lien porte tout le contenu de la tuile : le logo (avec son alt) et le nom
   sont dans l'ancre, ce qui donne au site de la marque un vrai lien suivi.
   Le thème force color/border/box-shadow sur tout <a>, d'où les !important
   et la couleur posée sur les <span> enfants. */
.tthp .tthp__link {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	min-height: 152px;
	padding: 28px 18px 26px;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	text-decoration: none !important;
}

.tthp .tthp__link:focus-visible {
	outline: 2px solid var(--tthp-ink);
	outline-offset: -3px;
}

/* Flèche des tuiles qui ouvrent un autre site. */
.tthp__ext {
	position: absolute;
	top: 12px;
	right: 12px;
	color: var(--tthp-body);
	opacity: 0;
	transform: translate(-2px, 2px);
	transition: opacity 0.28s ease-out, transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.tthp__cell:hover .tthp__ext,
.tthp__cell:focus-within .tthp__ext {
	opacity: 1;
	color: var(--tthp-red);
	transform: none;
}

.tthp__cell[hidden] {
	display: none;
}

.tthp__cell::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: var(--tthp-red);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.tthp__cell:hover,
.tthp__cell:focus-within {
	background: var(--tthp-band);
}

.tthp__cell:hover::after,
.tthp__cell:focus-within::after {
	transform: scaleX(1);
}

.tthp__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 46px;
	transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.tthp__cell:hover .tthp__logo,
.tthp__cell:focus-within .tthp__logo {
	transform: translateY(-3px);
}

.tthp .tthp__img {
	display: block;
	width: auto;
	max-width: 78%;
	max-height: 46px;
	height: auto;
	object-fit: contain;
	border: 0;
	box-shadow: none;
	border-radius: 0;
}

.tthp__name {
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--tthp-ink);
}

.tthp__status,
.tthp__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---------- Entrée des cellules au changement d'onglet ---------- */

@keyframes tthp-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.tthp.is-ready .tthp__cell.is-in {
	animation: tthp-in 0.44s cubic-bezier(0.16, 1, 0.3, 1) both;
	animation-delay: calc(var(--tthp-n, 0) * 26ms);
}

/* ---------- Responsive ---------- */

@media (max-width: 1199px) {
	.tthp__grid {
		--tthp-cols: 4;
	}
}

@media (max-width: 880px) {
	.tthp__grid {
		--tthp-cols: 3;
	}

	.tthp .tthp__link {
		min-height: 138px;
		padding: 24px 14px 22px;
	}
}

@media (max-width: 760px) {
	.tthp__tabs {
		flex-wrap: nowrap;
		justify-content: flex-start;
		gap: 0 6px;
		margin-bottom: 26px;
		overflow-x: auto;
		scrollbar-width: none;
		scroll-snap-type: x proximity;
		-webkit-overflow-scrolling: touch;
	}

	.tthp__tabs::-webkit-scrollbar {
		display: none;
	}

	.tthp__tab {
		scroll-snap-align: center;
		font-size: 11px;
		padding: 11px 10px 14px;
	}

	.tthp__tab::after {
		left: 10px;
		right: 10px;
	}
}

@media (max-width: 560px) {
	.tthp__grid {
		--tthp-cols: 2;
	}

	.tthp .tthp__link {
		min-height: 124px;
		gap: 14px;
	}

	.tthp__ext {
		top: 9px;
		right: 9px;
	}

	.tthp__logo {
		height: 38px;
	}

	.tthp .tthp__img {
		max-height: 38px;
	}

	.tthp__name {
		font-size: 11px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tthp *,
	.tthp *::before,
	.tthp *::after {
		animation-duration: 0.01ms !important;
		animation-delay: 0ms !important;
		transition-duration: 0.01ms !important;
	}
}
