/* Video Gallery Page */

/* 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-group {
  margin-bottom: 40px;
  padding: 0; /* override global section { padding: 80px 0 } */
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}
.section-header h2 {
  font-size: 20px;
  margin: 0 0 4px;
  color: #9f7d23;
}
.section-header p {
  font-size: 13px;
  color: #888;
  margin: 0;
}
.view-toggle {
  display: flex;
  gap: 4px;
  background: #f5f5f5;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #e0d5c0;
}
.toggle-btn {
  padding: 8px 20px;
  border: 1px solid transparent;
  background: transparent;
  color: #666;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}
.toggle-btn:hover {
  color: #333;
  background: rgba(188, 159, 96, 0.08);
}
.toggle-btn.active {
  background: #BC9F60;
  color: #fff;
  border-color: #BC9F60;
  box-shadow: 0 2px 6px rgba(188, 159, 96, 0.3);
}
.group-body {
  padding: 20px 24px;
}

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

/* 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;
}
.video-group .video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.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;
}
.video-group .play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  transition: background 0.2s;
}
.video-group .video-thumbnail-btn:hover .play-overlay {
  background: rgba(0, 0, 0, 0.45);
}
.video-group .newplay-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.video-group .video-thumbnail-btn:hover .newplay-button {
  transform: scale(1.1);
}
.video-group .play-icon {
  color: #333;
}
.video-group .duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}
.video-group .video-info {
  padding: 12px 14px;
}
.video-group .video-title {
  font-size: 14px;
  margin: 0 0 4px;
  color: #333;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.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 #ddd;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}
.nav-arrow:hover {
  background: #f5f5f5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.nav-arrow.prev { left: -18px; }
.nav-arrow.next { right: -18px; }

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

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

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