/* =========================================================
   AVOLVE Media — shared video player (assets/js/video-player.js)
   Same look as the earlier Our Work player: dark blurred backdrop,
   rounded frame with a faint cyan edge, round glass buttons.
   Every rule starts with .avp so nothing else on the site changes.
   ========================================================= */
.avp {
  --avp-r: 9 / 16;
  --avp-gap: clamp(10px, 2vw, 24px);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ece4dc;
  overflow: hidden;
}
.avp[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: max(14px, env(safe-area-inset-top, 0px)) 16px max(18px, env(safe-area-inset-bottom, 0px));
}
.avp__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--avp-gap);
  max-width: 100%;
}
.avp::backdrop {
  background: rgba(0, 0, 1, .9);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}
html.avp-open { overflow: hidden; }

.avp__head {
  align-self: stretch;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
  min-height: 48px;
  padding: 0 64px;               /* keeps clear of the close button */
  text-align: center;
}
.avp__title {
  margin: 0;
  font-family: var(--sans, inherit);
  font-size: 1rem;
  font-weight: 500;
  color: rgba(236, 228, 220, .86);
}
.avp__count { margin: 0; font-size: .85rem; color: rgba(236, 228, 220, .55); font-variant-numeric: tabular-nums; }

/* the frame keeps the video's own shape and always fits the screen */
.avp__frame {
  position: relative;
  flex: none;
  aspect-ratio: var(--avp-r);
  height: min(calc(100dvh - 120px), calc((100vw - 200px) / (9 / 16)));
  height: min(calc(100vh - 120px), calc((100vw - 200px) * 16 / 9));
  max-width: calc(100vw - 200px);   /* leaves room for the previous/next buttons */
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 1px rgba(0, 240, 255, .25), 0 20px 60px -20px rgba(0, 240, 255, .35);
}
@supports (height: 100dvh) {
  .avp__frame { height: min(calc(100dvh - 120px), calc((100vw - 200px) * 16 / 9)); }
}
.avp__frame.is-wide {
  --avp-r: 16 / 9;
  height: auto;
  width: min(calc(100vw - 200px), 1280px, calc((100vh - 120px) * 16 / 9));
}
@supports (height: 100dvh) {
  .avp__frame.is-wide { width: min(calc(100vw - 200px), 1280px, calc((100dvh - 120px) * 16 / 9)); }
}
.avp__slot, .avp__iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.avp__iframe { display: block; background: #000; }

/* honest fallback when the Vimeo player cannot load here */
.avp__msg {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(120% 80% at 30% 20%, #1d2024, #0b0c0d 70%);
}
.avp__msg[hidden] { display: none; }
.avp__msg-title { margin: 0; font-size: 1.05rem; font-weight: 500; color: #ece4dc; }
.avp__msg-text { margin: 0; max-width: 26em; font-size: .92rem; line-height: 1.5; color: rgba(236, 228, 220, .7); }
.avp__msg-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 6px;
  padding: 0 20px;
  border: 1px solid rgba(0, 240, 255, .55);
  border-radius: 999px;
  color: #00f0ff;
  text-decoration: none;
}
.avp__msg-link:hover { background: rgba(0, 240, 255, .1); }

/* round glass buttons */
.avp__btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  cursor: pointer;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease, opacity .25s ease;
}
.avp__btn svg { width: 22px; height: 22px; }
.avp__btn:hover:not(:disabled) { background: rgba(255, 255, 255, .2); border-color: #00f0ff; color: #00f0ff; }
.avp__btn:disabled { opacity: .28; cursor: default; }
.avp :focus-visible { outline: 2px solid #00f0ff; outline-offset: 3px; }
.avp__close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: clamp(12px, 2vw, 24px);
  z-index: 3;
}
.avp__nav { flex: none; }

/* phones: video uses the width; previous/next sit below it */
@media (max-width: 640px) {
  .avp[open] { padding-inline: 12px; }
  .avp__stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    row-gap: 14px;
    column-gap: 24px;
    width: 100%;
  }
  .avp__frame {
    grid-row: 1;
    grid-column: 1 / -1;
    justify-self: center;
    height: min(calc(100dvh - 190px), calc((100vw - 24px) * 16 / 9));
    height: min(calc(100vh - 190px), calc((100vw - 24px) * 16 / 9));
    max-width: calc(100vw - 24px);
  }
  @supports (height: 100dvh) {
    .avp__frame { height: min(calc(100dvh - 190px), calc((100vw - 24px) * 16 / 9)); }
  }
  .avp__frame.is-wide { height: auto; width: calc(100vw - 24px); }
  .avp__nav { grid-row: 2; }
  .avp__nav--prev { grid-column: 1; justify-self: end; }
  .avp__nav--next { grid-column: 2; justify-self: start; }
  .avp__head { padding: 0 56px; flex-direction: column; align-items: center; gap: 2px; }
}

/* Render Room theme: same player, Render Room yellow accents */
.avp--rr::backdrop { background: rgba(5, 5, 6, .975); }
.avp--rr .avp__frame { box-shadow: 0 0 0 1px rgba(255, 204, 0, .3), 0 20px 60px -20px rgba(255, 204, 0, .3); }
.avp--rr .avp__btn:hover:not(:disabled) { background: #ffcc00; border-color: #ffcc00; color: #000001; }
.avp--rr :focus-visible { outline-color: #ffcc00; }
.avp--rr .avp__msg-link { border-color: rgba(255, 204, 0, .6); color: #ffcc00; }
.avp--rr .avp__msg-link:hover { background: rgba(255, 204, 0, .12); }

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