/*
 * Styles du thème qui ne passent pas par theme.json.
 * Les couleurs, la typo et les boutons sont dans theme.json.
 */

/*
 * Grille des maquettes (13 oct.) : 1440 px, gouttières de 48 px. Le contenu
 * (theme.json : contentSize 1344 px, marges latérales var(--fgv-marge)) est
 * aligné sur la ligne du logo de l'en-tête à toutes les largeurs.
 */
:root {
	--fgv-marge: 48px;
}

@media (min-width: 1181px) and (max-width: 1360px) {
	:root {
		--fgv-marge: 24px;
	}
}

@media (max-width: 760px) {
	:root {
		--fgv-marge: 20px;
	}
}

html {
	-webkit-font-smoothing: antialiased;
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

/*
 * Focus visible au clavier, contenu et en-tête : anneau foncé et bande blanche
 * (contraste d'au moins 3:1 sur fond blanc, vert pâle ou vert forêt).
 * a.fgv-carte surcharge l'outline de survol des cartes d'événements.
 */
:where(main, article, .fgv-ariane, .fgv-barre-ev, .fgv-barre-verte, .fgv-entete, .fgv-panneau, .fgv-pied) :is(a, button, summary, [tabindex]):focus-visible,
.fgv-burger:focus-visible,
a.fgv-carte:focus-visible {
	outline: 3px solid var(--wp--preset--color--encre);
	outline-offset: 3px;
	box-shadow: 0 0 0 3px #fff; /* bande blanche : visible sur fond clair comme sur fond foncé */
}

/* Crédit photo (inc/credits.php) : pastille © dans le coin inférieur droit,
   le nom s'ouvre au survol ou au focus (tap sur mobile). */
.fgv-credit-cadre {
	position: relative;
	display: block;
}

.fgv-carrousel__photo,
.wp-block-image:has(> .fgv-credit) {
	position: relative;
}

.fgv-credit {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 0;
	max-width: calc(100% - 24px);
	padding: 5px 7px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.92);
	color: var(--wp--preset--color--encre);
	font-size: 12px;
	font-weight: 600;
	line-height: 14px;
	cursor: help;
	transition: gap 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.fgv-credit__nom {
	overflow: hidden;
	max-width: 0;
	white-space: nowrap;
	text-overflow: ellipsis;
	transition: max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.fgv-credit__signe {
	font-size: 14px;
}

.fgv-credit:focus-visible {
	outline: 2px solid var(--wp--preset--color--encre);
	outline-offset: 2px;
}

.fgv-credit:focus,
.fgv-credit:focus-visible {
	gap: 6px;
}

.fgv-credit:focus .fgv-credit__nom,
.fgv-credit:focus-visible .fgv-credit__nom {
	max-width: 260px;
	padding-left: 3px;
}

@media (hover: hover) {
	.fgv-credit:hover {
		gap: 6px;
	}

	.fgv-credit:hover .fgv-credit__nom {
		max-width: 260px;
		padding-left: 3px;
	}
}

/* L'espace sous la photo d'une animation passe au cadre, pour que la pastille
   reste sur la photo. */
.fgv-credit-cadre:has(> .fgv-animation__image) {
	margin-bottom: 14px;
}

.fgv-credit-cadre > .fgv-animation__image {
	margin-bottom: 0;
}

/* Vidéo : le crédit vaut pour l'image, pas pour la vidéo lancée. */
.fgv-video.est-lancee .fgv-credit {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.fgv-credit,
	.fgv-credit__nom {
		transition: none;
	}
}
