/* SpectraHub V133 · editor/frame, content-page typography and signature isolation fixes. */

/* One editor = one visible outer frame. Every inner Froala/fallback surface is borderless. */
body:is(.spectrahubForum,.spectrahubAdmin) .shXfEditorShell.shXfEditorShell{
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin:7px 0 14px!important;
  border:1px solid #626a72!important;
  border-radius:6px!important;
  outline:0!important;
  box-shadow:none!important;
  background:#383c42!important;
  overflow:visible!important;
}
body:is(.spectrahubForum,.spectrahubAdmin) .shXfEditorShell.shXfEditorShell:focus-within{
  border-color:#72b9ed!important;
  outline:0!important;
  box-shadow:none!important;
}
body:is(.spectrahubForum,.spectrahubAdmin) .shXfEditorShell.shXfEditorShell :is(
  .fr-box,.fr-box.fr-basic,.fr-wrapper,.fr-element,.fr-view,.shXfVisualHost,.shXfBbcodeArea
){
  border:0!important;
  outline:0!important;
  box-shadow:none!important;
  border-radius:0!important;
}
body:is(.spectrahubForum,.spectrahubAdmin) .shXfEditorShell.shXfEditorShell :is(.fr-toolbar,.shXfFallbackTools){
  border:0!important;
  border-bottom:1px solid #56616d!important;
  border-radius:5px 5px 0 0!important;
  outline:0!important;
  box-shadow:none!important;
}
body:is(.spectrahubForum,.spectrahubAdmin) .shXfEditorShell.shXfEditorShell .shXfAttachmentArea{
  border:0!important;
  border-top:1px solid #596169!important;
  border-radius:0 0 5px 5px!important;
  outline:0!important;
  box-shadow:none!important;
}
body:is(.spectrahubForum,.spectrahubAdmin) .shXfEditorShell.shXfEditorShell > .shXfOriginalTextarea{
  display:none!important;
  border:0!important;
}

/* Admin pages containing an editor must remain normal admin pages, never a full grey canvas. */
body.spectrahubAdmin main.wrap.main{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  min-height:0!important;
  background:transparent!important;
}
body.spectrahubAdmin main.wrap.main > :first-child{margin-top:0!important}

/* Forum content pages: readable normal-sized text; headings are visible but not huge. */
body.spectrahubForum .shContentPageForumStyle .shDocumentContent{
  font-size:15px!important;
  line-height:1.68!important;
}
body.spectrahubForum .shDocumentContent :is(h2.bb-heading,h2:not([class]),h3.bb-heading,h3:not([class])){
  margin:15px 0 8px!important;
  line-height:1.35!important;
  letter-spacing:0!important;
}
body.spectrahubForum .shDocumentContent h2.bb-heading,
body.spectrahubForum .shDocumentContent h2:not([class]){
  font-size:16px!important;
  font-weight:750!important;
}
body.spectrahubForum .shDocumentContent h3.bb-heading,
body.spectrahubForum .shDocumentContent h3:not([class]){
  font-size:15px!important;
  font-weight:750!important;
}
body.spectrahubForum .shV111PageHead h1{
  font-size:19px!important;
  line-height:1.3!important;
}

/* [HR] is a plain full-width divider, not a giant block or pseudo heading. */
body.spectrahubForum :is(.shDocumentContent,.shStaticBody,.bbWrapper,.bodyText,.message-body,.postContent) > hr.bb-hr,
body.spectrahubForum hr.bb-hr{
  display:block!important;
  box-sizing:border-box!important;
  width:100%!important;
  max-width:100%!important;
  height:0!important;
  min-height:0!important;
  margin:14px 0!important;
  padding:0!important;
  border:0!important;
  border-top:1px solid rgba(171,187,203,.48)!important;
  background:none!important;
  opacity:1!important;
  clear:both!important;
  float:none!important;
}

/* V138: do not reset signature typography. The profile signature's own BBCode [FONT] must render exactly as saved. */
@media(max-width:700px){
  body.spectrahubForum .shContentPageForumStyle .shDocumentContent{font-size:14px!important;line-height:1.56!important}
  body.spectrahubForum .shV111PageHead h1{font-size:18px!important}
  body.spectrahubForum hr.bb-hr{margin:12px 0!important}
}

/* V134: the older shared cascade still contains ::before/::after outline layers.
   They were the visible "second frame". Keep exactly one real border on the shell. */
body:is(.spectrahubForum,.spectrahubAdmin) .shXfEditorShell.shXfEditorShell::before,
body:is(.spectrahubForum,.spectrahubAdmin) .shXfEditorShell.shXfEditorShell::after{
  content:none!important;
  display:none!important;
  position:static!important;
  inset:auto!important;
  border:0!important;
  outline:0!important;
  box-shadow:none!important;
  pointer-events:none!important;
}
body:is(.spectrahubForum,.spectrahubAdmin) .shXfEditorShell.shXfEditorShell > .fr-box,
body:is(.spectrahubForum,.spectrahubAdmin) .shXfEditorShell.shXfEditorShell > .fr-box.fr-basic,
body:is(.spectrahubForum,.spectrahubAdmin) .shXfEditorShell.shXfEditorShell > .shXfVisualHost,
body:is(.spectrahubForum,.spectrahubAdmin) .shXfEditorShell.shXfEditorShell > .shXfBbcodeArea,
body:is(.spectrahubForum,.spectrahubAdmin) .shXfEditorShell.shXfEditorShell .fr-wrapper{
  border:0!important;outline:0!important;box-shadow:none!important;
}

/* Admin editor forms stay ordinary admin cards; no editor rule may turn the page into a canvas. */
body.spectrahubAdmin:has(.shXfEditorShell),
body.spectrahubAdmin:has(textarea[data-sh-xf-editor]){
  background:#2b3036!important;
  color:#eef2f5!important;
}
body.spectrahubAdmin main.wrap.main{
  position:relative!important;z-index:auto!important;
  display:block!important;visibility:visible!important;opacity:1!important;
}
body.spectrahubAdmin main.wrap.main :is(.pageHead,.formCard,.xfBlock){visibility:visible!important;opacity:1!important;}


/* V135: editor must stay below the fixed admin chrome. Toolbar/dropdown popups
   keep their own high z-index, but the editor frame itself never covers header. */
body.spectrahubAdmin .shXfEditorShell,
body.spectrahubAdmin .shXfEditorShell:focus-within{
  position:relative!important;
  z-index:10!important;
}
body.spectrahubAdmin .shXfEditorShell .fr-toolbar{z-index:12!important}
body.spectrahubAdmin .shAdminTop{z-index:20000!important}
body.spectrahubAdmin .shAdminSide{z-index:19000!important}
body.spectrahubAdmin .shAdminOverlay{z-index:18990!important}
/* Real editor popups and full-screen dialogs still need to be above the admin chrome. */
body.spectrahubAdmin > .fr-popup,
body.spectrahubAdmin .sh94Overlay,
body.spectrahubAdmin .shOwnImageLibraryBackdrop{z-index:2147483000!important}
