/* ABYARD — shared fullscreen video controls */
.abyard-video-fullscreen {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 30;
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 2px;
  background: rgba(7, 7, 9, .7);
  color: #fff;
  font-family: var(--fm, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: .82;
  transition: opacity .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}

.abyard-video-fullscreen[hidden] {
  display: none !important;
}

.abyard-video-fullscreen:hover {
  opacity: 1;
  border-color: var(--accent, #fdb813);
  background: var(--accent, #fdb813);
  color: #1a1305;
}

.abyard-video-fullscreen:focus-visible,
.abyard-video-fallback-close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.abyard-video-fullscreen-icon {
  font-size: 18px;
  line-height: 1;
  transform: translateY(-1px);
}

/* The project caption lives on the opposite side of this control. */
.pjx-vis > .abyard-video-fullscreen {
  top: max(14px, env(safe-area-inset-top));
  right: auto;
  bottom: auto;
  left: max(14px, env(safe-area-inset-left));
}

video.abyard-video-native-fullscreen:fullscreen,
video.abyard-video-native-fullscreen:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #000 !important;
  object-fit: contain !important;
  object-position: center !important;
  filter: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body.abyard-video-fallback-open {
  overflow: hidden !important;
}

.abyard-video-fallback {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: #000;
}

.abyard-video-fallback[hidden] {
  display: none !important;
}

.abyard-video-fallback video {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100dvh;
  display: block;
  background: #000;
  object-fit: contain;
  object-position: center;
}

.abyard-video-fallback-close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 2;
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 2px;
  background: rgba(7, 7, 9, .82);
  color: #fff;
  font: 500 11px/1 var(--fm, ui-monospace, SFMono-Regular, Menlo, monospace);
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.abyard-video-fallback-error {
  position: absolute;
  left: 50%;
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px));
  z-index: 2;
  max-width: min(90vw, 560px);
  margin: 0;
  padding: 10px 14px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, .24);
  background: rgba(7, 7, 9, .86);
  color: #fff;
  font: 500 13px/1.45 var(--fb, system-ui, sans-serif);
  text-align: center;
}

.abyard-video-fallback-error[hidden] {
  display: none !important;
}

@media (hover: hover) and (pointer: fine) {
  .abyard-video-fullscreen {
    opacity: .68;
  }

  .abyard-video-host:hover > .abyard-video-fullscreen,
  .abyard-video-host:focus-within > .abyard-video-fullscreen {
    opacity: 1;
  }
}

@media (max-width: 680px) {
  .abyard-video-fullscreen-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .abyard-video-fullscreen {
    width: 44px;
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .abyard-video-fullscreen {
    transition: none;
  }
}
