/* unCafe 0.9.60 — click-to-play YouTube. Scope exclusively to single posts. */
body.single .article-content .uncafe-youtube-lite {
  display:block; position:relative; width:100%; aspect-ratio:16/9;
  background:#292624; overflow:hidden; color:#fff; margin-block:1.35em;
}
body.single .article-content .uncafe-youtube-lite__play {
  appearance:none;position:absolute;inset:0;border:0;background:transparent;
  cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:10px;width:100%;height:100%;color:#fff;font:600 14px/1.3 Poppins,Arial,sans-serif;
}
body.single .article-content .uncafe-youtube-lite__play img {
  display:block;position:absolute;inset:0;width:100%;height:100%;object-fit:cover;
}
body.single .article-content .uncafe-youtube-lite__play::before {
  content:"";position:absolute;inset:0;background:linear-gradient(transparent 35%,rgb(0 0 0 / .36));
}
body.single .article-content .uncafe-youtube-lite__play-icon {
  position:relative;display:grid;place-items:center;width:66px;height:46px;
  border-radius:12px;background:#d1aaa3;color:#292624;font-size:20px;padding-left:3px;
  transition:transform .2s,background-color .2s;
}
body.single .article-content .uncafe-youtube-lite__play:hover .uncafe-youtube-lite__play-icon,
body.single .article-content .uncafe-youtube-lite__play:focus-visible .uncafe-youtube-lite__play-icon {
  background:#e5bbb4;transform:scale(1.06);
}
body.single .article-content .uncafe-youtube-lite__play-label {position:relative;text-shadow:0 1px 3px #0009;}
body.single .article-content .uncafe-youtube-lite__source {
  position:absolute;bottom:9px;right:12px;padding:3px 7px;border-radius:4px;
  font:500 11px/1.4 Poppins,Arial,sans-serif;color:#fff!important;
  background:#0009;text-decoration:none!important;z-index:1;
}
body.single .article-content .uncafe-youtube-lite iframe {
  display:block;width:100%;height:100%;border:0;aspect-ratio:16/9;
}
/* Only desktop: extend YouTube beyond the text column, with safe viewport bounds. */
@media(min-width:1025px) {
  body.single .article-content > .uncafe-youtube-lite,
  body.single .article-content > p:has(> .uncafe-youtube-lite),
  body.single .article-content > figure.wp-block-embed:has(.uncafe-youtube-lite),
  body.single .article-content > figure.wp-block-embed.is-provider-youtube,
  body.single .article-content > p:has(> iframe[src*="youtube.com/embed"]),
  body.single .article-content > p:has(> iframe[src*="youtube-nocookie.com/embed"]) {
    position:relative;left:50%;transform:translateX(-50%);
    width:min(var(--uncafe-youtube-desktop-width,115%), var(--uncafe-youtube-desktop-max,960px), calc(100vw - 48px));
    max-width:none;margin-left:0;margin-right:0;
  }
}
/* Always keep the full-width native and lightweight players inside smaller viewports. */
@media(max-width:1024px) {
  body.single .article-content .uncafe-youtube-lite,
  body.single .article-content > figure.wp-block-embed.is-provider-youtube,
  body.single .article-content > p:has(> iframe[src*="youtube.com/embed"]),
  body.single .article-content > p:has(> iframe[src*="youtube-nocookie.com/embed"]) {
    width:100%;max-width:100%;left:auto;transform:none;
  }
}

/* Legacy embeds placed directly inside a paragraph also honor the configured width. */
body.single .article-content > p:has(> iframe[src*="youtube.com/embed"]) iframe,
body.single .article-content > p:has(> iframe[src*="youtube-nocookie.com/embed"]) iframe {
  display:block;width:100%;height:auto;aspect-ratio:16/9;max-width:100%;
}

/* 0.9.61: Gutenberg reserves a 16:9 ratio with ::before. The lightweight
   player has its own aspect-ratio, so prevent the double-height blank gap.
   Scope this reset to wrappers that ALREADY contain a lightweight video. */
body.single .article-content figure.wp-block-embed:has(.uncafe-youtube-lite) .wp-block-embed__wrapper::before,
body.single .article-content figure.wp-block-embed:has(.uncafe-youtube-lite) .wp-block-embed__wrapper::after,
body.single .article-content .wp-block-embed__wrapper:has(.uncafe-youtube-lite)::before,
body.single .article-content .wp-block-embed__wrapper:has(.uncafe-youtube-lite)::after {
  content:none !important;
  display:none !important;
  padding:0 !important;
}
body.single .article-content .wp-block-embed__wrapper:has(.uncafe-youtube-lite) {
  padding-top:0 !important;
  height:auto !important;
  min-height:0;
  aspect-ratio:auto;
}
/* The video occupies 16:9 ONCE and is not offset from the preceding heading. */
body.single .article-content .wp-block-embed__wrapper > .uncafe-youtube-lite {
  margin:0;
}
body.single .article-content figure.wp-block-embed:has(.uncafe-youtube-lite) {
  margin-top:1.2em;
}
