/* 2026-10-21 (LOCAL): videos, nothing starts by itself.
   .lia-yt = box of the REAL YouTube player (inc/lia_video.php, js/lia_video.js): YouTube's own poster + Play, the first tap goes straight to it.
   .video-item = mp4 tile (func.php products()) with our own Play. */

.lia-yt {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  margin-left: auto; /* always centred in its column */
  margin-right: auto;
  background: #2b2b2b;
  border-radius: 8px;
}
/* the box gets its height from this spacer, so it works in every browser (no aspect-ratio needed) */
.lia-yt::before {
  content: "";
  display: block;
  padding-top: 56.25%; /* 16:9 */
}
.lia-yt-v::before {
  padding-top: 177.78%; /* 9:16 */
}
/* wide screens only: a 9:16 box in a wide column would be taller than the screen, so its width follows the screen height (still 9:16, still centred).
   Phones / tablets (< 992px) have no cap: the video takes the full width of its column. */
@media (min-width: 992px) {
  .lia-yt-v {
    max-width: 100%;
    max-width: max(240px, min(100%, calc((100vh - 140px) * 0.5625)));
  }
}
/* video that YouTube no longer has: no box, no Play, nothing (set by js/lia_video.js; the server hides known-dead videos before this) */
.lia-yt-gone {
  display: none;
}
.lia-yt-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}
/* round Play over a YouTube box: only a picture (pointer-events:none), the tap goes through to YouTube's own Play underneath. 112px circle hides YouTube's Play button and its logo while the player loads. */
.lia-yt-fake {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 112px;
  height: 112px;
  margin: -56px 0 0 -56px;
  box-sizing: border-box;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #C62E22; /* solid (no alpha): YouTube logo must not show through */
  box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
  z-index: 2;
  pointer-events: none;
}
.lia-yt-fake::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -19px 0 0 -11px;
  border-style: solid;
  border-width: 19px 0 19px 32px;
  border-color: transparent transparent transparent #fff;
}
.lia-yt-started .lia-yt-fake {
  display: none;
}

/* the Play button of the mp4 tiles: always visible, centred (YouTube boxes use YouTube's own Play) */
.lia-yt-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(40, 40, 40, .62);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  z-index: 3;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.lia-yt-play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -12px 0 0 -6px;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #fff;
}
.video-item:hover .lia-yt-play,
.lia-yt-play:focus {
  background: rgba(172, 0, 0, .9);
  transform: scale(1.08);
  outline: 0;
}
.video-item.is-playing .lia-yt-play {
  display: none;
}

/* mp4 tiles: after Play the video shows its own controls; it fills the whole tile (no 112% crop, which would hide the controls) */
.video-item.is-playing {
  cursor: default;
}
.video-item.is-playing video {
  width: 100%;
  pointer-events: auto;
  z-index: 3;
}

/* video inside the "Видео" pop-up window (modal.php) */
