/* Click-to-play film embed. Pairs with film-embed.js; see docs/films.md. */
.film-embed {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 16 / 9; border-radius: 16px;
  background: #0a0d1c; color: #fff; text-decoration: none;
  box-shadow: 0 40px 90px -40px rgba(99, 102, 241, .45), 0 0 0 1px #1d2646;
}
.film-embed img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.film-embed:hover img { transform: scale(1.015); }
.film-embed-overlay {
  position: absolute; inset: 0; display: flex; align-items: flex-end; gap: clamp(10px, 1.6vw, 18px);
  padding: clamp(12px, 3vw, 34px);
  background: linear-gradient(180deg, rgba(5, 8, 22, 0) 45%, rgba(5, 8, 22, .78) 100%);
}
.film-embed-play {
  flex: none; display: grid; place-items: center; border-radius: 50%;
  width: clamp(52px, 7.5vw, 92px); height: clamp(52px, 7.5vw, 92px);
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  box-shadow: 0 18px 50px -12px rgba(139, 92, 246, .8), inset 0 0 0 3px rgba(255, 255, 255, .25);
  transition: transform .2s ease;
}
.film-embed:hover .film-embed-play { transform: scale(1.06); }
.film-embed-play svg { width: 38%; height: 38%; margin-left: 8%; }
.film-embed-text { display: grid; gap: 6px; text-align: left; padding-bottom: clamp(2px, .6vw, 8px); }
.film-embed-text b { font-weight: 800; font-size: clamp(16px, 2.4vw, 28px); line-height: 1.1; letter-spacing: -0.01em; text-shadow: 0 2px 16px rgba(5, 8, 22, .6); }
.film-embed-text span { font-weight: 700; font-size: clamp(10px, 1.2vw, 13px); letter-spacing: .1em; text-transform: uppercase; color: #cfd6ea; }
.film-embed:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 4px; }
.film-embed-frame { display: block; width: 100%; border: 0; background: transparent; color-scheme: dark; }

.film-transcript { margin-top: 16px; color: var(--text-secondary, #cbd5e1); }
.film-transcript summary { cursor: pointer; font-weight: 600; font-size: .95rem; color: var(--text-secondary, #cbd5e1); }
.film-transcript summary:hover { color: var(--text, #f1f5f9); }
.film-transcript p { margin-top: 10px; line-height: 1.7; font-size: .95rem; }

/* ── Compact card: a deep dive inside a feature section or docs page ── */
.film-slot { max-width: 960px; margin: 40px auto 0; }
.film-slot:first-child { margin-top: 0; }
.film-embed--card {
  aspect-ratio: auto; display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 20px; align-items: center;
  padding: 12px; border-radius: 16px; background: rgba(15, 22, 41, .8);
  box-shadow: 0 0 0 1px #1e293b; transition: box-shadow .2s ease, background .2s ease;
}
.film-embed--card:hover { background: #141c33; box-shadow: 0 0 0 1px #334155, 0 24px 60px -30px rgba(99, 102, 241, .55); }
.film-embed--card:hover img { transform: none; }
.film-card-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; }
.film-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.film-card-thumb .film-embed-play { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; transform: translate(-50%, -50%); }
.film-embed--card:hover .film-embed-play { transform: translate(-50%, -50%) scale(1.08); }
.film-card-text { display: grid; gap: 6px; text-align: left; min-width: 0; }
.film-card-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #60a5fa; }
.film-card-text b { font-size: 1.1rem; font-weight: 700; letter-spacing: -.01em; color: #f1f5f9; }
.film-card-sum { font-size: .93rem; line-height: 1.55; color: #cbd5e1; }
.film-deck { max-width: 960px; margin: 40px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.film-deck .film-slot { margin: 0; max-width: none; }
.film-deck .film-embed--card { grid-template-columns: 1fr; align-items: start; }
.film-deck .film-slot:has(.film-embed-frame) { grid-column: 1 / -1; order: -1; }
@media (max-width: 640px) {
  .film-embed--card { grid-template-columns: 1fr; }
  .film-deck { grid-template-columns: 1fr; }
}
.docs-content > .film-slot { max-width: none; margin: 4px 0 32px; }
.film-series-link { margin-top: 14px; font-size: .95rem; }
.film-series-link a { color: var(--accent-light, #60a5fa); font-weight: 600; text-decoration: none; }
.film-series-link a:hover { text-decoration: underline; }

/* ── Full screen fallback (iPhone): the film asks, film-embed.js applies ── */
.film-embed-frame.is-fullscreen {
  position: fixed; inset: 0; z-index: 2147483647;
  width: 100vw; height: 100vh !important; height: 100dvh !important; max-width: none;
  background: #000;
}
html.film-host-fs, html.film-host-fs body { overflow: hidden; }
