/* BastionGuard Community | SCEditor UI: adapted to the existing navy / teal theme. */
body.bbpress main.bsg-aurora-page .sceditor-container {
  --bsg-ed-bg:#ffffff; --bsg-ed-bar:#ffffff; --bsg-ed-border:rgba(8,107,235,0.6); --bsg-ed-cyan:#086beb;
  display:flex!important; flex-direction:column!important; width:100%!important; min-width:0!important; max-width:100%!important;
  background:var(--bsg-ed-bg)!important; color:#121f32!important;
  border:1px solid var(--bsg-ed-border)!important; border-radius:12px!important;
  box-shadow:0 8px 25px rgba(10,45,90,0.06)!important; overflow:hidden!important;
  font-family:inherit!important;
}
body.bbpress main.bsg-aurora-page .sceditor-container:focus-within {
  border-color:rgba(8,107,235,0.6)!important; box-shadow:0 0 0 3px rgba(8,107,235,0.12)!important;
}
body.bbpress main.bsg-aurora-page .sceditor-toolbar {
  display:flex!important; flex-flow:row wrap!important; align-items:center!important;
  gap:3px!important; min-width:0!important; padding:9px!important;
  background:linear-gradient(135deg,#086beb,#ffffff)!important;
  border:0!important; border-bottom:1px solid rgba(8,107,235,0.43)!important;
}
body.bbpress main.bsg-aurora-page .sceditor-group {
  display:inline-flex!important; align-items:center!important; flex-flow:row wrap!important;
  margin:0 5px 0 0!important; padding:1px 5px 1px 0!important;
  border:0!important; border-right:1px solid rgba(8,107,235,0.24)!important;
  background:transparent!important; box-shadow:none!important; border-radius:0!important;
}
body.bbpress main.bsg-aurora-page .sceditor-button {
  display:inline-flex!important; align-items:center!important; justify-content:center!important;
  min-height:31px!important; min-width:31px!important; margin:1px!important;
  padding:4px!important; border:1px solid transparent!important; border-radius:6px!important;
  background:transparent!important; color:#121f32!important; text-decoration:none!important;
  box-shadow:none!important; opacity:1!important;
}
body.bbpress main.bsg-aurora-page .sceditor-button:hover,
body.bbpress main.bsg-aurora-page .sceditor-button:focus-visible,
body.bbpress main.bsg-aurora-page .sceditor-button.active {
  border-color:rgba(8,107,235,0.54)!important; background:#086beb!important;
  outline:none!important;
}
body.bbpress main.bsg-aurora-page .sceditor-button.disabled {opacity:.35!important;pointer-events:none!important;}
body.bbpress main.bsg-aurora-page .sceditor-button div {filter:brightness(1.5) saturate(.9)!important;}
body.bbpress main.bsg-aurora-page .sceditor-container iframe,
body.bbpress main.bsg-aurora-page .sceditor-container textarea {
  display:block; background:#ffffff!important; color:#121f32!important; width:100%!important;
  min-height:150px!important; max-width:100%!important; border:none!important;
  border-radius:0!important; font-size:15px!important; line-height:1.65!important;
  box-shadow:none!important; padding:12px!important;
}
body.bbpress main.bsg-aurora-page .sceditor-container iframe {padding:0!important;}
body.bbpress main.bsg-aurora-page .sceditor-grip {background:#086beb!important;border-top:1px solid rgba(8,107,235,0.6)!important;}
body.bbpress main.bsg-aurora-page .sceditor-dropdown {
  background:#ffffff!important;color:#121f32!important;border:1px solid rgba(8,107,235,0.6)!important;
  border-radius:8px!important;box-shadow:0 12px 36px rgba(10,45,90,0.135)!important;
}
body.bbpress main.bsg-aurora-page .sceditor-dropdown input,
body.bbpress main.bsg-aurora-page .sceditor-dropdown select {
  background:#ffffff!important;color:#121f32!important;border:1px solid rgba(8,107,235,0.6)!important;
  border-radius:6px!important;padding:6px!important;
}
body.bbpress main.bsg-aurora-page .sceditor-dropdown .button,
body.bbpress main.bsg-aurora-page .sceditor-dropdown input[type="button"] {
  background:#0b73f0!important;color:#ffffff!important;font-weight:750!important;
  border:0!important;border-radius:7px!important;
}
/* Hide only the legacy Markdown toolbar on bbPress composer forms. */
body.bbpress main.bsg-aurora-page #new-post .bg-md-toolbar,
body.bbpress main.bsg-aurora-page #new-post .bbp-md-toolbar,
body.bbpress main.bsg-aurora-page #new-post .md-toolbar {display:none!important;}
@media(max-width:600px) {
  body.bbpress main.bsg-aurora-page .sceditor-toolbar {gap:1px!important;padding:6px!important;}
  body.bbpress main.bsg-aurora-page .sceditor-group {margin-right:3px!important;padding-right:3px!important;}
  body.bbpress main.bsg-aurora-page .sceditor-button {min-width:32px!important;min-height:32px!important;}
  body.bbpress main.bsg-aurora-page .sceditor-container textarea {min-height:150px!important;}
}

/* BastionGuard 1.10.13: solid-white SVG toolbar icons with a unified control layout. */
body.bbpress main.bsg-aurora-page .sceditor-toolbar {
  padding: 9px 10px !important;
  gap: 5px !important;
  align-items: center !important;
  background: #ffffff !important;
}
body.bbpress main.bsg-aurora-page .sceditor-group {
  display: inline-flex !important;
  gap: 3px !important;
  padding: 0 8px 0 0 !important;
  margin: 0 3px 0 0 !important;
  min-height: 37px !important;
  border-right: 1px solid rgba(8,107,235,0.2) !important;
  align-items: center !important;
}
body.bbpress main.bsg-aurora-page .sceditor-group:last-child {
  border-right: 0 !important;
  padding-right: 0 !important;
}
body.bbpress main.bsg-aurora-page .sceditor-button {
  flex: 0 0 36px !important;
  box-sizing: border-box !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
  background: rgba(8,107,235,0.72) !important;
  border: 1px solid rgba(8,107,235,0.17) !important;
  border-radius: 8px !important;
  color: #ffffff !important;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease !important;
}
body.bbpress main.bsg-aurora-page .sceditor-button:hover,
body.bbpress main.bsg-aurora-page .sceditor-button:focus-visible {
  background: #086beb !important;
  border-color: rgba(8,107,235,0.6) !important;
  box-shadow: 0 0 0 2px rgba(8,107,235,0.12) !important;
}
body.bbpress main.bsg-aurora-page .sceditor-button.active {
  background: #086beb !important;
  border-color: rgba(8,107,235,0.6) !important;
  box-shadow: inset 0 0 0 1px rgba(8,107,235,0.24) !important;
}
/* Hide default colored bitmap sprites and source-theme icon glyphs.
   Keep the actual SCEditor <a> buttons and command handlers intact. */
body.bbpress main.bsg-aurora-page .sceditor-button > div {
  display: block !important;
  position: relative !important;
  box-sizing: border-box !important;
  flex: 0 0 19px !important;
  width: 19px !important;
  height: 19px !important;
  min-width: 19px !important;
  min-height: 19px !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  background-image: none !important;
  box-shadow: none !important;
  text-indent: -9999px !important;
  font-size: 0 !important;
  filter: none !important;
  overflow: hidden !important;
}
/* Single-colour mask: visible icon colour is always white, regardless of the default skin. */
body.bbpress main.bsg-aurora-page .sceditor-button > div::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  background: #ffffff !important;
  -webkit-mask-image: var(--bsg-sceditor-icon) !important;
  mask-image: var(--bsg-sceditor-icon) !important;
  -webkit-mask-repeat: no-repeat !important;
  mask-repeat: no-repeat !important;
  -webkit-mask-position: center !important;
  mask-position: center !important;
  -webkit-mask-size: contain !important;
  mask-size: contain !important;
}
/* If any SCEditor icon set injected SVGs, hide only these decorative
   descendants; replacement masks above remain visible. */
body.bbpress main.bsg-aurora-page .sceditor-button > div > svg,
body.bbpress main.bsg-aurora-page .sceditor-button > div > img { display: none !important; }
body.bbpress main.bsg-aurora-page .sceditor-button-bold { --bsg-sceditor-icon: url("../icons/sceditor/bold.svg"); }
body.bbpress main.bsg-aurora-page .sceditor-button-italic { --bsg-sceditor-icon: url("../icons/sceditor/italic.svg"); }
body.bbpress main.bsg-aurora-page .sceditor-button-underline { --bsg-sceditor-icon: url("../icons/sceditor/underline.svg"); }
body.bbpress main.bsg-aurora-page .sceditor-button-strike { --bsg-sceditor-icon: url("../icons/sceditor/strike.svg"); }
body.bbpress main.bsg-aurora-page .sceditor-button-left { --bsg-sceditor-icon: url("../icons/sceditor/left.svg"); }
body.bbpress main.bsg-aurora-page .sceditor-button-center { --bsg-sceditor-icon: url("../icons/sceditor/center.svg"); }
body.bbpress main.bsg-aurora-page .sceditor-button-right { --bsg-sceditor-icon: url("../icons/sceditor/right.svg"); }
body.bbpress main.bsg-aurora-page .sceditor-button-size { --bsg-sceditor-icon: url("../icons/sceditor/size.svg"); }
body.bbpress main.bsg-aurora-page .sceditor-button-color { --bsg-sceditor-icon: url("../icons/sceditor/color.svg"); }
body.bbpress main.bsg-aurora-page .sceditor-button-bulletlist { --bsg-sceditor-icon: url("../icons/sceditor/bulletlist.svg"); }
body.bbpress main.bsg-aurora-page .sceditor-button-orderedlist { --bsg-sceditor-icon: url("../icons/sceditor/orderedlist.svg"); }
body.bbpress main.bsg-aurora-page .sceditor-button-link { --bsg-sceditor-icon: url("../icons/sceditor/link.svg"); }
body.bbpress main.bsg-aurora-page .sceditor-button-unlink { --bsg-sceditor-icon: url("../icons/sceditor/unlink.svg"); }
body.bbpress main.bsg-aurora-page .sceditor-button-image { --bsg-sceditor-icon: url("../icons/sceditor/image.svg"); }
body.bbpress main.bsg-aurora-page .sceditor-button-code { --bsg-sceditor-icon: url("../icons/sceditor/code.svg"); }
body.bbpress main.bsg-aurora-page .sceditor-button-source { --bsg-sceditor-icon: url("../icons/sceditor/source.svg"); }

body.bbpress main.bsg-aurora-page .sceditor-button.disabled {
  opacity: .43 !important;
  pointer-events: none !important;
}
@media (max-width: 600px) {
  body.bbpress main.bsg-aurora-page .sceditor-toolbar { padding: 7px !important; gap: 3px !important; }
  body.bbpress main.bsg-aurora-page .sceditor-group { margin-right: 1px !important; padding-right: 5px !important; gap: 2px !important; }
  body.bbpress main.bsg-aurora-page .sceditor-button {
    flex-basis: 37px !important; width: 37px !important; height: 37px !important;
    min-width: 37px !important; min-height: 37px !important;
  }
}


/* 1.10.13 — Popovers must escape the editor, including the composer card.
   overflow:hidden on the editor clipped the colour picker and link/image dialogs;
   z-index alone cannot fix ancestor clipping. */
body.bbpress main.bsg-aurora-page .bsg-aurora-compose,
body.bbpress main.bsg-aurora-page .bsg-aurora-compose .bsg-aurora-compose__body,
body.bbpress main.bsg-aurora-page .bsg-aurora-compose .bbp-field-content,
body.bbpress main.bsg-aurora-page .bsg-aurora-compose fieldset.bbp-form {
  overflow: visible !important;
}
body.bbpress main.bsg-aurora-page .sceditor-container {
  position: relative !important;
  overflow: visible !important;
  isolation: auto !important;
}
/* Raise the active composer above neighbouring cards, never above the site nav. */
body.bbpress main.bsg-aurora-page .bsg-aurora-compose:focus-within {
  position: relative !important;
  z-index: 60 !important;
}
body.bbpress main.bsg-aurora-page .sceditor-container:focus-within {
  z-index: 2 !important;
}
/* Keep the rounded top of the editor without clipping popups. */
body.bbpress main.bsg-aurora-page .sceditor-container > .sceditor-toolbar {
  border-radius: 10px 10px 0 0 !important;
}
body.bbpress main.bsg-aurora-page .sceditor-container > .sceditor-grip {
  border-radius: 0 0 9px 9px !important;
}
body.bbpress main.bsg-aurora-page .sceditor-container .sceditor-dropdown {
  position: absolute !important;
  z-index: 2000 !important;
  box-sizing: border-box !important;
  max-width: min(370px, calc(100vw - 24px)) !important;
  max-height: min(70vh, 460px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  padding: 12px !important;
  background: #ffffff !important;
  color: #121f32 !important;
  border: 1px solid rgba(8,107,235,0.6) !important;
  border-radius: 10px !important;
  box-shadow: 0 16px 40px rgba(10,45,90,0.195), 0 0 0 1px rgba(8,107,235,0.08) !important;
}
body.bbpress main.bsg-aurora-page .sceditor-container .sceditor-dropdown label,
body.bbpress main.bsg-aurora-page .sceditor-container .sceditor-dropdown p,
body.bbpress main.bsg-aurora-page .sceditor-container .sceditor-dropdown strong {
  color: #121f32 !important;
}
@media (max-width: 600px) {
  body.bbpress main.bsg-aurora-page .sceditor-container .sceditor-dropdown {
    max-width: calc(100vw - 20px) !important;
    max-height: min(60vh, 400px) !important;
  }
}

/* 1.10.19 — help editors preserve existing HTML/code during edits. */
body.bbpress .bsg-source-edit-note {color:#086beb!important;font-size:12px!important;margin:8px 0 14px!important;line-height:1.55!important;}

/* 1.11.15 — Editor professionale, coerente con il template Blue:
   barra chiara, pulsanti piatti con icone scure, stato attivo blu tenue, gruppi separati da divisori sottili. */
body.bbpress main.bsg-aurora-page .sceditor-container {
  border: 1px solid #b9cfe9 !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  box-shadow: none !important;
  transition: border-color .15s ease, box-shadow .15s ease !important;
}
body.bbpress main.bsg-aurora-page .sceditor-container:focus-within {
  border-color: #086beb !important;
  box-shadow: 0 0 0 3px rgba(8,107,235,.14) !important;
}
body.bbpress main.bsg-aurora-page .sceditor-container > .sceditor-toolbar {
  display: flex !important;
  flex-flow: row wrap !important;
  align-items: center !important;
  gap: 2px 4px !important;
  padding: 6px 8px !important;
  background: #f5f9ff !important;
  border: 0 !important;
  border-bottom: 1px solid #d8e6f7 !important;
  border-radius: 11px 11px 0 0 !important;
}
body.bbpress main.bsg-aurora-page .sceditor-toolbar .sceditor-group {
  display: inline-flex !important;
  align-items: center !important;
  flex-flow: row nowrap !important;
  gap: 1px !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 0 6px 0 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-right: 1px solid #d8e6f7 !important;
  box-shadow: none !important;
}
body.bbpress main.bsg-aurora-page .sceditor-toolbar .sceditor-group:last-child {
  border-right: 0 !important;
  padding-right: 0 !important;
}
body.bbpress main.bsg-aurora-page .sceditor-toolbar .sceditor-button {
  flex: 0 0 34px !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  color: #33445c !important;
  box-shadow: none !important;
}
body.bbpress main.bsg-aurora-page .sceditor-toolbar .sceditor-button > div { flex-basis: 18px !important; width: 18px !important; height: 18px !important; min-width: 18px !important; min-height: 18px !important; }
body.bbpress main.bsg-aurora-page .sceditor-toolbar .sceditor-button > div::after { background: #33445c !important; }
body.bbpress main.bsg-aurora-page .sceditor-toolbar .sceditor-button:hover,
body.bbpress main.bsg-aurora-page .sceditor-toolbar .sceditor-button:focus-visible {
  background: #e4effd !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
body.bbpress main.bsg-aurora-page .sceditor-toolbar .sceditor-button:hover > div::after,
body.bbpress main.bsg-aurora-page .sceditor-toolbar .sceditor-button:focus-visible > div::after { background: #0757c9 !important; }
body.bbpress main.bsg-aurora-page .sceditor-toolbar .sceditor-button:focus-visible { outline: 2px solid #086beb !important; outline-offset: -2px !important; }
body.bbpress main.bsg-aurora-page .sceditor-toolbar .sceditor-button.active {
  background: #d6e8ff !important;
  border-color: #a9cbf5 !important;
  box-shadow: none !important;
}
body.bbpress main.bsg-aurora-page .sceditor-toolbar .sceditor-button.active > div::after { background: #0757c9 !important; }
body.bbpress main.bsg-aurora-page .sceditor-toolbar .sceditor-button.disabled { opacity: .38 !important; }
/* Grip: maniglia di ridimensionamento discreta */
body.bbpress main.bsg-aurora-page .sceditor-container > .sceditor-grip {
  background: #f5f9ff !important;
  border: 0 !important;
  border-top: 1px solid #d8e6f7 !important;
  border-radius: 0 0 11px 11px !important;
  height: 12px !important;
  width: 100% !important;
  position: relative !important;
  cursor: ns-resize !important;
}
body.bbpress main.bsg-aurora-page .sceditor-container > .sceditor-grip::after {
  content: ""; position: absolute; left: 50%; top: 4px; width: 28px; height: 3px;
  margin-left: -14px; border-radius: 3px; background: #b9cfe9;
}
@media (max-width: 600px) {
  body.bbpress main.bsg-aurora-page .sceditor-container > .sceditor-toolbar { padding: 5px 6px !important; gap: 2px 2px !important; }
  body.bbpress main.bsg-aurora-page .sceditor-toolbar .sceditor-group { padding-right: 3px !important; }
  body.bbpress main.bsg-aurora-page .sceditor-toolbar .sceditor-button {
    flex-basis: 34px !important; width: 34px !important; height: 34px !important; min-width: 34px !important; min-height: 34px !important;
  }
}


/* 1.11.20 — table button, table dialog and tables in editor / posts. */
body.bbpress main.bsg-aurora-page .sceditor-button-bsgtable { --bsg-sceditor-icon: url("../icons/sceditor/table.svg"); }
.bsg-table-dialog { display: grid; gap: 8px; min-width: 210px; padding: 12px; color: #121f32; }
.bsg-table-dialog label { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; margin: 0 !important; padding: 0 !important; height: auto !important; font-size: 13px; font-weight: 650; }
.bsg-table-dialog input[type=number] { box-sizing: border-box !important; width: 76px !important; height: 34px !important; margin: 0 !important; padding: 4px 8px !important; border: 1px solid #cfe0f7; border-radius: 8px; background: #fff; color: #121f32; font: inherit; }
.bsg-table-dialog .bsg-t-check { justify-content: flex-start; gap: 8px; }
.bsg-table-dialog .bsg-t-check input { margin: 0 !important; }
.bsg-table-dialog .bsg-t-ok { background: #086beb; color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.bsg-table-dialog .bsg-t-ok:hover { background: #0757c9; }
.bsg-aurora-post__body table, .bsg-aurora-compose table.bsg-table, #bbpress-forums .bbp-topic-content table, #bbpress-forums .bbp-reply-content table {
  display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0 0 16px; font-size: 14px;
}
.bsg-aurora-post__body table th, .bsg-aurora-post__body table td,
#bbpress-forums .bbp-topic-content table th, #bbpress-forums .bbp-topic-content table td,
#bbpress-forums .bbp-reply-content table th, #bbpress-forums .bbp-reply-content table td {
  border: 1px solid #cfe0f7; padding: 8px 12px; text-align: left; vertical-align: top; color: #121f32;
}
.bsg-aurora-post__body table th, #bbpress-forums .bbp-topic-content table th, #bbpress-forums .bbp-reply-content table th { background: #eaf4ff; font-weight: 700; }
.bsg-aurora-post__body table tr:nth-child(even) td, #bbpress-forums .bbp-topic-content table tr:nth-child(even) td, #bbpress-forums .bbp-reply-content table tr:nth-child(even) td { background: #f8fbff; }

/* 1.11.21 — emoji button + picker. */
body.bbpress main.bsg-aurora-page .sceditor-button-bsgemoji { --bsg-sceditor-icon: url("../icons/sceditor/emoji.svg"); }
.bsg-emoji-dialog { width: min(318px, calc(100vw - 32px)); max-height: 320px; overflow-y: auto; padding: 10px 12px 12px; color: #121f32; }
.bsg-emoji-title { margin: 6px 0 4px; font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: #3f5a7d; }
.bsg-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.bsg-emoji-btn { all: unset; box-sizing: border-box; display: grid; place-items: center; height: 34px; border-radius: 8px; font-size: 20px; line-height: 1; cursor: pointer; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; }
.bsg-emoji-btn:hover, .bsg-emoji-btn:focus-visible { background: #eaf4ff; outline: 2px solid #086beb; outline-offset: -2px; }

/* 1.11.22 — the editor must grow with its container (SCEditor lays out iframe/textarea with flex). */
body.bbpress main.bsg-aurora-page .sceditor-container { display: flex !important; flex-direction: column !important; }
body.bbpress main.bsg-aurora-page .sceditor-container > .sceditor-toolbar { flex: 0 0 auto !important; }
body.bbpress main.bsg-aurora-page .sceditor-container > iframe,
body.bbpress main.bsg-aurora-page .sceditor-container > textarea { flex: 1 1 0% !important; height: auto !important; min-height: 150px !important; }
body.bbpress main.bsg-aurora-page .sceditor-container > .sceditor-grip { flex: 0 0 auto !important; }
