/* Sticky mini-player for homepage story video hero */

.trix-video-pip {
  --pip-red: #dc2626;
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  left: auto !important;
  top: auto !important;
  z-index: 13050 !important;
  width: min(360px, calc(100vw - 32px));
  border-radius: 16px;
  overflow: hidden;
  background: #05070c;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(18px) scale(0.96);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    visibility 0s linear 0.28s;
  font-family: Inter, sans-serif;
}

.trix-video-pip.is-visible {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: none;
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    visibility 0s linear 0s;
}

.trix-video-pip__stage {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  cursor: pointer;
  border: 0;
  padding: 0;
  margin: 0;
  background: #05070c;
  color: inherit;
  text-align: inherit;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.trix-video-pip__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.trix-video-pip__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 55%, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.62) 52%, rgba(0, 0, 0, 0.88) 100%);
}

.trix-video-pip__ui {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 16px 22px;
  pointer-events: none;
}

.trix-video-pip__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: #fff;
  color: #111;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.2;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.trix-video-pip__badge > span {
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: #111;
  flex-shrink: 0;
}

.trix-video-pip__title {
  margin: 10px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: clamp(15px, 3.4vw, 20px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  max-width: 18rem;
}

.trix-video-pip__title em {
  font-style: normal;
  color: var(--pip-red);
}

.trix-video-pip__play {
  position: relative;
  width: 78px;
  height: 78px;
  margin-top: 8px;
  flex-shrink: 0;
  isolation: isolate;
}

.trix-video-pip__play::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 9999px;
  background: radial-gradient(
    circle,
    rgba(220, 38, 38, 0.55) 0%,
    rgba(220, 38, 38, 0.22) 38%,
    rgba(220, 38, 38, 0.06) 62%,
    transparent 72%
  );
  filter: blur(4px);
  z-index: 0;
  animation: trix-pip-aura 2.8s ease-in-out infinite;
}

.trix-video-pip__ring {
  position: absolute;
  border-radius: 9999px;
  pointer-events: none;
}

.trix-video-pip__ring--outer {
  inset: 6px;
  border: 1.5px solid rgba(220, 38, 38, 0.85);
  box-shadow:
    0 0 14px rgba(220, 38, 38, 0.45),
    0 0 28px rgba(220, 38, 38, 0.2);
  animation: trix-pip-ring 2.8s ease-in-out infinite;
  z-index: 1;
}

.trix-video-pip__ring--mid {
  inset: 18px;
  background: radial-gradient(
    circle,
    rgba(40, 6, 10, 0.92) 55%,
    rgba(90, 12, 18, 0.75) 78%,
    rgba(220, 38, 38, 0.15) 100%
  );
  box-shadow:
    0 0 0 1px rgba(220, 38, 38, 0.25),
    inset 0 0 12px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

.trix-video-pip__core {
  position: relative;
  z-index: 3;
  width: 34px;
  height: 34px;
  margin: 22px auto 0;
  border-radius: 9999px;
  background: var(--pip-red);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 18px rgba(185, 28, 28, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.trix-video-pip__core svg {
  width: 12px;
  height: 12px;
  margin-left: 1px;
}

.trix-video-pip__chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0) 100%);
}

.trix-video-pip__chrome-right {
  display: flex;
  align-items: center;
  gap: 2px;
}

.trix-video-pip__btn {
  width: 30px;
  height: 30px;
  border: 0;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.92;
}

.trix-video-pip__btn:hover,
.trix-video-pip__btn:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.trix-video-pip__btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.trix-video-pip__frame {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  background: #000;
}

.trix-video-pip.is-playing .trix-video-pip__frame {
  display: block;
}

.trix-video-pip.is-playing .trix-video-pip__ui,
.trix-video-pip.is-playing .trix-video-pip__overlay,
.trix-video-pip.is-playing .trix-video-pip__progress {
  display: none;
}

.trix-video-pip.is-playing .trix-video-pip__stage {
  cursor: default;
}

.trix-video-pip__frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.trix-video-pip__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  height: 3px;
  background: rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

.trix-video-pip__progress > span {
  display: block;
  height: 100%;
  width: 28%;
  background: #fff;
}

@keyframes trix-pip-aura {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

@keyframes trix-pip-ring {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50% { opacity: 0.65; transform: scale(1.03); }
}

@media (max-width: 767px) {
  .trix-video-pip {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    border-radius: 14px;
  }

  .trix-video-pip__stage {
    aspect-ratio: 16 / 9;
  }

  .trix-video-pip__title {
    font-size: 16px;
  }

  .trix-video-pip__play {
    width: 68px;
    height: 68px;
  }

  .trix-video-pip__core {
    width: 30px;
    height: 30px;
    margin-top: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .trix-video-pip,
  .trix-video-pip.is-visible {
    transition: opacity 0.15s ease, visibility 0s linear 0s;
    transform: none;
  }

  .trix-video-pip__play::before,
  .trix-video-pip__ring--outer {
    animation: none;
  }
}

/* Lecture YouTube dans le bloc hero, sans nouvel onglet */
.pbx-video-hero-wrap.is-inline-playing .pbx-video-hero-content,
.pbx-video-hero-wrap.is-inline-playing .pbx-video-hero-overlay {
  opacity: 0;
  pointer-events: none;
}

.trix-inline-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 8;
  overflow: hidden;
  background: #000;
}

.trix-inline-player[hidden] {
  display: none !important;
}

.pbx-video-hero-wrap.is-inline-playing .trix-inline-player {
  display: block;
}

.trix-inline-player__frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
}

.trix-inline-player iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 177.78%;
  height: 100%;
  min-width: 100%;
  min-height: 56.25vw;
  border: 0;
  display: block;
  max-width: none;
  transform: translate(-50%, -50%);
}

.trix-inline-player__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #fff;
  background: #05070c;
  font-family: Inter, sans-serif;
}

.trix-inline-player__fallback-title {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.trix-inline-player__fallback p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.86);
}

.trix-inline-player__fallback-url {
  color: #f87171 !important;
  font-weight: 700;
}

.trix-inline-player__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 12;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 9999px;
  padding: 0;
  cursor: pointer;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.trix-inline-player__close:hover,
.trix-inline-player__close:focus-visible {
  background: rgba(220, 38, 38, 0.92);
  outline: none;
}

.trix-inline-player__close svg {
  width: 18px;
  height: 18px;
  display: block;
}
