/**
 * video-widget.css — Homepage YouTube Widget
 * Responsive, lazy-embed thumbnails, LIVE banner, Shorts carousel, grids.
 *
 * @author     Canny Agency SRL <office@canny.ro>
 * @copyright  2026 Canny Agency SRL
 */

.vw-section {
  padding: clamp(32px, 6vw, 64px) 16px;
  background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
}
.vw-container {
  max-width: 1200px;
  margin: 0 auto;
}
.vw-heading {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  color: #7b1420;
  margin: 0 0 24px;
  text-align: center;
}
.vw-subsection {
  margin-bottom: 48px;
}
.vw-subsection:last-child { margin-bottom: 0; }
.vw-subheading {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 16px;
  padding-left: 4px;
  border-left: 4px solid #7b1420;
  padding-left: 12px;
}

/* === LIVE BANNER === */
.vw-live {
  background: linear-gradient(135deg, #7b1420 0%, #a61e2d 100%);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 48px;
  box-shadow: 0 8px 32px rgba(123, 20, 32, 0.25);
  position: relative;
  overflow: hidden;
}
.vw-live__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: #7b1420;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}
.vw-live__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e50914;
  animation: vw-pulse 1.5s ease-in-out infinite;
}
@keyframes vw-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.3); opacity: 0.6; }
}
.vw-live__player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
.vw-live__player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.vw-live__title {
  color: #fff;
  font-size: 1rem;
  margin: 12px 0 0;
  font-weight: 500;
}

/* === GRID (Predici, Featured) === */
.vw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.vw-grid--featured {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  max-width: 1000px;
  margin: 0 auto;
}

/* === VIDEO CARD === */
.vw-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.vw-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}
.vw-card__thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #e5e7eb;
  border: 0;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}
.vw-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vw-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform 0.2s ease;
}
.vw-card__thumb:hover .vw-card__play {
  transform: scale(1.1);
}
.vw-card__thumb:focus-visible {
  outline: 3px solid #7b1420;
  outline-offset: -3px;
}
.vw-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
  margin: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === SHORTS CAROUSEL (vertical 9:16) === */
.vw-shorts-scroller {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 4px 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.vw-shorts-scroller::-webkit-scrollbar { height: 6px; }
.vw-shorts-scroller::-webkit-scrollbar-thumb {
  background: #7b1420;
  border-radius: 3px;
}
.vw-card--short {
  flex: 0 0 auto;
  width: 180px;
  scroll-snap-align: start;
}
.vw-card--short .vw-card__thumb {
  aspect-ratio: 9 / 16;
  border-radius: 12px;
}
.vw-card--short .vw-card__title {
  font-size: 0.85rem;
  margin: 8px 4px;
  -webkit-line-clamp: 3;
}

/* === EMBED MODE (after click) === */
.vw-card.vw-card--playing .vw-card__thumb {
  background: #000;
}
.vw-card.vw-card--playing .vw-card__thumb img,
.vw-card.vw-card--playing .vw-card__play {
  display: none;
}
.vw-card.vw-card--playing .vw-card__thumb iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* === STATES === */
.vw-loading,
.vw-empty {
  grid-column: 1 / -1;
  padding: 32px;
  text-align: center;
  color: #6b7280;
  font-size: 0.95rem;
  background: #f9fafb;
  border-radius: 8px;
}

/* === COOKIE CONSENT BLOCKED === */
.vw-consent-blocked {
  padding: 24px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  text-align: center;
  color: #92400e;
  font-size: 0.95rem;
}
.vw-consent-blocked button {
  margin-top: 12px;
  background: #7b1420;
  color: #fff;
  border: 0;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}
.vw-consent-blocked button:hover { background: #a61e2d; }

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .vw-section { padding: 24px 12px; }
  .vw-heading { font-size: 1.5rem; margin-bottom: 20px; }
  .vw-subheading { font-size: 1.125rem; margin-bottom: 12px; }
  .vw-subsection { margin-bottom: 32px; }
  .vw-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .vw-card--short { width: 150px; }
  .vw-live__title { font-size: 0.9rem; }
  .vw-live { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .vw-live__dot { animation: none; }
  .vw-card { transition: none; }
  .vw-card:hover { transform: none; }
}

/* Dark mode ready */
[data-theme="dark"] .vw-section {
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
}
[data-theme="dark"] .vw-heading { color: #f87171; }
[data-theme="dark"] .vw-subheading { color: #f3f4f6; }
[data-theme="dark"] .vw-card { background: #1f2937; }
[data-theme="dark"] .vw-card__title { color: #f3f4f6; }
