/* ==========================================================================
   Réalisations
   1. Grille « bento » des domaines (page Réalisations)
   2. Projets et galeries (pages domaine)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Grille bento
   Composition de la maquette pour les 8 premières tuiles (selon leur rang) :
   1 grand carré | 2, 3 petites | 4 large | 5 petite | 6 grand carré | 7 haute | 8 petite.
   Au-delà de 8, les tuiles se placent en petites cases à la suite.
   -------------------------------------------------------------------------- */
.bento {
	padding-bottom: 90px;
}

.bento__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-auto-rows: 300px;
	gap: 10px;
}

.bento__tile {
	--shade: linear-gradient(45deg, rgba(21, 74, 31, .88) 0%, rgba(21, 74, 31, 0) 38%);

	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 16px;
}

.bento__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform .5s ease-in-out;
}

.bento__shade {
	position: absolute;
	inset: 0;
	background: var(--shade);
	opacity: 0;
	pointer-events: none;
	transition: opacity .4s ease-in-out;
}

.bento__label {
	position: absolute;
	left: 18px;
	bottom: 16px;
	color: var(--c-white);
	font-family: var(--f-title);
	font-weight: 600;
	font-size: 16px;
	text-transform: uppercase;
	text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}

.bento__tile:hover .bento__image {
	transform: scale(1.05);
}

.bento__tile:hover .bento__shade {
	opacity: 1;
}

/* Grandes tuiles : dégradé plus marqué */
.bento__tile:nth-child(1),
.bento__tile:nth-child(6),
.bento__tile:nth-child(7) {
	--shade: linear-gradient(45deg, rgba(21, 74, 31, .92) 0%, rgba(21, 74, 31, 0) 42%);
}

@media (min-width: 901px) {
	.bento__tile:nth-child(1) {
		grid-column: 1 / 3;
		grid-row: 1 / 3;
	}

	.bento__tile:nth-child(4) {
		grid-column: 3 / 5;
		grid-row: 2;
	}

	.bento__tile:nth-child(6) {
		grid-column: 2 / 4;
		grid-row: 3 / 5;
	}

	.bento__tile:nth-child(7) {
		grid-column: 4;
		grid-row: 3 / 5;
	}

	.bento__tile:nth-child(8) {
		grid-column: 1;
		grid-row: 4;
	}

	.bento__tile:nth-child(1) .bento__label,
	.bento__tile:nth-child(6) .bento__label {
		left: 24px;
		bottom: 22px;
		font-weight: 700;
	}

	.bento__tile:nth-child(1) .bento__label {
		font-size: 26px;
	}

	.bento__tile:nth-child(6) .bento__label {
		font-size: 24px;
	}

	.bento__tile:nth-child(4) .bento__label,
	.bento__tile:nth-child(7) .bento__label {
		left: 20px;
		bottom: 18px;
		font-size: 18px;
	}
}

/* Tablette et mobile : grille régulière de deux colonnes, libellés tous à la même petite taille */
@media (max-width: 900px) {
	.bento__grid {
		grid-template-columns: repeat(2, 1fr);
		grid-auto-rows: 180px;
		gap: 8px;
	}
}

/* --------------------------------------------------------------------------
   2. Projets (pages domaine)
   -------------------------------------------------------------------------- */
.project {
	position: relative;
	padding: 110px 0 130px;
}

.project__head {
	max-width: 700px;
	margin-bottom: 56px;
	padding: 0 5px;
}

.project__kicker {
	margin-bottom: 10px;
}

.project__title {
	margin: 0 0 28px;
	color: var(--c-ink);
	font-family: var(--f-title);
	font-weight: 600;
	font-size: clamp(30px, 3.4vw, 44px);
	line-height: 1.15;
	text-transform: uppercase;
}

.project__text {
	margin: 0;
	color: var(--c-muted);
	font-family: var(--f-text);
	font-size: 17.5px;
	line-height: 1.85;
}

/* Une seule image */
.project__single {
	max-width: 1100px;
	padding: 0 5px;
}

.project__single img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 16px;
}

/* Plusieurs images : bande défilante qui déborde jusqu'au bord droit de l'écran */
.project__track {
	display: flex;
	gap: 20px;
	margin-right: calc(-50vw + 50%);
	padding-left: 5px;
	overflow-x: auto;
	cursor: grab;
	user-select: none;
	scrollbar-width: none;
}

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

.project__track.is-dragging {
	cursor: grabbing;
}

.project__item {
	position: relative;
	flex: 0 0 auto;
	width: calc((100% - 40px) / 2.3);
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 16px;
	background: #eef1ee;
}

.project__item img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	pointer-events: none;
}

.project__spacer {
	flex: 0 0 1px;
}

.project__controls {
	display: flex;
	align-items: center;
	gap: 18px;
	margin-top: 32px;
	padding: 0 5px;
}

.project__arrow {
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border: 1.5px solid #d7dcd9;
	border-radius: 50%;
	background: var(--c-white);
	color: var(--c-ink);
	font-size: 18px;
	cursor: pointer;
}

.project__arrow:hover {
	border-color: var(--c-green);
	color: var(--c-green);
}

.project__progress {
	position: relative;
	flex: 1;
	height: 2px;
	overflow: hidden;
	border-radius: 2px;
	background: #e3e7ea;
}

.project__progress-bar {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	border-radius: 2px;
	background: var(--c-green);
}

@media (max-width: 900px) {
	.project {
		padding: 16px 0 72px;
	}

	.project__head {
		margin-bottom: 32px;
	}

	.project__item {
		width: 82vw;
	}
}

/* --------------------------------------------------------------------------
   3. Bouton flottant « Toutes les réalisations » (pages domaine)
   Fixé en bas à droite, il apparaît après 300 px de défilement (back-button.js).
   -------------------------------------------------------------------------- */
.back-button {
	position: fixed;
	right: 28px;
	bottom: 28px;
	z-index: 150;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 24px 14px 18px;
	border-radius: 40px;
	background: var(--c-ink);
	box-shadow: 0 12px 28px rgba(20, 30, 25, .28);
	color: var(--c-white);
	font-family: var(--f-title);
	font-weight: 600;
	font-size: 14px;
	letter-spacing: .6px;
	text-transform: uppercase;
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px);
	transition: opacity .3s ease, transform .3s ease, visibility .3s, background .25s ease;
}

.back-button.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.back-button:hover,
.back-button:focus-visible {
	background: var(--c-green);
	color: var(--c-white);
}

.back-button__icon {
	font-size: 16px;
	transition: transform .3s ease;
}

.back-button:hover .back-button__icon {
	transform: translateX(-3px);
}

.menu-open .back-button {
	visibility: hidden;
	opacity: 0;
}

@media (max-width: 600px) {
	.back-button {
		right: 16px;
		bottom: 16px;
		padding: 12px 18px 12px 14px;
		font-size: 12px;
	}
}

/* --------------------------------------------------------------------------
   Mobile et tablette : espaces verticaux resserrés (en fin de fichier pour primer)
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
	.bento {
		padding-bottom: 24px;
	}

	.project {
		padding-bottom: 56px;
	}
}
