/*
 * Druette — base et composants communs à toutes les pages.
 *
 * Unité --px : 1 pixel de la maquette. La maquette est dessinée grossie (2000 px de large) : sur ordinateur,
 * ses cotes sont ramenées à 75 % (--dru-scale), soit un écran de référence de 1500 px. Au-delà, la page ne
 * grossit plus ; de 1200 à 1500 px, elle se réduit avec l'écran en gardant ses proportions.
 * Les textes ont leurs propres tailles planchers (texte courant 16 px) : on garde la hiérarchie, pas les pixels.
 */

:root {
	--dru-corail: var(--wp--preset--color--corail, #f6494f);
	--dru-rouge: var(--wp--preset--color--rouge, #962d31);
	--dru-texte: var(--wp--preset--color--texte, #424242);
	--dru-fort: var(--wp--preset--color--texte-fort, #393939);
	--dru-doux: var(--wp--preset--color--texte-doux, #6f6f6f);
	--dru-papier: var(--wp--preset--color--papier, #f1eada);
	--dru-sable: var(--wp--preset--color--sable, #c8c4b9);
	--dru-blanc: #fff;
	--dru-font-titre: var(--wp--preset--font-family--titre, "Abril Fatface", Georgia, serif);
	--dru-font-texte: var(--wp--preset--font-family--texte, Poppins, system-ui, sans-serif);
	--dru-scale: 0.75;
	--px: 1px;
	--dru-gutter: clamp(1rem, 3vw, calc(58 * var(--px)));
	--dru-text: max(1rem, calc(17 * var(--px)));
	--dru-radius: calc(30 * var(--px));
	--dru-paper: var(--dru-papier) url(../images/papier.webp) 0 0 / 600px 1120px;
}

html {
	scroll-behavior: smooth;
}

@media (min-width: 1200px) {
	:root {
		--px: clamp(0.6px, 0.05vw, calc(var(--dru-scale) * 1px));
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--dru-paper);
	font-size: var(--dru-text);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

.wp-site-blocks {
	padding: 0;
}

.wp-site-blocks > * {
	margin-block: 0;
}

img {
	max-width: 100%;
	height: auto;
}

:where(a) {
	text-underline-offset: 0.18em;
}

:focus-visible {
	outline: 3px solid var(--dru-rouge);
	outline-offset: 3px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	z-index: 100;
	top: 0.5rem;
	left: 0.5rem;
	width: auto;
	height: auto;
	margin: 0;
	padding: 0.6rem 1rem;
	clip-path: none;
	background: var(--dru-blanc);
	color: var(--dru-fort);
	font-weight: 700;
}

.dru-container {
	width: min(100% - 2 * var(--dru-gutter), 1300px);
	margin-inline: auto;
}

/* Pictos : le fichier SVG sert de masque, la couleur est celle du texte. */
.dru-icon {
	display: inline-block;
	width: 1em;
	height: 1em;
	background: currentColor;
	-webkit-mask: var(--dru-icon) center / contain no-repeat;
	mask: var(--dru-icon) center / contain no-repeat;
	vertical-align: middle;
}

.dru-icon--telephone { --dru-icon: url(../icons/telephone.svg); }
.dru-icon--compte { --dru-icon: url(../icons/compte.svg); }
.dru-icon--panier { --dru-icon: url(../icons/panier.svg); }
.dru-icon--recherche { --dru-icon: url(../icons/recherche.svg); }
.dru-icon--instagram { --dru-icon: url(../icons/instagram.svg); }
.dru-icon--linkedin { --dru-icon: url(../icons/linkedin.svg); }
.dru-icon--livraison { --dru-icon: url(../icons/livraison.svg); }
.dru-icon--paiement { --dru-icon: url(../icons/paiement.svg); }
.dru-icon--service-client { --dru-icon: url(../icons/service-client.svg); }

/* Bouton à chevron. */
.dru-btn {
	display: inline-flex;
	align-items: center;
	gap: 1.1em;
	min-height: max(34px, calc(38 * var(--px)));
	padding: 0.3em 1.5em 0.3em 1.15em;
	border: 0;
	border-radius: calc(4 * var(--px));
	background: var(--dru-corail);
	color: var(--dru-blanc);
	font-family: var(--dru-font-texte);
	font-size: var(--dru-text);
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.dru-btn::before {
	content: "";
	flex: none;
	width: 0.4em;
	height: 0.4em;
	border: solid currentColor;
	border-width: 0.16em 0.16em 0 0;
	transform: rotate(45deg);
}

.dru-btn--rouge {
	background: var(--dru-rouge);
}

a.dru-btn:hover,
a:hover > .dru-btn,
.dru-tile:hover .dru-btn {
	background: var(--dru-rouge);
	color: var(--dru-blanc);
}

a.dru-btn--rouge:hover {
	background: var(--dru-corail);
}

/* En-tête de section : sur-titre entre deux puces, titre, accroche. */
.dru-section-head {
	text-align: center;
}

.dru-section-head > * {
	margin: 0;
}

.dru-surtitre {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.3em;
	color: var(--dru-fort);
	font-size: max(15px, calc(18 * var(--px)));
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
}

.dru-surtitre::before,
.dru-surtitre::after {
	content: "";
	flex: none;
	width: 0.62em;
	height: 0.62em;
	border-radius: 50%;
	background: var(--dru-corail);
}

.dru-titre {
	margin-top: calc(8 * var(--px));
	font-family: var(--dru-font-titre);
	font-size: clamp(1.625rem, 5vw, 2rem);
	font-weight: 400;
	line-height: 1.15;
}

.dru-titre + .dru-accroche,
.dru-accroche {
	max-width: 36em;
	margin: calc(12 * var(--px)) auto 0;
	color: var(--dru-doux);
	font-weight: 600;
	line-height: 1.2;
}

/* Pastilles de navigation : catégories de produits, rubriques du blog. */

.dru-category-nav ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.6rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dru-category-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0.35em 1.1em;
	border: 2px solid var(--dru-corail);
	border-radius: 999px;
	color: var(--dru-fort);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.dru-category-nav a:hover,
.dru-category-nav a[aria-current] {
	background: var(--dru-corail);
	color: var(--dru-blanc);
}

@media (max-width: 599px) {
	.dru-category-nav ul {
		flex-wrap: nowrap;
		justify-content: flex-start;
		margin-inline: calc(-1 * var(--dru-gutter));
		padding: 0 var(--dru-gutter) 0.4rem;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.dru-category-nav li {
		flex: none;
	}
}

/* Croquis décoratifs : seulement quand il y a de la place autour du contenu. */
.dru-decor {
	display: none;
	position: absolute;
	pointer-events: none;
	user-select: none;
}

@media (min-width: 1280px) {
	.dru-decor {
		display: block;
		height: auto;
	}
}

/*
 * Carte produit « étiquette » : cadre corail aux coins échancrés (masques en dégradés radiaux).
 * Les dimensions internes suivent la largeur de la carte (unité cqi).
 */
.dru-product-grid,
.dru-post-grid {
	display: grid;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dru-product-grid {
	grid-template-columns: repeat(4, minmax(0, 300px));
	justify-content: center;
	gap: calc(27 * var(--px));
}

.dru-product-grid > li {
	container-type: inline-size;
}

.dru-product-card {
	display: flex;
	flex-direction: column;
	--b: 1.67cqi;  /* épaisseur du trait corail */
	--n: 4.2cqi; /* rayon de l'arrondi rentrant des coins */
	--corner: transparent var(--n), #000 calc(var(--n) + 0.5px);
	position: relative;
	isolation: isolate;
	height: 100%;
	padding: 6cqi 6cqi 11.5cqi;
	text-align: center;
}

.dru-product-card::before,
.dru-product-card::after {
	content: "";
	position: absolute;
	z-index: -1;
}

.dru-product-card::before {
	inset: 0;
	background: var(--dru-corail);
	-webkit-mask:
		radial-gradient(circle at 0 0, var(--corner)) 0 0 / 51% 51% no-repeat,
		radial-gradient(circle at 100% 0, var(--corner)) 100% 0 / 51% 51% no-repeat,
		radial-gradient(circle at 0 100%, var(--corner)) 0 100% / 51% 51% no-repeat,
		radial-gradient(circle at 100% 100%, var(--corner)) 100% 100% / 51% 51% no-repeat;
	mask:
		radial-gradient(circle at 0 0, var(--corner)) 0 0 / 51% 51% no-repeat,
		radial-gradient(circle at 100% 0, var(--corner)) 100% 0 / 51% 51% no-repeat,
		radial-gradient(circle at 0 100%, var(--corner)) 0 100% / 51% 51% no-repeat,
		radial-gradient(circle at 100% 100%, var(--corner)) 100% 100% / 51% 51% no-repeat;
}

.dru-product-card::after {
	--in: transparent calc(var(--n) + var(--b)), #000 calc(var(--n) + var(--b) + 0.5px);
	inset: var(--b);
	background: var(--dru-papier);
	-webkit-mask:
		radial-gradient(circle at calc(-1 * var(--b)) calc(-1 * var(--b)), var(--in)) 0 0 / 51% 51% no-repeat,
		radial-gradient(circle at calc(100% + var(--b)) calc(-1 * var(--b)), var(--in)) 100% 0 / 51% 51% no-repeat,
		radial-gradient(circle at calc(-1 * var(--b)) calc(100% + var(--b)), var(--in)) 0 100% / 51% 51% no-repeat,
		radial-gradient(circle at calc(100% + var(--b)) calc(100% + var(--b)), var(--in)) 100% 100% / 51% 51% no-repeat;
	mask:
		radial-gradient(circle at calc(-1 * var(--b)) calc(-1 * var(--b)), var(--in)) 0 0 / 51% 51% no-repeat,
		radial-gradient(circle at calc(100% + var(--b)) calc(-1 * var(--b)), var(--in)) 100% 0 / 51% 51% no-repeat,
		radial-gradient(circle at calc(-1 * var(--b)) calc(100% + var(--b)), var(--in)) 0 100% / 51% 51% no-repeat,
		radial-gradient(circle at calc(100% + var(--b)) calc(100% + var(--b)), var(--in)) 100% 100% / 51% 51% no-repeat;
}

.dru-product-card__media {
	display: block;
	overflow: hidden;
	border-radius: 4.6cqi;
	aspect-ratio: 1;
}

.dru-product-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.dru-product-card:hover .dru-product-card__media img {
	transform: scale(1.04);
}

/* Liseré sous la photo : haut d'une seconde étiquette, coins échancrés. */
.dru-product-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	position: relative;
	margin: 3.7cqi -2.3cqi 0;
	padding: 10.5cqi 2.3cqi 0;
}

.dru-product-card__body::before,
.dru-product-card__body::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 8cqi;
}

.dru-product-card__body::before {
	background: var(--dru-corail);
	-webkit-mask:
		radial-gradient(circle at 0 0, var(--corner)) 0 0 / 51% 100% no-repeat,
		radial-gradient(circle at 100% 0, var(--corner)) 100% 0 / 51% 100% no-repeat;
	mask:
		radial-gradient(circle at 0 0, var(--corner)) 0 0 / 51% 100% no-repeat,
		radial-gradient(circle at 100% 0, var(--corner)) 100% 0 / 51% 100% no-repeat;
}

.dru-product-card__body::after {
	--in: transparent calc(var(--n) + 1.34cqi), #000 calc(var(--n) + 1.34cqi + 0.5px);
	top: 1.34cqi;
	background: var(--dru-papier);
	-webkit-mask:
		radial-gradient(circle at 0 -1.34cqi, var(--in)) 0 0 / 51% 100% no-repeat,
		radial-gradient(circle at 100% -1.34cqi, var(--in)) 100% 0 / 51% 100% no-repeat;
	mask:
		radial-gradient(circle at 0 -1.34cqi, var(--in)) 0 0 / 51% 100% no-repeat,
		radial-gradient(circle at 100% -1.34cqi, var(--in)) 100% 0 / 51% 100% no-repeat;
}

.dru-product-card__body > * {
	position: relative;
	z-index: 1;
	margin: 0;
}

.dru-product-card__title {
	font-family: var(--dru-font-titre);
	font-size: 11.6cqi;
	font-weight: 400;
	line-height: 1;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

.dru-product-card__title a {
	color: var(--dru-texte);
	text-decoration: none;
}

.dru-product-card__subtitle {
	margin-top: 2cqi;
	color: var(--dru-fort);
	font-size: max(11px, 5.7cqi);
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
}

.dru-product-card__price {
	margin-top: 2.6cqi;
	color: var(--dru-corail);
	font-size: 12.3cqi;
	font-weight: 700;
	line-height: 1.1;
}

.dru-product-card__price del {
	color: var(--dru-doux);
	font-size: 0.55em;
	font-weight: 400;
}

.dru-product-card__price ins {
	text-decoration: none;
}

.dru-product-card .dru-btn {
	margin-top: auto;
	padding-right: 2.4em;
}

/* Bouton en bas de la carte, toujours séparé du prix. */
.dru-product-card__body > :nth-last-child(2) {
	margin-bottom: 3cqi;
}

/* Contenu net et prix au kilo, sous le prix. */
.dru-product-card__unit {
	margin-top: 1.4cqi;
	color: var(--dru-doux);
	font-size: max(11px, 4.6cqi);
	line-height: 1.3;
}

.dru-product-card__unit .woocommerce-Price-amount {
	white-space: nowrap;
}

/* Bouton « Acheter » : produit ajouté au panier, ou épuisé. */
.dru-product-card .dru-btn.is-added {
	background: var(--dru-corail);
}

.dru-btn--off {
	background: var(--dru-sable);
	color: var(--dru-fort);
}

.dru-btn[aria-busy="true"] {
	opacity: 0.7;
	cursor: progress;
}

/* Pastille de promotion (« -20 % ») : sur la photo des cartes et de la fiche produit. */
.dru-badge {
	position: absolute;
	z-index: 2;
	top: 1rem;
	left: 1rem;
	padding: 0.3em 0.75em;
	border-radius: 999px;
	background: var(--dru-corail);
	color: var(--dru-blanc);
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.2;
}

.dru-product-card .dru-badge {
	top: 9cqi;
	left: 9cqi;
	font-size: max(11px, 5.2cqi);
}

/* Carte d'article. */
.dru-post-grid {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: calc(40 * var(--px)) calc(32 * var(--px));
}

.dru-post-card,
.dru-post-grid > li.wp-block-post {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.dru-post-card__media {
	display: block;
	width: 100%;
	margin: 0;
	overflow: hidden;
	border-radius: var(--dru-radius);
	aspect-ratio: 410 / 304;
}

.dru-post-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.dru-post-card__title {
	margin: calc(34 * var(--px)) 0 0;
	font-family: var(--dru-font-texte);
	font-size: clamp(1.25rem, 3vw, calc(28 * var(--px)));
	font-weight: 700;
	line-height: 1.2;
}

.dru-post-card__title a {
	color: var(--dru-texte);
	text-decoration: none;
}

.dru-post-card__excerpt {
	margin: calc(22 * var(--px)) 0 calc(20 * var(--px));
	color: var(--dru-doux);
	line-height: 1.25;
}

.dru-post-card .dru-btn,
.dru-post-grid .dru-btn {
	margin-top: auto;
}

@media (max-width: 1199px) {
	.dru-product-grid {
		grid-template-columns: repeat(2, minmax(0, 300px));
		gap: 1rem;
	}

	.dru-post-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 2rem 1rem;
	}
}

@media (max-width: 599px) {
	.dru-post-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.dru-product-card .dru-btn {
		padding-right: 1.2em;
		padding-left: 0.9em;
		gap: 0.7em;
		font-size: 0.875rem;
	}
}
