/* YouTube-Video-Vorschau in Event-Beschreibungen + Modal-Player.
   Erzeugt von DescriptionHtml::render(), gesteuert von youtube-embed.js. */

.yt-embed {
  position: relative;
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0.75rem 0;
  border-radius: 10px;
  overflow: hidden;
  line-height: 0;
  background: #000;
  cursor: pointer;
  text-decoration: none;
}

.yt-embed__thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.yt-embed:hover .yt-embed__thumb,
.yt-embed:focus-visible .yt-embed__thumb {
  transform: scale(1.03);
  filter: brightness(0.85);
}

/* Play-Button (YouTube-Stil: abgerundetes Rechteck + weisses Dreieck). */
.yt-embed__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.yt-embed__play::before {
  content: "";
  width: 68px;
  height: 48px;
  border-radius: 14px;
  background: rgba(18, 18, 18, 0.78);
  transition: background 0.2s ease;
}

.yt-embed__play::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 11px 0 11px 19px;
  border-color: transparent transparent transparent #fff;
  margin-left: 4px;
}

.yt-embed:hover .yt-embed__play::before,
.yt-embed:focus-visible .yt-embed__play::before {
  background: #ff0000;
}

.yt-embed:focus-visible {
  outline: 3px solid rgba(0, 255, 208, 0.6);
  outline-offset: 2px;
}

/* ---- Modal-Player ---- */
html.yt-modal-open {
  overflow: hidden;
}

.yt-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(2px);
}

.yt-modal[hidden] {
  display: none;
}

.yt-modal__frame {
  position: relative;
  width: min(92vw, 960px);
  aspect-ratio: 16 / 9;
}

.yt-modal__player,
.yt-modal__player iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
  background: #000;
}

.yt-modal__close {
  position: absolute;
  top: -46px;
  right: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.yt-modal__close:hover {
  background: rgba(0, 255, 208, 0.3);
  transform: scale(1.05);
}

.yt-modal__close:focus-visible {
  outline: 3px solid rgba(0, 255, 208, 0.6);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .yt-modal__close {
    top: 0;
    right: 0;
    transform: translate(-6px, -52px);
  }
}
