/* LearnDash layer 3/6: [ld_profile] = navy hero with stat tiles + compact course rows. See base.css for the cascade strategy. */
.learndash-wrapper .ld-profile-summary { background: transparent; }
.learndash-wrapper .ld-profile-summary .ld-profile-card { background: var(--wp--preset--color--hero); color: var(--wp--preset--color--on-hero); border-radius: var(--sddsg-ld-radius); }
.learndash-wrapper .ld-profile-summary .ld-profile-card :where(h1, h2, h3, a, p, span) { color: var(--wp--preset--color--on-hero); }
.learndash-wrapper .ld-profile-summary .sddsg-avp__anchor { margin-block-end: 1.75rem; } /* avatar picker: "Ändern" badge must not overlap the avatar */
.learndash-wrapper .ld-profile-summary .sddsg-avp__open { inset-block-start: calc(100% + 0.5rem); inset-block-end: auto; }

.learndash-wrapper #ld-profile {
	.ld-profile-summary {
		display: grid; gap: 1.25rem; align-items: center; grid-template-columns: 1fr;
		padding: clamp(1.25rem, 4vw, 2.25rem); margin-block-end: 1.75rem;
		background: linear-gradient(135deg, var(--wp--preset--color--hero), color-mix(in srgb, var(--wp--preset--color--hero) 78%, #000));
		color: var(--wp--preset--color--on-hero); border: 0; border-radius: var(--wp--custom--radius--lg);
		box-shadow: var(--wp--preset--shadow--md);
		@media (min-width: 48em) { grid-template-columns: 1fr minmax(18rem, 26rem); }
		.ld-profile-card { display: flex; align-items: center; gap: 1rem; background: none; padding: 0; border: 0; box-shadow: none; }
		.ld-profile-card .ld-profile-avatar { inline-size: 4rem; block-size: 4rem; min-inline-size: 0; margin: 0; flex: none; border: 2px solid rgb(255 255 255 / .55); border-radius: 50%; background: rgb(255 255 255 / .12); overflow: hidden; }
		.ld-profile-card .ld-profile-avatar img { inline-size: 100%; block-size: 100%; border: 0; border-radius: 50%; background: rgb(255 255 255 / .12); object-fit: cover; }
	}
	.ld-profile-heading { font-size: var(--wp--preset--font-size--large); font-weight: 700; color: var(--wp--preset--color--on-hero); }
	h2.ld-profile-heading, .ld-item-list-heading { margin-block-end: 0.75rem; }
	.ld-profile-stats {
		display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; margin: 0; padding: 0.25rem 0;
		border: 1px solid rgb(255 255 255 / .22); border-radius: var(--wp--custom--radius--md); background: rgb(255 255 255 / .07); overflow: hidden;
	}
	.ld-profile-stat { display: grid; justify-items: center; gap: 0.15rem; padding: 0.9rem 0.5rem; margin: 0; border: 0; border-inline-start: 1px solid rgb(255 255 255 / .22); background: none; }
	.ld-profile-stats .ld-profile-stat { inline-size: auto; justify-self: stretch; align-content: center; margin: 0; max-inline-size: none; padding-block: 0.875rem !important; padding-inline: 0.5rem; }
	.ld-profile-stat:first-child { border-inline-start: 0; }
	.ld-profile-stat strong { font-size: var(--wp--preset--font-size--x-large); line-height: 1.1; color: var(--wp--preset--color--on-hero); }
	.ld-profile-stat span { font-size: var(--wp--preset--font-size--x-small); color: var(--wp--preset--color--hero-muted); overflow-wrap: normal; word-break: normal; hyphens: none; text-align: center; }

	/* course rows: compact, one-line ellipsis titles */
	.ld-item-list-item { overflow: visible; }
	.ld-item-list-item .ld-item-name { min-inline-size: 0; }
	.ld-item-list-item .ld-item-title { min-inline-size: 0; flex: 1 1 0; }
	.ld-item-list-item .ld-course-title { display: block; min-inline-size: 0; max-inline-size: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; line-height: 1.4; font-weight: 600; }
	/* Row CTA ("Zertifikat"): the portal's secondary button */
	.sddsg-ld-cta--outline { border: var(--sddsg-btn-border) solid var(--sddsg-btn2-border) !important; color: var(--wp--preset--color--heading) !important; background: transparent !important; overflow: visible; }
}
/* LD turns hovered buttons navy with dark text and fades them (opacity): shared hover looks instead */
.learndash-wrapper:not(#_) #ld-profile .ld-item-list-item {
	.sddsg-ld-cta--primary:is(:hover, :focus-visible) { background-color: var(--wp--preset--color--accent) !important; color: var(--wp--preset--color--on-accent) !important; opacity: 1; filter: var(--sddsg-btn-hover); box-shadow: var(--sddsg-btn-shadow-hover); }
	.sddsg-ld-cta--outline:is(:hover, :focus-visible) { background-color: var(--sddsg-btn2-bg-hover) !important; color: var(--wp--preset--color--heading) !important; border-color: var(--sddsg-btn2-border-hover) !important; opacity: 1; }
	.sddsg-ld-cta--outline:active { background-color: var(--sddsg-btn2-bg-press) !important; opacity: 1; }
	.sddsg-ld-cta--primary:active { opacity: 1; filter: var(--sddsg-btn-press); }
}

/* LD: ".ld-profile-stats .ld-profile-stat { margin: 0 0 2em !important }" -> empty strip under the stats (user 2026-11-07). */
.learndash-wrapper #ld-profile .ld-profile-stats .ld-profile-stat { margin: 0 !important; }
/* "Ihre Kurse" heading needs air before the list. */
.learndash-wrapper #ld-profile .ld-section-heading { margin-block-end: 0.75rem; }
/* It is a section heading of the page like "Konto" (H2): same size. (LearnDash prints it as H3; the level is the plugin's template.) */
.learndash-wrapper #ld-profile .ld-item-list.ld-course-list .ld-section-heading h3 { font-size: var(--wp--preset--font-size--x-large); line-height: 1.2; letter-spacing: -0.015em; }

/* Course row CTA ("Zertifikat →", "Starten", …): never break the label into syllables ("Zerti-fikat"), keep its width. */
.learndash-wrapper #ld-profile :is(.sddsg-ld-cta, .sddsg-ld-cta--primary, .sddsg-ld-cta--outline) { white-space: nowrap; hyphens: none; overflow-wrap: normal; word-break: keep-all; flex: none; min-inline-size: max-content; }
/* …and the details area (certificate icon + CTA) keeps its natural width, so the icon never slides into the progress bar. */
.learndash-wrapper #ld-profile .ld-item-list-item .ld-item-details { flex: none; min-inline-size: max-content; gap: .75rem; }
@media (max-width: 47.99em) { /* single column: CTA fills the remaining row width next to the certificate icon, still one line */
	.learndash-wrapper #ld-profile .ld-item-list-item .ld-item-details { min-inline-size: 0; }
	.learndash-wrapper #ld-profile :is(.sddsg-ld-cta, .sddsg-ld-cta--primary, .sddsg-ld-cta--outline) { flex: 1 1 auto; min-inline-size: 0; }
}
@media (min-width: 48em) { /* desktop: CTA at natural width (the 100% rule is for the stacked mobile layout and pushed the certificate icon out) */
	.learndash-wrapper #ld-profile .ld-item-list-item-course .ld-item-details .sddsg-ld-cta { inline-size: auto; }
}
/* Tablet: the profile shows only the "Zertifikat" button in the last column (no Starten/Fortsetzen, see below), so the
   shared 11rem column (course.css) is narrowed to that button and the titles get the room. Still fixed: bars line up. */
@media (min-width: 48em) and (max-width: 63.99em) {
	.learndash-wrapper #ld-profile .ld-item-list-item.ld-item-list-item-course { grid-template-columns: minmax(0, 1fr) minmax(10rem, 14rem) 8.75rem; }
}
@media (max-width: 47.99em) { /* the hidden certificate icon leaves LearnDash's left margin on the button: align it with the bar */
	.learndash-wrapper #ld-profile .ld-item-details .sddsg-ld-cta { margin-inline-start: 0; }
}

/* Certificate icon link (shown when no labelled certificate button follows): link colours with a hover/pressed state. */
.learndash-wrapper:not(.sddsg-b) #ld-profile .ld-item-list-item .ld-item-details .ld-certificate-link:is(:hover, :focus-visible) .ld-icon { color: var(--wp--preset--color--link-hover) !important; }
.learndash-wrapper #ld-profile .ld-item-list-item .ld-item-details .ld-certificate-link:active { opacity: 0.7; }
/* Certificate icon link: 26x43px target -> 44x44 hit area without changing the row layout (fixed last column on desktop). */
.learndash-wrapper #ld-profile .ld-item-list-item .ld-item-details .ld-certificate-link { position: relative; }
.learndash-wrapper #ld-profile .ld-item-list-item .ld-item-details .ld-certificate-link::before { content: ""; position: absolute; inset-block-start: 50%; inset-inline-start: 50%; inline-size: 2.75rem; block-size: 2.75rem; transform: translate(-50%, -50%); }

/*
 * Profile = progress and certificates; "/kurse/" (Meine Kurse) is where courses are started and continued.
 * Rows therefore keep the title link, progress and the certificate, but no second set of Starten/Fortsetzen buttons.
 * To bring the buttons back, remove the next rule.
 */
/* (.ld-item-list-item-course twice: responsive.css sets display on the same buttons later in the cascade) */
.learndash-wrapper #ld-profile .ld-item-list-item.ld-item-list-item-course .ld-item-details :is(.sddsg-ld-cta--primary, .sddsg-ld-cta--outline) { display: none; }
.learndash-wrapper #ld-profile .ld-item-list-item.ld-item-list-item-course .ld-item-details .ld-certificate-link ~ .sddsg-ld-cta--outline { display: inline-flex; }
/* One certificate control per row: the labelled button stays, the icon-only duplicate (same URL) goes. */
.learndash-wrapper #ld-profile .ld-item-list-item .ld-item-details .ld-certificate-link:has(~ .sddsg-ld-cta--outline) { display: none; }
/* Empty list: information, not a warning (LearnDash prints .ld-alert-warning with a "!" icon). */
.learndash-wrapper #ld-profile .ld-item-list .ld-alert-warning { background: var(--wp--preset--color--surface); border-color: var(--wp--preset--color--border); color: var(--wp--preset--color--contrast); }
.learndash-wrapper #ld-profile .ld-item-list .ld-alert-warning .ld-alert-icon { display: none; }
