/* Bloc Critiques — styles front */

.hsar {
	max-width: 100%;
	margin-inline: auto;
}

.hsar__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 22px;
}

.hsar__heading {
	margin: 0;
	color: #111;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.hsar__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 30px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hsar__item {
	position: relative;
	display: flex;
	flex-direction: column;
	margin: 0;
}

/* --- Visuel et étiquette ---------------------------------------------- */

.hsar__media {
	--hsar-ratio: 1 / 1;
	position: relative;
	aspect-ratio: var(--hsar-ratio);
	overflow: hidden;
	background-color: #ebebeb;
}

@supports not (aspect-ratio: 1 / 1) {
	.hsar__media {
		min-height: 220px;
	}
}

/* Deux classes : indispensable pour passer devant « .elementor img { height: auto } ». */
.hsar__media .hsar__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center center;
	transition: transform 500ms ease;
}

/* Format « hauteur naturelle » : l'image reprend sa place dans le flux. */
.hsar__media--auto {
	aspect-ratio: auto;
}

.hsar__media--auto .hsar__img {
	position: relative;
	height: auto;
}

.hsar--zoom .hsar__item:hover .hsar__media .hsar__img,
.hsar--zoom .hsar__item:focus-within .hsar__media .hsar__img {
	transform: scale(1.04);
}

/* Voile de couleur : au-dessus de l'image, sous les textes. */
.hsar__veil {
	position: absolute;
	inset: 0;
	z-index: 1;
	background-color: transparent;
	pointer-events: none;
}

.hsar__tag {
	position: absolute;
	top: 16px;
	left: 16px;
	/* Au-dessus du lien étiré de la carte (z-index 2), sinon le lien de
	   catégorie qu'elle contient reste inatteignable. */
	z-index: 3;
	color: #f5b301;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 1px;
	line-height: 1.2;
	text-transform: uppercase;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

/* --- Textes ------------------------------------------------------------ */

.hsar__title {
	margin: 18px 0 0;
	color: #111;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.25;
	text-transform: uppercase;
	text-wrap: balance;
	transition: color 200ms ease;
}

.hsar__permalink {
	color: inherit;
	text-decoration: none;
}

/* Toute la carte devient cliquable sans imbriquer de lien. */
.hsar__permalink::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
}

.hsar__permalink:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

.hsar__subtitle {
	margin: 6px 0 0;
	color: #333;
	font-size: 17px;
	line-height: 1.4;
}

.hsar__link {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	margin-top: 18px;
	color: #111;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 1px;
	text-decoration: none;
	text-transform: uppercase;
}

/* Le lien d'en-tête est un vrai lien : pas de marge haute. */
.hsar__link--more {
	margin-top: 0;
}

.hsar__arrow {
	transition: transform 200ms ease;
}

.hsar__item:hover .hsar__arrow,
.hsar__link--more:hover .hsar__arrow,
.hsar__link--more:focus-visible .hsar__arrow {
	transform: translateX(4px);
}

/* La ligne de lien reste alignée en bas quand les titres ont des hauteurs différentes. */
.hsar__item .hsar__link {
	margin-top: auto;
	padding-top: 18px;
}

.hsar__link--todo {
	color: #996800;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
}

.hsar-empty {
	padding: 24px;
	border: 1px dashed #c3c4c7;
	color: #50575e;
	text-align: center;
}

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

@media (max-width: 1024px) {
	.hsar__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Tablettes comprises : même comportement qu'en mobile. */
@media (max-width: 1024px) {
	.hsar__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.hsar__head {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.hsar__title {
		font-size: 19px;
	}

	/* --- Maquette mobile : image en retrait, textes centrés ------------- */

	.hsar--m-center .hsar__head {
		align-items: center;
	}

	.hsar--m-center .hsar__item {
		align-items: center;
		text-align: center;
	}

	.hsar--m-center .hsar__media {
		align-self: stretch;
		margin-inline: var(--hsar-inset, 0);
	}

	.hsar--m-center .hsar__link {
		align-self: center;
	}

	.hsar--m-underline .hsar__item .hsar__link {
		text-decoration: underline;
		text-underline-offset: 4px;
	}

	.hsar--m-no-tag .hsar__tag {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hsar__title,
	.hsar__arrow,
	.hsar__media .hsar__img {
		transition: none;
	}
}

/* Nom de catégorie cliquable : au-dessus du lien étiré de la carte. */
.hsar__tag a {
	position: relative;
	z-index: 3;
	color: inherit;
	text-decoration: none;
}

.hsar__tag a:hover,
.hsar__tag a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Un widget Elementor est un élément flex : sans min-width, il s'élargit à la
   taille de son contenu, et une zone à défilement horizontal fait alors
   déborder toute la page. */
.elementor-widget-hsa_reviews {
	min-width: 0;
	max-width: 100%;
}

.hsar,
.hsar__grid {
	max-width: 100%;
	min-width: 0;
}
