/**
 * videos.css — Grille de cartes vidéo (webinaires), même langage
 * visuel que les tuiles (tuiles.css) et les articles (articles.css).
 */

.hub-video-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: stretch;
}

.hub-video-grid > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.hub-video-grid .hub-video-card {
  flex: 0 0 calc(33.333% - 0.8rem);
  width: calc(33.333% - 0.8rem);
}

@media (max-width: 992px) {
  .hub-video-grid .hub-video-card {
    flex: 0 0 calc(50% - 0.6rem);
    width: calc(50% - 0.6rem);
  }
}

@media (max-width: 576px) {
  .hub-video-grid .hub-video-card {
    flex: 0 0 100%;
    width: 100%;
  }
}

.hub-video-card {
  background: #fff;
  border: 1px solid #e8eef6;
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.hub-video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(51, 76, 152, 0.12);
}

.hub-video-card__title {
  margin: 0;
  padding: 1rem 1.2rem 0.4rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--wp--preset--color--primary-dark);
}

.hub-video-card__desc {
  margin: 0;
  padding: 0 1.2rem 1.2rem;
  font-size: 0.83rem;
  line-height: 1.5;
  color: #555;
}

/* ── Vignette cliquable (ouvre la visionneuse) ────────────────── */
.hub-video-card__thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
  overflow: hidden;
}

.hub-video-card__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.hub-video-card__thumb:hover img {
  transform: scale(1.05);
}

.hub-video-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--wp--preset--color--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.hub-video-card__thumb:hover .hub-video-card__play {
  transform: translate(-50%, -50%) scale(1.1);
}

.hub-video-card__play::before {
  content: "";
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent var(--wp--preset--color--primary-dark);
  margin-left: 4px;
}

/* ── Visionneuse plein écran (lightbox) ───────────────────────── */
.hub-video-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
}

.hub-video-lightbox.is-open {
  display: flex;
}

.hub-video-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(2px);
}

.hub-video-lightbox__inner {
  position: relative;
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.hub-video-lightbox__frame,
.hub-video-lightbox__frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.hub-video-lightbox__close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.hub-video-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.3);
}
