/*
 * Video list — section of YouTube video cards scoped to a category.
 * Desktop: 4-col grid. Slider mode (> 4 videos) uses Swiper 11.
 * Design source: Figma 407:51142 (desktop), 407:52539 (mobile).
 */

.iw-video-list {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background: #f7f7f8;
  font-family: inherit;
  color: #181d27;
  -webkit-font-smoothing: antialiased;
}

.iw-video-list__inner {
  max-width: var(--iw-container-max);
  margin: 0 auto;
  padding: 56px var(--iw-container-pad-x);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
  min-width: 0;
}

/* ---- Header ---------------------------------------------------------- */

.iw-video-list__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.iw-video-list__title {
  margin: 0;
  font-weight: 700;
  font-size: 32px;
  line-height: 44px;
  color: #181d27;
}

.iw-video-list__more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 510;
  font-size: 16px;
  line-height: 22px;
  color: var(--iw-accent, #4564ed);
  text-decoration: none;
  transition: opacity 0.12s;
}
.iw-video-list__more:hover { opacity: 0.8; }

.iw-video-list__more-arrow { flex: 0 0 12px; }

/* ---- Grid / slider --------------------------------------------------- */

/* Slider wrap: chứa swiper + nav buttons (sibling). Position relative để
   nav absolute định vị theo wrap, không bị overflow:hidden của swiper bên
   trong cắt mất khi nav nằm ngoài viewport slider (left/right -20px). */
.iw-video-list__slider-wrap {
  position: relative;
}

/* Swiper container — Swiper manage column count via JS. width:100% + min-width:0
   để cắt circular layout: swiper-wrapper bên trong set width = sum_slides; nếu
   container shrink-to-fit theo content sẽ phình > 8M px. */
.iw-video-list__grid {
  display: block;
  overflow: hidden;
  width: 100%;
  min-width: 0;
}
.iw-video-list__grid .swiper-slide {
  height: auto;
}

/* Swiper nav buttons (circle 40, subtle bg). Inline SVG trong button dùng
   currentColor — match pattern news-product, hover đổi màu via color prop. */
.iw-video-list__nav {
  position: absolute;
  top: 96px; /* vertically centered on thumbnail (thumb=200 → 100 from top) */
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #e7e7e7;
  border-radius: 50%;
  background: #fff;
  color: var(--iw-accent, #4564ed); /* chevron (svg currentColor) theo scheme */
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
  margin: 0;
  /* Reset Flatsome button defaults gây artifact (icon thừa, shadow). */
  box-shadow: none;
  text-shadow: none;
  min-height: auto;
}
.iw-video-list__nav > svg {
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.iw-video-list__nav:hover { background: #f5f5f5; border-color: var(--iw-accent, #4564ed); color: var(--iw-accent, #4564ed); }
.iw-video-list__nav--prev { left: -20px; }
.iw-video-list__nav--next { right: -20px; }
.iw-video-list__nav.swiper-button-disabled {
  opacity: 0.4;
  pointer-events: none;
}
/* Swiper add `.swiper-button-lock` khi watchOverflow detect tất cả slides fit
   → ≤slidesPerView slides → ẩn hẳn nav. Match pattern news-product. */
.iw-video-list__nav.swiper-button-lock { display: none; }

/* ---- Card ------------------------------------------------------------ */

.iw-video-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  background: transparent;
}

.iw-video-card__media {
  position: relative;
  display: block;
  width: 100%;
  height: 200px;
  overflow: hidden;
  border-radius: 8px;
  background: #eee;
}

.iw-video-card__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.iw-video-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform 0.15s;
}
.iw-video-card__media:hover .iw-video-card__play { transform: scale(1.1); }
.iw-video-card__play svg { filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35)); }

.iw-video-card__title {
  margin: 0;
  font-family: inherit;
  font-weight: 590;
  font-size: 18px;
  line-height: 1.5;
  color: #0f0f0f;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.iw-video-card__title a {
  color: inherit;
  text-decoration: none;
}
.iw-video-card__title a:hover { color: var(--iw-accent, #4564ed); }

/* ---- Responsive ------------------------------------------------------ */

/* Tablet (768-1199): nav top tính lại theo thumb height tablet. */
@media (max-width: 1199px) {
  .iw-video-list__nav { top: 84px; }
}

@media (max-width: 540px) {
  .iw-video-card__media { height: auto; aspect-ratio: 16 / 9; }
  /* Hide nav ≤540 (touch swipe đủ). Match breakpoint news-product. */
  .iw-video-list__nav { display: none; }
  /* Bleed full viewport — bỏ pad-x trên inner, heading giữ pad-x riêng,
     slider offset qua JS. Match pattern news-product mobile. */
  .iw-video-list__inner { padding: 40px 0; }
  .iw-video-list__header { padding: 16px var(--iw-container-pad-x) 0; }

  .iw-video-list__title { font-size: 24px; line-height: 32px; }
  .iw-video-list__more { font-size: 14px; line-height: 20px; }

  .iw-video-card__media { height: 138px; border-radius: 12px; }
  .iw-video-card__title { font-size: 14px; line-height: 20px; color: #3d3d3d; }
  .iw-video-card { gap: 12px; }
}
