/* ========================================================================== 
   GALERIE DE RÉALISATIONS HARD DÉCO — VERSION 1.1.0
   ========================================================================== */

.hd-projects-gallery {
	--hd-gallery-heading: var(--theme-headings-color, #334a64);
	--hd-gallery-text: var(--theme-text-color, #53677d);
	--hd-gallery-accent: var(--theme-palette-color-1, #20b9d7);
	--hd-gallery-soft:  var(--theme-palette-color-6 );
	--hd-gallery-border: rgba(51, 74, 100, 0.16);
	--hd-gallery-column-gap: 40px;
	--hd-gallery-row-gap: 58px;
	width: 100%;
}

/* --------------------------------------------------------------------------
   Filtres
   -------------------------------------------------------------------------- */

.hd-projects-filters {
	--hd-filter-navy: var(--theme-headings-color, #30465f);
	--hd-filter-cyan: var(--theme-palette-color-1, #20b9d7);
	--hd-filter-border: #d8e0e6;
	--hd-filter-soft: #f3f6f8;
	position: relative;
	display: flex;
	align-items: stretch;
	gap: 12px;
	margin: 0 0 clamp(42px, 6vw, 76px);
	padding: 18px;
	border-radius: 8px;
	background: var(--hd-filter-soft);
}

.hd-projects-filters__top {
	display: flex;
	flex: 0 0 auto;
}

.hd-projects-filters__reset {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 66px;
	padding: 0 24px;
	border: 1px solid var(--hd-filter-border);
	border-radius: 4px;
	background: #fff;
	color: var(--hd-filter-navy);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
	transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.hd-projects-filters__reset:hover {
	border-color: var(--hd-filter-cyan);
	color: var(--hd-filter-cyan);
}

.hd-projects-filters__reset.is-active {
	border-color: var(--hd-filter-navy);
	background: var(--hd-filter-navy);
	color: #fff;
}

.hd-projects-filters__grid {
	display: grid;
	flex: 1;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.hd-projects-filter {
	position: relative;
	min-width: 0;
}

.hd-projects-filter__toggle {
	position: relative;
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-rows: auto auto;
	align-items: center;
	gap: 4px 15px;
	width: 100%;
	min-height: 66px;
	padding: 12px 18px 12px 21px;
	overflow: hidden;
	border: 1px solid var(--hd-filter-border);
	border-radius: 4px;
	background: #fff;
	color: var(--hd-filter-navy);
	box-shadow: none;
	text-align: left;
	cursor: pointer;
	transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.hd-projects-filter__toggle::before {
	position: absolute;
	top: 13px;
	bottom: 13px;
	left: 0;
	width: 3px;
	background: var(--hd-filter-cyan);
	content: "";
}

.hd-projects-filter__toggle:hover {
	border-color: #afbec9;
}

.hd-projects-filter.is-open .hd-projects-filter__toggle {
	border-color: var(--hd-filter-navy);
	box-shadow: 0 8px 20px rgb(48 70 95 / 8%);
}

.hd-projects-filter__label {
	grid-column: 1;
	grid-row: 1;
	color: var(--hd-filter-cyan);
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

.hd-projects-filter__value {
	grid-column: 1;
	grid-row: 2;
	min-width: 0;
	overflow: hidden;
	color: var(--hd-filter-navy);
	font-size: 1rem;
	font-weight: 650;
	line-height: 1.3;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hd-projects-filter__chevron {
	grid-column: 2;
	grid-row: 1 / 3;
	position: relative;
	width: 11px;
	height: 11px;
	color: var(--hd-filter-cyan);
}

.hd-projects-filter__chevron::before {
	position: absolute;
	inset: 0;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	content: "";
	transform: rotate(45deg);
	transition: transform 180ms ease;
}

.hd-projects-filter.is-open .hd-projects-filter__chevron::before {
	transform: rotate(-135deg);
}

.hd-projects-filter__menu {
	position: absolute;
	top: calc(100% + 7px);
	left: 0;
	right: 0;
	z-index: 80;
	padding: 7px;
	border: 1px solid var(--hd-filter-border);
	border-radius: 4px;
	background: #fff;
	box-shadow: 0 14px 30px rgb(48 70 95 / 12%);
}

.hd-projects-filter__list {
	display: grid;
	gap: 3px;
	max-height: 340px;
	overflow-y: auto;
	padding-right: 2px;
}

.hd-projects-filter__option {
	position: relative;
	display: block;
	padding: 10px 13px;
	border-radius: 2px;
	color: var(--hd-filter-navy);
	line-height: 1.25;
	text-decoration: none;
	transition: color 180ms ease, background-color 180ms ease;
}

.hd-projects-filter__option:hover {
	background: var(--hd-filter-soft);
}

.hd-projects-filter__option.is-active {
	padding-left: 17px;
	background: var(--hd-filter-navy);
	color: #fff;
}

.hd-projects-filter__option.is-active::before {
	position: absolute;
	top: 8px;
	bottom: 8px;
	left: 6px;
	width: 3px;
	background: var(--hd-filter-cyan);
	content: "";
}

.hd-projects-filter__option-name {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hd-projects-filter__list::-webkit-scrollbar {
	width: 6px;
}

.hd-projects-filter__list::-webkit-scrollbar-thumb {
	border-radius: 999px;
	background: var(--hd-filter-border);
}

/* --------------------------------------------------------------------------
   Grille de secours puis masonry amélioré par JavaScript
   -------------------------------------------------------------------------- */

.hd-projects-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: var(--hd-gallery-column-gap);
	row-gap: var(--hd-gallery-row-gap);
	position: relative;
}

.hd-projects-grid.is-masonry-enhanced {
	display: block;
	min-height: 1px;
}

.hd-projects-grid.is-masonry-enhanced .hd-project-card {
	position: absolute;
	top: 0;
	left: 0;
	will-change: transform;
}

.hd-projects-grid.is-layout-ready .hd-project-card {
	transition: transform 280ms ease;
}

/* --------------------------------------------------------------------------
   Carte projet
   -------------------------------------------------------------------------- */

.hd-project-card {
	min-width: 0;
	margin: 0;
}

.hd-project-card__image-link {
	display: block;
	overflow: hidden;
	border-radius: 8px;
	background: var(--hd-gallery-soft);
	text-decoration: none;
}

.hd-project-card__image,
.hd-project-card__placeholder {
	display: block;
	width: 100%;
	height: auto;
}

.hd-project-card__image {
	transition: transform 550ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hd-project-card__image-link:hover .hd-project-card__image {
	transform: scale(1.018);
}

.hd-project-card__placeholder {
	aspect-ratio: 4 / 3;
	background: linear-gradient(135deg, #edf2f5, #dce6eb);
}

.hd-project-card__content {
	padding: 25px 8px 0;
}

.hd-project-card__eyebrow {
	margin: 0 0 9px;
	color: var(--hd-gallery-accent);
	font-size: 0.72rem;
	font-weight: 750;
	letter-spacing: 0.075em;
	line-height: 1.45;
	text-transform: uppercase;
}

.hd-project-card__title {
	margin: 0;
	color: var(--hd-gallery-heading);
	font-size: clamp(1.2rem, 1.55vw, 1.48rem);
	font-weight: 750;
	letter-spacing: -0.025em;
	line-height: 1.2;
}

.hd-project-card__title a {
	color: inherit;
	text-decoration: none;
}

.hd-project-card__title a:hover {
	color: var(--hd-gallery-accent);
}

.hd-project-card__excerpt {
	margin: 13px 0 0;
	color: var(--hd-gallery-text);
	font-size: 0.96rem;
	line-height: 1.68;
}

.hd-project-card__link {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin-top: 17px;
	color: var(--hd-gallery-heading);
	font-size: 0.76rem;
	font-weight: 800;
	letter-spacing: 0.055em;
	line-height: 1.3;
	text-decoration: none;
	text-transform: uppercase;
}

.hd-project-card__arrow {
	color: var(--hd-gallery-accent);
	font-size: 1.05rem;
	transition: transform 180ms ease;
}

.hd-project-card__link:hover .hd-project-card__arrow {
	transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Chargement progressif
   -------------------------------------------------------------------------- */

.hd-projects-gallery__more {
	display: flex;
	justify-content: center;
	margin-top: clamp(48px, 7vw, 86px);
}

.hd-projects-gallery__load {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 13px;
	min-height: 48px;
	padding: 0 25px;
	border: 1px solid var(--hd-gallery-heading);
	border-radius: 5px;
	background: transparent;
	color: var(--hd-gallery-heading);
	font-size: 0.77rem;
	font-weight: 800;
	letter-spacing: 0.055em;
	text-decoration: none;
	text-transform: uppercase;
}

.hd-projects-gallery__load:hover {
	border-color: var(--hd-gallery-accent);
	background: var(--hd-gallery-accent);
	color: #fff;
}

.hd-projects-gallery__load.is-loading {
	pointer-events: none;
	opacity: 0.58;
}

.hd-projects-gallery__load.is-loading .hd-projects-gallery__load-arrow {
	animation: hd-projects-loading 650ms ease-in-out infinite alternate;
}

.hd-projects-gallery__empty {
	grid-column: 1 / -1;
	margin: 0;
	padding: 42px;
	background: var(--hd-gallery-soft);
	color: var(--hd-gallery-text);
	text-align: center;
}

@keyframes hd-projects-loading {
	to { transform: translateY(6px); }
}

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

@media (max-width: 767px) {
	.hd-projects-gallery {
		--hd-gallery-row-gap: 46px;
	}

	.hd-projects-filters {
		flex-direction: column;
		gap: 10px;
		padding: 14px;
		margin-bottom: 42px;
	}

	.hd-projects-filters__top,
	.hd-projects-filters__grid {
		width: 100%;
	}

	.hd-projects-filters__grid {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.hd-projects-filters__reset {
		width: 100%;
		min-height: 52px;
	}

	.hd-projects-filter__toggle {
		min-height: 60px;
	}

	.hd-projects-filter__menu {
		position: static;
		margin-top: 7px;
	}

	.hd-projects-grid,
	.hd-projects-grid.is-masonry-enhanced {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		row-gap: var(--hd-gallery-row-gap);
		height: auto !important;
	}

	.hd-projects-grid.is-masonry-enhanced .hd-project-card {
		position: relative;
		width: auto !important;
		transform: none !important;
	}

	.hd-project-card__content {
		padding: 21px 4px 0;
	}

	.hd-project-card__title {
		font-size: 1.3rem;
	}

	.hd-project-card__excerpt {
		font-size: 0.97rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hd-project-card,
	.hd-project-card__image,
	.hd-project-card__arrow {
		transition: none !important;
	}
}
