/*
 * The bands of the home page after the first: the route and its cards, the sheet, the cards of the
 * receipt and of the rest of the day, the one screen, the questions, the call. The pages of the
 * questions (/questions/ and each question) are bands too, and take the same rules.
 *
 * Written for the phone; a wider screen adds rules. Colours and sizes come from Elementor's kit
 * (--nuit, --espace-16 …); the sign-in door's materials come from style.css (--ro-bleu-*,
 * --ro-sol-*, --ro-ombre-*, --ro-coin-*, --ro-police-*, --ro-anneaux-*, --ro-grain-*).
 * Nothing here moves by itself: no transition, no animation.
 */

/* The head of a band */

.ro-bands [id],
.ro-bands[id] {
	scroll-margin-block-start: var(--ro-hauteur-entete);
}

.ro-bands__head {
	margin-block-end: var(--espace-32);
	max-inline-size: 68ch;
}

.ro-bands__head h1,
.ro-bands__head h2 {
	margin-block: 0;
}

/* The h1 of a question's own page is a sentence: it is set as an h2 is, not as the title of a page. */
.ro-bands__head--question h1 {
	font-size: var(--titre-2);
	line-height: 1.15;
}

.ro-bands__lead {
	margin-block: var(--espace-12) 0;
	color: var(--ardoise);
	font-family: var(--ro-police-texte);
	font-size: var(--chapeau);
	line-height: 1.5;
}

.ro-route__text p,
.ro-questions__answer p {
	margin-block: var(--espace-12) 0;
	max-inline-size: 68ch;
}

/*
 * The card: the one component of the bands, drawn as the door draws its three. A tile with an icon,
 * then facts (a label, a value, a caption) or a feature (a title, a text, a link). It does not
 * lift when touched: nothing on the page moves by itself but the hero's sweep.
 */

.ro-icon {
	display: block;
	flex: none;
	inline-size: 18px;
	block-size: 18px;
}

.ro-card {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: var(--espace-16);
	min-inline-size: 0;
	max-inline-size: none;
	margin: 0;
	padding: 20px;
	border: 1px solid var(--ro-bleu-100);
	border-radius: var(--ro-coin-carte);
	background: var(--ro-sol-carte);
	box-shadow: var(--ro-ombre-carte);
	color: var(--nuit);
	font-family: var(--ro-police-texte);
	list-style: none;
}

.ro-card__tile {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	inline-size: 36px;
	block-size: 36px;
	border-radius: var(--ro-coin-controle);
	background-color: var(--ro-bleu-50);
	color: var(--ro-bleu-600);
}

.ro-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--espace-4);
	min-inline-size: 0;
}

/* Facts: a label, a value as big as 8 characters allow, a caption. */

.ro-card__label {
	margin: 0;
	color: var(--ro-gris-600);
	font-size: 13px;
	font-weight: 600;
	line-height: 18px;
}

.ro-card__value {
	margin: 0;
	color: var(--nuit);
	font-family: var(--ro-police-titre);
	font-size: calc(var(--fit, 1) * clamp(22px, 2.2vw, 30px));
	font-stretch: 100%;
	font-weight: 800;
	letter-spacing: -0.5px;
	line-height: 1.13;
	white-space: nowrap;
}

.ro-card__caption {
	margin: 0;
	color: var(--ro-gris-600);
	font-size: 13px;
	line-height: 18px;
}

/* A feature: a title, a text, a link when its address is set. */

.ro-card__title {
	margin: 0;
	color: var(--nuit);
	font-family: var(--ro-police-texte);
	font-size: 1.125rem;
	font-stretch: 100%;
	font-weight: 600;
	line-height: 1.3;
}

.ro-card__text {
	margin: var(--espace-4) 0 0;
	color: var(--ardoise);
	font-size: 1rem;
	line-height: 1.55;
}

.ro-card__link {
	margin: 0;
}

.ro-card__link .ro-link {
	display: inline-flex;
	align-items: center;
	min-block-size: 44px;
	/* Focused from the keyboard, it scrolls clear of the action bar that stands at the foot of a phone. */
	scroll-margin-block-end: calc(var(--ro-hauteur-barre, 0px) + var(--espace-16));
}

/* A grid of cards: one column on a phone, two from 768 px, three from 1025 px. Two cards stay two. */

.ro-cards {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--espace-24);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Route: an ordered list whose marker is the blue line; each step has its card */

.ro-route {
	position: relative;
	margin: 0;
	padding: 0;
	padding-inline-start: var(--espace-24);
	list-style: none;
	counter-reset: ro-route;
}

/* The line: the one gradient of the site. */
.ro-route::before {
	content: "";
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	inline-size: 4px;
	border-radius: 2px;
	background-image: linear-gradient(to bottom, var(--azur), var(--roi));
}

.ro-route__step {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--espace-16);
	/* A step holds a card beside its text: it is not held to the measure of a list item. */
	max-inline-size: none;
	counter-increment: ro-route;
}

.ro-route__step + .ro-route__step {
	margin-block-start: var(--espace-48);
}

.ro-route__text {
	min-inline-size: 0;
}

.ro-route__title {
	margin-block: 0;
}

.ro-route__title::before {
	content: counter(ro-route) ". ";
	color: var(--roi);
	font-variant-numeric: tabular-nums;
}

.ro-route__step > .ro-card {
	inline-size: 100%;
}

/* The sheet of the specimen: centred in its band, its fold is in document.css */

.ro-sheet {
	max-inline-size: 720px;
	margin-inline: auto;
}

/* The one screen: the door's panel around the capture */

.ro-screen {
	margin: 0;
	min-inline-size: 0;
}

.ro-screen__panel {
	position: relative;
	/* The rings and the grain are layers under the card: this makes their place. */
	isolation: isolate;
	overflow: hidden;
	padding-block: var(--espace-24) 0;
	padding-inline: var(--espace-24) 0;
	border-radius: var(--ro-coin-panneau);
	background: var(--ro-sol-panneau);
}

/* The contour rings, as masks filled with a blue: top end and bottom start, at the door's scale. */
.ro-screen__panel::before,
.ro-screen__panel::after,
.ro-call::before,
.ro-call::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: var(--ro-bleu-500);
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: min(100%, 808px) auto;
	mask-size: min(100%, 808px) auto;
}

.ro-screen__panel::before {
	opacity: 0.26;
	-webkit-mask-image: var(--ro-anneaux-hd);
	mask-image: var(--ro-anneaux-hd);
	-webkit-mask-position: right top;
	mask-position: right top;
}

.ro-screen__panel::after {
	opacity: 0.2;
	-webkit-mask-image: var(--ro-anneaux-bg);
	mask-image: var(--ro-anneaux-bg);
	-webkit-mask-position: left bottom;
	mask-position: left bottom;
}

/* The grain: the door's, drawn on the ground at 12 % (25 % on the night). */
.ro-grain {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--ro-grain-fort) 0 0 / 100% 100%;
	opacity: var(--ro-grain-opacite, 0.12);
	pointer-events: none;
}

/* The capture: a white card that bleeds out of the panel's far bottom corner. */
.ro-screen__frame {
	display: block;
	margin-inline-end: -8%;
	margin-block-end: -6%;
	overflow: hidden;
	border: 1px solid var(--trait);
	border-radius: var(--coin-ecran);
	background-color: var(--papier);
	box-shadow: var(--ro-ombre-cadre);
}

.ro-screen__frame img {
	display: block;
	inline-size: 100%;
	block-size: auto;
	border-radius: 0;
}

.ro-screen__caption {
	margin-block-start: var(--espace-12);
	color: var(--ardoise);
	font-family: var(--ro-police-texte);
	font-size: var(--petit);
	font-weight: 500;
	line-height: 1.5;
}

/* Questions: open, no accordion, no card; a line between two questions */

.ro-questions {
	max-inline-size: 68ch;
	font-family: var(--ro-police-texte);
}

.ro-questions__index {
	margin: 0 0 var(--espace-32);
	padding: 0;
	list-style: none;
}

.ro-questions__index a {
	display: inline-block;
	padding-block: var(--espace-12);
	scroll-margin-block-end: calc(var(--ro-hauteur-barre, 0px) + var(--espace-16));
}

.ro-questions__item + .ro-questions__item {
	margin-block-start: var(--espace-32);
	padding-block-start: var(--espace-32);
	border-block-start: 1px solid var(--trait);
}

/* An h3 in the home page's band, an h2 on the archive: the same look at either level. */
.ro-questions__question {
	margin-block: 0;
	font-family: var(--ro-police-texte);
	font-size: var(--titre-3);
	font-stretch: 100%;
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.25;
}

/* The page of one question leads back to all of them. */
.ro-questions__all {
	margin-block: var(--espace-32) 0;
}

.ro-questions__all .ro-link {
	display: inline-flex;
	align-items: center;
	min-block-size: 44px;
	/* Focused from the keyboard, it scrolls clear of the action bar that stands at the foot of a phone. */
	scroll-margin-block-end: calc(var(--ro-hauteur-barre, 0px) + var(--espace-16));
}

/* Call: the one dark band, on the door's night; the one thing that is centred */

.ro-band.ro-call {
	position: relative;
	/* The rings and the grain are layers under the text. */
	isolation: isolate;
	overflow: hidden;
	background: var(--ro-sol-nuit);
	color: var(--papier);
}

.ro-call::before,
.ro-call::after {
	background: var(--ro-bleu-400);
	opacity: 0.2;
}

.ro-call::before {
	-webkit-mask-image: var(--ro-anneaux-hd);
	mask-image: var(--ro-anneaux-hd);
	-webkit-mask-position: right top;
	mask-position: right top;
}

.ro-call::after {
	-webkit-mask-image: var(--ro-anneaux-bg);
	mask-image: var(--ro-anneaux-bg);
	-webkit-mask-position: left bottom;
	mask-position: left bottom;
}

.ro-call .ro-grain {
	--ro-grain-opacite: 0.25;
}

.ro-call__inner {
	max-inline-size: 44rem;
	margin-inline: auto;
	text-align: center;
}

.ro-call__sentence {
	margin-block: 0;
	color: var(--papier);
	font-family: var(--ro-police-titre);
	font-weight: 800;
}

.ro-call__action {
	margin-block: var(--espace-32) 0;
	margin-inline: auto;
}

.ro-call__note {
	margin-block: var(--espace-12) 0;
	margin-inline: auto;
	color: var(--ro-bleu-200);
	font-family: var(--ro-police-texte);
	font-size: var(--petit);
	font-weight: 500;
}

.ro-call__ways {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--espace-8) var(--espace-32);
	margin: var(--espace-24) 0 0;
	padding: 0;
	list-style: none;
	font-family: var(--ro-police-texte);
}

.ro-call__ways a {
	display: inline-block;
	padding-block: var(--espace-12);
}

/* Right to left: the rings turn with the reading, as the door's do. */
[dir="rtl"] .ro-screen__panel::before,
[dir="rtl"] .ro-screen__panel::after,
[dir="rtl"] .ro-call::before,
[dir="rtl"] .ro-call::after {
	transform: scaleX(-1);
}

@media (min-width: 768px) {
	.ro-route {
		padding-inline-start: var(--espace-48);
	}

	/* The text on the start side, its card on the end side: the card is 320 px at most. */
	.ro-route__step {
		grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
		align-items: start;
		column-gap: var(--espace-32);
	}

	/* A step without a card keeps the whole line. */
	.ro-route__text:only-child {
		grid-column: 1 / -1;
	}

	.ro-route__step + .ro-route__step {
		margin-block-start: var(--espace-64);
	}

	.ro-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ro-screen__panel {
		padding-block: var(--espace-48) 0;
		padding-inline: var(--espace-48) 0;
	}
}

@media (min-width: 1025px) {
	.ro-route__step {
		column-gap: var(--espace-48);
	}

	.ro-cards {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.ro-cards--paire {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
