/* Domaine d'Essalois — styles complémentaires à theme.json */

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
img { height: auto; }
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--turquoise-fonce);
	outline-offset: 3px;
}
.wp-site-blocks > main { margin-block-start: 0; }
strong, b { color: var(--wp--preset--color--titre); font-weight: 500; }

/* ---------- En-tête ---------- */
.site-entete {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--wp--preset--color--blanc);
	border-bottom: 1px solid #ececec;
	transition: box-shadow .3s ease;
}
.admin-bar .site-entete { top: var(--wp-admin--admin-bar--height, 32px); }
.site-entete.est-defile { box-shadow: 0 4px 18px rgba(0, 0, 0, .06); }
.site-entete .wp-block-site-logo img { max-width: 220px; }
.site-entete .wp-block-navigation-item__content { padding: .45rem .7rem; border: 1px solid transparent; text-decoration: none; }
.site-entete .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--brun); }
.site-entete .current-menu-item > .wp-block-navigation-item__content,
.site-entete .current-menu-ancestor > .wp-block-navigation-item__content,
.site-entete .wp-block-navigation-item__content[aria-current="page"] {
	border-color: var(--wp--preset--color--beige);
	color: var(--wp--preset--color--brun);
}
.site-entete .wp-block-navigation__submenu-container {
	border: 1px solid #ececec !important;
	padding: .4rem 0;
}
.site-entete .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: .55rem 1.2rem; }

/* ---------- Titre orné (style de bloc « Titre orné ») ---------- */
.is-style-orne {
	text-align: center;
	text-transform: uppercase;
	letter-spacing: .06em;
}
.is-style-orne:not(.has-text-color) { color: var(--wp--preset--color--turquoise); }
.is-style-orne.minuscules { text-transform: none; letter-spacing: .03em; }
.is-style-orne.minuscules::before, .is-style-orne.minuscules::after { color: var(--wp--preset--color--turquoise); }
.is-style-orne::before,
.is-style-orne::after {
	content: "";
	display: block;
	width: min(244px, 70%);
	aspect-ratio: 244 / 30;
	margin: .5rem auto;
	background-color: currentColor;
	-webkit-mask: url(../ornement.svg) center / contain no-repeat;
	mask: url(../ornement.svg) center / contain no-repeat;
}
.is-style-orne::after { transform: scaleY(-1); }
.ornement {
	display: block;
	width: min(244px, 70%);
	aspect-ratio: 244 / 30;
	margin: 1.25rem auto;
	background-color: currentColor;
	-webkit-mask: url(../ornement.svg) center / contain no-repeat;
	mask: url(../ornement.svg) center / contain no-repeat;
}

/* ---------- Encart translucide sur photo ---------- */
.is-style-encart,
.wp-block-cover .is-style-encart {
	color: var(--wp--preset--color--texte);
	background: rgba(255, 255, 255, .86);
	padding: clamp(1.25rem, 3vw, 2rem) !important;
	height: 100%;
	backdrop-filter: blur(2px);
}

.is-style-encart :is(h1, h2, h3, h4) { color: var(--wp--preset--color--titre); }

/* ---------- Puces losanges ---------- */
.is-style-losanges { list-style: none; padding-left: 0; }
.is-style-losanges li { position: relative; padding-left: 1.5rem; margin-bottom: .6rem; }
.is-style-losanges li::before {
	content: "";
	position: absolute;
	left: 2px;
	top: .62em;
	width: .55rem;
	height: .55rem;
	background: var(--wp--preset--color--titre);
	transform: rotate(45deg);
}

/* ---------- Images ---------- */
.is-style-ombre img { box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.photo-recadree img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.photo-paysage img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

/* ---------- Diaporama d'accueil ---------- */
.hero {
	position: relative;
	min-height: clamp(460px, 82vh, 860px);
	display: grid;
	place-items: center;
	overflow: hidden;
	color: var(--wp--preset--color--blanc);
	isolation: isolate;
}
.hero__images { position: absolute !important; inset: 0; width: 100%; max-width: none !important; margin: 0 !important; z-index: -2; }
.hero__images > figure {
	position: absolute;
	inset: 0;
	margin: 0 !important;
	opacity: 0;
	animation: hero-fondu 35s linear infinite;
}
.hero__images > figure img { width: 100%; height: 100%; object-fit: cover; }
.hero__images > figure:nth-child(1) { opacity: 1; animation-delay: 0s; }
.hero__images > figure:nth-child(2) { animation-delay: 7s; }
.hero__images > figure:nth-child(3) { animation-delay: 14s; }
.hero__images > figure:nth-child(4) { animation-delay: 21s; }
.hero__images > figure:nth-child(5) { animation-delay: 28s; }
@keyframes hero-fondu {
	0% { opacity: 0; transform: scale(1); }
	4% { opacity: 1; }
	20% { opacity: 1; }
	26% { opacity: 0; transform: scale(1.07); }
	100% { opacity: 0; transform: scale(1.07); }
}
.hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg, rgba(20, 16, 12, .28) 0%, rgba(20, 16, 12, .5) 100%);
}
.hero__texte { text-align: center; padding-block: 3rem; }
.hero__texte h1, .hero__texte p { color: inherit; text-shadow: 0 2px 14px rgba(0, 0, 0, .35); }
.hero__texte .wp-block-image img { filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .35)); }
.hero .wp-block-button__link { color: var(--wp--preset--color--blanc); border-color: var(--wp--preset--color--blanc); background: rgba(0, 0, 0, .12); }
.hero .wp-block-button__link:hover, .hero .wp-block-button__link:focus { background: var(--wp--preset--color--blanc); color: var(--wp--preset--color--titre); }
@media (prefers-reduced-motion: reduce) {
	.hero__images > figure { animation: none; }
	.hero__images > figure:not(:first-child) { display: none; }
}
/* Dans l'éditeur : les photos du diaporama s'affichent côte à côte pour être modifiables */
.editor-styles-wrapper .hero__images { position: relative !important; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; z-index: 0; }
.editor-styles-wrapper .hero__images > figure { position: relative; opacity: 1; animation: none; }
.editor-styles-wrapper .hero { display: block; color: var(--wp--preset--color--titre); }
.editor-styles-wrapper .hero::after { display: none; }

/* ---------- Cartes de l'accueil ---------- */
.cartes .wp-block-image { overflow: hidden; }
.cartes .wp-block-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .6s ease; }
.cartes .wp-block-image a:hover img, .cartes .wp-block-image a:focus img { transform: scale(1.05); }
.cartes h3 a { text-decoration: none; color: inherit; }

/* ---------- Galeries ---------- */
.wp-block-gallery.galerie-carree .wp-block-image img { aspect-ratio: 1 / 1; object-fit: cover; }
.wp-block-gallery.galerie-paysage .wp-block-image img { aspect-ratio: 3 / 2; object-fit: cover; }

/* ---------- Formulaire de contact (Contact Form 7) ---------- */
.wpcf7 form p { margin: 0 0 1.1rem; }
.wpcf7 label { display: block; font-size: .875rem; color: var(--wp--preset--color--titre); }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"],
.wpcf7 input[type="date"], .wpcf7 input[type="number"], .wpcf7 select, .wpcf7 textarea {
	box-sizing: border-box;
	width: 100%;
	margin-top: .35rem;
	padding: .7rem .8rem;
	border: 1px solid #b9b2a7;
	border-radius: 0;
	background: #fff;
	font: inherit;
	color: var(--wp--preset--color--titre);
	letter-spacing: normal;
}
.wpcf7 textarea { min-height: 9rem; }
.wpcf7 .champs-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 600px) { .wpcf7 .champs-duo { grid-template-columns: 1fr; } }
.wpcf7 .wpcf7-quiz-label { display: inline-block; margin: .35rem .5rem 0 0; font-weight: 500; }
.wpcf7 .wpcf7-quiz { width: auto; max-width: 12rem; }
.wpcf7 .wpcf7-acceptance label { display: flex; gap: .6rem; align-items: flex-start; font-size: .8125rem; color: var(--wp--preset--color--texte); }
.wpcf7 .wpcf7-acceptance input { margin-top: .3rem; }
.wpcf7 .wpcf7-list-item { margin: 0; }
.wpcf7 input[type="submit"] {
	cursor: pointer;
	border: 1px solid var(--wp--preset--color--titre);
	background: var(--wp--preset--color--titre);
	color: #fff;
	padding: .85rem 2.2rem;
	font-family: var(--wp--preset--font-family--philosopher);
	letter-spacing: .18em;
	text-transform: uppercase;
	font-size: .8125rem;
	transition: background .2s, color .2s;
}
.wpcf7 input[type="submit"]:hover, .wpcf7 input[type="submit"]:focus { background: #fff; color: var(--wp--preset--color--titre); }
.wpcf7 .wpcf7-not-valid-tip { color: #a4262c; font-size: .8125rem; }
.wpcf7 form .wpcf7-response-output { margin: 1rem 0 0; padding: .8rem 1rem; border-width: 1px; }
.wpcf7 .wpcf7-spinner { vertical-align: middle; }
.champ-obligatoire { color: #a4262c; }

/* ---------- Carte ---------- */
.carte iframe { display: block; width: 100%; height: clamp(320px, 45vw, 440px); border: 0; filter: grayscale(.25); }

/* ---------- Pied de page ---------- */
.site-pied a { color: var(--wp--preset--color--brun-fonce); }
.site-pied a:hover, .site-pied a:focus { color: var(--wp--preset--color--turquoise-fonce); }
.site-pied .wp-block-social-links .wp-social-link { background: var(--wp--preset--color--brun-fonce) !important; color: #fff !important; }

/* ---------- Mobile ---------- */
@media (max-width: 781px) {
	.inverse-mobile { flex-direction: column-reverse; }
	.hero { min-height: 72vh; }
}
