/*
 * Course badges (TAU_Course_Badges). The badge is the course's featured image; these rules show it
 * as a badge instead of the theme's cropped banner. To resize, change the variables below in
 * Appearance → Customize → Additional CSS.
 */

body {
	--tau-badge-card: 128px;     /* Courses page cards */
	--tau-badge-course: 128px;   /* course page, top right */
	--tau-badge-cert: 72px;      /* next to each certificate */
	--tau-badge-phone: 72px;     /* course page on a phone */
}

/* Courses page: the theme's card image (a 2:3 banner by default) as a centered, uncropped badge. */
.post-type-archive-sfwd-courses .loop-entry .post-thumbnail {
	padding-bottom: 0 !important;
	width: var(--tau-badge-card);
	height: var(--tau-badge-card);
	margin: 28px auto 0;
	background: none;
	overflow: visible;
}
.post-type-archive-sfwd-courses .loop-entry .post-thumbnail-inner {
	position: static;
}
.post-type-archive-sfwd-courses .loop-entry .post-thumbnail img {
	width: var(--tau-badge-card);
	height: var(--tau-badge-card);
	object-fit: contain;
	transform: none !important;
}

/* Course page: the badge in the top-right corner of the course box, level with the title. The title
   keeps clear of it, and the header is at least as tall, so the video starts below the badge. */
.single-sfwd-courses .entry-content-wrap {
	position: relative;
}
.single-sfwd-courses .entry-header.sfwd-courses-title {
	padding-right: calc(var(--tau-badge-course) + 24px);
	min-height: var(--tau-badge-course);
}
/* With the Enter course / Resume course buttons under the title, they keep the video below the
   badge, so the header doesn't need the extra height. */
.single-sfwd-courses .entry-content-wrap:has(.tau-course-buttons) .entry-header.sfwd-courses-title {
	min-height: 0;
}
.tau-course-badge {
	position: absolute;
	top: 32px;
	right: 32px;
	width: var(--tau-badge-course);
	height: var(--tau-badge-course);
	object-fit: contain;
	margin: 0;
}

/* "My certificates": the course's badge next to each certificate. */
.tau-certs-item {
	display: grid;
	grid-template-columns: var(--tau-badge-cert) 1fr;
	column-gap: 20px;
	align-items: start;
}
.tau-certs-item > :not(.tau-certs-badge) {
	grid-column: 2;
}
.tau-certs-badge {
	grid-column: 1;
	grid-row: 1 / span 3;
	width: var(--tau-badge-cert);
	height: var(--tau-badge-cert);
	object-fit: contain;
}

@media screen and (max-width: 600px) {
	.single-sfwd-courses .entry-header.sfwd-courses-title {
		padding-right: calc(var(--tau-badge-phone) + 16px);
		min-height: var(--tau-badge-phone);
	}
	.single-sfwd-courses .entry-content-wrap:has(.tau-course-buttons) .entry-header.sfwd-courses-title {
		min-height: 0;
	}
	.tau-course-badge {
		top: 24px;
		right: 24px;
		width: var(--tau-badge-phone);
		height: var(--tau-badge-phone);
	}
	.tau-certs-item {
		grid-template-columns: 56px 1fr;
		column-gap: 14px;
	}
	.tau-certs-badge {
		width: 56px;
		height: 56px;
	}
}
