/**
 * Herb Whisperer — Video Library & Bunny.net Embed Styles
 *
 * Shared video wrapper used in:
 *   - LearnDash lessons (via learndash.css .hw-video-wrapper)
 *   - Student Video Library page template
 *   - Seminar Videos page template
 *   - HerbStand with Thomas page template
 *   - Individual course video pages
 *
 * Enqueued on video library page templates.
 */

/* ==========================================================================
   Video Library Page Layout
   ========================================================================== */

.hw-video-library {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.hw-video-library-header {
  margin-bottom: 2.5rem;
  text-align: center;
}

.hw-video-library-header h1 {
  font-family: var(--hw-font-heading, 'Playfair Display', Georgia, serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--hw-text, #2c2c2c);
  margin: 0 0 0.5rem;
}

.hw-video-library-header .hw-subtitle {
  font-size: 1.1rem;
  color: var(--hw-text-secondary, #5a5a5a);
  max-width: 600px;
  margin: 0 auto;
}


/* ==========================================================================
   Video Filter Bar
   ========================================================================== */

.hw-video-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding: 0.75rem 1rem;
  background: var(--hw-bg-warm, #faf8f5);
  border: 1px solid var(--hw-border-light, #ece7df);
  border-radius: 8px;
  flex-wrap: wrap;
}

.hw-video-filters label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--hw-text-secondary, #5a5a5a);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hw-video-filter-btn {
  padding: 0.4rem 1rem;
  font-family: var(--hw-font-body, 'Source Sans 3', sans-serif);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--hw-text-secondary, #5a5a5a);
  background: transparent;
  border: 1px solid var(--hw-border, #ddd6cc);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.hw-video-filter-btn:hover {
  border-color: var(--hw-green-light, #3e7a35);
  color: var(--hw-green, #2d5a27);
}

.hw-video-filter-btn.active {
  background: var(--hw-green, #2d5a27);
  color: #fff;
  border-color: var(--hw-green, #2d5a27);
}


/* ==========================================================================
   Video Grid
   ========================================================================== */

.hw-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.hw-video-card {
  background: #fff;
  border: 1px solid var(--hw-border-light, #ece7df);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s, transform 0.3s;
}

.hw-video-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Thumbnail with play button overlay */
.hw-video-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1a1a1a;
  cursor: pointer;
}

.hw-video-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.3s, transform 0.4s;
}

.hw-video-card:hover .hw-video-card-thumb img {
  opacity: 1;
  transform: scale(1.03);
}

.hw-video-card-thumb .hw-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}

.hw-video-card:hover .hw-play-overlay {
  transform: translate(-50%, -50%) scale(1.08);
  background: #fff;
}

.hw-play-overlay svg {
  width: 24px;
  height: 24px;
  margin-left: 3px;
  fill: var(--hw-green, #2d5a27);
}

/* Duration badge */
.hw-video-card-thumb .hw-duration {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* Card body */
.hw-video-card-body {
  padding: 1rem 1.25rem 1.25rem;
}

.hw-video-card-title {
  font-family: var(--hw-font-heading, 'Playfair Display', Georgia, serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--hw-text, #2c2c2c);
  margin: 0 0 0.35rem;
  line-height: 1.3;
}

.hw-video-card-title a {
  color: inherit;
  text-decoration: none;
}

.hw-video-card-title a:hover {
  color: var(--hw-green, #2d5a27);
}

.hw-video-card-desc {
  font-size: 0.9rem;
  color: var(--hw-text-secondary, #5a5a5a);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.hw-video-card-meta {
  font-size: 0.8rem;
  color: var(--hw-text-muted, #8a8a8a);
}

.hw-video-card-meta span + span::before {
  content: '·';
  margin: 0 0.4em;
}


/* ==========================================================================
   Inline Video Player (expanded from card or standalone)
   ========================================================================== */

.hw-video-player {
  max-width: 900px;
  margin: 0 auto 2rem;
}

.hw-video-player-title {
  font-family: var(--hw-font-heading, 'Playfair Display', Georgia, serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hw-video-player .hw-video-wrapper {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.hw-video-player-desc {
  margin-top: 1rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--hw-text-secondary, #5a5a5a);
}


/* ==========================================================================
   Access Gate (non-enrolled user)
   ========================================================================== */

.hw-video-access-gate {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(
    135deg,
    var(--hw-bg-warm, #faf8f5) 0%,
    var(--hw-green-pale, #e8f0e6) 100%
  );
  border: 1px solid var(--hw-border-light, #ece7df);
  border-radius: 10px;
}

.hw-video-access-gate h2 {
  font-family: var(--hw-font-heading, 'Playfair Display', Georgia, serif);
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.hw-video-access-gate p {
  max-width: 500px;
  margin: 0 auto 1.5rem;
  color: var(--hw-text-secondary, #5a5a5a);
}

.hw-video-access-gate .hw-btn-primary {
  display: inline-block;
  background: var(--hw-green, #2d5a27);
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s;
}

.hw-video-access-gate .hw-btn-primary:hover {
  background: var(--hw-green-light, #3e7a35);
}


/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  .hw-video-grid {
    grid-template-columns: 1fr;
  }

  .hw-video-filters {
    flex-direction: column;
    align-items: flex-start;
  }

  .hw-video-library-header h1 {
    font-size: 1.6rem;
  }
}
