/*
  WASPrFlow video components.
  Shared by the homepage demo modal/strip and the video library page.
*/

.video-hero-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--wf-border);
  border-radius: 22px;
  background: #000;
  box-shadow: var(--wf-shadow);
}

.video-hero-thumb img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.video-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.18);
  transition: background 180ms ease;
}

.video-hero-thumb:hover .video-play,
.video-card:hover .video-play {
  background: rgba(0, 0, 0, 0.30);
}

.video-hero-thumb .video-play {
  inset: 14px 14px auto auto;
  width: 58px;
  height: 58px;
  background: transparent;
}

.video-hero-thumb:hover .video-play {
  background: transparent;
}

.video-play span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding-left: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #0f172a;
  font-size: 1.25rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
}

.video-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 22px;
}

.video-jump a {
  padding: 8px 13px;
  border: 1px solid var(--wf-border);
  border-radius: 999px;
  background: var(--wf-panel);
  color: var(--wf-muted);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: var(--wf-shadow-soft);
}

.video-jump a:hover {
  color: var(--wf-text);
  border-color: color-mix(in srgb, var(--wf-accent) 30%, var(--wf-border));
}

.video-block {
  margin: 0;
}

.video-frame {
  overflow: hidden;
  border: 1px solid var(--wf-border);
  border-radius: 20px;
  background: #000;
  box-shadow: var(--wf-shadow);
}

.video-frame video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: var(--wf-muted);
  font-size: 0.9rem;
}

.video-meta .tag {
  color: var(--wf-text);
}

.video-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 4px solid var(--wf-accent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--wf-accent-soft) 62%, var(--wf-panel));
  color: var(--wf-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.video-note strong {
  color: var(--wf-text);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.video-card {
  display: block;
  padding: 0;
  overflow: hidden;
  color: inherit;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.video-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--wf-accent) 26%, var(--wf-border));
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.12);
}

.video-card-thumb {
  position: relative;
  overflow: hidden;
  background: #000;
  border-bottom: 1px solid var(--wf-border);
}

.video-card-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.video-card-thumb video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
  object-fit: cover;
}

.video-card-thumb .video-play span {
  width: 52px;
  height: 52px;
  font-size: 1rem;
}

.video-card .video-play {
  inset: 10px 10px auto auto;
  width: 52px;
  height: 52px;
  background: transparent;
}

.video-card:hover .video-play {
  background: transparent;
}

.video-runtime {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.video-card-body {
  padding: 16px;
}

.video-card-body h3 {
  margin: 0 0 7px;
  font-size: 1.06rem;
}

.video-card-body p {
  margin: 0 0 10px;
  color: var(--wf-muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.video-card-body .text-link {
  font-size: 0.88rem;
}

.video-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.video-strip + .hero-actions {
  margin-top: 22px;
}

.section-video-link {
  margin: 18px 0 0;
}

.section-video-link a {
  color: var(--wf-accent-2);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.section-video-link a:hover {
  color: var(--wf-text);
}

.transcript {
  margin-top: 12px;
  padding: 0 14px;
  border: 1px solid var(--wf-border);
  border-radius: 14px;
  background: var(--wf-panel);
}

.transcript summary {
  padding: 12px 0;
  cursor: pointer;
  color: var(--wf-text);
  font-weight: 800;
  font-size: 0.92rem;
  list-style: none;
}

.transcript summary::-webkit-details-marker {
  display: none;
}

.transcript summary::after {
  content: "+";
  float: right;
  color: var(--wf-accent);
  font-weight: 800;
}

.transcript[open] summary::after {
  content: "\2212";
}

.transcript-body {
  max-height: 320px;
  overflow: auto;
  padding: 0 0 14px;
  color: var(--wf-muted);
  font-size: 0.93rem;
  line-height: 1.65;
}

.transcript-body p {
  margin: 0 0 8px;
}

.video-dialog {
  width: min(980px, calc(100% - 28px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 0;
  border: 1px solid var(--wf-border);
  border-radius: 22px;
  background: var(--wf-panel-strong);
  box-shadow: 0 40px 100px rgba(15, 23, 42, 0.32);
  color: var(--wf-text);
}

.video-dialog::backdrop {
  background: rgba(8, 15, 28, 0.72);
  backdrop-filter: blur(4px);
}

.video-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--wf-border);
}

.video-dialog-head h2 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.video-dialog-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--wf-border);
  border-radius: 999px;
  background: transparent;
  color: var(--wf-text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.video-dialog video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-dialog-note {
  margin: 0;
  padding: 12px 18px 16px;
  color: var(--wf-muted);
  font-size: 0.9rem;
}

.video-dialog-note a {
  color: var(--wf-accent-2);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.dialog-open {
  overflow: hidden;
}

.demo-pill:hover {
  border-color: color-mix(in srgb, var(--wf-accent) 42%, transparent);
}

@media (max-width: 900px) {
  .video-grid,
  .video-strip {
    grid-template-columns: 1fr;
  }

  .video-hero-thumb .video-play span {
    width: 56px;
    height: 56px;
  }
}
