/* Overlay shell: hidden by default */
#mwc-video-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;             /* NEW */
  transition: opacity 200ms ease, visibility 0s linear 200ms; /* delay visibility off */
}

/* Show only when open */
#mwc-video-overlay.is-open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;            /* NEW */
  transition: opacity 200ms ease; /* remove delay when showing */
}

/* Backdrop: black, but only visible when open via parent opacity/visibility */
#mwc-video-overlay .mwc-video-backdrop {
  position: absolute;
  inset: 0;
  background: #000;
}

/* Modal: neutral when closed; full-screen only when open */
#mwc-video-overlay .mwc-video-modal {
  position: absolute;             /* inert when closed */
  inset: auto;                    /* no footprint when closed */
  width: 0;
  height: 0;
  overflow: hidden;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

#mwc-video-overlay.is-open .mwc-video-modal {
  position: fixed;                /* only when open */
  inset: 0;
  width: 100vw;
  height: 100dvh;                 /* mobile-safe viewport */
  background: #000;
  overflow: hidden;
}

/* Video fills the modal when open */
#mwc-video-overlay .mwc-video-wrap {
  width: 100%;
  height: 100%;
}

#mwc-video-overlay video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Buttons pinned only when open (avoid stray clickable area) */
#mwc-video-overlay .mwc-video-close,
#mwc-video-overlay .mwc-video-next {
  position: fixed;
  right: calc(env(safe-area-inset-right, 0px) + 10px);
  z-index: 2;
}

#mwc-video-overlay .mwc-video-close { top: calc(env(safe-area-inset-top, 0px) + 8px); }
#mwc-video-overlay .mwc-video-next  { top: calc(env(safe-area-inset-top, 0px) + 56px); }

/* Make slide images look clickable and keyboard-focusable */
.mwc-video-clickable { cursor: pointer; }
.mwc-video-clickable:focus {
  outline: 2px solid rgba(255,255,255,0.6);
  outline-offset: 2px;
}

/* Remove the text arrow if you had it */
.mwc-video-next { position: relative; }
.mwc-video-next { /* optional if you want icon + text inline nicely */
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Icon before the label */
.mwc-video-next::after {
  content: "";
  display: inline-block;
  width: 28px;           /* adjust size */
  height: 28px;
  background: currentColor;  /* lets you recolor via 'color' */
  -webkit-mask: url(/themes/contrib/mwconstruction3/images/play-icon.svg) no-repeat center / contain;
  mask: url(/themes/contrib/mwconstruction3/images/play-icon.svg) no-repeat center / contain;
}

.mwc-video-next { color: var(--mw-orange-3) !important; }                 /* icon becomes white */
.mwc-video-next:hover { color: #e5e5e5; }



/* Only when open */
#mwc-video-overlay.is-open .mwc-video-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;           /* ← more reliable on Samsung browsers */
  background: #000;
  overflow: hidden;
  display: flex;           /* ← give the video real height */
  flex-direction: column;
}

#mwc-video-overlay .mwc-video-wrap {
  flex: 1 1 auto;          /* ← fill available space */
  min-height: 1px;         /* ← avoid zero-height bugs */
}

#mwc-video-overlay video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}


@keyframes mwcPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.mwc-pulse { animation: mwcPulse 1.2s ease-in-out infinite; }



/* Ensure slides can host an absolutely-positioned CTA */
.view-branze .swiper-slide {
  position: relative;
}

/* Animated PLAY CTA (hidden by default; shown when slide is visible or hovered) */
.view-branze .swiper-slide .mwc-play-cta {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  /*background: rgba(0,0,0,0.35);*/
  background: rgba(255,255,255,0.15);
  color: #fff;
  display: grid;
  place-items: center;
  z-index: 3;
  cursor: pointer;

  /* Hide until visible/hovered */
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

/* Show when slide is visibly in viewport or hovered */
.view-branze .swiper-slide.is-visible .mwc-play-cta,
.view-branze .swiper-slide:hover .mwc-play-cta {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* Icon inside CTA using your SVG (recolors via currentColor) */
.view-branze .swiper-slide .mwc-play-cta::before {
  content: "";
  width: 36px;
  height: 36px;
  display: block;
  background: currentColor;
  -webkit-mask: url(/themes/contrib/mwconstruction3/images/play-icon.svg) no-repeat center / contain;
  mask: url(/themes/contrib/mwconstruction3/images/play-icon.svg) no-repeat center / contain;
}

/* Pulse + ripple animation to attract attention */
@keyframes mwcCtaBreath {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(255,255,255,0.0); }
  50%      { transform: scale(1.06); box-shadow: 0 0 20px rgba(255,255,255,0.20); }
}
@keyframes mwcCtaRipple {
  0%   { opacity: 0.35; transform: scale(1); }
  80%  { opacity: 0;    transform: scale(1.9); }
  100% { opacity: 0;    transform: scale(2); }
}

/* Apply the animations only when CTA is shown */
.view-branze .swiper-slide.is-visible .mwc-play-cta,
.view-branze .swiper-slide:hover .mwc-play-cta {
  animation: mwcCtaBreath 1.8s ease-in-out infinite;
}

/* Outward ripple ring */
.view-branze .swiper-slide .mwc-play-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.55);
  transform-origin: center;
  opacity: 0;
}
.view-branze .swiper-slide.is-visible .mwc-play-cta::after,
.view-branze .swiper-slide:hover .mwc-play-cta::after {
  animation: mwcCtaRipple 1.8s ease-out infinite;
}

/* Hover / focus states */
.view-branze .swiper-slide .mwc-play-cta:hover,
.view-branze .swiper-slide .mwc-play-cta:focus-visible {
  /*background: rgba(255,255,255,0.15);*/
  background: rgba(0,0,0,0.35);
  border-color: #fff;
  outline: none;
}

/* Optional: subtle pulse hint on Next button when autoplay is blocked */
@keyframes mwcPulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
.mwc-pulse { animation: mwcPulse 1.2s ease-in-out infinite; }

/* Accessibility helper for the hidden span inside button */
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap; border: 0; padding: 0; margin: -1px;
}


/* Keep existing button placement/size (80x80 at top/right 120px) from earlier rules */

/* Ensure the central play icon sits above the ring */
.view-branze .swiper-slide .mwc-play-cta::before {
  position: relative;
  z-index: 2;
}

/* Circular text ring svg */
.view-branze .swiper-slide .mwc-play-cta-svg {
  position: absolute;
  inset: -10px;                     /* a bit outside the 80x80 circle */
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  z-index: 1;                        /* below the central icon */
  pointer-events: none;              /* clicks go to the button */
  transform-origin: 50% 50%;
  animation: mwcTextSpin 12s linear infinite;
}

/* Circular text style */
.view-branze .swiper-slide .mwc-textcircle {
  font: 700 11px/1 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  fill: rgba(255,255,255,0.9);
}

/* Gentle continuous rotation */
@keyframes mwcTextSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .view-branze .swiper-slide .mwc-play-cta-svg {
    animation: none;
  }
}

/* (Already in place) CTA visibility & animations from your previous setup:
   .mwc-play-cta appears only on .swiper-slide.is-visible or :hover
   keep your pulse/ripple rules as-is */


/* Let the text ring extend outside the 80×80 button without clipping */
.view-branze .swiper-slide .mwc-play-cta-svg {
  position: absolute;
  inset: -8px;                              /* push out 8px on all sides */
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  pointer-events: none;                     /* clicks still go to the button */
}

/* Optional: center the single phrase at the top of the circle */
.view-branze .swiper-slide .mwc-textcircle { text-anchor: middle; }
.view-branze .swiper-slide .mwc-textcircle textPath { startOffset: 50%; }


.view-branze .swiper-slide .mwc-play-cta-svg { transform: rotate(180deg); }

/* The CTA button container must not clip its children */
.view-branze .swiper-slide .mwc-play-cta {
  overflow: visible;
}

/* Give the SVG extra room around the 80×80 button and prevent SVG clipping */
.view-branze .swiper-slide .mwc-play-cta-svg {
  position: absolute;
  inset: -24px;                                 /* expand box around the button */
  width: calc(100% + 48px);
  height: calc(100% + 48px);
  overflow: visible;                             /* critical for rotating text */
  transform-origin: 50% 50%;
  /* If you are animating rotation, this helps some browsers: */
  transform-box: fill-box;
}

/* Single phrase centered at the top of the circle */
.view-branze .swiper-slide .mwc-textcircle { text-anchor: middle; }

/* If you want the single phrase at the BOTTOM instead, uncomment: */
/* .view-branze .swiper-slide .mwc-play-cta-svg { transform: rotate(180deg); } */



/* === SCALE PLAY CTA TO 120px === */
:root{
  --mwc-cta-size: 120px;                 /* button diameter */
  --mwc-cta-icon: calc(var(--mwc-cta-size) * 0.45);  /* inner play icon ~54px */
  --mwc-cta-border: 3px;                 /* border & ripple thickness (was 2px) */
  --mwc-ring-outset: 36px;               /* extra space around button for text ring (was ~24px for 80px) */
}

/* Button: keep your top/right as-is; this only enlarges it */
.view-branze .swiper-slide .mwc-play-cta{
  width: var(--mwc-cta-size);
  height: var(--mwc-cta-size);
  border-width: var(--mwc-cta-border);
  overflow: visible;                      /* make sure bigger ring isn't clipped */
}

/* Center icon inside the button */
.view-branze .swiper-slide .mwc-play-cta::before{
  width: var(--mwc-cta-icon);
  height: var(--mwc-cta-icon);
}

/* Ripple ring thickness matches the button border */
.view-branze .swiper-slide .mwc-play-cta::after{
  border-width: var(--mwc-cta-border);
}

/* Circular text ring box grows to avoid clipping as it rotates */
.view-branze .swiper-slide .mwc-play-cta-svg{
  inset: calc(-1 * var(--mwc-ring-outset));
  width: calc(100% + var(--mwc-ring-outset) * 2);
  height: calc(100% + var(--mwc-ring-outset) * 2);
  overflow: visible;                      /* critical on some browsers */
  transform-origin: 50% 50%;
  transform-box: fill-box;
}



/* Focus style for the CTA when tabbed */
.view-branze .swiper-slide .mwc-play-cta:focus-visible {
  outline: 2px solid rgba(255,255,255,0.85);
  outline-offset: 4px;
}

/* Improve tap behavior without hurting swipe */
.view-branze .swiper-slide .mwc-play-cta { touch-action: manipulation; }



