/* Video grid for consistent video area sizing and layout */
.video-grid {
	display: grid;
	width: 100%;
	max-width: 100%;
	aspect-ratio: 16/11;
	background: #f8fafd;
	border-radius: 8px;
	overflow: hidden;
	gap: 0;
}
/* Ensure 2x2 grid never exceeds card width and is fully responsive */
.video-grid--3, .video-grid--4 {
	max-width: 100%;
}
.video-grid .video-cell {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: center;
	padding: 0.5em;
	min-width: 0;
	min-height: 0;
}
/* 1 video: video row + caption row */
.video-grid--1 {
	grid-template-columns: 1fr;
	grid-template-rows: 5fr 1fr;
}
/* 2 videos: 2 columns, video row + caption row */
.video-grid--2 {
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 5fr 1fr;
	gap: 5px;
	align-items: center;
}
/* 3 or 4 videos: 2x2 grid, each with caption below */
.video-grid--3, .video-grid--4 {
			 grid-template-columns: 1fr 1fr;
			 grid-template-rows: 5fr 1fr 5fr 1fr;
			 gap: 5px;
}

/* Explicit grid placement for 2x2 video grid (4 videos) */
.video-grid--4 .video-cell:nth-child(1) {
	grid-column: 1 / 2;
	grid-row: 1 / 2;
}
.video-grid--4 .video-cell:nth-child(2) {
	grid-column: 2 / 3;
	grid-row: 1 / 2;
}
.video-grid--4 .video-cell:nth-child(3) {
	grid-column: 1 / 2;
	grid-row: 3 / 4;
}
.video-grid--4 .video-cell:nth-child(4) {
	grid-column: 2 / 3;
	grid-row: 3 / 4;
}
.video-grid .video-cell video,
.video-grid .video-cell img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0px;
	background: #f8fafd;
	min-width: 0;
	min-height: 0;
}
.video-caption {
			 color: #fff;
			 font-size: 0.95em;
			 background: rgba(0,0,0,0.45);
			 border-radius: 0 0 0px 0px;
			 width: 100%;
			 text-align: center;
			 margin-top: 0;
			 padding: 0.2em 0.5em 0.4em 0.5em;
			 box-sizing: border-box;
			 min-height: 1.8em;
			 max-height: 2.2em;
			 display: flex;
			 align-items: center;
			 justify-content: center;
			 overflow: hidden;
			 text-overflow: ellipsis;
			 white-space: nowrap;
}

/* Smaller captions for subdivided video grids (3 or 4 videos) */
.video-grid--2 .video-caption,
.video-grid--3 .video-caption,
.video-grid--4 .video-caption {
	font-size: 0.5em;
	min-height: 1.8em;
	max-height: 2.2em;
}

@media (max-width: 768px) {
	.video-grid {
		aspect-ratio: 16/11;
	}
}

/* Chapter summary card styling */
.chapter-summary-section {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 2px 12px rgba(0,0,0,0.07);
	padding: 1.5rem 1.25rem 1.25rem 1.25rem;
	margin-bottom: 0.4rem;
	display: flex;
	flex-direction: column;
	height: 100%;
	transition: box-shadow 0.2s;
	min-height: 52rem;
}
.chapter-summary-section:hover {
	box-shadow: 0 4px 24px rgba(0,0,0,0.13);
}
.chapter-summary-title {
	font-size: 1.2rem;
	font-weight: 700;
	margin-bottom: 0.5rem;
	color: #2a2a2a;
}
.chapter-summary-desc {
	font-size: 1rem;
	color: #444;
	margin-bottom: 1rem;
}

/* Modern download button */
.chapter-download-btn {
	display: inline-block;
	background: linear-gradient(90deg, #3273dc 0%, #23d160 100%);
	color: #fff !important;
	font-weight: 600;
	padding: 0.6em 1.4em;
	border-radius: 6px;
	text-decoration: none;
	box-shadow: 0 2px 8px rgba(50,115,220,0.08);
	transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
	margin-bottom: 0.5rem;
}
.chapter-download-btn:hover {
	background: linear-gradient(90deg, #23d160 0%, #3273dc 100%);
	color: #fff;
	box-shadow: 0 4px 16px rgba(50,115,220,0.18);
	transform: translateY(-2px) scale(1.03);
}

/* Video embed styling */
.video-embed video,
.video-embed iframe {
	width: 100%;
	max-width: 100%;
	border-radius: 0px;
	background: #000;
}
.video-embed {
	margin-bottom: 1rem;
}

@media (max-width: 768px) {
	.chapter-summary-section {
		padding: 1rem 0.5rem 1rem 0.5rem;
		min-height: 420px; /* Shorter min-height for mobile */
	}
	.chapter-summary-title {
		font-size: 1.05rem;
	}
	.chapter-summary-desc {
		font-size: 0.97rem;
	}
}
