/* Mon espace : cartes compactes, progression native toujours visible. */
.ld-profile #ld-main-course-list,
.entry-content .kognos-espace-grille,
.kognos-catalogue-grille {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: .75rem;
	align-items: start;
}

.learndash-wrapper :is(#ld-profile, .kognos-cours-profil) .kognos-profil-carte,
.entry-content .kognos-espace-carte,
.kognos-catalogue-carte {
	min-width: 0;
	margin: 0;
	border: 1px solid #dde5ec;
	border-radius: 6px;
	background: #fff;
}

.learndash-wrapper :is(#ld-profile, .kognos-cours-profil) .kognos-profil-carte .ld-item-list-item-preview {
	display: block;
	padding: 1rem 1rem 0;
}

.learndash-wrapper :is(#ld-profile, .kognos-cours-profil) .kognos-profil-carte .ld-item-name,
.kognos-espace-carte .kognos-espace-lien {
	display: flex;
	gap: .9rem;
	align-items: flex-start;
	color: var(--global-palette3, #07294e);
	text-decoration: none;
}

.learndash-wrapper :is(#ld-profile, .kognos-cours-profil) .kognos-profil-carte .ld-item-name:hover,
.kognos-espace-carte .kognos-espace-lien:hover {
	color: var(--global-palette2, #136586);
}

.kognos-profil-vignette {
	flex: 0 0 52px;
	width: 52px;
	height: 52px;
	border: 1px solid #dde5ec;
	border-radius: 6px;
	object-fit: cover;
}

.kognos-profil-texte {
	display: flex;
	flex-direction: column;
	gap: .3rem;
	min-width: 0;
	overflow-wrap: anywhere;
}

.learndash-wrapper :is(#ld-profile, .kognos-cours-profil) .kognos-profil-carte .ld-course-title,
.kognos-espace-titre {
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.4;
}

.kognos-profil-description {
	color: #5a6675;
	font-size: .875rem;
	font-weight: 400;
	line-height: 1.45;
}

.learndash-wrapper :is(#ld-profile, .kognos-cours-profil) .kognos-profil-carte .ld-item-details {
	justify-content: flex-start;
	flex-wrap: wrap;
	gap: .5rem;
	margin: .85rem 0 0;
}

.learndash-wrapper :is(#ld-profile, .kognos-cours-profil) .kognos-profil-carte button.kognos-favori {
	margin: 0;
	min-height: 28px;
	padding: .22rem .65rem;
	font-size: .75rem;
	font-weight: 700;
}

.learndash-wrapper :is(#ld-profile, .kognos-cours-profil) .kognos-profil-carte .ld-item-details .ld-status,
.kognos-profil-statut {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	margin: 0;
	padding: .22rem .65rem;
	border: 1px solid transparent;
	border-radius: 999px;
	font-size: .75rem;
	font-weight: 700;
	line-height: 1.5;
	text-transform: none;
}

.kognos-profil-statut {
	border-color: #f2d77a;
	background: #fff3c4;
	color: #805300;
}

.learndash-wrapper :is(#ld-profile, .kognos-cours-profil) .kognos-profil-carte .ld-item-details .ld-status-progress {
	border-color: #aecbf0;
	background: #dcedff !important;
	color: #154f86 !important;
}

.learndash-wrapper :is(#ld-profile, .kognos-cours-profil) .kognos-profil-carte .ld-item-details .ld-status-complete {
	border-color: #a5d8bd;
	background: #dcf5e7 !important;
	color: #16633f !important;
}

.learndash-wrapper :is(#ld-profile, .kognos-cours-profil) .kognos-profil-carte .ld-item-details .ld-status::before,
.kognos-profil-statut::before {
	content: "";
	flex: 0 0 6px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}

.learndash-wrapper :is(#ld-profile, .kognos-cours-profil) .kognos-profil-carte .ld-item-details .ld-expand-button {
	margin: 0 0 0 auto;
}

.learndash-wrapper :is(#ld-profile, .kognos-cours-profil) .kognos-profil-carte .ld-certificate-link {
	margin: 0;
}

.kognos-profil-progression {
	padding: .65rem 1rem 1rem;
}

.learndash-wrapper .kognos-profil-progression .ld-progress {
	margin: 0;
}

.learndash-wrapper .kognos-profil-progression .ld-progress-heading {
	flex-wrap: wrap;
	gap: .3rem .75rem;
	line-height: 1.45;
}

.learndash-wrapper .kognos-profil-progression .ld-progress-heading .ld-progress-label,
.learndash-wrapper .kognos-profil-progression .ld-progress-heading .ld-progress-percentage {
	font-weight: 600;
	text-transform: none;
}

.learndash-wrapper .kognos-profil-progression .ld-progress-bar {
	height: 5px;
	margin: .4rem 0 0;
	background: #e7edf2;
}

.learndash-wrapper .kognos-profil-progression .ld-progress-bar-percentage {
	height: 5px;
}

.learndash-wrapper :is(#ld-profile, .kognos-cours-profil) .kognos-profil-carte .ld-item-list-item-expanded::before {
	display: none;
}

.learndash-wrapper :is(#ld-profile, .kognos-cours-profil) .kognos-profil-carte .ld-item-contents {
	padding: 1rem;
	border-top: 1px solid #dde5ec;
	overflow-x: auto;
}

.kognos-profil-carte:has(.ld-expand-button[aria-expanded="true"]) {
	grid-column: 1 / -1;
}

.ld-profile:not(:has(.kognos-profil-carte .ld-expand-button)) .ld-item-list-actions > .ld-expand-button {
	display: none;
}

.kognos-profil-carte a:focus-visible,
.kognos-profil-carte button:focus-visible,
.kognos-espace-carte a:focus-visible {
	outline: 2px solid var(--global-palette2, #136586);
	outline-offset: 3px;
}

/* Favoris et dernières capsules : même grille, avec leur contexte et actions. */
.entry-content .kognos-espace-grille,
.kognos-catalogue-grille {
	margin: 0;
	padding: 0;
	list-style: none;
}

.entry-content .kognos-espace-carte {
	padding: 1rem;
}

.kognos-espace-pied {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: .5rem;
	margin-top: .85rem;
}

.kognos-espace-meta {
	min-width: 0;
	overflow-wrap: anywhere;
}

.kognos-espace-type {
	display: inline-block;
	padding: .22rem .65rem;
	border: 1px solid #cddfe9;
	border-radius: 999px;
	background: #edf5fa;
	color: #244f6a;
	font-size: .75rem;
	font-weight: 700;
	line-height: 1.5;
}

.kognos-espace-carte .kognos-espace-details {
	margin: .4rem 0 0;
	color: #5a6675;
	font-size: .8125rem;
	line-height: 1.45;
}

.kognos-espace-carte .kognos-favori-retirer {
	flex: 0 0 auto;
}

/* Même rythme pour les archives WordPress, les blocs et les pages LearnDash. */
body .pagination,
body .wp-block-query-pagination,
.learndash-wrapper .ld-pagination,
body .learndash-pager {
	justify-content: center;
	margin: 1.5rem 0;
	color: #5a6675;
	font-size: .875rem;
	font-weight: 500;
	text-transform: none;
}

body .pagination .nav-links,
body .wp-block-query-pagination,
body .wp-block-query-pagination-numbers,
.learndash-wrapper .ld-pagination .ld-pages,
body .learndash-pager,
body .learndash-pager .pager-left,
body .learndash-pager .pager-right {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: .35rem;
}

.learndash-wrapper .ld-pagination .ld-pages,
body .learndash-pager {
	flex: 0 1 auto;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	overflow: visible;
	line-height: 1.4;
}

body .pagination .page-numbers,
body .wp-block-query-pagination a,
body .wp-block-query-pagination .page-numbers,
.learndash-wrapper .ld-pagination .ld-pages a,
body .learndash-pager a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	min-height: 40px;
	margin: 0;
	padding: .35rem .65rem;
	border: 1px solid transparent;
	border-radius: 6px;
	background: transparent;
	box-shadow: none;
	color: #5a6675;
	font-size: .875rem;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
}

body .pagination .page-numbers.current,
body .wp-block-query-pagination .page-numbers.current,
body .pagination a:hover,
body .wp-block-query-pagination a:hover,
.learndash-wrapper .ld-pagination .ld-pages a:not(.disabled):hover,
body .learndash-pager a:not(.disabled):hover {
	background: var(--global-palette8, #e7eff6);
	color: var(--global-palette3, #07294e);
}

body .pagination .page-numbers.current,
body .wp-block-query-pagination .page-numbers.current {
	border-color: #dde5ec;
	font-weight: 700;
}

body .pagination .page-numbers.dots,
body .wp-block-query-pagination .page-numbers.dots {
	min-width: 1.5rem;
	padding-inline: .2rem;
}

.learndash-wrapper .ld-pagination .ld-pages > span,
body .learndash-pager .pager-legend {
	padding: 0 .5rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.learndash-wrapper .ld-pagination .ld-pages a.disabled,
body .learndash-pager a.disabled {
	opacity: .4;
	pointer-events: none;
}

body .pagination a:focus-visible,
body .wp-block-query-pagination a:focus-visible,
.learndash-wrapper .ld-pagination .ld-pages a:focus-visible,
body .learndash-pager a:focus-visible {
	outline: 2px solid var(--global-palette2, #136586);
	outline-offset: 2px;
}

@media (max-width: 700px) {
	.ld-profile #ld-main-course-list,
	.entry-content .kognos-espace-grille,
	.kognos-catalogue-grille {
		grid-template-columns: minmax(0, 1fr);
	}

	.kognos-profil-vignette {
		flex-basis: 44px;
		width: 44px;
		height: 44px;
	}
}

/* Les noms proviennent des ordres professionnels des formations. */
.kognos-profil-ordres > h2 { margin: 0 0 1.5rem; }
.learndash-wrapper .kognos-profil-ordres .kognos-profil-ordre { margin: 0 0 2rem; }
.kognos-profil-ordre > h3 { margin: 0 0 1rem; padding-bottom: .75rem; border-bottom: 1px solid #dce5eb; font-size: 1.375rem; }
