/*
 * Zone d'intervention, chargée sur cette page seulement, après locale.css dont elle reprend
 * les sections, le texte rédigé et la clôture.
 *
 * Ce qui lui est propre, c'est la mesure. La route se lit sur une échelle de temps, de la base à
 * la limite de la zone élargie : les deux zones se posent au-dessus de leur part d'échelle
 * (--proche, fraction posée par le gabarit), et chaque ville y arrive à sa distance (--t).
 * Même trait que le trajet des pages locales : un départ cerclé, une arrivée pleine, l'eau entre
 * les deux.
 */

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

.zone-tete {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	padding-block: clamp(26px, 4vw, 40px) clamp(52px, 7vw, 88px);
}

/* La lueur se lève derrière la carte, là où la base lance ses ondes. */
.zone-tete::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		radial-gradient(42% 58% at 76% 46%, rgba(88, 152, 214, 0.15), rgba(88, 152, 214, 0) 70%),
		linear-gradient(180deg, rgba(18, 33, 58, 0.35), rgba(6, 13, 22, 0) 420px);
}

.zone-tete__grille {
	display: grid;
	gap: clamp(44px, 6vw, 64px);
}

@media (min-width: 960px) {
	.zone-tete__grille {
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
		align-items: center;
	}
}

.zone-tete__repere { margin-top: clamp(28px, 4.4vw, 52px); }

.zone-tete__titre {
	max-width: 9em;
	margin-top: 18px;
	font-size: clamp(42px, 6.4vw, 78px);
	line-height: 1;
	letter-spacing: -0.02em;
}

.zone-tete__chapo {
	max-width: 50ch;
	margin-top: clamp(20px, 2.6vw, 28px);
	font-size: clamp(16px, 1.5vw, 18px);
	line-height: 1.7;
	color: var(--text-2);
}

/* La carte déborde un peu vers la droite en grand écran : elle est le paysage de la page. */
@media (min-width: 960px) {
	.zone-tete__carte { margin-right: calc(-1 * clamp(0px, 2vw, 24px)); }
}

/* ---------------------------------------------------------------- Vérification */

/* Le formulaire de l'accueil (accueil.css), sous le chapeau : même saisie, même verdict. */
.zone-verif {
	display: grid;
	gap: 16px;
	max-width: 560px;
	margin-top: clamp(32px, 4.4vw, 48px);
}

.zone-verif .verdict:empty { display: none; }

.zone-verif .verdict:has(+ .zone-suite:not([hidden])) {
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
}

.zone-verif .zone-suite {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 22px;
	margin-top: -16px;
	padding: 18px;
	border: 1px solid var(--line-strong);
	border-top: 0;
	border-radius: 0 0 var(--r-md) var(--r-md);
	background: rgba(255, 255, 255, 0.02);
}

.zone-verif .verdict.est-ok + .zone-suite { border-color: rgba(71, 180, 137, 0.35); background: rgba(71, 180, 137, 0.05); }
.zone-verif .verdict.est-frais + .zone-suite { border-color: rgba(217, 154, 43, 0.35); background: rgba(217, 154, 43, 0.05); }
.zone-verif .verdict.est-refus + .zone-suite { border-color: rgba(111, 168, 220, 0.35); background: rgba(111, 168, 220, 0.05); }

.zone-verif .zone-suite .bouton { flex: 1 1 auto; max-width: 100%; }
.zone-verif .fleche { transition: transform var(--dur-lente) var(--ease); }
.zone-verif .bouton:hover .fleche,
.zone-verif .bouton:focus-visible .fleche { transform: translateX(4px); }
.zone-verif .lien-souligne { font-size: 14.5px; }

@media (min-width: 560px) {
	.zone-verif .zone-suite .bouton { flex: 0 1 auto; }
}

/* ---------------------------------------------------------------- Deux zones */

.zone-cercles__tete h2 {
	max-width: 17ch;
	margin-top: 22px;
	font-size: clamp(30px, 4vw, 46px);
}

.zone-cercles__tete .lieu-deux__intro { max-width: 58ch; }

/*
 * Deux bandes, la proche plus claire. En grand écran, la proche prend exactement sa part de
 * l'échelle (--proche) : la limite des deux zones tombe sur le repère des minutes de chaque
 * piste en dessous. Jamais moins de 260 px, pour que son texte respire.
 */
.zones {
	display: grid;
	gap: 12px;
	margin-top: clamp(40px, 5vw, 60px);
}

@media (min-width: 960px) {
	.zones {
		grid-template-columns: max(260px, calc(var(--proche) * 100%)) minmax(0, 1fr);
		gap: 0;
	}
}

.zones__zone {
	display: flex;
	flex-direction: column;
	padding: 24px clamp(20px, 2.4vw, 30px) 22px;
	border-top: 1px solid;
}

.zones__zone--proche {
	border-top-color: var(--water);
	background: linear-gradient(180deg, rgba(111, 168, 220, 0.11), rgba(111, 168, 220, 0.025));
}

.zones__zone--large {
	border-top-color: rgba(111, 168, 220, 0.38);
	background: linear-gradient(180deg, rgba(111, 168, 220, 0.045), rgba(111, 168, 220, 0.008));
}

@media (min-width: 960px) {
	.zones__zone--large { box-shadow: inset 1px 0 0 rgba(238, 242, 247, 0.1); }
}

.zones__nom {
	font-size: 11.5px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--water-2);
}

.zones__zone--large .zones__nom { color: var(--text-2); }

.zones__duree {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-top: 16px;
	font-family: var(--display);
	font-weight: 200;
	font-size: clamp(54px, 5.6vw, 72px);
	line-height: 0.9;
	color: var(--text);
}

.zones__duree small {
	font-family: var(--text-font);
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--text-3);
}

.zones__texte {
	max-width: 44ch;
	margin-top: 18px;
	font-size: 15.5px;
	line-height: 1.6;
	color: var(--text-2);
}

/* Ce qui justifie la route : l'entrée de chaque famille, son prix, et la réservation au bout. */
.zones__liste {
	max-width: 560px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

.zones__liste a {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 0;
	border-bottom: 1px solid var(--line);
	font-size: 14.5px;
	line-height: 1.4;
	color: var(--text);
	text-decoration: none;
	transition: border-color var(--dur-lente) var(--ease), color var(--dur-lente) var(--ease);
}

.zones__liste .prix {
	flex: none;
	font-family: var(--display);
	font-size: 16px;
	color: var(--water-2);
}

.zones__liste a:hover,
.zones__liste a:focus-visible { border-color: rgba(111, 168, 220, 0.55); color: #fff; }

/* Le décompte des localités, au pied de chaque zone : les deux pieds s'alignent. */
.zones__compte {
	margin-top: auto;
	padding-top: 26px;
	font-size: 11.5px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--text-3);
}

.zones__compte .prix {
	margin-right: 6px;
	font-family: var(--display);
	font-size: 22px;
	letter-spacing: 0.02em;
	color: var(--text);
}

/* ---------------------------------------------------------------- Échelle des trajets */

.echelle { margin: clamp(56px, 7vw, 88px) 0 0; }

.echelle__tete {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 32px;
}

.echelle__tete h3 {
	font-weight: 300;
	font-size: clamp(20px, 2.2vw, 26px);
	line-height: 1.25;
}

.echelle__tete p {
	max-width: 46ch;
	font-size: 14px;
	line-height: 1.55;
	color: var(--text-3);
}

/* La règle : la base à gauche, la limite de la zone proche, la limite de la zone élargie. */
.echelle__axe {
	position: relative;
	height: 34px;
	margin-top: 28px;
	border-bottom: 1px solid var(--line-strong);
	font-size: 11px;
	line-height: 1;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--text-3);
}

.echelle__axe span {
	position: absolute;
	bottom: 13px;
	white-space: nowrap;
}

/* Le départ : cerclé, comme sur le trajet des pages locales. */
.echelle__origine {
	left: 0;
	padding-left: 20px;
	color: var(--text-2);
}

.echelle__origine::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	width: 11px;
	height: 11px;
	margin-top: -6px;
	border: 1px solid rgba(238, 242, 247, 0.6);
	border-radius: 50%;
	background: var(--ink);
}

.echelle__seuil {
	left: calc(var(--proche) * 100%);
	transform: translateX(-50%);
	color: var(--water-2);
}

.echelle__fin { right: 0; }

/* Les graduations descendent des libellés jusqu'à la règle. */
.echelle__seuil::after,
.echelle__fin::after {
	content: '';
	position: absolute;
	top: calc(100% + 5px);
	width: 1px;
	height: 8px;
	background: currentColor;
	opacity: 0.6;
}

.echelle__seuil::after { left: 50%; }
.echelle__fin::after { right: 0; }

/* Sur un téléphone, le nom de la base mangerait la graduation des minutes : le cercle suffit. */
@media (max-width: 640px) {
	.echelle__origine { font-size: 0; padding-left: 11px; }
}

.echelle__lignes {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* En grand écran, la bande de la zone proche descend à travers l'échelle, dans le prolongement
   de son bloc. Empilés sur un téléphone, les blocs ne la portent plus : elle n'y dirait rien. */
@media (min-width: 960px) {
	.echelle__lignes { background: linear-gradient(90deg, rgba(111, 168, 220, 0.04) 0 calc(var(--proche) * 100%), transparent 0); }
}

/* Une ville : son titre et ses minutes, sa piste, puis la route et le déplacement. */
.echelle__ligne {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas:
		'titre  duree'
		'piste  piste'
		'detail frais';
	align-items: baseline;
	column-gap: 20px;
	padding: 20px 0 17px;
	border-bottom: 1px solid var(--line);
	color: var(--text);
	text-decoration: none;
	isolation: isolate;
}

/* Le survol monte comme un niveau d'eau, comme les lignes de l'index. */
.echelle__ligne::before {
	content: '';
	position: absolute;
	inset: 0 calc(-1 * clamp(4px, 1vw, 12px));
	z-index: -1;
	background: linear-gradient(90deg, rgba(111, 168, 220, 0.1), rgba(111, 168, 220, 0.02) 70%, transparent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform var(--dur-lente) var(--ease);
}

.echelle__ligne:hover,
.echelle__ligne:focus-visible { color: #fff; }

.echelle__ligne:hover::before,
.echelle__ligne:focus-visible::before { transform: scaleX(1); }

.echelle__ligne:focus-visible { outline-offset: -2px; }

.echelle__titre {
	grid-area: titre;
	text-wrap: balance;
	font-family: var(--display);
	font-weight: 300;
	font-size: clamp(17.5px, 1.8vw, 20px);
	line-height: 1.3;
}

.echelle__duree {
	grid-area: duree;
	justify-self: end;
	font-family: var(--display);
	font-weight: 200;
	font-size: clamp(24px, 2.4vw, 30px);
	line-height: 1;
	white-space: nowrap;
}

.echelle__duree small {
	margin-left: 5px;
	font-family: var(--text-font);
	font-size: 11px;
	font-weight: 400;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--text-3);
}

.echelle__piste {
	grid-area: piste;
	position: relative;
	height: 16px;
	margin-block: 12px 9px;
}

/* La route entière, plus claire dans la zone proche. */
.echelle__piste::before {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 1px;
	background: linear-gradient(90deg,
		rgba(111, 168, 220, 0.42) 0 calc(var(--proche) * 100%),
		rgba(238, 242, 247, 0.1) calc(var(--proche) * 100%) 100%);
}

/* La limite de la zone proche, graduée sur chaque piste. */
.echelle__piste::after {
	content: '';
	position: absolute;
	left: calc(var(--proche) * 100%);
	top: 3px;
	width: 1px;
	height: 10px;
	background: rgba(169, 207, 240, 0.45);
}

/* Le chemin parcouru, de la base à la ville : l'eau qui arrive. */
.echelle__trace {
	position: absolute;
	left: 0;
	top: calc(50% - 1px);
	width: calc(var(--t) * 100%);
	height: 2px;
	background: linear-gradient(90deg, rgba(238, 242, 247, 0.35), var(--water-2));
	transform-origin: left;
}

.echelle__point {
	position: absolute;
	left: calc(var(--t) * 100%);
	top: 50%;
	width: 11px;
	height: 11px;
	margin: -5.5px 0 0 -5.5px;
	border-radius: 50%;
	background: var(--water-2);
	box-shadow: 0 0 0 5px rgba(111, 168, 220, 0.16), 0 0 14px rgba(150, 200, 255, 0.55);
	transition: box-shadow var(--dur-lente) var(--ease);
}

.echelle__ligne:hover .echelle__point,
.echelle__ligne:focus-visible .echelle__point {
	box-shadow: 0 0 0 9px rgba(111, 168, 220, 0.2), 0 0 20px rgba(150, 200, 255, 0.7);
}

.echelle__detail {
	grid-area: detail;
	font-size: 13.5px;
	line-height: 1.45;
	color: var(--text-3);
}

.echelle__frais {
	grid-area: frais;
	justify-self: end;
	font-size: 13.5px;
	line-height: 1.45;
	text-align: right;
}

.echelle__frais.est-compris { color: var(--ok); }
.echelle__frais.est-frais { color: var(--warn); }

.echelle figcaption { margin-top: 18px; max-width: 70ch; }

/* ---------------------------------------------------------------- Déplacement */

.frais {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
	margin: 0;
	border-top: 1px solid var(--line);
}

.frais > div { padding: 26px 24px 26px 0; }

.frais > div + div {
	padding-left: clamp(20px, 2.6vw, 32px);
	border-left: 1px solid var(--line);
}

@media (max-width: 520px) {
	.frais > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}

.frais dt {
	font-size: 11px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--text-3);
}

.frais dd { margin: 14px 0 0; }

.frais__valeur {
	display: block;
	font-family: var(--display);
	font-weight: 200;
	font-size: clamp(48px, 5.4vw, 66px);
	line-height: 1;
	color: var(--text);
}

.frais__valeur small {
	margin-left: 8px;
	font-size: 0.26em;
	font-weight: 400;
	letter-spacing: 0.1em;
	color: var(--text-2);
}

.frais__note {
	display: block;
	max-width: 30ch;
	margin-top: 12px;
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--text-2);
}

/* Le calcul pour un vrai lieu : une addition posée, comme sur un bon de travail. */
.calcul {
	margin: clamp(30px, 4vw, 44px) 0 0;
	padding: clamp(22px, 2.6vw, 30px) clamp(20px, 2.6vw, 30px) 22px;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: linear-gradient(180deg, rgba(14, 28, 46, 0.72), rgba(8, 17, 28, 0.5));
}

.calcul__titre {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 11.5px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--text);
}

.calcul__titre span {
	color: var(--water);
}

.calcul__titre span::after {
	content: '';
	display: inline-block;
	width: 28px;
	height: 1px;
	margin-left: 12px;
	vertical-align: middle;
	background: rgba(238, 242, 247, 0.28);
}

.calcul__lignes {
	width: 100%;
	margin-top: 14px;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.calcul__lignes th,
.calcul__lignes td {
	padding: 12px 0;
	border-bottom: 1px solid var(--line);
	font-weight: 400;
	text-align: left;
	vertical-align: baseline;
}

.calcul__lignes th {
	font-size: 15px;
	line-height: 1.4;
	color: var(--text-2);
}

.calcul__lignes td {
	padding-left: 16px;
	font-family: var(--display);
	font-size: 17px;
	text-align: right;
	white-space: nowrap;
	color: var(--text);
}

.calcul__lignes tfoot th,
.calcul__lignes tfoot td {
	padding-top: 18px;
	border-bottom: 0;
	color: var(--text);
}

.calcul__lignes tfoot th { font-size: 15.5px; }

.calcul__lignes tfoot td {
	font-weight: 200;
	font-size: clamp(28px, 3vw, 34px);
	line-height: 1;
}

.calcul .aide { margin-top: 12px; }

/* 320 px : « approx. CHF 56 » en anglais élargissait la page de 4 px. Le total et les marges se resserrent. */
@media (max-width: 399.98px) {
	.calcul { padding-inline: 16px; }
	.calcul__lignes tfoot td { font-size: 24px; }
}

/* ---------------------------------------------------------------- Cantons */

.cantons {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--line);
}

.cantons li {
	padding: 22px 0 20px;
	border-bottom: 1px solid var(--line);
}

.cantons__tete {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 16px;
}

.cantons__tete b {
	font-family: var(--display);
	font-weight: 300;
	font-size: clamp(21px, 2.2vw, 26px);
	line-height: 1.2;
	color: var(--text);
}

.cantons__tete .prix {
	font-family: var(--display);
	font-weight: 200;
	font-size: clamp(24px, 2.6vw, 30px);
	line-height: 1;
	color: var(--text);
}

.cantons__tete small {
	margin-left: 8px;
	font-family: var(--text-font);
	font-size: 11px;
	font-weight: 400;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--text-3);
}

/*
 * Une barre par canton, à la même échelle pour les quatre : la part pleine reçoit toutes les
 * prestations, la part hachurée les seules interventions longues. La légende, sous la barre,
 * double chaque part d'une phrase : la hachure n'est jamais seule à porter le sens.
 */
.cantons__barre {
	display: flex;
	height: 7px;
	margin-top: 16px;
	background: rgba(255, 255, 255, 0.035);
}

.cantons__proche,
.cantons__large { display: block; height: 100%; }

.cantons__proche {
	width: calc(var(--proche) * 100%);
	background: linear-gradient(90deg, var(--water), var(--water-2));
}

.cantons__large {
	width: calc(var(--large) * 100%);
	background: repeating-linear-gradient(135deg, rgba(111, 168, 220, 0.55) 0 1px, transparent 1px 5px);
	box-shadow: inset 0 0 0 1px rgba(111, 168, 220, 0.35);
}

.cantons__detail {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 22px;
	margin-top: 12px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--text-2);
}

.cantons__part {
	display: inline-flex;
	align-items: center;
	gap: 9px;
}

.cantons__part::before {
	content: '';
	flex: none;
	width: 12px;
	height: 7px;
}

.cantons__part--proche::before { background: linear-gradient(90deg, var(--water), var(--water-2)); }

.cantons__part--large::before {
	background: repeating-linear-gradient(135deg, rgba(111, 168, 220, 0.55) 0 1px, transparent 1px 5px);
	box-shadow: inset 0 0 0 1px rgba(111, 168, 220, 0.35);
}

/* Un nom de lieu ou une unité ne se coupe pas (voir $insecable dans le gabarit). */
.insecable { white-space: nowrap; }

/* ---------------------------------------------------------------- Apparition */

/* accueil.js ne pose .a-reveler que sur ce qui est hors écran, et jamais en mouvement réduit. */
.zone .a-reveler {
	opacity: 0;
	transform: translateY(18px);
	filter: blur(6px);
	transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease);
}

.zone .a-reveler.est-revele { opacity: 1; transform: none; filter: none; }

/* À l'apparition, l'eau part de la base et chaque ville la reçoit à son tour. */
.echelle.a-reveler .echelle__trace {
	transition: transform 1.5s var(--ease) calc(0.35s + var(--i, 0) * 0.08s);
}

.echelle.a-reveler .echelle__point {
	transition: left 1.5s var(--ease) calc(0.35s + var(--i, 0) * 0.08s), opacity 0.3s linear calc(0.35s + var(--i, 0) * 0.08s), box-shadow var(--dur-lente) var(--ease);
}

.echelle.a-reveler:not(.est-revele) .echelle__trace { transform: scaleX(0); }
.echelle.a-reveler:not(.est-revele) .echelle__point { left: 0; opacity: 0; }

/* Les barres des cantons se remplissent de gauche à droite. */
.a-reveler .cantons__barre { transition: clip-path 1.4s var(--ease) 0.3s; }
.a-reveler:not(.est-revele) .cantons__barre { clip-path: inset(0 100% 0 0); }
