/* ── Hulu Accessibility Widget — fully isolated, no site overrides unless body classes active ── */

#hulu-a11y-widget,
#hulu-a11y-widget *,
#hulu-a11y-widget *::before,
#hulu-a11y-widget *::after {
  box-sizing: border-box;
  font-family: 'Heebo', ui-sans-serif, system-ui, sans-serif;
}

#hulu-a11y-widget {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99999;
  direction: rtl;
}

#hulu-a11y-widget [data-a11y-interactive] {
  pointer-events: auto;
}

/* ── Floating trigger button ── */
#hulu-a11y-widget .hulu-a11y-fab {
  position: fixed;
  bottom: 1.5rem;
  inset-inline-end: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border: none;
  border-radius: 9999px;
  background: #1e3a5f;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.22);
  transition:
    transform 0.2s ease,
    opacity 0.25s ease,
    width 0.25s ease,
    height 0.25s ease;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

#hulu-a11y-widget .hulu-a11y-fab:hover {
  transform: scale(1.05);
}

#hulu-a11y-widget .hulu-a11y-fab:focus-visible {
  outline: 3px solid #d4af37;
  outline-offset: 3px;
}

#hulu-a11y-widget .hulu-a11y-fab svg {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

#hulu-a11y-widget .hulu-a11y-fab.is-minimized {
  width: 2.75rem;
  height: 2.75rem;
  opacity: 0.72;
  inset-inline-end: 0.35rem;
}

#hulu-a11y-widget .hulu-a11y-fab.is-dragging {
  transition: none;
  opacity: 0.92;
}

@media (max-width: 480px) {
  #hulu-a11y-widget .hulu-a11y-fab {
    width: 2.75rem;
    height: 2.75rem;
    bottom: 5.75rem;
    inset-inline-end: 0.75rem;
  }

  #hulu-a11y-widget .hulu-a11y-fab svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  #hulu-a11y-widget .hulu-a11y-fab.is-minimized {
    width: 2.25rem;
    height: 2.25rem;
    bottom: 5.25rem;
    inset-inline-end: 0.25rem;
  }
}

/* ── Backdrop ── */
#hulu-a11y-widget .hulu-a11y-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.45);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease;
}

#hulu-a11y-widget .hulu-a11y-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

/* ── Panel (desktop: side card) ── */
#hulu-a11y-widget .hulu-a11y-panel {
  position: fixed;
  inset-inline-end: 1.25rem;
  bottom: 5.5rem;
  width: min(20rem, calc(100vw - 2rem));
  max-height: min(32rem, calc(100vh - 7rem));
  background: #fff;
  color: #111;
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.97);
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease,
    transform 0.28s ease;
}

#hulu-a11y-widget .hulu-a11y-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ── Panel header ── */
#hulu-a11y-widget .hulu-a11y-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

#hulu-a11y-widget .hulu-a11y-panel-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e3a5f;
}

#hulu-a11y-widget .hulu-a11y-close {
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 9999px;
  background: #f3f4f6;
  color: #111;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

#hulu-a11y-widget .hulu-a11y-close:hover {
  background: #e5e7eb;
}

#hulu-a11y-widget .hulu-a11y-close:focus-visible {
  outline: 3px solid #1e3a5f;
  outline-offset: 2px;
}

#hulu-a11y-widget .hulu-a11y-close svg {
  width: 1.35rem;
  height: 1.35rem;
}

/* ── Panel body ── */
#hulu-a11y-widget .hulu-a11y-panel-body {
  padding: 0.75rem 1rem 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

#hulu-a11y-widget .hulu-a11y-hint {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #666;
  display: none;
}

#hulu-a11y-widget .hulu-a11y-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #f0f0f0;
}

#hulu-a11y-widget .hulu-a11y-option:last-of-type {
  border-bottom: none;
}

#hulu-a11y-widget .hulu-a11y-option-label {
  font-size: 0.92rem;
  line-height: 1.4;
  color: #222;
}

#hulu-a11y-widget .hulu-a11y-toggle {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  border: none;
  border-radius: 9999px;
  background: #d1d5db;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

#hulu-a11y-widget .hulu-a11y-toggle[aria-pressed='true'] {
  background: #1e3a5f;
}

#hulu-a11y-widget .hulu-a11y-toggle::after {
  content: '';
  position: absolute;
  top: 0.15rem;
  inset-inline-start: 0.15rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);
  transition: transform 0.2s ease;
}

#hulu-a11y-widget .hulu-a11y-toggle[aria-pressed='true']::after {
  inset-inline-start: calc(100% - 1.35rem);
  transform: none;
}

#hulu-a11y-widget .hulu-a11y-btn-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

#hulu-a11y-widget .hulu-a11y-action {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  background: #fafafa;
  color: #222;
  font-size: 0.85rem;
  padding: 0.55rem 0.5rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

#hulu-a11y-widget .hulu-a11y-action:hover {
  background: #f0f0f0;
}

#hulu-a11y-widget .hulu-a11y-action.is-active {
  background: #1e3a5f;
  border-color: #1e3a5f;
  color: #fff;
}

#hulu-a11y-widget .hulu-a11y-reset {
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.65rem;
  border: none;
  border-radius: 0.5rem;
  background: #7a1c2e;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

#hulu-a11y-widget .hulu-a11y-reset:hover {
  background: #651525;
}

/* ── Mobile bottom sheet (≤768px) ── */
@media (max-width: 768px) {
  #hulu-a11y-widget .hulu-a11y-panel {
    inset-inline: 0;
    inset-inline-end: 0;
    bottom: 0;
    width: 100%;
    max-height: 68vh;
    border-radius: 1.25rem 1.25rem 0 0;
    transform: translateY(100%);
  }

  #hulu-a11y-widget .hulu-a11y-panel.is-open {
    transform: translateY(0);
  }

  #hulu-a11y-widget .hulu-a11y-panel-header {
    padding: 1.1rem 1.15rem 0.85rem;
  }

  #hulu-a11y-widget .hulu-a11y-panel-title {
    font-size: 1.15rem;
  }

  #hulu-a11y-widget .hulu-a11y-close {
    width: 3.25rem;
    height: 3.25rem;
  }

  #hulu-a11y-widget .hulu-a11y-close svg {
    width: 1.5rem;
    height: 1.5rem;
  }

  #hulu-a11y-widget .hulu-a11y-panel-body {
    padding: 0.85rem 1.15rem 1.25rem;
    max-height: calc(68vh - 4.5rem);
  }

  #hulu-a11y-widget .hulu-a11y-option {
    padding: 0.85rem 0;
  }

  #hulu-a11y-widget .hulu-a11y-option-label {
    font-size: 1rem;
  }

  #hulu-a11y-widget .hulu-a11y-hint {
    display: block;
    font-size: 0.82rem;
  }
}

/* ── Site adjustments — ONLY when body classes are set by the widget ── */

body.a11y-light-bg {
  background-color: #f2ede6 !important;
}

html:has(body.a11y-light-bg) {
  background-color: #f2ede6 !important;
  background-image: none !important;
}

body.a11y-light-bg.dark,
body.a11y-light-bg .dark {
  color-scheme: light;
}

body.a11y-light-bg .dark\:text-white,
body.a11y-light-bg .dark\:text-white\/70,
body.a11y-light-bg .dark\:text-white\/80 {
  color: #1f1f1f !important;
}

body.a11y-light-bg .dark\:bg-black\/30,
body.a11y-light-bg .dark\:bg-black\/50,
body.a11y-light-bg .dark\:bg-black\/80 {
  background-color: rgb(255 252 247 / 0.88) !important;
}

body.a11y-light-bg .dark\:bg-white\/5,
body.a11y-light-bg .dark\:bg-white\/10 {
  background-color: rgb(255 252 247 / 0.92) !important;
}

body.a11y-light-bg .dark\:border-white\/10,
body.a11y-light-bg .dark\:border-white\/20 {
  border-color: rgb(0 0 0 / 0.08) !important;
}

body.a11y-light-bg .dark\:hover\:bg-white\/10:hover {
  background-color: rgb(0 0 0 / 0.04) !important;
}

body.a11y-light-bg .hero-gradient {
  background: linear-gradient(180deg, #faf8f5 0%, #f5f0ea 55%, #ede8df 100%) !important;
}

body.a11y-font-lg {
  font-size: 106%;
}

body.a11y-font-xl {
  font-size: 112%;
}

body.a11y-high-contrast {
  filter: contrast(1.12);
}

body.a11y-highlight-links #root a {
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

body.a11y-stop-animations *,
body.a11y-stop-animations *::before,
body.a11y-stop-animations *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}
