/*
 * core/paragraph — styles du socle.
 *
 * Retour en haut : le paragraphe sort du flux et se fixe dans le coin bas
 * droit de l'écran ; son lien prend la forme d'une pastille. Un seul par page,
 * posé à la fin du contenu, vers une ancre en haut de page.
 *
 * L'apparition au défilement passe par une animation liée au défilement de la
 * page, sans JavaScript. Un navigateur qui ne la connaît pas montre la pastille
 * d'emblée : moins élégant, jamais inaccessible.
 */

.is-style-gaia-to-top {
	position: fixed;
	right: var(--wp--preset--spacing--40);
	bottom: var(--wp--preset--spacing--40);
	z-index: 50;
	margin: 0 !important;
	max-width: none;
}

.is-style-gaia-to-top a {
	display: inline-block;
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
	border: var(--wp--custom--rule--hairline) solid var(--wp--preset--color--border-strong);
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--sm);
	line-height: 1.4;
	text-decoration: none;
	transition: background-color var(--wp--custom--transition--base), color var(--wp--custom--transition--base);
}

.is-style-gaia-to-top a:hover,
.is-style-gaia-to-top a:focus-visible {
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

@supports (animation-timeline: scroll()) {

	.is-style-gaia-to-top {
		animation: gaia-to-top linear both;
		animation-timeline: scroll(root);
		animation-range: 0 60vh;
	}
}

@keyframes gaia-to-top {
	0%,
	50% {
		opacity: 0;
		visibility: hidden;
	}

	100% {
		opacity: 1;
		visibility: visible;
	}
}

/*
 * Badge — le surtitre en pastille cernée d'un filet. Une icône en ligne
 * (core/icon n'est pas un enfant possible d'un paragraphe : le texte seul) ;
 * la pastille s'ajuste à son contenu et ne prend jamais toute la largeur.
 */
.is-style-gaia-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	width: fit-content;
	max-width: 100%;
	padding: 0.35em 0.9em;
	border: var(--wp--custom--rule--hairline) solid var(--wp--preset--color--border-strong);
	border-radius: var(--wp--custom--radius--pill);
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--xs);
	line-height: 1.4;
}

.is-style-gaia-badge::before {
	content: "";
	flex: none;
	width: 0.5em;
	height: 0.5em;
	border-radius: 50%;
	background-color: var(--wp--preset--color--accent);
}

/* État — pastille à l'accent + petite ligne en chasse fixe. */
.is-style-gaia-status {
	display: flex;
	align-items: center;
	gap: 0.6em;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--xs);
	color: var(--wp--preset--color--muted);
}

.is-style-gaia-status::before {
	content: "";
	flex: none;
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 50%;
	background-color: var(--wp--preset--color--secondary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--secondary) 25%, transparent);
}

.is-style-gaia-status.has-text-align-right {
	justify-content: flex-end;
}

/*
 * Lien fléché — la flèche oblique est un masque en currentcolor, comme sur
 * gaia-arrow : un glyphe « ↗ » dans ::after serait lu à voix haute.
 */
.is-style-gaia-more a {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
	text-decoration: none;
}

.is-style-gaia-more a::after {
	content: "";
	flex: none;
	width: 0.9em;
	height: 0.9em;
	background-color: currentcolor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='m256-240-56-56 384-384H240v-80h480v480h-80v-344L256-240Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='m256-240-56-56 384-384H240v-80h480v480h-80v-344L256-240Z'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform var(--wp--custom--transition--base);
}

.is-style-gaia-more a:hover,
.is-style-gaia-more a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.is-style-gaia-more a:hover::after,
.is-style-gaia-more a:focus-visible::after {
	transform: translate(0.15em, -0.15em);
}

@media (prefers-reduced-motion: reduce) {

	.is-style-gaia-more a::after {
		transition: none;
	}
}

/* Dégradé — le même que sur les titres, pour un chiffre clé en paragraphe. */
p.is-style-gaia-gradient {
	width: fit-content;
	background-image: linear-gradient(100deg, var(--wp--preset--color--primary), var(--wp--preset--color--accent));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent !important;
	-webkit-text-fill-color: transparent;
	font-weight: 800;
}

@media (forced-colors: active) {

	p.is-style-gaia-gradient {
		background-image: none;
		color: CanvasText !important;
		-webkit-text-fill-color: CanvasText;
	}

	.is-style-gaia-badge::before,
	.is-style-gaia-status::before {
		background-color: CanvasText;
	}
}

/*
 * Descriptions des sections (accroches, textes de cartes, de tuiles, d'étapes) :
 * interligne 1,2 dans tous les patterns, quelle que soit l'ambiance. L'interligne
 * de lecture d'une ambiance (1,5 à 1,72) est fait pour un article ; sous un titre
 * de section ou de carte, il éparpillait les lignes (revues cabinet-soin #4,
 * pix-flow #14, sophrologue #5 #8 #10, catalogue des patterns 02/11).
 * Les patterns n'écrivent JAMAIS d'interligne eux-mêmes : c'est cette règle qui
 * le porte (validateur de gaia-library).
 *
 * Seul le corps d'un article garde l'interligne de lecture : les paragraphes
 * posés directement dans le contenu (`.wp-block-post-content > p`) en héritent.
 */
p,
p.has-sm-font-size,
p.has-xs-font-size,
p.has-lg-font-size {
	line-height: 1.2;
}

.wp-block-post-content > p {
	line-height: inherit;
}

/*
 * Ligne d'accroche d'un hero (hero-image → tagline) : les capitales espacées du
 * surtitre, sans la pastille qu'une variation peut lui donner (Poudre). Préfixé
 * par la couverture : la pastille d'une ambiance de page est portée par
 * :is(<portée>) p.is-style-gaia-eyebrow, plus spécifique qu'une double classe.
 */
.wp-block-cover p.is-style-gaia-eyebrow.gaia-tagline {
	padding: 0;
	background: none;
}
