/* Student FeedVideo - Brand color system and layout (aligned with theme COLOR_SYSTEM.md) */

/* Uses theme CSS variables with safe fallbacks defined in lms-theme/COLOR_SYSTEM.md */

.sfv-section {
	background: var(--brand-surface, #FFFFFF);
	color: var(--brand-ink, #1F2A24);
	padding: 48px 16px;
	max-width: 1200px;
	margin: 0 auto;
}
.sfv-feature-wrap {
	max-width: 1200px;
	margin: 0 auto 40px auto;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

@media (min-width: 1280px) {
	.sfv-feature-wrap { 
		flex-direction: row; 
		align-items: stretch; /* Đảm bảo các cột có chiều cao bằng nhau */
	}
	.sfv-feature-left { 
		width: 650px; 
		display: flex;
		flex-direction: column;
	}
	.sfv-feature-right { 
		flex: 1; 
		display: flex;
		flex-direction: column;
		justify-content: center; /* Căn giữa nội dung theo chiều dọc */
	}
}

/* Feature media inherits 16:9 rules from .sfv-media */
.sfv-feature-media { min-height: 0; }

.sfv-feature-title { font-size: 18px; font-weight: 700; margin: 12px 0 0 0; color: var(--brand-green-dark, #1B5E20); }
.sfv-feature-excerpt { color: var(--brand-ink, #1F2A24); margin-top: 10px; max-height: 220px; overflow: auto; }

.sfv-carousel { max-width: 1200px; margin: 0 auto; }
.sfv-carousel { position: relative; }
.sfv-carousel-scroll { overflow: auto; padding: 0 34px; /* space for buttons */ scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; touch-action: pan-x; }
.sfv-carousel-scroll::-webkit-scrollbar { display: none; }
.sfv-carousel-track { display: flex; gap: 10px; padding: 0 10px; }
.sfv-thumb { flex: 0 0 calc((100% - 20px) / 3); cursor: pointer; scroll-snap-align: start; }
@media (max-width: 1024px) { .sfv-thumb { flex: 0 0 calc((100% - 10px) / 2); } }
@media (max-width: 640px) { .sfv-thumb { flex: 0 0 100%; } }
.sfv-thumb-media { 
    position: relative; 
    overflow: hidden; 
    border-radius: 8px;
    aspect-ratio: 16/9;
    width: 100%;
    max-width: 350px;
}
.sfv-thumb-media::before { content: ""; display: block; padding-top: 56.25%; }
.sfv-thumb-media img { 
    position: absolute; 
    inset: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block;
}
.sfv-thumb-placeholder { width: 100%; height: 100%; background: #334155; }
.sfv-thumb-title { margin: 8px 0 0 0; font-size: 14px; color: var(--brand-ink, #1F2A24); }

/* Carousel buttons */
/* Unified nav button style (matching testimonial-nav) */
.testimonial-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--brand-line, #E9E3D9); background: var(--brand-surface, #fff); color: var(--brand-green-dark, #1B5E20); display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.08); }
.testimonial-nav.prev { left: 0; }
.testimonial-nav.next { right: 0; }
.testimonial-nav[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Copy equivalent look & feel from testimonials-section (icons, hover, focus) */
.sfv-carousel .testimonial-nav { z-index: 2; transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease; }
.sfv-carousel .testimonial-nav i { font-size: 14px; line-height: 1; }
.sfv-carousel .testimonial-nav:hover { background: var(--brand-green, #2E7D32); border-color: var(--brand-green, #2E7D32); color: var(--brand-surface, #fff); box-shadow: 0 6px 16px rgba(0,0,0,0.14); }
.sfv-carousel .testimonial-nav:focus { outline: 2px solid var(--brand-cta, #D84315); outline-offset: 2px; }

/* Adjust position to sit slightly outside the scroll area */
.sfv-carousel .testimonial-nav.prev { left: 4px; }
.sfv-carousel .testimonial-nav.next { right: 4px; }

@media (max-width: 640px) {
	.sfv-carousel .testimonial-nav { width: 32px; height: 32px; }
	.sfv-carousel .testimonial-nav i { font-size: 12px; }
}


.sfv-header {
	max-width: 1200px;
	margin: 0 auto 24px auto;
	text-align: center;
}

.sfv-title {
	margin: 0 0 8px 0;
	font-size: 28px;
	line-height: 1.2;
    color: var(--brand-green-dark, #1B5E20);
}

.sfv-subtitle {
	margin: 0;
	color: var(--brand-muted, #66756C);
}

.sfv-grid {
	max-width: 1200px;
	margin: 0 auto;
	display: grid;
	grid-gap: 16px;
}

.sfv-grid.cols-1 { grid-template-columns: 1fr; }
.sfv-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.sfv-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.sfv-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
	.sfv-grid.cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
	.sfv-grid.cols-3, .sfv-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
	.sfv-grid { grid-template-columns: 1fr !important; }
}

.sfv-card {
	background: var(--brand-bg, #FAF6F0);
	border: 1px solid var(--brand-line, #E9E3D9);
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* 16:9 responsive media container */
.sfv-media {
	position: relative;
	background: #000;
}
.sfv-media::before {
	content: "";
	display: block;
	padding-top: 56.25%;
}
.sfv-media iframe,
.sfv-media video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: block;
	border: none;
	border-radius: 8px;
}

/* Custom player compatibility */
.sfv-media .player-wrapper {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #000;
	margin: 0; /* Loại bỏ margin để không có khoảng trống */
	border-radius: 0; /* Sử dụng border-radius của container cha */
}

.sfv-media .player-wrapper iframe {
	position: relative;
	width: 100%;
	height: 100%;
}

.sfv-body {
	padding: 14px;
}

.sfv-student {
	margin: 0 0 4px 0;
	font-size: 16px;
}

.sfv-role {
	color: var(--brand-green, #2E7D32);
	font-weight: 600;
	margin-bottom: 6px;
}

.sfv-excerpt {
	margin: 0;
	color: var(--brand-muted, #66756C);
	font-size: 14px;
	line-height: 1.5;
}

.sfv-empty {
	text-align: center;
	padding: 24px;
	color: var(--brand-muted, #66756C);
}

/* Hover overlay accent */
.sfv-thumb:hover .sfv-thumb-media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.25);
}

/* Dragging state */
.sfv-carousel.is-dragging { cursor: grabbing; }
.sfv-carousel.is-dragging .sfv-thumb { pointer-events: none; }




/* ---- Facade: ảnh bìa + nút phát, iframe chỉ nạp khi bấm ---- */
.sfv-facade { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; border-radius: 8px; overflow: hidden; }
.sfv-facade img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.sfv-facade:hover img { transform: scale(1.03); }
.sfv-facade:focus-visible { outline: 3px solid var(--brand-cta, #D84315); outline-offset: 2px; }
.sfv-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%; background: var(--brand-cta, #D84315); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); transition: transform .15s, background .15s; pointer-events: none; }
.sfv-play::after { content: ""; position: absolute; left: 27px; top: 21px; border-style: solid; border-width: 13px 0 13px 22px; border-color: transparent transparent transparent #fff; }
.sfv-facade:hover .sfv-play { transform: scale(1.08); background: var(--brand-cta-dark, #BF360C); }
.sfv-play-sm { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
.sfv-play-sm::after { left: 18px; top: 13px; border-width: 9px 0 9px 15px; }
.sfv-thumb:hover .sfv-thumb-media::after { display: none; }
.sfv-thumb:hover .sfv-play { background: var(--brand-cta-dark, #BF360C); transform: scale(1.08); }
.sfv-thumb:focus-visible { outline: 3px solid var(--brand-cta, #D84315); outline-offset: 3px; border-radius: 8px; }
.sfv-feature-excerpt[hidden] { display: none; }
.sfv-media .sfv-embed { position: absolute; inset: 0; }
.sfv-media .sfv-embed iframe { width: 100%; height: 100%; }
