/* ==========================================================================
   Les 3 Fées Bobines — styles du thème
   Chargé sur le site et dans l'éditeur. Les couleurs, polices et tailles
   viennent de theme.json (variables --wp--preset--*).
   ========================================================================== */

:root {
	--l3fb-brun: var(--wp--preset--color--brun, #514138);
	--l3fb-lin: var(--wp--preset--color--lin, #E2DAD3);
	--l3fb-blanc: var(--wp--preset--color--blanc, #FFFFFF);
	--l3fb-brun-doux: color-mix(in srgb, var(--l3fb-brun) 72%, var(--l3fb-blanc));
	--l3fb-lin-clair: color-mix(in srgb, var(--l3fb-lin) 45%, var(--l3fb-blanc));
	--l3fb-trait: color-mix(in srgb, var(--l3fb-brun) 35%, transparent);
	--l3fb-radius: var(--wp--custom--radius--medium, 14px);
	--l3fb-transition: var(--wp--custom--transition, 0.25s ease);
	--l3fb-couture: repeating-linear-gradient(90deg, var(--l3fb-trait) 0 7px, transparent 7px 12px);
}

/* --- Base ---------------------------------------------------------------- */

html {
	scroll-behavior: smooth;
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-x: clip;
}

::selection {
	background: var(--l3fb-lin);
	color: var(--l3fb-brun);
}

img {
	height: auto;
	max-width: 100%;
}

strong,
b {
	font-weight: 500;
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 1.5px dashed var(--l3fb-brun);
	outline-offset: 3px;
}

a {
	text-underline-offset: 0.22em;
	text-decoration-thickness: 1px;
	transition: color var(--l3fb-transition), opacity var(--l3fb-transition);
}

:where(.wp-element-button, .wp-block-button__link) {
	transition: background-color var(--l3fb-transition), color var(--l3fb-transition), border-color var(--l3fb-transition), transform var(--l3fb-transition);
}

:where(.wp-element-button, .wp-block-button__link):active {
	transform: translateY(1px);
}

/* Les titres en script ont besoin d'un peu d'air au-dessus. */
:where(h1, h2, h3, h4, h5, h6) {
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

/* Champs de formulaire */
:where(input[type="text"], input[type="email"], input[type="url"], input[type="tel"], input[type="number"], input[type="password"], input[type="search"], select, textarea) {
	border: 1px solid var(--l3fb-lin);
	border-radius: var(--wp--custom--radius--small, 6px);
	background: var(--l3fb-blanc);
	color: var(--l3fb-brun);
	font: inherit;
	padding: 0.7em 0.9em;
	transition: border-color var(--l3fb-transition), box-shadow var(--l3fb-transition);
}

:where(input, select, textarea):focus {
	border-color: var(--l3fb-brun);
	box-shadow: 0 0 0 3px var(--l3fb-lin-clair);
	outline: none;
}

/* Pas d'espace parasite entre en-tête, contenu et pied de page. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* --- En-tête ------------------------------------------------------------- */

.l3fb-annonce {
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.l3fb-annonce p {
	margin: 0;
}

.l3fb-header {
	position: relative;
	z-index: 50;
}

.l3fb-header::after,
.l3fb-ligne-couture::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 6px;
	height: 1px;
	background: var(--l3fb-couture);
	pointer-events: none;
}

/* En-tête collant : le sticky doit porter sur la partie de modèle elle-même. */
@media (min-width: 782px) {
	.wp-site-blocks > header.wp-block-template-part:has(.l3fb-header-sticky) {
		position: sticky;
		top: 0;
		z-index: 100;
	}
	.admin-bar .wp-site-blocks > header.wp-block-template-part:has(.l3fb-header-sticky) {
		top: 32px;
	}
}

.l3fb-header .wp-block-site-title a {
	text-decoration: none;
}

.l3fb-header .wp-block-navigation-item__content {
	position: relative;
	padding-block: 0.4em;
}

.l3fb-header .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: var(--l3fb-couture);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform var(--l3fb-transition);
}

.l3fb-header .wp-block-navigation-item__content:hover::after,
.l3fb-header .current-menu-item > .wp-block-navigation-item__content::after {
	transform: scaleX(1);
}

.l3fb-header .wp-block-site-title {
	white-space: nowrap;
}

/* Tablette : menu plus compact pour tenir sur une ligne. */
@media (min-width: 601px) and (max-width: 1100px) {
	.l3fb-header .wp-block-navigation {
		--wp--style--block-gap: 1.1rem;
		gap: 1.1rem !important;
		font-size: 0.75rem !important;
		letter-spacing: 0.08em !important;
	}
	.l3fb-header .wp-block-navigation .wp-block-navigation__container {
		gap: 1.1rem !important;
		flex-wrap: nowrap;
	}
	.l3fb-header .wp-block-site-tagline {
		display: none;
	}
}

/* Sous-menus */
.wp-block-navigation .wp-block-navigation__submenu-container {
	border: 1px solid var(--l3fb-lin) !important;
	border-radius: var(--l3fb-radius);
	padding: 0.5rem !important;
	box-shadow: var(--wp--preset--shadow--douce);
	background: var(--l3fb-blanc) !important;
}

.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.55em 1em;
	border-radius: var(--wp--custom--radius--small, 6px);
}

.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	background: var(--l3fb-lin-clair);
}

/* Menu mobile (superposition) */
.wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--l3fb-lin) !important;
	color: var(--l3fb-brun) !important;
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: center;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: center !important;
	gap: 1.25rem;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--italianno);
	font-size: 2.75rem;
	letter-spacing: 0;
	text-transform: none;
}

.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	color: var(--l3fb-brun);
}

/* Icônes compte / panier dans l'en-tête */
.l3fb-header-actions {
	gap: 0.75rem;
}

.l3fb-header-actions svg {
	width: 22px;
	height: 22px;
}

/* --- Pied de page -------------------------------------------------------- */

.l3fb-footer {
	position: relative;
}

.l3fb-footer::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 8px;
	height: 1px;
	background: var(--l3fb-couture);
}

.l3fb-footer h2,
.l3fb-footer h3 {
	margin-bottom: 0.5rem;
}

.l3fb-footer ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.l3fb-footer ul li {
	margin: 0 0 0.45rem;
}

.l3fb-footer a {
	text-decoration: none;
}

.l3fb-footer a:hover {
	text-decoration: underline;
}

.l3fb-footer-bas {
	border-top: 1px dashed var(--l3fb-trait);
}

/* --- Styles de blocs ----------------------------------------------------- */

/* Groupe : surpiqûre (bordure cousue intérieure) */
.is-style-surpiqure {
	position: relative;
	border-radius: var(--l3fb-radius);
	padding: var(--wp--preset--spacing--50);
}

.is-style-surpiqure::before {
	content: "";
	position: absolute;
	inset: 10px;
	border: 1.5px dashed var(--l3fb-trait);
	border-radius: calc(var(--l3fb-radius) - 6px);
	pointer-events: none;
}

/* Groupe : carte douce */
.is-style-carte {
	background: var(--l3fb-blanc);
	border-radius: var(--l3fb-radius);
	box-shadow: var(--wp--preset--shadow--douce);
	padding: var(--wp--preset--spacing--40);
	transition: transform var(--l3fb-transition), box-shadow var(--l3fb-transition);
}

.is-style-carte:hover {
	transform: translateY(-3px);
	box-shadow: var(--wp--preset--shadow--marquee);
}

/* Groupe : sections colorées */
.is-style-section-lin {
	background-color: var(--l3fb-lin);
	color: var(--l3fb-brun);
}

.is-style-section-brun {
	background-color: var(--l3fb-brun);
	color: var(--l3fb-blanc);
}

.is-style-section-brun :where(h1, h2, h3, h4, h5, h6, a, .wp-block-heading) {
	color: var(--l3fb-blanc);
}

.is-style-section-brun :where(.wp-element-button, .wp-block-button__link) {
	background: var(--l3fb-blanc);
	color: var(--l3fb-brun);
	border-color: var(--l3fb-blanc);
}

.is-style-section-brun :where(.wp-element-button, .wp-block-button__link):hover {
	background: var(--l3fb-lin);
	border-color: var(--l3fb-lin);
}

.is-style-section-brun .is-style-surpiqure::before,
.is-style-section-brun.is-style-surpiqure::before {
	border-color: color-mix(in srgb, var(--l3fb-blanc) 45%, transparent);
}

/* Groupe : étiquette cousue (petit badge façon étiquette textile) */
.is-style-etiquette {
	display: inline-block;
	position: relative;
	background: var(--l3fb-lin);
	padding: 0.5rem 1.25rem;
	border-radius: 4px;
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.is-style-etiquette::before {
	content: "";
	position: absolute;
	inset: 3px;
	border: 1px dashed var(--l3fb-trait);
	border-radius: 3px;
	pointer-events: none;
}

.is-style-etiquette > * {
	margin: 0;
}

/* Colonnes en cartes */
.wp-block-columns.is-style-cartes > .wp-block-column {
	background: var(--l3fb-blanc);
	border-radius: var(--l3fb-radius);
	box-shadow: var(--wp--preset--shadow--douce);
	padding: var(--wp--preset--spacing--40);
	position: relative;
}

.wp-block-columns.is-style-cartes > .wp-block-column::before {
	content: "";
	position: absolute;
	inset: 8px;
	border: 1px dashed var(--l3fb-trait);
	border-radius: calc(var(--l3fb-radius) - 5px);
	pointer-events: none;
}

/* Image : arche */
.wp-block-image.is-style-arche img,
.wp-block-cover.is-style-arche,
.wp-block-cover.is-style-arche .wp-block-cover__image-background {
	border-radius: 999px 999px var(--l3fb-radius) var(--l3fb-radius) !important;
}

.wp-block-image.is-style-arche,
.wp-block-image.is-style-polaroid,
.wp-block-image.is-style-tambour {
	width: 100%;
}

.wp-block-image.is-style-arche img,
.wp-block-image.is-style-polaroid img,
.wp-block-image.is-style-tambour img {
	width: 100%;
}

.wp-block-image.is-style-arche img {
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

/* Image : tambour à broder (ronde, double cerclage) */
.wp-block-image.is-style-tambour {
	position: relative;
	padding: 12px;
}

.wp-block-image.is-style-tambour img {
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 50% !important;
	border: 6px solid var(--l3fb-lin);
	box-shadow: 0 0 0 1px var(--l3fb-trait), var(--wp--preset--shadow--douce);
}

.wp-block-image.is-style-tambour::after {
	content: "";
	position: absolute;
	inset: 0;
	border: 1.5px dashed var(--l3fb-trait);
	border-radius: 50%;
	pointer-events: none;
}

/* Image : polaroïd */
.wp-block-image.is-style-polaroid {
	background: var(--l3fb-blanc);
	padding: 12px 12px 3rem;
	box-shadow: var(--wp--preset--shadow--douce);
	border-radius: 4px;
	transform: rotate(-1.5deg);
	transition: transform var(--l3fb-transition);
}

.wp-block-image.is-style-polaroid:hover {
	transform: rotate(0deg) scale(1.01);
}

.wp-block-image.is-style-polaroid img {
	border-radius: 2px !important;
}

.wp-block-image.is-style-polaroid figcaption {
	font-family: var(--wp--preset--font-family--italianno);
	font-size: 1.75rem;
	font-style: normal;
	text-align: center;
	margin-top: 0.5rem;
}

/* Séparateurs */
.wp-block-separator.is-style-couture {
	border: 0 !important;
	height: 2px !important;
	background: var(--l3fb-couture) !important;
	opacity: 1;
	width: 100%;
}

.wp-block-separator.is-style-couture:not(.is-style-wide):not(.alignwide):not(.alignfull) {
	max-width: 160px;
}

.wp-block-separator.is-style-fil-ondule {
	border: 0 !important;
	height: 14px !important;
	max-width: 220px;
	background: url("../images/fil-ondule.svg") center / 100% 100% no-repeat !important;
	opacity: 1;
}

.wp-block-separator.is-style-bobine {
	border: 0 !important;
	height: 34px !important;
	max-width: 320px;
	background:
		url("../images/bobine.svg") center / 34px 34px no-repeat,
		linear-gradient(var(--l3fb-trait), var(--l3fb-trait)) left center / calc(50% - 30px) 1px no-repeat,
		linear-gradient(var(--l3fb-trait), var(--l3fb-trait)) right center / calc(50% - 30px) 1px no-repeat !important;
	opacity: 1;
}

/* Titres & paragraphes */
.is-style-surtitre {
	font-family: var(--wp--preset--font-family--roboto) !important;
	font-size: var(--wp--preset--font-size--x-small) !important;
	font-weight: 500 !important;
	letter-spacing: 0.24em !important;
	line-height: 1.6 !important;
	text-transform: uppercase;
	margin-bottom: 0.25rem;
}

.wp-block-heading.is-style-brode {
	position: relative;
	padding-bottom: 0.5em;
}

.wp-block-heading.is-style-brode::after {
	content: "";
	display: block;
	width: 140px;
	max-width: 60%;
	height: 12px;
	margin-top: 0.15em;
	background: url("../images/fil-ondule.svg") center / 100% 100% no-repeat;
}

.wp-block-heading.is-style-brode.has-text-align-center::after {
	margin-inline: auto;
}

.wp-block-heading.is-style-brode.has-text-align-right::after {
	margin-left: auto;
}

.is-style-chapo {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 300;
	line-height: 1.6;
}

.is-style-signature {
	font-family: var(--wp--preset--font-family--italianno);
	font-size: var(--wp--preset--font-size--script-m);
	line-height: 1.1;
}

/* Boutons */
.wp-block-button.is-style-cousu .wp-block-button__link {
	background: transparent;
	color: var(--l3fb-brun);
	border: 1.5px dashed var(--l3fb-brun);
}

.wp-block-button.is-style-cousu .wp-block-button__link:hover {
	background: var(--l3fb-lin);
	border-style: solid;
	border-color: var(--l3fb-lin);
}

.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: currentColor;
	border: 1px solid currentColor;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--l3fb-lin);
	color: var(--l3fb-brun);
	border-color: var(--l3fb-lin);
}

.wp-block-button.is-style-lien .wp-block-button__link {
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	color: currentColor !important;
	padding: 0.25em 0 !important;
	background-image: var(--l3fb-couture) !important;
	background-size: 100% 1px !important;
	background-position: left bottom !important;
	background-repeat: no-repeat !important;
}

.wp-block-button.is-style-lien .wp-block-button__link::after {
	content: " →";
}

/* Listes */
.wp-block-list.is-style-points-croix,
.wp-block-list.is-style-aiguilles {
	list-style: none;
	padding-left: 0;
}

.wp-block-list.is-style-points-croix li,
.wp-block-list.is-style-aiguilles li {
	position: relative;
	padding-left: 1.75em;
	margin-bottom: 0.4em;
}

.wp-block-list.is-style-points-croix li::before {
	content: "×";
	position: absolute;
	left: 0.2em;
	top: -0.08em;
	font-size: 1.3em;
	font-weight: 300;
	color: var(--l3fb-brun-doux);
}

.wp-block-list.is-style-aiguilles li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.55em;
	width: 1.1em;
	height: 1px;
	background: var(--l3fb-couture);
}

/* Citation élégante */
.wp-block-quote.is-style-elegante {
	border: 0 !important;
	padding: 0 !important;
	text-align: center;
	position: relative;
}

.wp-block-quote.is-style-elegante::before {
	content: "“";
	display: block;
	font-family: var(--wp--preset--font-family--italianno);
	font-size: 6rem;
	line-height: 0.6;
	height: 0.5em;
	color: var(--l3fb-brun-doux);
}

.wp-block-quote.is-style-elegante p {
	font-style: italic;
	font-weight: 300;
}

.wp-block-quote.is-style-elegante cite {
	display: block;
	margin-top: 1rem;
}

/* --- Articles & archives ------------------------------------------------- */

.l3fb-carte-article .wp-block-post-featured-image {
	overflow: hidden;
	border-radius: var(--l3fb-radius);
}

.l3fb-carte-article .wp-block-post-featured-image img {
	transition: transform 0.6s ease;
}

.l3fb-carte-article:hover .wp-block-post-featured-image img {
	transform: scale(1.04);
}

.wp-block-query-pagination .page-numbers,
.wp-block-query-pagination a {
	text-decoration: none;
}

.wp-block-query-pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 2.4em;
	height: 2.4em;
	border-radius: 999px;
}

.wp-block-query-pagination .page-numbers.current {
	background: var(--l3fb-brun);
	color: var(--l3fb-blanc);
}

/* Commentaires */
.wp-block-comments .wp-block-comment-template li {
	border-bottom: 1px dashed var(--l3fb-trait);
	padding-bottom: 1.25rem;
	margin-bottom: 1.25rem;
}

/* Questions / réponses (bloc Détails) */
.wp-block-details {
	border-bottom: 1px dashed var(--l3fb-trait);
	padding: 1rem 0;
}

.wp-block-details summary {
	cursor: pointer;
	font-weight: 400;
	list-style: none;
	position: relative;
	padding-right: 2rem;
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details summary::after {
	content: "+";
	position: absolute;
	right: 0.25rem;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.4em;
	font-weight: 300;
	transition: transform var(--l3fb-transition);
}

.wp-block-details[open] summary::after {
	transform: translateY(-50%) rotate(45deg);
}

.wp-block-details > :not(summary) {
	margin-top: 0.75rem;
}

/* Recherche */
.wp-block-search__input {
	border-radius: 999px !important;
	padding-inline: 1.25em !important;
}

/* Icônes illustratives des motifs */
.l3fb-icone img {
	width: 64px !important;
	height: 64px !important;
	border-radius: 0 !important;
}

/* --- Accessibilité & mouvements ----------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* Les colonnes WordPress s'empilent sous 782 px : on garde un espacement régulier. */
@media (max-width: 781px) {
	.wp-block-columns:not(.is-not-stacked-on-mobile) {
		gap: var(--wp--preset--spacing--40);
	}
}
