/*
 * Prestations et prix (page-prestations.php).
 *
 * Une page qui se regarde. En tête, l'aperçu : chaque famille, son dessin et son prix d'entrée,
 * tout le catalogue d'un coup d'œil. Puis une bande par famille, séparée de la suivante par un
 * filet et du vide : à gauche son dessin, son nom et la phrase du client, à droite une ligne par
 * prix. On n'encadre que ce qui se choisit : ces lignes, rien d'autre.
 *
 * Une ligne se lit comme une carte de restaurant : ce que c'est à gauche, combien à droite (le
 * montant en grand, les centimes en petit), et combien de temps sous le prix. Survolée, elle se
 * remplit d'eau : seul ce qui se touche réagit, la bande reste posée.
 *
 * Bande en deux colonnes à partir de 1100 px, alignées sur la tête de page. En dessous, la
 * famille passe au-dessus de ses prix. Rien ne dépend d'un script.
 */

/* ---------------------------------------------------------------- Tête */

.tarifs__tete {
	display: grid;
	gap: 22px clamp(40px, 5.5vw, 80px);
	padding-block: clamp(40px, 7vw, 88px) clamp(30px, 4.4vw, 52px);
}

@media (min-width: 960px) {
	.tarifs__tete {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		align-items: end;
	}
}

.tarifs__titre {
	max-width: 12ch;
	margin-top: 22px;
	font-size: clamp(36px, 5vw, 58px);
}

.tarifs__chapo {
	max-width: 46ch;
	font-size: clamp(15px, 1.4vw, 17px);
	line-height: 1.7;
	color: var(--text-2);
}

.tarifs__chapo p + p { margin-top: 0.8em; }

@media (min-width: 960px) {
	.tarifs__chapo { padding-bottom: 6px; }
}

/* ---------------------------------------------------------------- Aperçu */

/* Trois familles par rangée au téléphone, une seule rangée sur grand écran. */
.apercu { margin-bottom: clamp(16px, 3vw, 28px); }

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

.apercu__lien {
	position: relative;
	display: grid;
	grid-template-rows: auto 1fr auto;
	justify-items: center;
	gap: 3px;
	height: 100%;
	padding: 14px 4px 12px;
	overflow: hidden;
	isolation: isolate;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: linear-gradient(180deg, rgba(14, 28, 46, 0.6), rgba(8, 17, 28, 0.35));
	color: var(--text);
	text-align: center;
	text-decoration: none;
	transition: border-color var(--dur) var(--ease);
}

.apercu__rond {
	display: block;
	width: 34px;
	height: 34px;
	margin-bottom: 6px;
	color: var(--text-2);
	transition: color var(--dur) var(--ease);
}

.apercu__nom {
	font-family: var(--display);
	font-size: 14.5px;
	line-height: 1.2;
}

.apercu__prix {
	font-size: 12px;
	line-height: 1.35;
	color: var(--water-2);
	white-space: nowrap;
}

/* Sur tablette, le dessin à gauche du nom : trois rangées basses plutôt que trois hautes. */
@media (min-width: 600px) {
	.apercu__liste { gap: 10px; }

	.apercu__lien {
		grid-template-columns: 40px minmax(0, 1fr);
		grid-template-rows: auto auto;
		justify-items: start;
		align-items: center;
		column-gap: 14px;
		padding: 14px 16px;
		text-align: left;
	}

	.apercu__rond { grid-row: 1 / span 2; width: 40px; height: 40px; margin: 0; }
	.apercu__nom { align-self: end; font-size: 16px; }
	.apercu__prix { align-self: start; font-size: 13px; }
}

/* Sur grand écran, toutes les familles sur une rangée, quel qu'en soit le nombre. */
@media (min-width: 1100px) {
	.apercu__liste {
		grid-auto-columns: minmax(0, 1fr);
		grid-auto-flow: column;
		grid-template-columns: none;
		gap: 8px;
	}

	.apercu__lien {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto 1fr auto;
		justify-items: center;
		align-items: start;
		padding: 18px 6px 16px;
		text-align: center;
	}

	.apercu__rond { grid-row: auto; width: 38px; height: 38px; margin-bottom: 8px; }
	.apercu__nom { align-self: auto; font-size: 15px; }
	.apercu__prix { align-self: auto; font-size: 12px; }
}

/* ---------------------------------------------------------------- Bandes */

.familles {
	margin: 0;
	border-bottom: 1px solid var(--line);
}

.famille {
	--rond: 52px;
	display: grid;
	gap: 18px;
	padding-block: clamp(26px, 4vw, 44px);
	border-top: 1px solid var(--line);
	scroll-margin-top: calc(var(--entete) + 8px);
}

.famille:first-child { border-top: 0; }

@media (min-width: 600px) {
	.famille { --rond: 60px; gap: 24px; }
}

/* Deux colonnes, sur la même grille que la tête de page : les prix partent sous le chapeau. */
@media (min-width: 1100px) {
	.famille {
		--rond: 68px;
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		column-gap: clamp(40px, 5.5vw, 80px);
		align-items: start;
	}
}

.famille__tete {
	display: grid;
	grid-template-columns: var(--rond) minmax(0, 1fr);
	align-items: start;
	column-gap: 18px;
}

.famille__rond {
	display: grid;
	place-items: center;
	width: var(--rond);
	height: var(--rond);
	border: 1px solid var(--line-strong);
	border-radius: 50%;
	background: radial-gradient(circle at 50% 30%, #11243b, var(--ink) 74%);
	color: var(--text-2);
	transition: border-color var(--dur-lente) var(--ease), color var(--dur-lente) var(--ease);
}

.famille__rond .picto { width: 60%; height: 60%; }

/* Arrivé depuis l'aperçu : la famille visée se signale, son dessin dans l'eau claire. */
.famille:target .famille__rond {
	background: radial-gradient(circle at 50% 30%, rgba(111, 168, 220, 0.28), var(--ink) 78%);
	box-shadow: 0 0 0 4px rgba(111, 168, 220, 0.12);
}

.famille:hover .famille__rond,
.famille:focus-within .famille__rond,
.famille:target .famille__rond {
	border-color: rgba(111, 168, 220, 0.55);
	color: var(--text);
}

/* Le nom centré sur le dessin quand il tient sur une ligne, la suite dessous. */
.famille__texte { padding-top: calc((var(--rond) - 1.15em) / 2 - 2px); font-size: clamp(22px, 2.3vw, 28px); }

.famille__titre {
	font-weight: 300;
	font-size: 1em;
	line-height: 1.15;
}

/* La phrase du client, quand toute la famille répond au même constat. */
.famille__constat {
	max-width: 38ch;
	margin-top: 8px;
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--text-2);
}

.famille__constat::before { content: '«\00a0'; color: var(--text-3); }
.famille__constat::after { content: '\00a0»'; color: var(--text-3); }

.famille__fiches {
	display: flex;
	flex-wrap: wrap;
	gap: 0 14px;
	margin-top: 6px;
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--text-3);
}

.famille__fiches a {
	padding-block: 6px;
	color: var(--water);
	text-decoration: underline;
	text-decoration-color: rgba(111, 168, 220, 0.4);
	text-underline-offset: 3px;
}

.famille__fiches a:hover { text-decoration-color: var(--water-2); }

.famille__fiches span { padding-block: 6px; }

/* Au doigt, chaque lien fait 44 px de haut : il ne doit pas falloir viser. */
@media (pointer: coarse), (max-width: 599.98px) {
	.famille__fiches { align-items: center; }
	.famille__fiches a { display: inline-flex; align-items: center; min-height: 44px; padding-block: 0; }
}

/* Le nom commun des variantes, écrit une fois au-dessus de leurs offres. */
.famille__service {
	margin-bottom: 10px;
	font-size: 11.5px;
	line-height: 1.5;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--text-3);
}

/* ---------------------------------------------------------------- Prix */

.offres {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/*
 * Une ligne par prix : le nom (et la phrase du client) à gauche, le prix et la durée l'un sous
 * l'autre à droite, la flèche au bord.
 */
.offre {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto 14px;
	grid-template-areas:
		"nom prix fleche"
		"phrase info fleche";
	align-items: center;
	gap: 2px 14px;
	min-height: 64px;
	padding: 12px 14px;
	overflow: hidden;
	isolation: isolate;
	border: 1px solid var(--line-strong);
	border-radius: var(--r-lg);
	background: linear-gradient(180deg, rgba(18, 36, 56, 0.5), rgba(11, 22, 36, 0.35));
	color: var(--text);
	text-decoration: none;
	transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

@media (min-width: 600px) {
	.offre {
		gap: 3px 22px;
		min-height: 72px;
		padding: 14px 18px 14px 20px;
	}
}

/* L'eau monte dans la ligne pointée : un voile, et la surface en filet clair. */
.offre::before,
.apercu__lien::before {
	content: '';
	position: absolute;
	z-index: -1;
	inset: 0;
	border-top: 1px solid rgba(169, 207, 240, 0.32);
	background: linear-gradient(180deg, rgba(111, 168, 220, 0.16), rgba(111, 168, 220, 0.05));
	transform: translateY(101%);
	transition: transform 0.28s var(--ease);
}

.offre__nom {
	grid-area: nom;
	align-self: end;
	font-family: var(--display);
	font-weight: 300;
	font-size: 16.5px;
	line-height: 1.3;
}

/* Sans phrase, le nom occupe la hauteur de la ligne, face au prix et à sa durée. */
.offre:not(:has(.offre__phrase)) .offre__nom { grid-row: 1 / span 2; align-self: center; }

@media (min-width: 600px) {
	.offre__nom { font-size: 18px; }
}

/* Une barre de plus par cran de taille, comme un niveau d'eau. */
.jauge {
	display: inline-flex;
	align-items: flex-end;
	gap: 2px;
	height: 0.72em;
	margin-left: 10px;
	vertical-align: baseline;
}

.jauge i {
	display: block;
	width: 4px;
	background: rgba(255, 255, 255, 0.16);
}

.jauge i.plein { background: var(--water); }

/* La phrase du client sous le nom, quand les variantes répondent à des constats différents. */
.offre__phrase {
	grid-area: phrase;
	align-self: start;
	font-size: 13.5px;
	line-height: 1.45;
	color: var(--text-2);
}

.offre__prix {
	grid-area: prix;
	justify-self: end;
	align-self: end;
	white-space: nowrap;
	font-family: var(--display);
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
	color: var(--water-2);
	transition: color var(--dur) var(--ease);
}

.prix-vu__montant {
	font-weight: 200;
	font-size: 25px;
	letter-spacing: -0.01em;
}

.prix-vu__reste {
	font-weight: 300;
	font-size: 12.5px;
	color: var(--text-2);
}

@media (min-width: 600px) {
	.prix-vu__montant { font-size: 30px; }
	.prix-vu__reste { font-size: 13px; }
}

/* La durée sur place, sous le prix. */
.offre__info {
	grid-area: info;
	justify-self: end;
	align-self: start;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12.5px;
	line-height: 1.4;
	white-space: nowrap;
	/* Pas le gris tertiaire : sur une ligne remplie d'eau, il tombait à 4,2:1. */
	color: var(--text-2);
}

.offre__picto {
	display: block;
	flex: none;
	width: 14px;
	height: 14px;
}

.offre__fleche {
	grid-area: fleche;
	grid-row: 1 / span 2;
	color: var(--water);
	font-size: 15px;
	line-height: 1;
	opacity: 0.6;
	transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

/* Sur devis : la même ligne, en pointillé, et ce qu'on y obtient à la place de la durée. */
.offre--devis {
	border-style: dashed;
	background: none;
}

.offre--devis .offre__nom { color: var(--text-2); }

.offre--devis .offre__prix {
	font-weight: 300;
	font-size: 18px;
	color: var(--text-2);
}

@media (min-width: 600px) {
	.offre--devis .offre__prix { font-size: 20px; }
}

/* Survol et focus : seul ce qui se touche bouge. */
.offre:hover,
.offre:focus-visible,
.apercu__lien:hover,
.apercu__lien:focus-visible {
	border-color: rgba(111, 168, 220, 0.55);
	color: #fff;
}

.offre:hover::before,
.offre:focus-visible::before,
.apercu__lien:hover::before,
.apercu__lien:focus-visible::before { transform: none; transition-duration: 0.45s; }

/* Au doigt, l'appui remplit la ligne tout de suite : le geste a été pris. */
.offre:active,
.apercu__lien:active { border-color: rgba(111, 168, 220, 0.55); }

.offre:active::before,
.apercu__lien:active::before { transform: none; transition-duration: 0.12s; }

.offre:hover .offre__prix,
.offre:focus-visible .offre__prix,
.offre:hover .offre__nom,
.offre:focus-visible .offre__nom { color: #fff; }

.apercu__lien:hover .apercu__rond,
.apercu__lien:focus-visible .apercu__rond { color: var(--text); }

.offre:hover .offre__fleche,
.offre:focus-visible .offre__fleche { opacity: 1; transform: translateX(3px); }

/* Au doigt, pas de survol : la flèche reste allumée, c'est elle qui dit « ça s'ouvre ». */
@media (hover: none) {
	.offre__fleche { opacity: 1; }
}

/* ---------------------------------------------------------------- Mouvement */

/* La goutte du robinet et de la fuite tombe tant que la bande est survolée. */
@keyframes famille-goutte {
	0%, 20% { opacity: 1; transform: none; }
	70% { opacity: 0; transform: translateY(5px); }
	71% { opacity: 0; transform: translateY(-3px); }
	100% { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
	.famille__rond .goutte { transform-box: fill-box; }

	.famille:hover .famille__rond .goutte { animation: famille-goutte 1.6s var(--ease) infinite; }

	/* Chaque ligne se pose en entrant dans l'écran, là où le navigateur sait lier l'animation au
	   défilement. Ailleurs, elle est là d'emblée. Un mouvement sans fondu : une ligne arrêtée à
	   moitié de son entrée doit se lire aussi bien qu'une autre (un fondu la laissait à 3:1). */
	@supports (animation-timeline: view()) {
		.famille__tete,
		.famille__service,
		.offres > li {
			animation: famille-entree linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 100%;
		}
	}
}

@keyframes famille-entree {
	from { transform: translateY(16px); }
}

/* ---------------------------------------------------------------- Ce qui peut s'ajouter */

.supplements__tete {
	display: grid;
	gap: 18px clamp(40px, 5.5vw, 80px);
	margin-bottom: clamp(30px, 4.4vw, 52px);
}

@media (min-width: 960px) {
	.supplements__tete {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		align-items: end;
	}
}

.supplements__tete h2 { margin-top: 18px; }

.supplements__intro {
	max-width: 46ch;
	font-size: clamp(15px, 1.4vw, 16.5px);
	line-height: 1.7;
	color: var(--text-2);
}

/* Trois chiffres, séparés par des filets : ce qui est compris, puis ce qui s'ajoute. */
.plus {
	display: grid;
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--line);
}

.plus__item {
	display: grid;
	grid-template-columns: 40px minmax(0, 1fr);
	column-gap: 20px;
	padding-block: 24px;
	border-bottom: 1px solid var(--line);
}

.plus__picto {
	display: block;
	width: 40px;
	height: 40px;
	color: var(--text-2);
}

.plus__titre {
	font-family: var(--text-font);
	font-weight: 400;
	font-size: 11px;
	line-height: 1.5;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--text-3);
}

.plus__chiffre {
	margin-top: 8px;
	font-family: var(--display);
	font-weight: 200;
	font-size: clamp(34px, 3.8vw, 46px);
	line-height: 1.05;
	letter-spacing: -0.01em;
	color: var(--text);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.plus__chiffre small {
	font-size: 0.42em;
	font-weight: 300;
	letter-spacing: 0.02em;
	color: var(--text-2);
}

.plus__sep {
	margin-inline: 0.22em;
	color: var(--water);
}

.plus__texte {
	max-width: 32ch;
	margin-top: 8px;
	font-size: 14.5px;
	line-height: 1.6;
	color: var(--text-2);
}

@media (min-width: 800px) {
	/* Autant de colonnes égales que de chiffres : trois, ou deux sans soir ni nuit. */
	.plus {
		grid-auto-columns: minmax(0, 1fr);
		grid-auto-flow: column;
	}

	.plus__item {
		display: block;
		padding: 34px clamp(20px, 2.8vw, 40px) 36px;
	}

	.plus__item:first-child { padding-left: 0; }
	.plus__item:last-child { padding-right: 0; }
	.plus__item + .plus__item { border-left: 1px solid var(--line); }

	.plus__picto { width: 44px; height: 44px; margin-bottom: 24px; }
}

/* ---------------------------------------------------------------- Aide */

.aide-choix {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr);
	gap: 22px 22px;
	align-items: start;
}

.aide-choix__rond {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border: 1px solid var(--line-strong);
	border-radius: 50%;
	background: radial-gradient(circle at 50% 30%, #11243b, var(--ink) 74%);
	color: var(--text-2);
}

.aide-choix__rond .picto { width: 58%; height: 58%; }

.aide-choix__titre { font-size: clamp(24px, 2.8vw, 32px); }

.aide-choix__texte {
	max-width: 56ch;
	margin-top: 12px;
	font-size: 15px;
	line-height: 1.7;
	color: var(--text-2);
}

.aide-choix__bouton { grid-column: 2; justify-self: start; }

@media (max-width: 559px) {
	.aide-choix { grid-template-columns: minmax(0, 1fr); }
	.aide-choix__bouton { grid-column: 1; }
}

@media (min-width: 960px) {
	.aide-choix {
		grid-template-columns: 72px minmax(0, 1fr) auto;
		column-gap: clamp(28px, 3.4vw, 44px);
		align-items: center;
	}

	.aide-choix__rond { width: 72px; height: 72px; }
	.aide-choix__bouton { grid-column: 3; }
}
