/* =========================================================
   PORTRAIT VIDEOS (9:16) — news, boat models, used boats
   - never stretched to the page width
   - never taller than 80% of the viewport (no scrolling to see it)
   - 1 video: centred | 2+ videos: side by side, centred
   - per-video visibility: desktop / mobile / both
========================================================= */

.cy-pv {
  --cy-pv-max: 380px;
  --cy-pv-gap: 24px;
  margin: 40px auto;
  padding: 0 20px;
  max-width: 1480px;
  box-sizing: border-box;
}

/* Inside the news article the container already has its own gutters */
.cy-news-single__article .cy-pv {
  padding: 0;
  margin: 10px auto 40px;
}

.cy-pv__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: var(--cy-pv-gap);
}

.cy-pv__item {
  flex: 0 0 auto;
  /* width = min(available width, 380px, width that gives 80vh of height at 9:16) */
  width: min(100%, var(--cy-pv-max), calc(80vh * 9 / 16));
}

.cy-pv__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #000;
  overflow: hidden;
}

.cy-pv__frame iframe,
.cy-pv__frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
}

/* Desktop */
@media (min-width: 768px) {
  .cy-pv__item--mobile,
  .cy-pv--no-desktop {
    display: none !important;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .cy-pv {
    margin: 30px auto;
    padding: 0 16px;
  }

  .cy-news-single__article .cy-pv {
    padding: 0;
  }

  .cy-pv__grid {
    flex-direction: column;
    align-items: center;
  }

  .cy-pv__item--desktop,
  .cy-pv--no-mobile {
    display: none !important;
  }
}

/* =========================================================
   CUSTOM PLAY / PAUSE — white circle, centred
========================================================= */

.cy-pv__toggle {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.cy-pv__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .35);
  position: relative;
  transition: opacity .25s ease, transform .2s ease;
}

/* play triangle */
.cy-pv__icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #111;
}

/* pause bars */
.cy-pv__frame.is-playing .cy-pv__icon::before {
  width: 20px;
  height: 24px;
  border: 0;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg, #111 0 6px, transparent 6px 14px, #111 14px 20px);
}

/* while playing: hide the circle, show it on hover / tap */
.cy-pv__frame.is-playing .cy-pv__icon {
  opacity: 0;
}

.cy-pv__frame.is-playing:hover .cy-pv__icon,
.cy-pv__frame.is-playing.is-flash .cy-pv__icon,
.cy-pv__toggle:focus-visible .cy-pv__icon {
  opacity: 1;
}

.cy-pv__toggle:hover .cy-pv__icon {
  transform: scale(1.06);
}

/* =========================================================
   SOUND (mute / unmute) — small white circle, bottom-right
========================================================= */

.cy-pv__sound {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .9;
  transition: opacity .2s ease, transform .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.cy-pv__sound:hover,
.cy-pv__sound:focus-visible {
  opacity: 1;
  transform: scale(1.06);
}

.cy-pv__sound svg { display: block; }
.cy-pv__sound-off { display: none !important; }
.cy-pv__frame.is-muted .cy-pv__sound-on { display: none !important; }
.cy-pv__frame.is-muted .cy-pv__sound-off { display: block !important; }

/* =========================================================
   Override theme button styles (brown hover etc.)
   - overlay: transparent; black 30% while the circle is visible
========================================================= */

.cy-pv .cy-pv__toggle,
.cy-pv .cy-pv__toggle:hover,
.cy-pv .cy-pv__toggle:focus,
.cy-pv .cy-pv__toggle:active {
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: none;
  color: inherit;
  transition: background-color .25s ease;
}

.cy-pv .cy-pv__frame:not(.is-playing) .cy-pv__toggle,
.cy-pv .cy-pv__frame.is-playing .cy-pv__toggle:hover,
.cy-pv .cy-pv__frame.is-playing.is-flash .cy-pv__toggle {
  background: rgba(0, 0, 0, .3) !important;
  background-color: rgba(0, 0, 0, .3) !important;
}

.cy-pv .cy-pv__sound,
.cy-pv .cy-pv__sound:hover,
.cy-pv .cy-pv__sound:focus,
.cy-pv .cy-pv__sound:active {
  background: #fff !important;
  background-color: #fff !important;
  border: 0 !important;
  color: #111;
}

/* =========================================================
   Lock position/size in every state (theme/Bootstrap :focus/:active
   were moving the buttons to the top-left corner on click)
========================================================= */

.cy-pv .cy-pv__sound,
.cy-pv .cy-pv__sound:hover,
.cy-pv .cy-pv__sound:focus,
.cy-pv .cy-pv__sound:focus-visible,
.cy-pv .cy-pv__sound:active {
  position: absolute !important;
  top: auto !important;
  left: auto !important;
  right: 12px !important;
  bottom: 12px !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  line-height: 1 !important;
  outline: none;
  z-index: 3;
}

.cy-pv .cy-pv__sound:active {
  transform: scale(.95) !important;
}

.cy-pv .cy-pv__toggle,
.cy-pv .cy-pv__toggle:hover,
.cy-pv .cy-pv__toggle:focus,
.cy-pv .cy-pv__toggle:focus-visible,
.cy-pv .cy-pv__toggle:active {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 0 !important;
  transform: none !important;
  z-index: 2;
}

.cy-pv .cy-pv__sound svg {
  position: static !important;
  width: 22px;
  height: 22px;
  margin: 0;
}
.cy-pv .cy-pv__sound-off { display: none !important; }
.cy-pv .cy-pv__frame.is-muted .cy-pv__sound-on { display: none !important; }
.cy-pv .cy-pv__frame.is-muted .cy-pv__sound-off { display: block !important; }
