/* Sessão Gooner v1.7.32 — HQS custom player (player/hqs-player.css + hqs-overlay-dropin.js, same as /privado/)
 * on the PUBLIC catalog for logged-in users:
 *   - inline on /videos/v/<code>/  (#hqs-overlay.sg-hqs-inline — in page flow, never fixed/overlaying the page)
 *   - modal on /videos/            (#hqs-modal-shell.sg-hqs-shell--videos — same modal as /privado/)
 * Loaded after hqs-player.css. Nothing here positions anything over the player: notice/share bar are in flow,
 * the poster button is removed from the DOM on tap, the fallback iframe hides the HQS chrome. */

/* ---------- modal shell (rules shared with assets/privado.css, which is not loaded on /videos/) ---------- */
.sg-hqs-shell[hidden],
#hqs-modal-shell[hidden],
#hqs-modal-shell:not(.is-open) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
#hqs-modal-shell.is-open {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
#hqs-modal-shell.is-open #hqs-overlay,
#hqs-overlay.hqs-open:not(.sg-hqs-inline) {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: center;
  justify-content: center;
  pointer-events: auto !important;
}
body.hqs-noscroll {
  overflow: hidden !important;
}

/* ---------- fallback iframe (vidara.to/e | voe.sx/e) inside the HQS frame ---------- */
#hqs-fs-root .sg-hqs-embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  z-index: 50;
}
#hqs-fs-root:has(.sg-hqs-embed:not([hidden])) {
  aspect-ratio: 16 / 9;
}
/* HQS chrome must never sit on top of the provider iframe (would eat taps). */
#hqs-fs-root:has(.sg-hqs-embed:not([hidden])) #hqs-exact-ui,
#hqs-fs-root:has(.sg-hqs-embed:not([hidden])) .hqs-p {
  display: none !important;
}

/* ---------- /videos/ modal extras: notice + share bar (in flow, above the video) ---------- */
.sg-hqs-shell--videos .sg-hqs-extras {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
}
.sg-hqs-shell--videos .sg-hqs-extras .sg-single__notice {
  margin: 0;
}
/* v1.7.34/1.7.35: hqs-boot hides the "sem anúncio" notice only when a video ends up on a provider iframe (host ads). */
.sg-single__notice[hidden] {
  display: none !important;
}
.sg-hqs-shell--videos .sg-hqs-extras .sg-sharebar {
  padding: 0;
  background: none;
  border: 0;
}
.sg-hqs-shell--videos .sg-hqs-extras .sg-share-btn {
  min-height: 2rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
}
/* keep the whole 16:9 frame (and its control bar) inside the stage */
.sg-hqs-shell--videos #hqs-fs-root.hqs-exact-host,
.sg-hqs-shell--videos #hqs-fs-root:has(.hqs-p) {
  max-height: min(720px, calc(92vh - 190px)) !important;
}
.sg-hqs-shell--videos #hqs-fs-root:fullscreen,
.sg-hqs-shell--videos #hqs-fs-root:-webkit-full-screen {
  max-height: none !important;
}
@media (max-height: 560px) {
  /* phone landscape: all height goes to the video */
  .sg-hqs-shell--videos .sg-hqs-extras {
    display: none;
  }
  .sg-hqs-shell--videos #hqs-fs-root.hqs-exact-host,
  .sg-hqs-shell--videos #hqs-fs-root:has(.hqs-p) {
    max-height: calc(92vh - 70px) !important;
  }
}
/* "Link copiado" toast above the fixed player shell (pointer-events:none in videos.css) */
body .sg-toast {
  z-index: 2147483647;
}

/* ---------- inline player on the permalink page ---------- */
.sg-single__hqs {
  position: relative;
  width: 100%;
}
body #hqs-overlay.sg-hqs-inline {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  z-index: auto !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  transform: none !important;
}
body #hqs-overlay.sg-hqs-inline[hidden] {
  display: none !important;
}
body #hqs-overlay.sg-hqs-inline .hqs-stage,
body #hqs-overlay.sg-hqs-inline.hqs-open .hqs-stage {
  width: 100% !important;
  max-height: none !important;
  overflow: visible !important;
  padding: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
}
body #hqs-overlay.sg-hqs-inline #hqs-fs-root {
  width: 100% !important;
  aspect-ratio: 16 / 9;
  border-radius: 14px !important;
  border: 1px solid rgba(232, 213, 181, 0.14);
  box-sizing: border-box;
}
body #hqs-overlay.sg-hqs-inline #hqs-fs-root:fullscreen,
body #hqs-overlay.sg-hqs-inline #hqs-fs-root:-webkit-full-screen {
  border: 0;
  border-radius: 0 !important;
  aspect-ratio: auto;
  max-height: none !important;
}
/* no modal to close inline */
body #hqs-overlay.sg-hqs-inline #hqs-exact-ui .hqs-p__x {
  display: none !important;
}
body #hqs-overlay.sg-hqs-inline #hqs-status {
  font-size: 0.78rem;
  margin-top: 0.4rem;
  color: var(--sg-muted, #9a8f84);
}

/* poster (click-to-play); removed from the DOM on tap */
.sg-single__start {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(232, 213, 181, 0.14);
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  font: inherit;
  color: #fff;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}
.sg-single__start img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.78);
  pointer-events: none;
}
.sg-single__start-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(196, 122, 132, 0.94);
  color: #140f0d;
  font-size: 1.5rem;
  pointer-events: none;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
.sg-single__start .sg-vcard__dur {
  pointer-events: none;
}
.sg-single__start:hover .sg-single__start-play,
.sg-single__start:focus-visible .sg-single__start-play {
  background: #d38b95;
}
.sg-single__start:focus-visible {
  outline: 2px solid var(--sg-gold, #c4a574);
  outline-offset: 2px;
}
.sg-single__hqs.is-started .sg-single__start {
  display: none !important;
}

/* Inline + phone: the HQS menu is a position:fixed bottom sheet with a fixed scrim (1.7.27). Inline there is no
 * black modal behind it, so lift the player above the sticky site nav (z 10050) only while the menu is open
 * (scrim then catches the "tap outside to close" instead of the nav links) and make the sheet opaque. */
body #hqs-overlay.sg-hqs-inline #hqs-fs-root:has(.hqs-p.menu-open) {
  z-index: 100000 !important;
}
@media (max-width: 640px), (pointer: coarse) and (max-height: 500px) {
  body #hqs-overlay.sg-hqs-inline #hqs-fs-root .hqs-p .hqs-p__menu {
    background: rgba(16, 13, 12, 0.97) !important;
  }
  body #hqs-overlay.sg-hqs-inline #hqs-fs-root .hqs-p.menu-open .hqs-p__scrim {
    background: rgba(0, 0, 0, 0.55) !important;
  }
}

/* Fallback iframe in the /videos/ modal: HQS chrome (with its ×) is hidden, so bring back the plain modal bar
 * (title · Tela cheia · Fechar) that hqs-player.css hides while the chrome exists. */
#hqs-modal-shell #hqs-overlay:has(.sg-hqs-embed:not([hidden])) .hqs-stage > .hqs-bar {
  display: flex !important;
  height: auto !important;
  width: auto !important;
  margin: 0 0 0.6rem !important;
  overflow: visible !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
