/*
 * La zone de photos : le tunnel de réservation (étape des coordonnées) et le formulaire de
 * demande de la page Contact. Chargée sur ces deux pages seulement, après leur feuille.
 */

/* ---------------------------------------------------------------- Photos */

/*
 * Une grande zone à toucher ou à survoler de fichiers, puis les photos en vignettes, chacune avec
 * sa croix. Le champ du navigateur reste dessous, invisible mais atteignable au clavier : son
 * focus s'affiche sur la zone. Sans script (pas de .est-ameliore), il reste seul, tel quel.
 */
.photos { position: relative; }

.photos.est-ameliore .photos__entree {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.photos__zone {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr);
	align-items: center;
	gap: 16px;
	min-height: 96px;
	padding: 18px 20px;
	background: var(--surface);
	border: 1px dashed rgba(111, 168, 220, 0.5);
	border-radius: var(--r-md);
	cursor: pointer;
	transition: border-color var(--dur-lente) var(--ease), background-color var(--dur-lente) var(--ease);
}

.photos__zone[hidden] { display: none; }

.photos__picto { width: 48px; height: 48px; color: var(--text); }

.photos__texte { display: grid; gap: 4px; }

.photos__titre {
	font-family: var(--display);
	font-size: 19px;
	line-height: 1.25;
	color: var(--text);
}

.photos__consigne { font-size: 13.5px; line-height: 1.5; color: var(--text-2); }

/* Au doigt, on prend la photo ou on va la chercher. À la souris, on la glisse. */
.photos__consigne--souris { display: none; }

@media (hover: hover) and (pointer: fine) {
	.photos__consigne--doigt { display: none; }
	.photos__consigne--souris { display: block; }

	.photos__zone:not(.est-pleine):hover {
		border-color: var(--water);
		background-color: var(--surface-on);
	}
}

.photos__zone.est-survolee {
	border-style: solid;
	border-color: var(--water);
	background-color: var(--water-dim);
}

/* Le focus est sur le champ caché : il se montre sur la zone, comme sur tout le site. */
.photos__entree:focus-visible ~ .photos__zone {
	outline: 2px solid var(--water);
	outline-offset: 3px;
}

/* Des photos déjà là : la zone se resserre en une ligne, sous les vignettes. */
.photos.a-des-photos .photos__zone {
	grid-template-columns: 32px minmax(0, 1fr);
	gap: 12px;
	min-height: var(--tap);
	padding: 8px 16px;
}

.photos.a-des-photos .photos__picto { width: 32px; height: 32px; }
.photos.a-des-photos .photos__titre { font-size: 16px; }
.photos.a-des-photos .photos__consigne { display: none; }

.photos__zone.est-pleine {
	cursor: default;
	border-style: solid;
	border-color: var(--line-strong);
	background-color: transparent;
}

.photos__zone.est-pleine .photos__titre { font-family: var(--text-font); font-size: 14px; color: var(--text-2); }
.photos__zone.est-pleine .photos__picto { opacity: 0.5; }

.champ.est-invalide .photos__zone {
	border-style: solid;
	border-color: var(--warn);
	background-color: rgba(240, 192, 105, 0.05);
}

.photos__liste {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
	gap: 10px;
	margin: 2px 0 4px;
	padding: 0;
	list-style: none;
}

.photos__liste[hidden] { display: none; }

.photos__vignette {
	position: relative;
	aspect-ratio: 1;
	overflow: hidden;
	background: var(--surface);
	border: 1px solid var(--line-strong);
	border-radius: var(--r-md);
}

.photos__vignette img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Le nom du fichier : lu par les lecteurs d'écran, affiché seulement quand l'aperçu manque. */
.photos__nom {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.photos__vignette.sans-apercu img { display: none; }

.photos__vignette.sans-apercu .photos__nom {
	position: static;
	display: grid;
	place-items: center;
	width: auto;
	height: 100%;
	padding: 10px 8px;
	clip-path: none;
	white-space: normal;
	overflow-wrap: anywhere;
	font-size: 11.5px;
	line-height: 1.35;
	text-align: center;
	color: var(--text-2);
}

/* La croix : 36 px, posée sur la photo, lisible sur une image claire comme sombre. */
.photos__retirer {
	position: absolute;
	top: 4px;
	right: 4px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	background: rgba(6, 13, 22, 0.82);
	border: 1px solid var(--line-strong);
	border-radius: var(--r-md);
	color: var(--text);
	cursor: pointer;
	transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.photos__retirer svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
}

.photos__retirer:hover,
.photos__retirer:focus-visible {
	background: var(--ink);
	border-color: rgba(255, 255, 255, 0.6);
}

/* Trop lourde : cadre et bandeau ambre, jamais rouge. Le message sous le champ dit quoi faire. */
.photos__vignette.est-trop { border-color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }

.photos__alerte {
	position: absolute;
	inset: auto 0 0;
	padding: 4px 6px;
	background: var(--warn);
	color: var(--ink);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
}

.photos__compte {
	font-size: 13.5px;
	color: var(--text-3);
	font-variant-numeric: tabular-nums;
}

@keyframes vignette-entre {
	from { opacity: 0; transform: translateY(6px); }
}

@media (prefers-reduced-motion: no-preference) {
	.photos__vignette { animation: vignette-entre 0.25s var(--ease) both; }
}
