.custom-banner-campus-vpro{
    width: 100%;
    height: auto;
    background: #4d4c51;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}

.img-banner-campus-vpro{
    display: block;
    width: auto;
    height: 100%;
    max-height: 220px;
    background-image: var(--desktop-img);
    background-size: cover;
    transition: all .5s ease;
    margin: auto;
    aspect-ratio: 5;
}

@media (max-width: 580px){
    .img-banner-campus-vpro{
        width: 100%;
        background-image: var(--mobile-img);
        aspect-ratio: 2.9;
        max-height: none;
    }
}

/*FUCNTIONALITY*/

/* Wrapper laid over the Bunny embed. The iframe keeps its own player, styling,
   analytics, Cast and heatmap -- we only place the ad overlay on top of it. */
#bunny-wrapper {
  position: absolute;
  top: 0;
  width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  background-color: transparent;
  overflow: hidden; /* clips the scrim to the player box */
  pointer-events: none;
}

/* --- FULLSCREEN ---
   The wrapper is promoted to the fullscreen element (see main.js), so it has to
   fill the screen instead of keeping its 16:9 page layout. The iframe fills it and
   the ad is still drawn on top. */
#bunny-wrapper:fullscreen,
#bunny-wrapper:-webkit-full-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-height: none;
  aspect-ratio: auto;
  background-color: #000;
}

#bunny-wrapper:fullscreen iframe,
#bunny-wrapper:-webkit-full-screen iframe {
  width: 100%;
  height: 100%;
}

/* Scale the card up with the frame */
#bunny-wrapper:fullscreen #custom_advertising,
#bunny-wrapper:-webkit-full-screen #custom_advertising {
  width: min(42%, 720px);
  bottom: 90px;
}

/* Fallback: if fullscreen could not be promoted to the wrapper, the iframe alone is
   on screen and nothing outside it can show, so hide the overlay entirely. */
#bunny-wrapper.is-fullscreen .ad-scrim,
#bunny-wrapper.is-fullscreen #custom_advertising {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* --- SCRIM ---------------------------------------------------------------
   Dims the paused frame the way YouTube does. Kept pointer-events: none so a
   click on the dark area still reaches the player and resumes playback.
   Delete this block if you would rather not dim the video. */
#bunny-wrapper .ad-scrim {
  position: absolute;
  inset: 0;
  z-index: 9;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.45);
  transition: opacity 0.35s ease-in-out;
}

#bunny-wrapper.is-paused .ad-scrim {
  opacity: 1;
}

/* --- AD CARD -------------------------------------------------------------
   Bottom-left of the frame, directly above Plyr's control bar, sliding up into
   place. 70px clears the controls, which are always visible while paused. */
#bunny-wrapper #custom_advertising {
  position: absolute;
  left: 20px;
  bottom: 70px;
  transform: translateY(12px);
  width: min(42%, 520px);
  margin: 0;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  border-radius: 12px;
  overflow: visible; /* lets the close button sit outside the corner */
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition:
    opacity 0.35s ease-in-out,
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0.35s;
}

#bunny-wrapper #custom_advertising.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition:
    opacity 0.35s ease-in-out,
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s;
}

#bunny-wrapper #custom_advertising.is-active:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

/* Artwork is clipped by the card, the close button is not */
#bunny-wrapper #custom_advertising .img-banner-campus-vpro {
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 5;
  background-image: var(--desktop-img);
  border-radius: inherit;
  overflow: hidden;
}

/* --- CLOSE BUTTON --- */
#bunny-wrapper .ad-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 26px;
  height: 26px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 11;
}

#bunny-wrapper .ad-close svg {
  width: 14px;
  height: 14px;
  display: block;
}

#bunny-wrapper .ad-close:hover,
#bunny-wrapper .ad-close:focus-visible {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
  outline: none;
}

/* Small screens: narrower frame, shorter control bar */
@media (max-width: 580px) {
  #bunny-wrapper #custom_advertising {
    left: 12px;
    bottom: 52px;
    width: 70%;
    border-radius: 8px;
  }
}

/* Respect reduced-motion preferences: fade only, no slide */
@media (prefers-reduced-motion: reduce) {
  #bunny-wrapper #custom_advertising,
  #bunny-wrapper #custom_advertising.is-active,
  #bunny-wrapper #custom_advertising.is-active:hover {
    transform: none;
    transition: opacity 0.2s ease-in-out, visibility 0s;
  }
}
