/* Click-to-play YouTube previews in articles (inc/video-embed.php, assets/js/components/video.js):
   a 16:9 panel with the title and a play button; the player loads only on press. */
.pe-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 2rem 0;
  overflow: hidden;
  border: 1px solid var(--wp--preset--color--color-line, #2A313B);
  border-radius: 12px;
  background: radial-gradient(120% 90% at 30% 20%, #16314A 0%, #0E1620 55%, #0A0F15 100%);
  color: var(--wp--preset--color--color-text-primary, #F2F4F7);
}
/* Inside an embed block the wrapper already keeps 16:9; the preview fills it. */
.wp-has-aspect-ratio .wp-block-embed__wrapper > .pe-video { position: absolute; inset: 0; height: 100%; margin: 0; aspect-ratio: auto; }
.wp-block-embed__wrapper > .pe-video { margin: 0; }
/* Vertical shorts: a portrait panel, centred, never inside a 16:9 frame. */
.pe-video.is-portrait { aspect-ratio: 9 / 16; width: min(100%, 340px); margin: 2rem auto; }
.wp-block-embed__wrapper:has(> .pe-video.is-portrait)::before { display: none; }
.wp-has-aspect-ratio .wp-block-embed__wrapper > .pe-video.is-portrait { position: relative; inset: auto; height: auto; aspect-ratio: 9 / 16; margin: 0 auto; }
.pe-video.is-portrait .pe-video__title { font-size: 1rem; }
/* A thumbnail already shows the video's own title card: the text title stays for screen readers only. */
.pe-video.has-thumb .pe-video__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pe-video.has-thumb .pe-video__play { padding-bottom: 24px; background: linear-gradient(180deg, rgba(10, 15, 21, 0) 55%, rgba(10, 15, 21, 0.55) 100%); }
.pe-video__thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.pe-video__play {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  width: 100%; height: 100%; margin: 0; padding: 24px 24px 52px;
  border: 0; border-radius: 0;
  background: linear-gradient(180deg, rgba(10, 15, 21, 0.1) 0%, rgba(10, 15, 21, 0.7) 100%);
  color: inherit; font: inherit; text-align: center; cursor: pointer;
}
.pe-video__play:focus-visible { outline: 2px solid var(--wp--preset--color--color-highlight, #1AB3F5); outline-offset: -4px; }
.pe-video__icon {
  position: relative; flex: none; width: 68px; height: 68px; border-radius: 50%;
  background: var(--wp--preset--color--color-accent, #3070A8);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.pe-video__icon::after {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%);
  border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #FFFFFF;
}
.pe-video__play:hover .pe-video__icon { transform: scale(1.06); background: var(--wp--preset--color--color-highlight, #1AB3F5); }
.pe-video__title { max-width: 42ch; font-weight: 600; font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem); line-height: 1.3; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7); }
.pe-video__note {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 8px 14px;
  background: rgba(10, 15, 21, 0.72); color: var(--wp--preset--color--color-text-secondary, #A3ABB8);
  font-size: 0.78rem; line-height: 1.35; text-align: center; pointer-events: none;
}
.pe-video__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 600px) {
  .pe-video__icon { width: 54px; height: 54px; }
  .pe-video__play { gap: 10px; padding: 16px 16px 46px; }
  .pe-video__title { font-size: 0.95rem; }
  .pe-video__note { font-size: 0.7rem; padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) { .pe-video__icon { transition: none; } }
