/* =============================================================================
   ARTICLE VIDEO — YouTube / remote video embed
   ============================================================================= */

.article-video {
  max-width: var(--content-wide);
  margin-inline: auto;
  margin-block: var(--space-12);
}

.article-video__inner {
  background: #0B0F1A;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
  border: 1px solid rgba(99, 102, 241, 0.2);
  position: relative;
}

/* Gradient top accent */
.article-video__inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-brand);
  z-index: 1;
}

/* Label bar above video */
.article-video__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  background: rgba(99, 102, 241, 0.1);
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-primary-300);
  letter-spacing: var(--tracking-wide);
}

.article-video__label svg {
  color: var(--color-primary-400);
  flex-shrink: 0;
}

/* Responsive 16:9 embed */
.article-video__embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

/* Flatten all Drupal wrapper divs inside the embed container */
.article-video__embed div,
.article-video__embed .media,
.article-video__embed .contextual-region,
.article-video__embed .field--name-field-youtube-video,
.article-video__embed .field--name-field-media-oembed-video,
.article-video__embed .field--name-field-media-oembed-video > div {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  display: block;
}

/* Contextual button — don't stretch it */
.article-video__embed .contextual {
  position: absolute;
  width: auto;
  height: auto;
  inset: auto;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 10;
}

.article-video__embed iframe,
.article-video__embed video {
  width: 100% !important;
  height: 100% !important;
  border: none;
  display: block;
  position: absolute;
  inset: 0;
}

/* Fallback if aspect-ratio not supported */
@supports not (aspect-ratio: 16 / 9) {
  .article-video__embed {
    padding-top: 56.25%; /* 9/16 = 56.25% */
    height: 0;
    position: relative;
  }

  .article-video__embed iframe,
  .article-video__embed video {
    position: absolute;
    top: 0;
    left: 0;
  }
}
