/**
 * Classic post editor — Yoast SEO + page builder (Brizy/Breezy) light compat.
 * No adaptive JS; static dark surfaces + input safety only.
 *
 * @package YOOAdmin_Studio_Hub
 */

/* Pointer-events safety only — colors live in studio-hub-classic-editor-dark.css */

html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  :is(#post-body-content, #poststuff, #titlediv, #postdivrich),
html.yooadmin-studio-hub-html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  :is(#post-body-content, #poststuff, #titlediv, #postdivrich) {
  pointer-events: auto !important;
}

/* Yoast metabox (React) — typing only; no z-index (was painting over SiteOrigin modals). */
html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  :is(#wpseo_meta, #wpseo-metabox-root, .wpseo-metabox-content, .wpseo-meta-section-react),
html.yooadmin-studio-hub-html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  :is(#wpseo_meta, #wpseo-metabox-root, .wpseo-metabox-content, .wpseo-meta-section-react) {
  pointer-events: auto !important;
}

html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  :is(
    #wpseo-metabox-root input,
    #wpseo-metabox-root textarea,
    #wpseo-metabox-root select,
    #wpseo-metabox-root [contenteditable="true"],
    .wpseo-metabox-content input,
    .wpseo-metabox-content textarea
  ),
html.yooadmin-studio-hub-html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  :is(
    #wpseo-metabox-root input,
    #wpseo-metabox-root textarea,
    #wpseo-metabox-root select,
    #wpseo-metabox-root [contenteditable="true"],
    .wpseo-metabox-content input,
    .wpseo-metabox-content textarea
  ) {
  pointer-events: auto !important;
}

/* Page builder inline (not modals). */
html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  :is([id^="brz-"], [class*="brz-root"], #breezy-editor, .breezy-editor, [class*="breezy-editor"], #so-panels-panels, .siteorigin-panels-builder),
html.yooadmin-studio-hub-html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  :is([id^="brz-"], [class*="brz-root"], #breezy-editor, .breezy-editor, [class*="breezy-editor"], #so-panels-panels, .siteorigin-panels-builder) {
  pointer-events: auto !important;
}

/* SiteOrigin modals — overlay click-through (do not override position). */
html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat:has(.so-panels-dialog)
  .so-overlay,
html.yooadmin-studio-hub-html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat:has(.so-panels-dialog)
  .so-overlay {
  z-index: 100049 !important;
  pointer-events: none !important;
}

html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat:has(.so-panels-dialog)
  .so-panels-dialog
  :is(.so-content, .so-title-bar, .so-left-sidebar, .so-right-sidebar, .so-toolbar),
html.yooadmin-studio-hub-html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat:has(.so-panels-dialog)
  .so-panels-dialog
  :is(.so-content, .so-title-bar, .so-left-sidebar, .so-right-sidebar, .so-toolbar) {
  z-index: 100052 !important;
  pointer-events: auto !important;
}

/* Add Widget — div.widget-type-wrapper (not a.so-widget) */
html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  .so-panels-dialog
  .widget-type-wrapper,
html.yooadmin-studio-hub-html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  .so-panels-dialog
  .widget-type-wrapper {
  display: block !important;
  background: #22262e !important;
  background-color: #22262e !important;
  color: #cfd6e0 !important;
  -webkit-text-fill-color: #cfd6e0 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  box-shadow: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  .so-panels-dialog
  .widget-type-wrapper
  :is(h3, small, span, p, .widget-icon),
html.yooadmin-studio-hub-html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  .so-panels-dialog
  .widget-type-wrapper
  :is(h3, small, span, p, .widget-icon) {
  color: #cfd6e0 !important;
  -webkit-text-fill-color: #cfd6e0 !important;
  opacity: 1 !important;
}

html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  .so-panels-dialog
  :is(.widget-type-list, .widget-type),
html.yooadmin-studio-hub-html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  .so-panels-dialog
  :is(.widget-type-list, .widget-type) {
  pointer-events: auto !important;
  opacity: 1 !important;
}

/* Edit Widget — a.so-widget inside .so-widgets */
html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  .so-panels-dialog
  .so-widgets
  :is(a.so-widget, a[class*="widget"]),
html.yooadmin-studio-hub-html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  .so-panels-dialog
  .so-widgets
  :is(a.so-widget, a[class*="widget"]) {
  display: block !important;
  background: #22262e !important;
  background-color: #22262e !important;
  color: #cfd6e0 !important;
  -webkit-text-fill-color: #cfd6e0 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  text-decoration: none !important;
}

html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  .so-panels-dialog
  .so-widgets
  :is(a.so-widget, a[class*="widget"])
  :is(h3, small, span, p),
html.yooadmin-studio-hub-html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  .so-panels-dialog
  .so-widgets
  :is(a.so-widget, a[class*="widget"])
  :is(h3, small, span, p) {
  color: #cfd6e0 !important;
  -webkit-text-fill-color: #cfd6e0 !important;
}

html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat:has(.so-panels-dialog)
  #wpseo_meta,
html.yooadmin-studio-hub-html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat:has(.so-panels-dialog)
  #wpseo_meta {
  z-index: auto !important;
  pointer-events: none !important;
}

html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  :is([id^="brz-"] iframe, #breezy-editor iframe, .breezy-editor iframe),
html.yooadmin-studio-hub-html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  :is([id^="brz-"] iframe, #breezy-editor iframe, .breezy-editor iframe) {
  pointer-events: auto !important;
}

/* Title + classic TinyMCE */
html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  :is(#title, .wp-editor-area, textarea.wp-editor-area),
html.yooadmin-studio-hub-html:is([data-yooadmin-studio-color-mode-effective="dark"], .is-dark-theme)
  body.ysh-classic-editor-light-compat
  :is(#title, .wp-editor-area, textarea.wp-editor-area) {
  pointer-events: auto !important;
  background-color: #1a1d23 !important;
  color: #cfd6e0 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}
