/* =========================================================================
   WAC YT Consent – Frontend Styles
   ========================================================================= */

/* ── Wrapper ── */
.wac-yt-wrapper {
  display: block;
}

/* ── Ratio container ── */
.wac-yt-consent {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #111;
  cursor: default;
}

.wac-yt-consent[data-ratio="16-9"] {
  padding-bottom: 56.25%;
}

.wac-yt-consent[data-ratio="4-3"] {
  padding-bottom: 75%;
}

.wac-yt-consent[data-ratio="1-1"] {
  padding-bottom: 100%;
}

/* Show pointer cursor when consented and no video is playing */
.wac-yt-consent.wac-yt-consented:not(.wac-yt-playing) {
  cursor: pointer;
}

/* ── Thumbnail (always visible while no video is playing) ── */
.wac-yt-thumbnail {
  position: absolute;
  inset: 0;
  background: #111;
}

.wac-yt-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wac-yt-consent.wac-yt-playing .wac-yt-thumbnail {
  display: none;
}

/* ── Play button (always visible above thumbnail) ── */
.wac-yt-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.50);
  border-radius: 50%;
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  pointer-events: none;
  /* clicks pass through to container */
  transition: background 0.18s ease, transform 0.18s ease;
  z-index: 2;
}

/* Normalise icon size + force color (Elementor SVGs override color otherwise) */
.wac-yt-play-btn svg,
.wac-yt-play-btn i {
  width: 1.4rem;
  height: 1.4rem;
  font-size: 1.4rem;
  display: block;
  flex-shrink: 0;
  margin-left: 0.15rem;
  /* optical centering of the play triangle */
  color: #fff;
}

.wac-yt-play-btn svg {
  fill: currentColor;
}

.wac-yt-play-btn i::before {
  color: #fff;
}

/* Hover effect on play button: only when consented (no overlay on top) */
.wac-yt-consent.wac-yt-consented:hover .wac-yt-play-btn {
  background: rgba(0, 0, 0, 0.78);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Hide play button while video is playing */
.wac-yt-consent.wac-yt-playing .wac-yt-play-btn {
  display: none;
}

/* ── Consent overlay: full area, visible on hover only when no consent ── */
.wac-yt-consent-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Hidden: opacity 0 + pointer-events none */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 3;
}

/* Show on hover – as long as no consent has been given */
.wac-yt-consent:not(.wac-yt-consented):hover .wac-yt-consent-overlay,
/* Touch fallback: shown via JS class */
.wac-yt-consent:not(.wac-yt-consented).wac-yt-show-consent .wac-yt-consent-overlay {
  opacity: 1;
  pointer-events: all;
}

/* After consent: remove overlay entirely */
.wac-yt-consent.wac-yt-consented .wac-yt-consent-overlay {
  display: none;
}

/* ── Consent content (text + button) ── */
.wac-yt-consent-inner {
  display: flex;
  flex-direction: column;
  text-align: center;
  color: #fff;
  padding: 1.5rem 2rem;
  max-width: min(440px, 90%);
  max-height: 100%;
  overflow: hidden;
}

.wac-yt-consent-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  mask-image: linear-gradient(to bottom, #000 calc(100% - 1.25rem), transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.25rem), transparent);
}

.wac-yt-consent-content::-webkit-scrollbar { width: 4px; }
.wac-yt-consent-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.wac-yt-text {
  font-size: 0.875rem;
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

/* Privacy notice: smaller font, visually offset */
.wac-yt-privacy-note {
  font-size: 0.78rem;
  margin: 0 0 1.1rem;
  line-height: 1.45;
  opacity: 0.9;
}

/* Centre all paragraphs in the overlay – !important required because
   Elementor/theme p { text-align: left } can load with higher specificity. */
.wac-yt-consent-inner p {
  text-align: center !important;
}

/* Link color: !important prevents both browser visited-color and Elementor
   global link styles from overriding. The Elementor control (button_bg_color)
   also uses !important and therefore still wins. */
.wac-yt-privacy-note a,
.wac-yt-privacy-note a:link,
.wac-yt-privacy-note a:visited {
  font-weight: bold !important;
  color: #fff !important;
  text-decoration: underline;
}

.wac-yt-privacy-note a:hover {
  text-decoration: none;
  font-weight: bold !important;
  color: #009DD4 !important;
}

/* ── Consent button ── */
.wac-yt-btn {
  display: block;
  margin: 0 auto;
  width: fit-content;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 0.65rem 2rem;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, border-color 0.15s ease;
}

/* More specific selector to prevent Elementor Kit styles from overriding font-size */
.wac-yt-consent-overlay .wac-yt-btn {
  font-size: 0.6875rem !important;
  flex: 0 0 auto;
  margin-top: 0.5rem;
}

@media (max-width: 767px) {
  .wac-yt-consent-inner {
    padding: 0.85rem 1rem;
    max-width: 100%;
  }

  .wac-yt-text {
    font-size: 0.78rem;
    line-height: 1.35;
    margin: 0 0 0.45rem;
  }

  .wac-yt-privacy-note {
    font-size: 0.68rem;
    line-height: 1.3;
    margin: 0 0 0.65rem;
  }

  .wac-yt-consent-overlay .wac-yt-btn {
    padding-top: 0.55rem !important;
    padding-bottom: 0.55rem !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }
}

@media (max-width: 360px) {
  .wac-yt-text         { font-size: 0.72rem; }
  .wac-yt-privacy-note { font-size: 0.62rem; }
}

.wac-yt-btn:hover,
.wac-yt-btn:focus-visible {
  background: rgba(255, 255, 255, 0.28);
  border-color: #fff;
  outline: none;
}

/* ── Video container ── */
.wac-yt-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* keeps overlay clickable while empty */
}

.wac-yt-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  pointer-events: all;
}

/* ── Error notice (no valid URL) ── */
.wac-yt-no-video {
  padding: 1rem;
  background: #f5f5f5;
  color: #666;
  font-size: 0.875rem;
  text-align: center;
}

/* ── Revoke link (small text below the video) ── */
.wac-yt-revoke-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.35rem;
}

.wac-yt-revoke-wrapper[hidden] {
  display: none;
}

.wac-yt-revoke {
  color: var(--e-global-color-text, #888);
  font-size: 0.72rem;
  cursor: pointer;
  text-decoration: underline;
  opacity: 0.55;
  font-family: inherit;
  background: none;
  border: none;
  padding: 0;
  line-height: 1.4;
}

.wac-yt-revoke:hover,
.wac-yt-revoke:focus-visible {
  opacity: 1;
  outline: none;
}

/* =========================================================================
   Lightbox
   ========================================================================= */

#wac-yt-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#wac-yt-lightbox[hidden] {
  display: none;
}

.wac-yt-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

.wac-yt-lb-content {
  position: relative;
  z-index: 1;
  width: 90vw;
  max-width: 1200px;
}

/* Close button: top-right of viewport, inside the fixed overlay */
.wac-yt-lb-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 2;
  background: none !important;
  border: none;
  color: #fff;
  font-size: 2.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  opacity: 0.85;
  font-family: inherit;
}

.wac-yt-lb-close:hover,
.wac-yt-lb-close:focus-visible {
  opacity: 1;
  outline: none;
}

.wac-yt-lb-iframe-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  /* lightbox always 16:9 */
  height: 0;
  background: #000;
}

.wac-yt-lb-iframe-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}