/* plg_content_ytvideo – zmienne można nadpisać w user.css szablonu */
.ytv {
  --ytv-radius: 6px;
  --ytv-play: #e00;
  --ytv-focus: #1a73e8;
  margin: 1.5rem 0;
  max-width: var(--ytv-max, 800px);
  width: 100%;
}
.ytv--center { margin-inline: auto; }
.ytv--right  { margin-left: auto; }

.ytv__frame,
.ytv__trigger {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--ytv-radius);
  background: #000;
}
.ytv__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.ytv__trigger { padding: 0; border: 0; cursor: pointer; }
.ytv__trigger img {
  width: 100%; height: 100%; object-fit: cover; display: block; margin: 0;
  transition: transform .3s ease, filter .3s ease;
}
.ytv__trigger:hover img { transform: scale(1.03); filter: brightness(.85); }
.ytv__trigger:focus-visible { outline: 3px solid var(--ytv-focus); outline-offset: 3px; }

.ytv__play {
  position: absolute; left: 50%; top: 50%;
  width: 68px; height: 48px; transform: translate(-50%, -50%);
}
.ytv__play svg { width: 100%; height: 100%; }
.ytv__play-bg { fill: #212121; fill-opacity: .8; transition: fill .2s, fill-opacity .2s; }
.ytv__trigger:hover .ytv__play-bg,
.ytv__trigger:focus-visible .ytv__play-bg { fill: var(--ytv-play); fill-opacity: 1; }

.ytv__caption { margin-top: .5rem; font-size: .9em; opacity: .8; text-align: center; }

/* Popup */
.ytv-dialog {
  width: min(92vw, 1100px);
  max-width: none; max-height: none;
  padding: 0; border: 0; background: transparent; overflow: visible;
}
.ytv-dialog::backdrop { background: rgba(0, 0, 0, .85); }
.ytv-dialog__frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 85vh;
  background: #000; border-radius: 6px; overflow: hidden;
}
.ytv-dialog__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ytv-dialog__close {
  position: absolute; top: -48px; right: 0;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .15); color: #fff; font-size: 28px; line-height: 1;
  cursor: pointer;
}
.ytv-dialog__close:hover { background: rgba(255, 255, 255, .3); }
.ytv-dialog__close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.ytv-dialog[open] { animation: ytv-in .2s ease-out; }
@keyframes ytv-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .ytv-dialog[open] { animation: none; }
  .ytv__trigger img { transition: none; }
}
@media (max-width: 600px) {
  .ytv-dialog { width: 100vw; }
  .ytv-dialog__close { right: 8px; }
}
