/* ==========================================================================
   Tourlandry — styles complémentaires à theme.json
   ========================================================================== */

/* Pied de page ------------------------------------------------------------ */
.tl-footer {
	margin-top: 0;
	padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--velours);
	color: var(--wp--preset--color--texte-doux);
	font-size: var(--wp--preset--font-size--petit);
	border-top: 1px solid rgba(243, 235, 224, 0.08);
}

.tl-footer-titre {
	font-family: var(--wp--preset--font-family--dm-serif-display);
	font-size: var(--wp--preset--font-size--grand);
	color: var(--wp--preset--color--texte-clair);
	margin: 0;
}

.tl-footer-label {
	font-family: var(--wp--preset--font-family--bodoni-moda);
	font-size: 0.75rem;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--wp--preset--color--or);
	margin: 0;
}

/* Espace sous le contenu des pages ordinaires, supprimé quand la page se
   termine par une section pleine largeur (comme l'accueil). */
.wp-site-blocks > main {
	padding-bottom: var(--wp--preset--spacing--60);
}

.wp-site-blocks > main:has(.wp-block-post-content > .alignfull:last-child) {
	padding-bottom: 0;
}

/* Boutons « contour » (style Contour du bloc Bouton) ----------------------- */
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--texte-clair);
	border: 1px solid var(--wp--preset--color--texte-doux);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--texte-clair);
	color: var(--wp--preset--color--noir-chaud);
}

/* Formes d'images (styles des blocs Image et Couverture) ------------------- */
.wp-block-image.is-style-arche img,
.wp-block-cover.is-style-arche {
	border-radius: 999px 999px 0 0;
	overflow: hidden;
}

.wp-block-image.is-style-medaillon img,
.wp-block-cover.is-style-medaillon {
	border-radius: 50%;
	overflow: hidden;
}

.wp-block-image.is-style-feuille img,
.wp-block-cover.is-style-feuille {
	border-radius: 38% 2% 38% 2%;
	overflow: hidden;
}

.wp-block-image.is-style-arche-inversee img,
.wp-block-cover.is-style-arche-inversee {
	border-radius: 0 0 999px 999px;
	overflow: hidden;
}

/* Blason : écu découpé (même contour que dans le bloc Collage). */
.wp-block-image.is-style-blason img,
.wp-block-cover.is-style-blason {
	clip-path: polygon(0% 0%, 100% 0%, 100% 55%, 98% 66%, 94% 75%, 88% 83%, 79% 90%, 68% 95%, 57% 98.5%, 50% 100%, 43% 98.5%, 32% 95%, 21% 90%, 12% 83%, 6% 75%, 2% 66%, 0% 55%);
}

.wp-block-image.is-style-cadre-dore,
.wp-block-cover.is-style-cadre-dore {
	position: relative;
	isolation: isolate;
	margin-right: 14px;
	margin-bottom: 14px;
}

.wp-block-image.is-style-cadre-dore::after,
.wp-block-cover.is-style-cadre-dore::after {
	content: "";
	position: absolute;
	inset: 14px -14px -14px 14px;
	border: 1px solid var(--wp--preset--color--or);
	z-index: -1;
	pointer-events: none;
}

/* Images alignées à gauche ou à droite ------------------------------------ */
/* Sans largeur définie, une image flottante prend sa taille naturelle et
   occupe toute la colonne : on lui donne une largeur par défaut raisonnable.
   Une largeur réglée dans l'éditeur reste prioritaire. */
.wp-block-image.alignleft,
.wp-block-image.alignright {
	width: min(45%, 380px);
}

.wp-block-image.alignleft img,
.wp-block-image.alignright img {
	width: 100%;
	height: auto;
}

@media (max-width: 600px) {
	.wp-block-image.alignleft,
	.wp-block-image.alignright {
		float: none;
		width: 100%;
		margin-left: 0;
		margin-right: 0;
	}
}

/* Hero de l'accueil ------------------------------------------------------- */
.tl-hero {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
	align-items: center;
	gap: clamp(2rem, 6vw, 5rem);
	min-height: min(88vh, 900px);
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50) var(--wp--preset--spacing--60);
	box-sizing: border-box;
	overflow: hidden;
}

.tl-hero-texte {
	position: relative;
	z-index: 1;
	max-width: 640px;
}

.tl-hero-texte > * {
	margin-top: 0;
	margin-bottom: 1.25rem;
}

.tl-hero-texte .wp-block-buttons {
	margin-top: 2rem;
}

.tl-accroche {
	font-family: var(--wp--preset--font-family--bonheur-royale);
	font-size: clamp(2rem, 1.4rem + 2vw, 2.9rem);
	line-height: 1.1;
	color: var(--wp--preset--color--or);
}

.tl-hero-media {
	position: relative;
	isolation: isolate;
	margin: 0;
}

.tl-hero-media video {
	display: block;
	width: 100%;
	object-fit: cover;
}

/* Forme « Arche » : la vidéo dans une fenêtre, avec un cadre doré décalé. */
.tl-hero-media.is-style-arche {
	justify-self: end;
	width: min(100%, 480px);
	margin-right: 28px;
}

.tl-hero-media.is-style-arche video {
	aspect-ratio: 472 / 672;
	border-radius: 999px 999px 0 0;
}

.tl-hero-media.is-style-arche::after {
	content: "";
	position: absolute;
	inset: 28px -28px -28px 28px;
	border: 1px solid var(--wp--preset--color--or);
	border-radius: 999px 999px 0 0;
	z-index: -1;
	pointer-events: none;
}

/* Forme « Plein écran » : la vidéo couvre tout le hero, texte en bas à gauche. */
.tl-hero:has(.tl-hero-media.is-style-plein-ecran) {
	grid-template-columns: minmax(0, 1fr);
	align-items: end;
	min-height: min(92vh, 960px);
}

.tl-hero-media.is-style-plein-ecran {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.tl-hero-media.is-style-plein-ecran video {
	width: 100%;
	height: 100%;
}

.tl-hero-media.is-style-plein-ecran::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(26, 20, 17, 0.45);
	z-index: 1;
	pointer-events: none;
}

.tl-hero:has(.tl-hero-media.is-style-plein-ecran) .tl-hero-texte {
	max-width: 820px;
}

/* Bouton lecture / pause de la vidéo */
.tl-video-toggle {
	position: absolute;
	z-index: 2;
	bottom: 1.25rem;
	left: 50%;
	transform: translateX(-50%);
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border-radius: 50%;
	border: 1px solid rgba(243, 235, 224, 0.6);
	background: rgba(26, 20, 17, 0.35);
	color: var(--wp--preset--color--texte-clair);
	cursor: pointer;
}

.tl-video-toggle:hover,
.tl-video-toggle:focus-visible {
	background: rgba(26, 20, 17, 0.7);
	outline: 2px solid var(--wp--preset--color--or);
	outline-offset: 2px;
}

.is-style-plein-ecran .tl-video-toggle {
	left: auto;
	right: var(--wp--preset--spacing--50);
	bottom: var(--wp--preset--spacing--40);
	transform: none;
}

/* Hero sur mobile et tablette : la vidéo en arche passe au-dessus du texte. */
@media (max-width: 781px) {
	.tl-hero {
		grid-template-columns: minmax(0, 1fr);
		min-height: auto;
	}

	.tl-hero-media.is-style-arche {
		order: -1;
		justify-self: center;
		width: min(78%, 360px);
		margin-right: 16px;
	}

	.tl-hero-media.is-style-arche::after {
		inset: 16px -16px -16px 16px;
	}

	.tl-hero:has(.tl-hero-media.is-style-plein-ecran) {
		min-height: 80vh;
	}
}

/* Forme « Plein écran, menu sur la vidéo » -------------------------------- */
/* La vidéo occupe tout l'écran et l'en-tête se pose dessus en transparence.
   Un voile plus dense en haut garde le menu lisible, et en bas le texte. */
.tl-hero:has(.tl-hero-media.is-style-plein-ecran-menu) {
	grid-template-columns: minmax(0, 1fr);
	align-items: end;
	min-height: 100vh;
	min-height: 100svh;
}

.tl-hero-media.is-style-plein-ecran-menu {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.tl-hero-media.is-style-plein-ecran-menu video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tl-hero-media.is-style-plein-ecran-menu::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(
		to bottom,
		rgba(26, 20, 17, 0.75) 0%,
		rgba(26, 20, 17, 0.25) 28%,
		rgba(26, 20, 17, 0.35) 60%,
		rgba(26, 20, 17, 0.7) 100%
	);
}

.tl-hero:has(.tl-hero-media.is-style-plein-ecran-menu) .tl-hero-texte {
	max-width: 820px;
}

.is-style-plein-ecran-menu .tl-video-toggle {
	left: auto;
	right: var(--wp--preset--spacing--50);
	bottom: var(--wp--preset--spacing--40);
	transform: none;
}

/* Supprime tout espace résiduel au-dessus de la vidéo et sous l'en-tête. */
body:has(.tl-hero-media.is-style-plein-ecran-menu) .wp-site-blocks > main,
body:has(.tl-hero-media.is-style-plein-ecran-menu) .wp-block-post-content,
body:has(.tl-hero-media.is-style-plein-ecran-menu) .tl-hero {
	margin-block-start: 0;
	padding-block-start: 0;
}

/* Sections pleine largeur : collées les unes aux autres, sans bande vide ---- */
.wp-block-post-content > .alignfull {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* Surtitre en petites capitales (réutilisable dans toutes les sections) ---- */
.tl-surtitre {
	font-family: var(--wp--preset--font-family--bodoni-moda);
	font-size: 0.75rem;
	letter-spacing: 0.35em;
	text-transform: uppercase;
	color: var(--wp--preset--color--or);
}

/* Section « Le château en chiffres » -------------------------------------- */
.tl-chiffres {
	padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50);
	background: var(--wp--preset--color--beige);
	color: var(--wp--preset--color--encre);
	text-align: center;
}

.tl-chiffres > * {
	margin-block: 0;
}

.tl-chiffres .tl-accroche {
	color: var(--wp--preset--color--or-fonce);
}

.tl-chiffres h2 {
	color: var(--wp--preset--color--noir-chaud);
	margin-bottom: var(--wp--preset--spacing--40);
}

.tl-chiffres-grille {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	max-width: 1320px;
	margin-inline: auto;
}

.tl-chiffres-grille > * {
	margin: 0;
}

.tl-chiffre {
	padding: 0.5rem 1.5rem;
	border-right: 1px solid rgba(42, 33, 28, 0.2);
}

.tl-chiffre:last-child {
	border-right: 0;
}

.tl-chiffre > * {
	margin: 0;
}

.tl-chiffre-valeur {
	font-family: var(--wp--preset--font-family--dm-serif-display);
	font-size: clamp(2.5rem, 2rem + 2vw, 3.4rem);
	line-height: 1.1;
	color: var(--wp--preset--color--noir-chaud);
	margin-bottom: 0.4rem !important;
}

.tl-chiffre p:not(.tl-chiffre-valeur) {
	font-size: var(--wp--preset--font-size--petit);
	line-height: 1.5;
}

/* Tablette : deux colonnes. Téléphone : une colonne avec filets horizontaux. */
@media (max-width: 1024px) {
	.tl-chiffres-grille {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		row-gap: 2rem;
	}

	.tl-chiffre:nth-child(2n) {
		border-right: 0;
	}
}

@media (max-width: 600px) {
	.tl-chiffres-grille {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 0;
	}

	.tl-chiffre {
		border-right: 0;
		padding: 1.25rem 0;
		border-bottom: 1px solid rgba(42, 33, 28, 0.2);
	}

	.tl-chiffre:last-child {
		border-bottom: 0;
	}
}

/* Accessibilité : moins d'animations si le visiteur l'a demandé ------------ */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
