/* Mahiru Pre-roll Ads V1 — overlay on article content video shells */

.mh-preroll-shell,
.wp-block-video.mh-preroll-active,
.wp-video.mh-preroll-active,
.rsfv-video-wrapper.mh-preroll-active,
.rsfv-shortcode-wrapper.mh-preroll-active,
.mejs-container.mh-preroll-active {
  position: relative;
}

.mh-preroll-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.92);
  box-sizing: border-box;
  padding: 8px;
  overflow: hidden;
}

.mh-preroll-frame-wrap {
  --mh-preroll-aw: 16;
  --mh-preroll-ah: 9;
  width: min(100%, 100%);
  max-width: 100%;
  aspect-ratio: var(--mh-preroll-aw) / var(--mh-preroll-ah);
  max-height: calc(100% - 52px);
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.mh-preroll-iframe,
.mh-preroll-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #111;
  object-fit: contain;
}

.mh-preroll-chrome {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
}

.mh-preroll-badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  padding: 4px 8px;
}

.mh-preroll-countdown {
  font-size: 12px;
  color: #f0f0f0;
  margin-right: auto;
}

.mh-preroll-skip {
  pointer-events: auto;
  margin-left: auto;
  min-width: 72px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(20, 20, 24, 0.92);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.mh-preroll-skip:disabled,
.mh-preroll-skip[hidden] {
  display: none;
}

.mh-preroll-skip:not([hidden]):not(:disabled):hover,
.mh-preroll-skip:not([hidden]):not(:disabled):focus-visible {
  background: rgba(40, 40, 48, 0.95);
}

.mh-preroll-headline {
  margin: 0 0 8px;
  padding: 0 8px;
  text-align: center;
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  font-weight: 700;
  color: #fff;
  max-width: 100%;
}

.mh-preroll-cta {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  margin-left: auto;
  margin-right: 8px;
  border-radius: 6px;
  background: var(--mh-pink, #d85f93);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  max-width: 55%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mh-preroll-resume {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}

.mh-preroll-resume-btn {
  min-width: min(80%, 280px);
  min-height: 56px;
  padding: 14px 28px;
  border: 0;
  border-radius: 10px;
  background: var(--mh-pink, #d85f93);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 640px) {
  .mh-preroll-overlay {
    padding: 4px;
  }
  .mh-preroll-frame-wrap {
    max-height: calc(100% - 48px);
  }
  .mh-preroll-skip,
  .mh-preroll-cta {
    min-height: 44px;
  }
  .mh-preroll-cta {
    max-width: 42%;
    font-size: 12px;
  }
}
