/* =========================================================
   Mavicovod Media: просмотр фото и видеоплеер
   ========================================================= */

/* ---------- Просмотр фото ---------- */
html.mv-lock, html.mv-lock body { overflow: hidden !important; overscroll-behavior: none; }
.mv {
  position: fixed;
  inset: 0;
  z-index: 100000;
  color: #fff;
  font-family: var(--font, system-ui, sans-serif);
  opacity: 0;
  transition: opacity .2s ease;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.mv.is-open { opacity: 1; }
.mv-bg { position: absolute; inset: 0; background: rgba(5, 7, 10, .96); transition: opacity .2s; }
.mv svg, .mp svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mv svg .f, .mp svg .f { fill: currentColor; stroke: none; }
.mv-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 22px 16px;
  background: linear-gradient(rgba(0, 0, 0, .6), transparent);
  transition: opacity .2s;
}
.mv-count { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; opacity: .9; white-space: nowrap; }
.mv-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff !important; opacity: .8; font-size: 14px; text-decoration: none !important; margin-left: 8px; }
.mv-sp { flex: 1 1 auto; }
.mv-b {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff !important;
  cursor: pointer;
  text-decoration: none !important;
}
.mv-b:hover { background: rgba(255, 255, 255, .14); }
.mv-stage { position: absolute; inset: 0; z-index: 1; overflow: hidden; display: flex; }
.mv-track { flex: 1 1 auto; display: flex; transition: transform .2s ease, opacity .2s; }
.mv-slide { position: relative; flex: 1 1 auto; display: grid; place-items: center; padding: 64px 0 96px; }
.mv-single .mv-slide { padding-bottom: 40px; }
.mv-img {
  max-width: 100vw;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .2s;
  transform-origin: center center;
  will-change: transform;
  pointer-events: none;
}
.mv-slide.is-loaded .mv-img { opacity: 1; }
.mv-spin, .mp-spin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .25);
  border-top-color: #fff;
  animation: mvspin .8s linear infinite;
}
.mv-slide.is-loaded .mv-spin { display: none; }
@keyframes mvspin { to { transform: rotate(360deg); } }
.mv-err { position: absolute; font-size: 15px; opacity: .8; }
.mv-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .15s, opacity .2s;
}
.mv-nav:hover { background: rgba(255, 255, 255, .24); }
.mv-nav:disabled { opacity: 0; pointer-events: none; }
.mv-prev { left: 18px; }
.mv-next { right: 18px; }
.mv-single .mv-nav { display: none; }
.mv-thumbs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  justify-content: safe center;
  gap: 6px;
  padding: 14px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  overflow-x: auto;
  scrollbar-width: none;
  background: linear-gradient(transparent, rgba(0, 0, 0, .6));
  transition: opacity .2s;
}
.mv-thumbs::-webkit-scrollbar { display: none; }
.mv-th { flex: 0 0 auto; width: 56px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #222; cursor: pointer; opacity: .55; transition: opacity .15s, border-color .15s; }
.mv-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mv-th.on { opacity: 1; border-color: #fff; }
.mv-hint {
  position: absolute;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 3;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .6);
  font-size: 13px;
  width: max-content;
  max-width: calc(100% - 32px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.mv-hint-on .mv-hint { opacity: 1; }
.mv-ui-off .mv-top, .mv-ui-off .mv-thumbs, .mv-ui-off .mv-nav, .mv.is-zoomed .mv-thumbs { opacity: 0; pointer-events: none; }
@media (hover: none) { .mv-nav { display: none; } }
@media (max-width: 600px) {
  .mv-th { width: 46px; height: 46px; }
  .mv-slide { padding: 56px 0 80px; }
}

/* Фото на страницах — видно, что их можно открыть */
#content img[onclick*="img_show"] { cursor: zoom-in; }

/* ---------- Видеоплеер ---------- */
.mp {
  position: relative;
  width: 100%;
  max-height: 78vh;
  aspect-ratio: 16 / 9;
  margin: 6px 0;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: var(--font, system-ui, sans-serif);
  outline: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  isolation: isolate;
}
.mp.is-vertical { max-width: min(100%, calc(78vh * 9 / 16)); margin-left: auto; margin-right: auto; }
.mp:focus-visible { box-shadow: 0 0 0 3px var(--accent, #0077FF); }
.mp-video { position: absolute; inset: 0; width: 100% !important; height: 100% !important; object-fit: contain; background: #000; display: block; }
.mp.is-fs { max-height: none; border-radius: 0; aspect-ratio: auto; }
.mp-big {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: -34px 0 0 -34px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
  transition: transform .15s, opacity .2s, background .15s;
}
.mp-big svg { width: 30px; height: 30px; margin-left: 4px; }
.mp-big:hover { transform: scale(1.06); background: var(--accent, #0077FF); }
.mp:not(.is-paused) .mp-big, .mp.is-wait .mp-big { opacity: 0; pointer-events: none; }
.mp.is-ended .mp-big svg { margin-left: 0; }
.mp-spin { z-index: 3; display: none; }
.mp.is-wait .mp-spin { display: block; }
.mp-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 26px 10px 6px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .75));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.mp.mp-ui .mp-bar, .mp.is-paused:not(.is-fresh) .mp-bar, .mp.is-scrub .mp-bar { opacity: 1; transform: none; pointer-events: auto; }
.mp.is-fresh .mp-bar { opacity: 0 !important; pointer-events: none !important; }
.mp-prog { position: relative; height: 18px; margin: 0 6px; cursor: pointer; touch-action: none; }
.mp-prog::before, .mp-buf, .mp-done {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  height: 4px;
  border-radius: 99px;
  transition: height .12s, top .12s;
}
.mp-prog::before { right: 0; background: rgba(255, 255, 255, .25); }
.mp-buf { width: 0; background: rgba(255, 255, 255, .4); }
.mp-done { width: 0; background: var(--accent, #3EA6FF); }
.mp-prog:hover::before, .mp-prog:hover .mp-buf, .mp-prog:hover .mp-done, .mp.is-scrub .mp-prog::before, .mp.is-scrub .mp-buf, .mp.is-scrub .mp-done { top: 6px; height: 6px; }
.mp-knob {
  position: absolute;
  top: 9px;
  left: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  transform: scale(0);
  transition: transform .12s;
}
.mp-prog:hover .mp-knob, .mp.is-scrub .mp-knob, .mp.mp-ui .mp-knob { transform: scale(1); }
.mp-tip {
  position: absolute;
  bottom: 22px;
  left: 0;
  transform: translateX(-50%);
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .8);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.mp-prog:hover .mp-tip, .mp.is-scrub .mp-tip { opacity: 1; }
.mp-row { display: flex; align-items: center; gap: 2px; }
.mp-b {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff !important;
  font: 600 14px var(--font, system-ui);
  cursor: pointer;
  text-decoration: none !important;
}
.mp-b:hover { background: rgba(255, 255, 255, .14); }
.mp-b svg { width: 22px; height: 22px; }
.mp-vol { display: flex; align-items: center; }
.mp-vr { width: 0; opacity: 0; transition: width .2s, opacity .2s; accent-color: #fff; height: 4px; margin: 0; }
.mp-vol:hover .mp-vr, .mp-vr:focus { width: 80px; opacity: 1; margin: 0 6px 0 2px; }
.mp-time { margin-left: 6px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: .95; }
.mp-sp { flex: 1 1 auto; }
.mp-menu-w { position: relative; }
.mp-menu {
  position: absolute;
  right: 0;
  bottom: 46px;
  display: flex;
  flex-direction: column;
  min-width: 140px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(20, 20, 22, .96);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.mp-menu[hidden] { display: none; }
.mp-menu button { padding: 9px 12px; border: 0; border-radius: 8px; background: transparent; color: #fff; font: 14px var(--font, system-ui); text-align: left; cursor: pointer; }
.mp-menu button:hover { background: rgba(255, 255, 255, .1); }
.mp-menu button.on { background: var(--accent, #0077FF); color: #fff; }
.mp-tap {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 38%;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
}
.mp-tap-l { left: 0; background: radial-gradient(circle at 0 50%, rgba(255, 255, 255, .18), transparent 70%); }
.mp-tap-r { right: 0; background: radial-gradient(circle at 100% 50%, rgba(255, 255, 255, .18), transparent 70%); }
.mp-tap span { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: rgba(0, 0, 0, .45); }
.mp-tap.go { animation: mptap .6s ease; }
@keyframes mptap { 20% { opacity: 1; } 100% { opacity: 0; } }
.mp-resume {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  border-radius: 99px;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(6px);
  white-space: nowrap;
}
.mp-resume[hidden] { display: none; }
.mp-resume button { border: 0; background: transparent; color: #fff; cursor: pointer; font: 500 13.5px var(--font, system-ui); padding: 9px 6px 9px 16px; }
.mp-resume .mp-resume-x { padding: 6px 10px 6px 4px; display: grid; place-items: center; }
.mp-resume .mp-resume-x svg { width: 16px; height: 16px; }
.mp-err {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 16px 22px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 14.5px;
  line-height: 1.45;
  text-align: center;
}
.mp-err > div { max-width: 460px; }
.mp-err-dl { padding: 8px 16px; border-radius: 99px; background: rgba(255,255,255,.16); color: #fff !important; font-weight: 600; text-decoration: none; }
.mp-err-dl:hover { background: rgba(255,255,255,.26); }
.mp.is-error .mp-big, .mp.is-error .mp-bar { display: none; }
@media (max-width: 600px) {
  .mp { border-radius: 10px; }
  .mp-back, .mp-fwd, .mp-vol { display: none; }
  .mp-b { min-width: 38px; }
  .mp-big { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
}
@media (hover: none) { .mp-vr { display: none; } }

/* YouTube / VK / Rutube — аккуратно 16:9 */
.mp-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 6px 0; border-radius: 14px; overflow: hidden; background: #000; }
.mp-frame iframe { position: absolute; inset: 0; width: 100% !important; height: 100% !important; border: 0; }
