/* Styles communs, repris de la maquette (corps, liens, sélection, animations). Chaque section a sa feuille dans sections/. */

html {
	scroll-behavior: smooth;
}

html,
body {
	margin: 0;
	padding: 0;
}

body {
	background: #f4f1ea;
	color: #16212b;
	font-family: 'Noto Sans', sans-serif;
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}

a {
	color: #1b5480;
	text-decoration: none;
}

a:hover {
	color: #0e3350;
}

/* Un élément masqué par le script reste masqué, quelle que soit sa mise en page. */
[hidden] {
	display: none !important;
}

::selection {
	background: #c6d9e6;
}

:focus-visible {
	outline: 2px solid #e3b25c;
	outline-offset: 3px;
}

@keyframes eaq-rise {
	from { opacity: 0; transform: translateY(46px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes eaq-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes eaq-float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-14px); }
}

@keyframes eaq-monte {
	from { transform: translateY(135%); }
	to { transform: none; }
}

@keyframes eaq-rideau {
	from { clip-path: inset(100% 0 0 0); }
	to { clip-path: inset(0 0 0 0); }
}

@keyframes eaq-recul {
	from { scale: 1.3; }
	to { scale: 1; }
}

@keyframes eaq-carte {
	from { opacity: 0; transform: translateY(40px) scale(.94); }
	to { opacity: 1; transform: none; }
}

@keyframes eaq-pulse {
	0% { box-shadow: 0 0 0 0 rgba(27, 84, 128, .65); }
	100% { box-shadow: 0 0 0 18px rgba(27, 84, 128, 0); }
}

/* Les sections qu'on vise depuis le menu s'arrêtent sous la barre collante. */
#annonces,
#dons {
	scroll-margin-top: 96px;
}

/* Le pied de page reste en bas de l'écran, même sur une page courte. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.eaq-main {
	flex: 1 0 auto;
}

/* L'en-tête collant doit avoir la page entière comme conteneur, pas l'enveloppe du gabarit. */
.eaq-entete-part {
	display: contents;
}

.wp-site-blocks > *,
.eaq-main > *,
.eaq-main .wp-block-post-content > * {
	margin-block: 0;
}

/* Titres de section communs : grand titre bleu nuit, petit titre en capitales espacées. */
.eaq-surtitre {
	margin: 0 0 12px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .24em;
	text-transform: uppercase;
	color: #1b5480;
}

.eaq-titre {
	margin: 0;
	font-weight: 700;
	font-size: clamp(34px, 3.6vw, 50px);
	letter-spacing: -.03em;
	color: #0e3350;
}

.eaq-titre .accent,
.eaq-accent {
	font-family: 'Noto Serif', serif;
	font-style: italic;
	font-weight: 400;
	color: #1b5480;
}

/* Tête de section : titre à gauche, petit texte ou lien à droite (passe dessous si la place manque). */
.eaq-tete {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
}

.eaq-tete__intro {
	margin: 0;
	font-size: 14.5px;
	color: #556270;
	max-width: 300px;
}

/* Boutons de la maquette : plein (bleu nuit) et contour. */
.eaq-bouton {
	display: inline-block;
	background: #0e3350;
	color: #f4f1ea;
	padding: 14px 26px;
	border-radius: 6px;
	font-weight: 600;
	font-size: 15px;
	transition: background .25s, transform .25s;
}

.eaq-bouton:hover {
	background: #1b5480;
	color: #f4f1ea;
	transform: translateY(-2px);
}

.eaq-bouton--contour {
	background: transparent;
	border: 1px solid rgba(14, 51, 80, .28);
	color: #0e3350;
	transition: border-color .25s, background .25s;
}

.eaq-bouton--contour:hover {
	background: #e6e1d6;
	border-color: #0e3350;
	color: #0e3350;
	transform: none;
}

/* Encadré de l'infolettre, au bas des annonces (accueil et page des annonces) : sur téléphone, le bouton passe dessous. */
.eaq-infolettre-encart {
	display: grid;
	/* Le bouton prend la moitié au plus : un texte long passe à la ligne au lieu d'écraser la phrase. */
	grid-template-columns: auto minmax(0, 1fr) fit-content(50%);
	align-items: center;
	gap: 16px 22px;
	margin-top: 26px;
	padding: 22px 26px;
	border-radius: 6px;
	background: #f4f1ea;
}

.eaq-infolettre-encart__icone {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: #e3b25c;
	color: #0e3350;
	display: grid;
	place-items: center;
}

.eaq-infolettre-encart__phrase {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.45;
	color: #0e3350;
}

.eaq-infolettre-encart__bouton {
	background: #e3b25c;
	color: #0e3350;
	padding: 13px 26px;
	border-radius: 6px;
	font-weight: 700;
	font-size: 15px;
	text-align: center;
	transition: background .25s, transform .25s;
}

.eaq-infolettre-encart__bouton:hover {
	background: #ecc47c;
	color: #0e3350;
	transform: translateY(-2px);
}

/* Le contour doré du focus ne se verrait pas autour du bouton doré, sur un fond clair. */
.eaq-infolettre-encart :focus-visible {
	outline-color: #0e3350;
}

@media (max-width: 600px) {
	.eaq-infolettre-encart {
		grid-template-columns: auto minmax(0, 1fr);
		padding: 20px;
	}

	.eaq-infolettre-encart__phrase {
		font-size: 16px;
	}

	.eaq-infolettre-encart__bouton {
		grid-column: 1 / -1;
	}
}

/* Pages intérieures : le texte libre (paragraphes, titres, listes) se lit en colonne étroite, sous le titre. */
.eaq-page .wp-block-post-content > :where(:not([data-eaq-section])) {
	max-width: 760px;
	/* Aligné sur le titre de la page : conteneur de 1240 px plus ses marges de 32 px. */
	margin-inline: max(0px, calc((100% - 1304px) / 2)) auto;
	padding-inline: 32px;
	box-sizing: content-box;
	font-size: 16.5px;
	line-height: 1.75;
	color: #2d3b47;
}

.eaq-page .wp-block-post-content > p {
	margin-block: 0 18px;
}

.eaq-page .wp-block-post-content > h2 {
	margin-block: 44px 14px;
	font-size: clamp(22px, 2.2vw, 28px);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -.02em;
	color: #0e3350;
}

.eaq-page .wp-block-post-content > h3 {
	margin-block: 30px 10px;
	font-size: 19px;
	font-weight: 600;
	color: #0e3350;
}

.eaq-page .wp-block-post-content > ul,
.eaq-page .wp-block-post-content > ol {
	margin-block: 0 18px;
	padding-left: calc(32px + 1.2em);
}

.eaq-page .wp-block-post-content > :where(:not([data-eaq-section])) a {
	color: #1b5480;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.eaq-page .wp-block-post-content > :where(:not([data-eaq-section])):last-child {
	margin-bottom: 0;
	padding-bottom: 100px;
}

/* Lecteur de vidéos (assets/js/main.js) : la vidéo en 16:9 sur fond bleu nuit. */
.eaq-lecteur {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vh 4vw;
	box-sizing: border-box;
	background: rgba(14, 51, 80, .94);
	animation: eaq-fade .25s both;
}

.eaq-lecteur__cadre {
	width: min(100%, calc((100vh - 8vh) * 16 / 9));
	aspect-ratio: 16 / 9;
	border-radius: 10px;
	overflow: hidden;
	background: #000;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}

.eaq-lecteur__cadre iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.eaq-lecteur__fermer {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 6px;
	background: #f4f1ea;
	color: #0e3350;
	font-size: 17px;
	cursor: pointer;
	font-family: inherit;
	padding: 0;
}

.screen-reader-text {
	/* Une copie pour les lecteurs d'écran (titres découpés, verset) : copier le texte ne la reprend pas. */
	user-select: none;
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

@media (max-width: 820px) {
	section[id] {
		scroll-margin-top: 20px;
	}
}

@media (max-width: 600px) {
	.eaq-page .wp-block-post-content > :where(:not([data-eaq-section])) {
		padding-inline: 20px;
	}

	.eaq-page .wp-block-post-content > ul,
	.eaq-page .wp-block-post-content > ol {
		padding-left: calc(20px + 1.2em);
	}
}

/* ---------- Effets de main.js : le script pose ces classes, rien n'est caché sans lui ---------- */

/* Titres qui se lèvent (data-eaq-titre) : chaque mot monte de derrière un cache, l'un après l'autre. */
.eaq-leve__mot {
	display: inline-block;
	overflow: hidden;
	vertical-align: top;
	padding: .12em .06em .16em;
	margin: -.12em -.06em -.16em;
}

.eaq-leve__in {
	display: inline-block;
	transition: transform 1s calc(var(--i, 0) * 70ms + 120ms) cubic-bezier(.16, .84, .3, 1);
}

.eaq-leve:not(.eaq-leve--vu) .eaq-leve__in {
	transform: translateY(135%);
}

/* Petits titres (data-eaq-surtitre) : ils se resserrent en apparaissant, jusqu'à leur espacement à eux. */
.eaq-resserre {
	transition: opacity 1s ease, letter-spacing 1.4s cubic-bezier(.16, .84, .3, 1);
}

.eaq-resserre:not(.eaq-resserre--vu) {
	opacity: 0;
	letter-spacing: .6em;
}

/* Photos (data-eaq-rideau) : fermées d'un coup, elles s'ouvrent du bas vers le haut en reculant. Le
   recul passe devant les transitions propres aux photos des sections, le temps de l'ouverture. */
.eaq-rideau:not(.eaq-rideau--ouvert) {
	clip-path: inset(100% 0 0 0);
}

.eaq-rideau:not(.eaq-rideau--ouvert) img {
	scale: 1.25;
}

.eaq-rideau--ouvert {
	clip-path: inset(0 0 0 0);
	transition: clip-path 1.4s cubic-bezier(.77, 0, .18, 1);
}

.eaq-rideau.eaq-rideau--ouvert img {
	scale: 1;
	transition: scale 2.4s cubic-bezier(.16, .84, .3, 1);
}

/* Profondeur (data-eaq-profondeur) : la photo déborde de son cadre pour y glisser sans montrer ses bords.
   Le débord est posé d'avance, le script pouvant arriver après le premier affichage ; « html » le fait
   passer devant la règle « img » de chaque section. */
@media (prefers-reduced-motion: no-preference) {
	html [data-eaq-profondeur] img {
		position: relative;
		top: -9%;
		height: 118%;
	}
}

/* Cartes lumineuses (data-eaq-lueur) : une lueur dorée sous la souris, le bord qui s'allume près d'elle. */
.eaq-lueur-carte {
	isolation: isolate;
}

.eaq-lueur-carte--placee {
	position: relative;
}

.eaq-lueur-carte > span.eaq-lueur {
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: inherit;
	pointer-events: none;
	opacity: 0;
	transition: opacity .45s ease;
	background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), var(--eaq-lueur, rgba(227, 178, 92, .16)), transparent 45%);
}

.eaq-lueur-carte[data-eaq-lueur="sombre"] {
	--eaq-lueur: rgba(227, 178, 92, .28);
}

.eaq-lueur::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	padding: 1px;
	background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(227, 178, 92, .9), transparent 65%);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
}

.eaq-lueur-carte:hover > span.eaq-lueur {
	opacity: 1;
}

/* Passage d'une page à l'autre : l'ancienne s'efface en montant, la nouvelle arrive ; le menu reste en place. */
@view-transition {
	navigation: auto;
}

/* Sur la barre et non sur son conteneur : nommé, un élément isole ce qu'il contient, et le flou de la barre
   ne verrait plus la page derrière elle. */
.eaq-entete__barre {
	view-transition-name: entete;
}

::view-transition-old(root) {
	animation: eaq-page-sort .32s cubic-bezier(.4, 0, 1, 1) both;
}

::view-transition-new(root) {
	animation: eaq-page-entre .6s .05s cubic-bezier(0, 0, .2, 1) both;
}

@keyframes eaq-page-sort {
	to { opacity: 0; transform: translateY(-18px); }
}

@keyframes eaq-page-entre {
	from { opacity: 0; transform: translateY(28px); }
}

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

	::view-transition-group(*),
	::view-transition-old(*),
	::view-transition-new(*) {
		animation: none !important;
	}

	*,
	*::before,
	*::after {
		animation-duration: .01ms !important;
		animation-delay: 0s !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		transition-delay: 0s !important;
	}
}
