/**
 * Audioengine – Video Learning Widget
 */

/* ── Grid ───────────────────────────────────────────────────────────── */

.ae-vl__grid {
  display: grid;
  gap: 1.75rem;
}

/* ── Card ───────────────────────────────────────────────────────────── */

.ae-vl__card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Thumbnail ──────────────────────────────────────────────────────── */

.ae-vl__thumb-link {
  display: block;
  text-decoration: none;
  border-radius: 6px;
  overflow: hidden;
}

.ae-vl__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1a1a;
  overflow: hidden;
  border-radius: 6px;
}

.ae-vl__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.35s ease, opacity 0.25s ease;
}

.ae-vl__thumb-link:hover .ae-vl__thumb img {
  transform: scale(1.04);
  opacity: 0.85;
}

.ae-vl__thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
}

/* ── Play button ────────────────────────────────────────────────────── */

.ae-vl__play-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 42px;
  height: 42px;
  background: var(--color-primary, #b22222);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

/* Play triangle via clip-path pseudo-element */
.ae-vl__play-btn::after {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 13px;
  border-color: transparent transparent transparent #fff;
  margin-left: 3px;
}

.ae-vl__thumb-link:hover .ae-vl__play-btn {
  transform: scale(1.12);
  background: #8b0000;
}

/* ── Title ──────────────────────────────────────────────────────────── */

.ae-vl__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  font-family: 'Nunito Sans', sans-serif;
}

.ae-vl__title a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ae-vl__title a:hover {
  color: var(--color-primary, #b22222);
}

/* ── Pagination ─────────────────────────────────────────────────────── */

.ae-vl__pagination {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.ae-vl__pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.875rem;
  color: #333;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  background: #fff;
}

.ae-vl__pagination .page-numbers:hover,
.ae-vl__pagination .page-numbers.current {
  background: var(--color-primary, #b22222);
  border-color: var(--color-primary, #b22222);
  color: #fff;
}

.ae-vl__pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
  pointer-events: none;
}

/* ── Empty state ────────────────────────────────────────────────────── */

.ae-vl__empty {
  text-align: center;
  color: #888;
  font-family: 'Nunito Sans', sans-serif;
  padding: 3rem 1rem;
}

/* ── Lightbox modal ─────────────────────────────────────────────────── */

.ae-vl-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
}

.ae-vl-modal.is-open {
  display: flex;
}

.ae-vl-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  animation: ae-vl-fade-in 0.2s ease;
}

.ae-vl-modal__box {
  position: relative;
  z-index: 1;
  width: min(90vw, 960px);
  animation: ae-vl-zoom-in 0.22s ease;
}

.ae-vl-modal__close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.15s ease;
  padding: 0;
}

.ae-vl-modal__close:hover {
  opacity: 1;
}

.ae-vl-modal__close svg {
  width: 24px;
  height: 24px;
}

.ae-vl-modal__ratio {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
  border-radius: 4px;
  overflow: hidden;
}

.ae-vl-modal__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Body scroll lock ───────────────────────────────────────────────── */

body.ae-vl-no-scroll {
  overflow: hidden;
}

/* ── Animations ─────────────────────────────────────────────────────── */

@keyframes ae-vl-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes ae-vl-zoom-in {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
