/*
 * La page « Notre histoire », 30/09/2026.
 *
 * Demande de Remy : « une belle mise en forme comme la page d'accueil et les
 * blog ». La page reste rendue par Elementor, parce que son formulaire de
 * contact est un widget Elementor Pro en service (58 messages depuis mars 2025,
 * le dernier le 22/09/2026) : on ne le reconstruit pas. Tout le haut de la page
 * est un seul widget HTML aux classes .ap-histoire__*, mis en forme ici ; le
 * bas garde le titre « Contact », son texte, l'ancre #contact du pied de page
 * et le formulaire, restyles ici aussi.
 *
 * Charge sur cette seule page (is_page( 'notre-histoire' ), functions.php).
 * Vocabulaire de l'accueil : titres soulignes d'un trait bleu de 56 px, cartes
 * blanches au bord fin, bande taupe, pastilles numerotees, rayon de 14 px.
 */

/* --- Le cadre : la page sort de la colonne de 720 px ------------------------- */

.ap-page .ap-prose {
	max-width: none;
}

/* Le titre de la page est le h1 de la carte d'ouverture : page.php ne pose pas
   son en-tete sur cette page (Remy : un h1 suivi d'un h2 qui le repete, non). */

/* Elementor pose ses propres marges et largeurs : on les neutralise. */
.ap-page .elementor .e-con,
.ap-page .elementor .e-con-inner {
	--padding-top: 0;
	--padding-bottom: 0;
	--padding-left: 0;
	--padding-right: 0;
	--content-width: 100%;
	max-width: 100%;
}

.ap-histoire {
	font-size: 17px;
	line-height: 1.7;
}

.ap-histoire > section + section {
	margin-top: 72px;
}

.ap-histoire p {
	margin: 0 0 1em;
}

.ap-histoire p:last-child {
	margin-bottom: 0;
}

.ap-histoire figure {
	margin: 0;
}

.ap-histoire img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--ap-rayon);
}

.ap-histoire h1,
.ap-histoire h2,
.ap-histoire h3 {
	margin: 0 0 0.5em;
	font-weight: 500;
}

.ap-histoire__surtitre {
	margin: 0 0 10px !important;
	color: var(--ap-bleu-600);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.ap-histoire__titre {
	font-size: clamp(1.7rem, 1.3rem + 1.3vw, 2.2rem);
	line-height: 1.15;
}

.ap-histoire__titre::after {
	content: "";
	display: block;
	width: 56px;
	height: 3px;
	margin-top: 0.42em;
	border-radius: 2px;
	background: var(--ap-bleu);
}

.ap-histoire__bloc--centre,
.ap-histoire__titre--centre {
	text-align: center;
}

.ap-histoire__bloc--centre {
	max-width: 780px;
	margin-left: auto;
	margin-right: auto;
}

.ap-histoire__bloc--centre .ap-histoire__titre::after,
.ap-histoire__titre--centre::after {
	margin-left: auto;
	margin-right: auto;
}

.ap-histoire__chapeau {
	max-width: 640px;
	margin: 0 auto 32px !important;
	color: var(--ap-doux);
	text-align: center;
}

/* --- L'ouverture : la carte creme posee sur le bord de la photo ---------------
 *
 * Remy, 30/09/2026 : « l'image en haut, elle est tronquee, j'aime pas cette
 * disposition ». L'ancienne photo portait le logo incruste dans son coin, que
 * tout recadrage coupait, et elle ne tenait pas la hauteur de la carte. La
 * photo (media 1492, sans incrustation) prend maintenant toute la hauteur du
 * bloc, et la carte chevauche son bord gauche d'une colonne, a 48 px de ses
 * bords haut et bas : la hauteur du bloc suit toujours celle du texte, la
 * photo s'y ajuste en object-fit, rien ne deborde ni ne laisse de vide.
 * Telephone : la photo en tete, la carte remonte dessus, comme l'ouverture
 * des autres pages (.ap-page-heros de theme.css).
 */

.ap-histoire__ouverture {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	align-items: center;
}

.ap-histoire__ouverture-texte {
	position: relative;
	z-index: 1;
	grid-column: 1 / span 6;
	grid-row: 1;
	margin: 48px 0;
	padding: 44px 48px;
	background: #FBF7F1;
	border: 1px solid #EFE6DA;
	border-radius: 20px;
	box-shadow: 0 16px 44px rgba(27, 42, 50, 0.13);
}

.ap-histoire__ouverture-photo {
	position: relative;
	grid-column: 6 / -1;
	grid-row: 1;
	align-self: stretch;
	overflow: hidden;
	border-radius: 20px;
	background: #EFE6DA;
}

.ap-histoire__sous-titre {
	margin: -4px 0 18px !important;
	color: var(--ap-bleu-700);
	font-family: var(--ap-serif);
	font-size: 1.35rem;
	font-style: italic;
	line-height: 1.3;
}

.ap-histoire__ouverture h1 {
	font-size: clamp(2rem, 1.4rem + 1.8vw, 2.7rem);
	line-height: 1.1;
}

/* Position absolue : la photo remplit la cellule sans imposer sa hauteur. */
.ap-histoire .ap-histoire__ouverture-photo img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border-radius: 0;
	object-fit: cover;
	object-position: 30% 50%;
}

/* --- La bande taupe, en pleine largeur comme celle de l'accueil -------------- */

.ap-histoire__bande {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
	gap: 48px;
	align-items: center;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding: 72px max(24px, calc(50vw - 540px));
	background: var(--ap-taupe);
	color: #F6F1EA;
}

.ap-histoire__bande h2 {
	color: #fff;
	font-size: clamp(1.7rem, 1.3rem + 1.3vw, 2.2rem);
}

.ap-histoire__bande strong {
	color: #fff;
}

.ap-histoire__bande .ap-histoire__surtitre {
	color: var(--ap-bleu-200);
}

.ap-histoire__duo-photos {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.ap-histoire__duo-photos img {
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.ap-histoire figcaption {
	margin-top: 10px;
	font-size: 0.82rem;
	letter-spacing: 0.04em;
	opacity: 0.85;
	text-align: center;
}

/* --- Les cartes de personnalisation ------------------------------------------ */

.ap-histoire__cartes,
.ap-histoire__valeurs {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 22px;
}

.ap-histoire__carte,
.ap-histoire__valeurs li {
	padding: 26px 26px 28px;
	background: var(--ap-carte);
	border: 1px solid var(--ap-trait);
	border-radius: var(--ap-rayon);
	font-size: 0.95rem;
	line-height: 1.6;
}

.ap-histoire__carte h3,
.ap-histoire__valeurs h3 {
	font-size: 1.4rem;
	font-weight: 600;
	color: var(--ap-bleu-800);
}

.ap-histoire__carte h3::before {
	content: "";
	display: block;
	width: 32px;
	height: 3px;
	margin-bottom: 14px;
	border-radius: 2px;
	background: var(--ap-bleu);
}

/* --- La galerie des finitions ------------------------------------------------ */

.ap-histoire__galerie {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.ap-histoire__galerie img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.ap-histoire__legende {
	margin-top: 14px !important;
	color: var(--ap-doux);
	font-size: 0.92rem;
	font-style: italic;
	text-align: center;
}

/* --- Les valeurs, avec les pastilles numerotees de l'accueil ----------------- */

/* Specificite doublee : « .ap-prose ol » et « .ap-prose li + li » posent un
   retrait et une marge qui decalaient les cartes. */
.ap-histoire .ap-histoire__valeurs {
	margin: 32px 0 0;
	padding: 0;
	list-style: none;
}

.ap-histoire .ap-histoire__valeurs li + li {
	margin-top: 0;
}

.ap-histoire__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin-bottom: 14px;
	border-radius: 50%;
	background: var(--ap-bleu);
	color: var(--ap-encre);
	font-weight: 600;
}

/* --- Les emotions partagees : photo et texte --------------------------------- */

.ap-histoire__partage {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 48px;
	align-items: center;
}

.ap-histoire__partage-photo img {
	aspect-ratio: 4 / 5;
	object-fit: cover;
	object-position: 60% 50%;
}

.ap-histoire__partage ul {
	margin: 0 0 1em;
	padding-left: 1.2em;
}

.ap-histoire__partage li + li {
	margin-top: 0.4em;
}

.ap-histoire__partage li::marker {
	color: var(--ap-bleu-400);
}

.ap-histoire a:not(.ap-bouton) {
	color: var(--ap-bleu-600);
	font-weight: 500;
	text-decoration: underline;
	text-decoration-color: var(--ap-bleu-200);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

/* --- L'appel final : la carte bleu pale de l'accueil ------------------------- */

.ap-histoire__appel {
	padding: 52px 32px;
	background: var(--ap-bleu-050);
	border: 1px solid var(--ap-bleu-100);
	border-radius: 20px;
	text-align: center;
}

.ap-histoire__appel h2 {
	font-size: clamp(1.8rem, 1.3rem + 1.5vw, 2.4rem);
}

.ap-histoire__appel p {
	max-width: 620px;
	margin-left: auto !important;
	margin-right: auto !important;
}

.ap-histoire__appel .ap-bouton {
	margin-top: 8px;
}

/* --- Le contact : le titre et le formulaire Elementor ------------------------ */

.ap-page .elementor-widget-heading .elementor-heading-title {
	margin-top: 64px;
	font-family: var(--ap-serif);
	font-size: clamp(1.8rem, 1.3rem + 1.5vw, 2.4rem);
	font-weight: 500;
	color: var(--ap-encre);
	text-align: center;
}

.ap-page .elementor-widget-heading .elementor-heading-title::after {
	content: "";
	display: block;
	width: 56px;
	height: 3px;
	margin: 0.42em auto 0;
	border-radius: 2px;
	background: var(--ap-bleu);
}

.ap-page .elementor-widget-text-editor {
	max-width: 640px !important;
	margin: 0 auto !important;
	color: var(--ap-doux);
	text-align: center;
}

.ap-page .elementor-widget-form {
	max-width: 640px;
	margin: 28px auto 0;
	padding: 32px;
	background: var(--ap-carte);
	border: 1px solid var(--ap-trait);
	border-radius: 20px;
}

.ap-page .elementor-field-group > label {
	color: var(--ap-encre);
	font-size: 0.9rem;
	font-weight: 600;
}

.ap-page .elementor-field-textual {
	padding: 12px 14px !important;
	border: 1px solid var(--ap-trait) !important;
	border-radius: 10px !important;
	background: var(--ap-fond) !important;
	font-family: var(--ap-sans) !important;
	font-size: 1rem !important;
}

.ap-page .elementor-field-textual:focus {
	border-color: var(--ap-bleu-400) !important;
	outline: 3px solid var(--ap-bleu-100);
}

.ap-page .elementor-form .elementor-button {
	padding: 14px 24px !important;
	border-radius: 10px !important;
	background: var(--ap-action) !important;
	color: var(--ap-action-texte) !important;
	font-family: var(--ap-sans) !important;
	font-size: 1rem !important;
	font-weight: 600 !important;
}

.ap-page .elementor-form .elementor-button:hover {
	background: var(--ap-action-survol) !important;
}

/* --- Tablette et telephone --------------------------------------------------- */

@media (max-width: 900px) {

	.ap-histoire__bande,
	.ap-histoire__partage {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}

	/* La photo en tete, la carte remonte de 56 px dessus, en retrait. */
	.ap-histoire__ouverture {
		grid-template-columns: minmax(0, 1fr);
	}

	.ap-histoire__ouverture-photo {
		grid-column: 1;
		grid-row: 1;
		aspect-ratio: 16 / 9;
	}

	.ap-histoire__ouverture-texte {
		grid-column: 1;
		grid-row: 2;
		margin: -56px 16px 0;
	}

	.ap-histoire__cartes,
	.ap-histoire__valeurs {
		grid-template-columns: minmax(0, 1fr);
	}

	.ap-histoire__partage-photo img {
		aspect-ratio: 4 / 3;
	}
}

@media (max-width: 600px) {

	.ap-histoire > section + section {
		margin-top: 52px;
	}

	.ap-histoire__ouverture-photo {
		aspect-ratio: 3 / 2;
	}

	.ap-histoire__ouverture-texte {
		margin: -40px 10px 0;
		padding: 28px 22px;
	}

	.ap-histoire__bande {
		padding: 52px 18px;
	}

	.ap-histoire__galerie {
		grid-template-columns: 1fr 1fr;
	}

	.ap-histoire__galerie figure:first-child {
		grid-column: 1 / -1;
	}

	.ap-page .elementor-widget-form {
		padding: 22px 18px;
	}
}

/* --- La carte sous le formulaire : l'adresse de la societe (Remy, 30/09) ----- */

.ap-page .elementor-widget-google_maps {
	max-width: 640px;
	margin: 24px auto 0;
}

.ap-page .elementor-widget-google_maps iframe {
	display: block;
	width: 100%;
	height: 320px;
	border: 1px solid var(--ap-trait);
	border-radius: 20px;
}
