/*
 * My Courses (page 113, Figma "Student_Courses.png").
 * Measurements are from the Figma export at 1440px; content sits in a 1200px container
 * (x 120..1320). Three 366.67px columns with Figma's 50px gap; image height, type,
 * spacing and the 238x43 outline pill are Figma's.
 */

/* ------------------------------------------------- My Courses (page 113) */
.fdi-courses-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: 50px;
	row-gap: 60px;
}

.fdi-course-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
}

/* Figma: 257px tall image, square corners. 1100/771 = 366.67/257, so the image is
   exactly 257px tall in the full 1200 container and scales below it.
   Figma's image fills are zoomed past "cover" (measured scale 0.220-0.229 of the
   1920px source vs 0.201 for cover), centred: hence the 1.12 zoom. */
.fdi-course-card__image {
	display: block;
	width: 100%;
	aspect-ratio: 1100 / 771;
	overflow: hidden;
}

.fdi-course-card__image img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transform: scale(1.12);
	/* Per-image vertical focal point (my-courses.php prints --fdi-focus-y, Figma's crop). */
	transform-origin: 50% var(--fdi-focus-y, 50%);
	transition: transform 0.3s ease;
}

.fdi-course-card__image:hover img {
	transform: scale(1.16);
}

/* Figma: PT Serif 700 31/34 navy, 30px below the image (ink centres match Figma). */
.fdi-course-card__title {
	margin: 30px 0 15px;
	font: 700 31px/34px var(--fdi-font-heading);
	letter-spacing: 0;
	text-transform: none;
	overflow-wrap: anywhere;
}

.fdi-course-card__title a {
	color: var(--fdi-navy);
	text-decoration: none;
}

.fdi-course-card__title a:hover {
	color: var(--fdi-teal);
}

/* Figma: Open Sans 600 17/24 black, 4 lines. */
.fdi-course-card__excerpt {
	margin: 0 0 27px;
	font: 600 17px/24px var(--fdi-font-body);
	letter-spacing: 0;
	color: var(--fdi-text);
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Figma: 238x43 pill, 2px teal outline, "Start Learning" PT Serif 700 20px,
   12px arrow 21px from the right edge. Hover (card 1 in Figma): teal fill. */
.fdi-course-card__btn {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 22px;
	min-width: 238px;
	height: 43px;
	margin-top: auto;
	padding: 0 19px 1px 24px;
	border: 2px solid var(--fdi-teal);
	border-radius: var(--fdi-radius-pill);
	background: transparent;
	color: var(--fdi-teal);
	font: 700 20px/1 var(--fdi-font-heading);
	letter-spacing: 0;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.fdi-course-card__btn svg,
.fdi-courses-empty .fdi-btn-outline-sm svg {
	display: block;
	flex: none;
	width: 12px;
	height: 12px;
}

.fdi-course-card__btn:hover,
.fdi-course-card__btn:focus-visible {
	background: var(--fdi-teal);
	color: var(--fdi-white);
}

.fdi-courses-empty {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 20px;
	padding: 30px;
	background: var(--fdi-surface);
	border-radius: var(--fdi-radius-box);
	font: 600 17px/24px var(--fdi-font-body);
}

.fdi-courses-empty p {
	margin: 0;
}

/* Same pill as the card buttons: text, then the 12px arrow 21px from the right edge. */
.fdi-courses-empty .fdi-btn-outline-sm {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	gap: 22px;
	height: 43px;
	padding: 0 19px 1px 24px;
	border: 2px solid var(--fdi-teal);
	border-radius: var(--fdi-radius-pill);
	color: var(--fdi-teal);
	font: 700 20px/1 var(--fdi-font-heading);
	text-decoration: none;
}

.fdi-courses-empty .fdi-btn-outline-sm:hover,
.fdi-courses-empty .fdi-btn-outline-sm:focus-visible {
	background: var(--fdi-teal);
	color: var(--fdi-white);
}

/* ------------------------------------------- Banner on this page (page 113) */
/* Student_Courses.png draws the greeting larger than the dashboard screens do:
   Open Sans 300/700 at 53px ("H" cap 38px, rows 219-256, baseline 256), ink 36px
   right of the avatar. lms-banner.css (dash) keeps the dashboard's 42px; this
   override is scoped to page 113's banner wrapper. */
@media (min-width: 769px) {
	.fdi-mycourses-banner .fdi-lms-banner__inner {
		gap: 30px;
	}

	.fdi-mycourses-banner .fdi-lms-banner__hello {
		top: 1px;
		font-family: var(--fdi-font-body);
		font-size: 53px;
	}

	/* Taller greeting: keep the account pill's bottom on the avatar's (y194). */
	.fdi-mycourses-banner .fdi-lms-banner__who {
		top: calc(100% + 7px);
	}
}

/* chrome.css gives boxed sections a 32px gutter at 1025-1360px; keep the avatar on
   the same edge as the heading and cards (1200 content + 2 x 32). */
@media (min-width: 1025px) and (max-width: 1360px) {
	.fdi-mycourses-banner .fdi-lms-banner__inner {
		max-width: 1264px;
		padding-inline: 32px;
	}
}

/* Tablet: the section keeps a 24px gutter down to 768px (Elementor's mobile step is
   767px), while lms-banner.css switches to 16px at 768px; match the section. */
@media (min-width: 768px) and (max-width: 1024px) {
	.fdi-mycourses-banner .fdi-lms-banner__inner {
		padding-inline: 24px;
	}
}

/* Small laptops (container under 1200 once the 32px gutters bite): narrower gaps. */
@media (max-width: 1263px) {
	.fdi-courses-grid {
		column-gap: 32px;
	}
}

@media (max-width: 1024px) {
	.fdi-courses-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 28px;
		row-gap: 48px;
	}

	.fdi-course-card__image {
		aspect-ratio: 391 / 257;
	}
}

@media (max-width: 767px) {
	.fdi-courses-grid {
		grid-template-columns: 1fr;
		row-gap: 40px;
	}

	.fdi-course-card__title {
		margin-top: 20px;
		font-size: 24px;
		line-height: 28px;
	}

	.fdi-course-card__excerpt {
		margin-bottom: 22px;
		font-size: 16px;
		line-height: 23px;
	}
}
