/* Video Gallery Page — nursing theme (#42328f) */

/* Reset global margins inside video-group (style.css sets large margins on p, h1-h6, etc.) */
.video-group h1, .video-group h2, .video-group h3, .video-group h4, .video-group h5, .video-group h6,
.video-group p, .video-group ul, .video-group ol {
  margin: 0;
}
.video-group article,
.video-group button {
  margin: 0;
  padding: 0;
}

.video-gallery-wrap {
  padding-top: 30px;
  padding-bottom: 60px;
}

.video-group {
  margin-bottom: 32px;
  padding: 0; /* override global section { padding: 80px 0 } */
  background: #fff;
  border: 1px solid #ece9f7;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(66, 50, 143, 0.06);
  overflow: hidden;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  background: linear-gradient(90deg, rgba(66, 50, 143, 0.06) 0%, rgba(66, 50, 143, 0) 100%);
  border-bottom: 1px solid #ece9f7;
}
.section-header h2 {
  font-size: 20px;
  margin: 0 0 4px;
  color: #42328f;
  font-weight: 700;
}
.section-header p {
  font-size: 13px;
  color: #6b6b85;
  margin: 0;
}
.view-toggle {
  display: flex;
  gap: 4px;
  background: #f3f1fb;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #ddd6f3;
  flex-shrink: 0;
}
.toggle-btn {
  padding: 8px 18px;
  border: 1px solid transparent;
  background: transparent;
  color: #5e5d7a;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}
.toggle-btn:hover {
  color: #42328f;
  background: rgba(66, 50, 143, 0.08);
}
.toggle-btn.active {
  background: #42328f;
  color: #fff;
  border-color: #42328f;
  box-shadow: 0 2px 6px rgba(66, 50, 143, 0.3);
}
.group-body {
  padding: 22px 24px;
}

/* Grid View */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

/* Video Card */
.video-group .video-card {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: #fff;
  border: 1px solid #ece9f7;
}
.video-group .video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(66, 50, 143, 0.18);
  border-color: #d8d1f0;
}
.video-group .video-container {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #000;
}
.video-group .video-thumbnail-btn {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: none;
  position: relative;
}
.video-group .video-thumbnail-btn img.responsive {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.video-group .video-thumbnail-btn:hover img.responsive {
  transform: scale(1.05);
}
.video-group .play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(33, 22, 80, 0.28);
  transition: background 0.2s;
}
.video-group .video-thumbnail-btn:hover .play-overlay {
  background: rgba(33, 22, 80, 0.5);
}
.video-group .newplay-button {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  color: #e53935;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.video-group .video-thumbnail-btn:hover .newplay-button {
  transform: scale(1.1);
  background: #fff;
}
.video-group .play-icon {
  color: #e53935;
  margin-left: 2px;
}
.video-group .video-info {
  padding: 14px 16px;
}
.video-group .video-title {
  font-size: 14px;
  margin: 0 0 4px;
  color: #2a2540;
  line-height: 1.45;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}
.video-group .video-date {
  font-size: 12px;
  color: #888;
}

/* Scroll View */
.scroll-container {
  position: relative;
}
.horizontal-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0;
}
.horizontal-scroll::-webkit-scrollbar {
  display: none;
}
.horizontal-scroll .video-card {
  flex: 0 0 300px;
  scroll-snap-align: start;
}
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border: 1px solid #ddd6f3;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  color: #42328f;
  box-shadow: 0 2px 8px rgba(66, 50, 143, 0.18);
  transition: all 0.2s;
}
.nav-arrow:hover {
  background: #42328f;
  color: #fff;
  border-color: #42328f;
  box-shadow: 0 4px 14px rgba(66, 50, 143, 0.35);
}
.nav-arrow.prev { left: -19px; }
.nav-arrow.next { right: -19px; }

/* Hidden utility */
.video-group .hidden {
  display: none !important;
}

/* Iframe in video container */
.video-group .video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Empty state */
.video-gallery-empty {
  text-align: center;
  padding: 60px 20px;
  color: #6b6b85;
  font-size: 15px;
  background: #fff;
  border: 1px dashed #ddd6f3;
  border-radius: 12px;
}

@media (max-width: 768px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 18px;
  }
  .video-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .horizontal-scroll .video-card {
    flex: 0 0 260px;
  }
  .nav-arrow {
    display: none;
  }
  .group-body {
    padding: 16px;
  }
}
