/* video-embed.css — click-to-load YouTube (privacy-enhanced) facade.
   Shared by the landing pages and the generated documentation; markup comes from
   scripts/lib/video-embed.mjs. Logical properties keep the Arabic (RTL) pages mirrored. */

.video-embed { margin: 0; max-width: 100%; }
.video-embed-frame {
  position: relative; aspect-ratio: 16 / 9; width: 100%; overflow: hidden;
  border-radius: var(--radius, 16px); background: var(--bg-raise, #1a1430);
  border: 1px solid var(--line-strong, rgba(157, 116, 242, .38)); box-shadow: 0 25px 50px rgba(0, 0, 0, .22);
}
.video-embed-frame > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #000; }

.video-embed-poster {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: transparent;
  color: var(--text, #f2edfc); font: inherit; text-decoration: none; cursor: pointer;
}
.video-embed-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.video-embed-poster::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(18, 14, 34, .04) 0%, rgba(18, 14, 34, .5) 100%);
  transition: background .2s;
}
.video-embed-poster:hover::after,
.video-embed-poster:focus-visible::after { background: linear-gradient(180deg, rgba(18, 14, 34, 0) 0%, rgba(18, 14, 34, .6) 100%); }
.video-embed-poster:focus-visible { outline: 3px solid var(--amber, #fdb233); outline-offset: -4px; border-radius: inherit; }

.video-embed-play {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: clamp(64px, 9vw, 92px); aspect-ratio: 1; border-radius: 50%;
  background: var(--amber, #fdb233); color: #241500; box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
  transition: transform .2s;
}
.video-embed-play svg { width: 46%; height: 46%; display: block; }
.video-embed-poster:hover .video-embed-play,
.video-embed-poster:focus-visible .video-embed-play { transform: scale(1.06); }

.video-embed-cta {
  position: absolute; z-index: 1; inset-inline-start: 18px; inset-block-end: 16px;
  display: flex; flex-direction: column; gap: 4px; text-align: start;
  font-family: var(--font-display, inherit); font-size: 1.05rem; font-weight: 600; line-height: 1.2;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .7);
}
.video-embed-cta small { font-family: var(--font-mono, monospace); font-size: .72rem; font-weight: 400; letter-spacing: .04em; color: #e6dcff; }
[dir="rtl"] .video-embed-cta small { letter-spacing: 0; }

.video-embed-caption { margin-block-start: 14px; display: grid; gap: 10px; font-size: .92rem; line-height: 1.55; color: var(--muted, #b9add3); }
.video-embed-caption > p { margin: 0; }
.video-embed-title { color: var(--text, #f2edfc); font-weight: 500; }
.video-embed-note { font-size: .82rem; color: var(--faint, #9386b9); }

.video-embed .video-embed-chapters { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.video-embed .video-embed-chapters a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--line, rgba(157, 116, 242, .22)); border-radius: 999px;
  color: var(--text, #f2edfc); background: rgba(169, 130, 245, .06); text-decoration: none; font-size: .84rem;
  transition: border-color .2s, background .2s;
}
.video-embed .video-embed-chapters a:hover,
.video-embed .video-embed-chapters a:focus-visible { border-color: var(--violet-bright, #a982f5); background: var(--violet-soft, rgba(122, 75, 216, .16)); color: var(--text, #f2edfc); }
.video-embed .video-embed-chapters a[aria-current="true"] { border-color: var(--amber, #fdb233); }
.video-embed .video-embed-chapters time { font-family: var(--font-mono, monospace); font-size: .74rem; color: var(--amber, #fdb233); direction: ltr; unicode-bidi: isolate; }

.video-embed .video-embed-external {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; width: fit-content;
  color: var(--violet-bright, #a982f5); text-decoration: none; font-size: .86rem; text-underline-offset: 5px;
}
.video-embed .video-embed-external:hover,
.video-embed .video-embed-external:focus-visible { text-decoration: underline; color: var(--violet-bright, #a982f5); }

/* Compact chapter card inside an article: starts at one chapter, no chapter list. */
.video-embed-compact { max-width: 560px; }
.video-embed-compact .video-embed-cta { font-size: .95rem; }
.video-embed-compact .video-embed-play { width: clamp(56px, 7vw, 72px); }

/* Landing page section (index.html / ar/index.html). */
.watch-section .watch-layout { margin-block-start: 44px; }
.watch-section .video-embed { max-width: 1000px; margin-inline: auto; }
.watch-section .sec-intro { max-width: 720px; }

@media (max-width: 600px) {
  .video-embed-frame { border-radius: 12px; }
  .video-embed-cta { inset-inline-start: 12px; inset-block-end: 10px; font-size: .95rem; }
  .video-embed .video-embed-chapters a { font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .video-embed-play, .video-embed-poster::after, .video-embed .video-embed-chapters a { transition: none; }
  .video-embed-poster:hover .video-embed-play, .video-embed-poster:focus-visible .video-embed-play { transform: none; }
}
