/* Méthode 3R — habillage des plugins Rĕsurgo.
   Chargé après les feuilles des plugins (dépendance déclarée), seulement là où elles sont utilisées. */

:root {
	--m3r-filet: color-mix(in srgb, var(--wp--preset--color--sauge) 45%, transparent);
}

/* ==========================================================================
   Plugin « Rĕsurgo — Espace Méthode 3R » (resurgo-espace-3r)
   Le plugin expose trois variables ; le reste recale ses composants sur la charte.
   ========================================================================== */

.r3r-espace {
	--r3r-trait: var(--m3r-filet);
	--r3r-encre: var(--wp--preset--color--braise-fonce);
	--r3r-repos: var(--wp--preset--color--brume);
	max-width: none;
}

.m3r-espace .r3r-espace .r3r-entete,
.m3r-espace .r3r-espace .r3r-sommaire {
	font-family: var(--wp--preset--font-family--lexend);
}

.r3r-entete p:first-child {
	font-size: var(--wp--preset--font-size--chapeau);
}

.r3r-sommaire a {
	color: var(--wp--preset--color--ardoise);
	text-underline-offset: 0.25em;
}

.r3r-sommaire a:hover,
.r3r-sommaire a:focus-visible {
	color: var(--wp--preset--color--braise-fonce);
}

/* Chaque section devient un panneau blanc sur le fond brume du gabarit. */
.m3r-espace .r3r-section {
	margin-top: var(--wp--preset--spacing--50);
	padding: var(--wp--preset--spacing--50);
	background: var(--wp--preset--color--blanc);
	border-radius: 1.5rem;
}

.r3r-chapeau {
	opacity: 1;
	color: var(--wp--preset--color--sauge-fonce);
}

.m3r-espace .r3r-diagnostic {
	border-left: 0;
	box-shadow: inset 4px 0 0 var(--wp--preset--color--braise);
	padding-left: calc(var(--wp--preset--spacing--50) + 0.5rem);
}

.r3r-espace .r3r-bouton {
	font-family: var(--wp--preset--font-family--lexend);
	font-weight: 500;
	font-size: 0.95rem;
	color: var(--wp--preset--color--blanc);
	background: var(--wp--preset--color--braise);
	border: 0;
	border-radius: 999px;
	padding: 0.7rem 1.35rem;
}

.r3r-espace .r3r-bouton:hover,
.r3r-espace .r3r-bouton:focus-visible {
	color: var(--wp--preset--color--blanc);
	background: var(--wp--preset--color--braise-fonce);
}

.r3r-espace :focus-visible {
	outline: 3px solid var(--wp--preset--color--braise);
}

/* Les cinq étapes de la bibliothèque : la grille s'ajuste au nombre d'étapes
   qui ont des documents, sans case vide. */
.r3r-etapes {
	grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
	border-radius: 1rem;
	overflow: hidden;
}

@media (max-width: 600px) {
	.r3r-etapes {
		grid-template-columns: 1fr;
	}
	.m3r-espace .r3r-section {
		padding: var(--wp--preset--spacing--40);
	}
}

.r3r-etape__rang {
	font-family: var(--wp--preset--font-family--lexend);
	font-size: var(--wp--preset--font-size--chapeau);
	letter-spacing: 0;
	opacity: 1;
	color: var(--wp--preset--color--braise);
}

.r3r-etape__nom {
	font-family: var(--wp--preset--font-family--lexend);
	font-weight: 500;
}

.r3r-etape__compte {
	opacity: 1;
	color: var(--wp--preset--color--sauge-fonce);
}

.r3r-groupe__entete {
	border-bottom-color: var(--wp--preset--color--braise);
}

.r3r-groupe__entete p,
.r3r-document p,
.r3r-video__meta {
	opacity: 1;
	color: var(--wp--preset--color--sauge-fonce);
}

.r3r-document h4,
.r3r-video h3 {
	font-family: var(--wp--preset--font-family--lexend);
	font-weight: 500;
}

.r3r-video__cadre {
	border-radius: 1rem;
}

.r3r-video__lecture {
	font-family: var(--wp--preset--font-family--lexend);
	background: color-mix(in srgb, var(--wp--preset--color--ardoise) 45%, transparent);
}

.r3r-video__lecture:hover,
.r3r-video__lecture:focus-visible {
	background: color-mix(in srgb, var(--wp--preset--color--ardoise) 65%, transparent);
}

/* Écran de connexion de l'espace, aligné sur le titre de la page */
.m3r-espace .r3r-connexion {
	max-width: 30rem;
	margin-left: 0 !important;
	padding: var(--wp--preset--spacing--50);
	background: var(--wp--preset--color--blanc);
	border-radius: 1.5rem;
}

.r3r-connexion form p {
	margin: 0 0 1rem;
}

.r3r-connexion label {
	display: block;
	font-family: var(--wp--preset--font-family--lexend);
	font-size: 0.95rem;
	margin-bottom: 0.3rem;
}

.r3r-connexion .login-remember label {
	display: inline;
}

/* ==========================================================================
   Plugin « Auto-diagnostic » (resurgo-autodiagnostic)
   Les couleurs passent par ses réglages (Auto-diagnostic > Couleurs), réglés
   par le thème à l'activation ; ici, seulement typographie et formes.
   ========================================================================== */

.rad-app {
	--rad-radius: 1.25rem;
	--rad-shadow: none;
	font-family: inherit;
	line-height: inherit;
}

.rad-app :where(h2, h3, h4, .rad-block-title, .rad-theme-title, .rad-grp-theme, .rad-acc > summary, .rad-table th) {
	font-family: var(--wp--preset--font-family--lexend);
}

.rad-app :where(.rad-theme-title, .rad-grp-theme, .rad-acc > summary, .rad-table th) {
	text-transform: none;
	letter-spacing: 0;
}

.rad-app .rad-btn {
	text-decoration: none;
	white-space: nowrap;
	font-family: var(--wp--preset--font-family--lexend);
	font-size: 0.95rem;
	font-weight: 500;
	text-transform: none;
	letter-spacing: 0;
	border-radius: 999px;
}

.rad-app .rad-btn--outline,
.rad-app .rad-btn:hover {
	background: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--braise-fonce);
	border-color: currentColor;
	box-shadow: none;
	transform: none;
}

.rad-app .rad-btn--primary:hover {
	color: var(--wp--preset--color--blanc);
	background: var(--wp--preset--color--braise-fonce);
}

.rad-app :where(.rad-link--danger, .rad-plan-person, .rad-plan-foot) {
	color: var(--wp--preset--color--braise-fonce);
}

.rad-app :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
	font-family: inherit;
	border-radius: 0.5rem;
}

.rad-app :where(input, select, textarea):focus-visible {
	outline: 3px solid var(--wp--preset--color--braise);
	outline-offset: 1px;
}

/* Sous-thématiques du questionnaire : le plugin pose la couleur de famille en
   style en ligne (border-color). WordPress ajoute alors « border-style: solid »
   sur les quatre côtés de tout élément portant ce style, d'où un cadre complet.
   On ne garde que le filet du bas prévu par le plugin. */
.rad-app .rad-sous-title,
.rad-app [style*="border-color"] {
	border-top-style: none;
	border-right-style: none;
	border-left-style: none;
	border-bottom: 2px solid;
	padding-left: 0;
	padding-right: 0;
}
