/* HRE Immo – Gestion des biens : styles publics */

:root {
	--hre-accent: #63323E;
	--hre-ink: #121212;
	--hre-light: #F5F5F7;
	--hre-muted: #7E7E83;
	--hre-status: #FF2C2C;
	--hre-gap: 2rem;
	--hre-radius: 1rem;
	--hre-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--hre-font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
}

.hre-search *, .hre-search *::before, .hre-search *::after,
.hre-card, .hre-card *, .hre-une, .hre-une * { box-sizing: border-box; }

/* ---------------------------------------------------------------- Recherche */

.hre-search {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
	align-items: end;
	gap: 0.875rem;
	padding: 1.25rem 1.5rem 1.5rem;
	background: #fff;
	border-radius: var(--hre-radius);
	box-shadow: 0 2px 10px rgba(18, 18, 18, 0.14);
	font-family: var(--hre-font);
	color: var(--hre-ink);
}

.hre-search__field { position: relative; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }

.hre-search__label {
	font-family: var(--hre-font-serif);
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.2;
	color: var(--hre-muted);
	margin: 0;
}

.hre-search .hre-search__control {
	display: block;
	width: 100%;
	height: 2.875rem;
	margin: 0;
	padding: 0 1.125rem;
	border: 0;
	border-radius: 0.625rem;
	background-color: var(--hre-light);
	box-shadow: none;
	font-family: var(--hre-font);
	font-size: 0.875rem;
	line-height: 2.875rem;
	color: var(--hre-ink);
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	transition: box-shadow 0.15s ease;
}
.hre-search .hre-search__control::placeholder { color: var(--hre-ink); opacity: 1; }
.hre-search .hre-search__control:focus { box-shadow: 0 0 0 2px rgba(99, 50, 62, 0.35); }

.hre-search__select { position: relative; display: block; }
.hre-search__select .hre-search__control { padding-right: 2.5rem; cursor: pointer; text-overflow: ellipsis; }
.hre-search__select::after {
	content: "";
	position: absolute;
	right: 1.125rem;
	top: 50%;
	width: 0.45rem;
	height: 0.45rem;
	border-right: 1.5px solid var(--hre-muted);
	border-bottom: 1.5px solid var(--hre-muted);
	transform: translateY(-70%) rotate(45deg);
	pointer-events: none;
}

.hre-search__actions { display: flex; flex-direction: column; align-items: center; gap: 0.375rem; }

.hre-search .hre-search__reset {
	font-family: var(--hre-font);
	font-size: 0.75rem;
	line-height: 1.2;
	color: var(--hre-muted);
	text-decoration: none;
	border: 0;
	box-shadow: none;
}
.hre-search .hre-search__reset:hover,
.hre-search .hre-search__reset:focus { color: var(--hre-accent); text-decoration: underline; }

.hre-search .hre-search__submit {
	height: 2.875rem;
	margin: 0;
	padding: 0 2.25rem;
	border: 0;
	border-radius: 999px;
	background: var(--hre-accent);
	color: #fff;
	font-family: var(--hre-font);
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
	box-shadow: none;
	transition: filter 0.15s ease;
}
.hre-search .hre-search__submit:hover,
.hre-search .hre-search__submit:focus-visible { filter: brightness(1.15); }

/* Budget : champ + curseur */
.hre-budget__panel {
	position: absolute;
	z-index: 20;
	top: calc(100% + 0.5rem);
	left: 0;
	right: 0;
	padding: 1rem 1.125rem 0.75rem;
	background: #fff;
	border-radius: 0.625rem;
	box-shadow: 0 8px 24px rgba(18, 18, 18, 0.16);
}
.hre-budget__panel[hidden] { display: none; }

.hre-budget__range {
	--hre-fill: 100%;
	display: block;
	width: 100%;
	height: 1.25rem;
	margin: 0;
	background: transparent;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}
.hre-budget__range::-webkit-slider-runnable-track {
	height: 4px;
	border-radius: 4px;
	background: linear-gradient(to right, var(--hre-accent) var(--hre-fill), #E2E2E6 var(--hre-fill));
}
.hre-budget__range::-moz-range-track { height: 4px; border-radius: 4px; background: #E2E2E6; }
.hre-budget__range::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--hre-accent); }
.hre-budget__range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 1.125rem;
	height: 1.125rem;
	margin-top: -7px;
	border: 3px solid #fff;
	border-radius: 50%;
	background: var(--hre-accent);
	box-shadow: 0 1px 4px rgba(18, 18, 18, 0.3);
}
.hre-budget__range::-moz-range-thumb {
	width: 0.75rem;
	height: 0.75rem;
	border: 3px solid #fff;
	border-radius: 50%;
	background: var(--hre-accent);
	box-shadow: 0 1px 4px rgba(18, 18, 18, 0.3);
}
.hre-budget__scale {
	display: flex;
	justify-content: space-between;
	margin-top: 0.375rem;
	font-size: 0.6875rem;
	color: var(--hre-muted);
}

@media (max-width: 900px) {
	.hre-search { grid-template-columns: 1fr 1fr; }
	.hre-search__actions { grid-column: 1 / -1; flex-direction: row-reverse; justify-content: space-between; }
}
@media (max-width: 560px) {
	.hre-search { grid-template-columns: 1fr; padding: 1rem; }
	.hre-search__actions { flex-direction: column; align-items: stretch; text-align: center; }
	.hre-search .hre-search__submit { width: 100%; }
}

/* ---------------------------------------------------------------- Carte de bien */

.hre-card {
	position: relative;
	display: block;
	aspect-ratio: 5 / 4;
	overflow: hidden;
	border-radius: var(--hre-radius);
	background: #d9d9db;
	color: var(--hre-light);
	font-family: var(--hre-font);
	text-decoration: none;
	isolation: isolate;
}
a.hre-card, a.hre-card:hover, a.hre-card:focus, a.hre-card:visited { color: var(--hre-light); text-decoration: none; box-shadow: none; border: 0; }
a.hre-card:focus-visible { outline: 3px solid var(--hre-accent); outline-offset: 3px; }

.hre-card .hre-card__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	border-radius: 0;
	transition: transform 0.5s ease;
	z-index: -2;
}
a.hre-card:hover .hre-card__img { transform: scale(1.04); }

.hre-card__shade {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.25) 30%, rgba(0, 0, 0, 0) 55%);
}

.hre-card__badge {
	position: absolute;
	top: 0.875rem;
	left: 0.875rem;
	display: inline-block;
	max-width: calc(100% - 7rem);
	padding: 0.4375rem 1.125rem;
	border-radius: 999px;
	background: var(--hre-light);
	color: var(--hre-ink);
	font-size: 0.75rem;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.hre-card__badge--status { background: var(--hre-status); color: var(--hre-light); }

.hre-card .hre-card__peb {
	position: absolute;
	top: 0.875rem;
	right: 0.875rem;
	width: auto;
	height: 1.125rem;
	max-width: none;
	margin: 0;
	border-radius: 0;
}

.hre-card__footer {
	position: absolute;
	left: 1.125rem;
	right: 1.125rem;
	bottom: 0.875rem;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 0.75rem;
}
.hre-card__info { display: flex; flex-direction: column; min-width: 0; }
.hre-card__price {
	font-size: 1.5rem;
	line-height: 1.2;
	font-weight: 400;
	color: var(--hre-light);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.hre-card__loc {
	font-size: 0.75rem;
	line-height: 1.35;
	color: var(--hre-light);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.hre-card__rooms {
	flex: none;
	font-size: 1rem;
	line-height: 1.35;
	color: var(--hre-light);
	white-space: nowrap;
}

.hre-card__img--empty { background: linear-gradient(135deg, #cfcfd4, #a9a9b0); }

/* ---------------------------------------------------------------- Galerie */

.hre-gallery {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--hre-gap);
}
.hre-gallery-wrap { scroll-margin-top: 6rem; }
.hre-empty { font-family: var(--hre-font); color: var(--hre-muted); text-align: center; padding: 2rem 0; }

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

/* ---------------------------------------------------------------- Biens à la une */

.hre-une { font-family: var(--hre-font); color: var(--hre-ink); }
.hre-une__header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 2rem;
	flex-wrap: wrap;
}
.hre-une .hre-une__surtitre {
	margin: 0 0 0.75rem;
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--hre-accent);
}
.hre-une .hre-une__titre {
	margin: 0;
	font-family: var(--hre-font-serif);
	font-size: 4rem;
	font-weight: 700;
	line-height: 1.1;
	color: var(--hre-ink);
}
.hre-une .hre-une__lien {
	font-size: 1rem;
	font-weight: 500;
	color: var(--hre-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}
.hre-une .hre-une__lien:hover { filter: brightness(1.25); }
.hre-une .hre-une__lien--apercu { opacity: 0.5; text-decoration-style: dashed; cursor: help; }
@media (max-width: 1024px) { .hre-une .hre-une__titre { font-size: 3rem; } }
@media (max-width: 640px)  { .hre-une .hre-une__titre { font-size: 2.25rem; } }

.hre-carousel { position: relative; }

.hre-carousel__track {
	display: flex;
	gap: var(--hre-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	outline: none;
}
.hre-carousel__track::-webkit-scrollbar { display: none; }

/* Centre les biens lorsqu'ils ne remplissent pas toute la largeur */
.hre-carousel__item:first-child { margin-left: auto; }
.hre-carousel__item:last-child { margin-right: auto; }

.hre-carousel__item {
	flex: 0 0 calc((100% - 2 * var(--hre-gap)) / 3);
	scroll-snap-align: start;
	min-width: 0;
}

.hre-carousel .hre-carousel__nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: none;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--hre-ink);
	box-shadow: 0 2px 10px rgba(18, 18, 18, 0.18);
	cursor: pointer;
	transform: translateY(-50%);
	transition: opacity 0.2s ease;
}
.hre-carousel .hre-carousel__nav:hover { color: var(--hre-accent); }
.hre-carousel .hre-carousel__nav:disabled { opacity: 0; pointer-events: none; }
.hre-carousel__nav--prev { left: -1.375rem; }
.hre-carousel__nav--next { right: -1.375rem; }
.hre-carousel.is-scrollable .hre-carousel__nav { display: flex; }

@media (max-width: 1024px) {
	.hre-carousel__item { flex-basis: calc((100% - var(--hre-gap)) / 2); }
	.hre-carousel__nav--prev { left: 0.5rem; }
	.hre-carousel__nav--next { right: 0.5rem; }
}
@media (max-width: 640px) {
	.hre-carousel__item { flex-basis: 86%; }
	.hre-carousel__track { gap: 1rem; }
	.hre-carousel .hre-carousel__nav { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
	.hre-carousel__track { scroll-behavior: auto; }
	.hre-card .hre-card__img { transition: none; }
}
