/* DRAG.SU v5.2.31 — shared visual/html rich editor for admin and public inline editors. */
.gd-rich-editor{--gdre-bg:#090e14;--gdre-bg2:#111821;--gdre-line:rgba(255,255,255,.09);--gdre-text:#eaf0f7;--gdre-muted:#9aa6b4;--gdre-red:#e53935;--gdre-red2:#ff5b55;width:100%;min-width:0;border:1px solid var(--gdre-line);border-radius:18px;background:linear-gradient(180deg,rgba(17,24,33,.98),rgba(8,12,18,.98));box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 14px 32px rgba(0,0,0,.22);overflow:hidden;color:var(--gdre-text)}
.gd-rich-editor__top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid var(--gdre-line);background:rgba(255,255,255,.025)}
.gd-rich-editor__title{display:grid;gap:2px;min-width:0}.gd-rich-editor__title b{font-size:13px;text-transform:uppercase;letter-spacing:.05em}.gd-rich-editor__title small{color:var(--gdre-muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gd-rich-editor__modes,.gd-rich-editor__toolbar{display:flex;flex-wrap:wrap;gap:7px;align-items:center}.gd-rich-editor__mode,.gd-rich-editor__btn{appearance:none;border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.04);color:#dfe7ef;border-radius:10px;min-height:34px;padding:0 10px;font-weight:900;font-size:12px;cursor:pointer}.gd-rich-editor__mode:hover,.gd-rich-editor__btn:hover{border-color:rgba(229,57,53,.5);color:#fff}.gd-rich-editor__mode.is-active{background:linear-gradient(180deg,#e7443f,#a81211);border-color:#f04a45;color:#fff;box-shadow:0 8px 18px rgba(229,57,53,.16)}
.gd-rich-editor__toolbar{padding:10px 14px;border-bottom:1px solid var(--gdre-line);background:rgba(0,0,0,.12)}
.gd-rich-editor__body{position:relative;min-height:320px}.gd-rich-editor__visual,.gd-rich-editor__html textarea,.gd-rich-editor__preview{width:100%;min-height:320px;padding:18px;border:0;outline:none;background:#070b10;color:var(--gdre-text);line-height:1.65;font-size:15px;overflow:auto}.gd-rich-editor__visual:focus,.gd-rich-editor__html textarea:focus{box-shadow:inset 0 0 0 1px rgba(229,57,53,.35)}
.gd-rich-editor__html textarea{display:block;resize:vertical;font-family:Consolas,Menlo,Monaco,monospace;font-size:13px;white-space:pre-wrap}.gd-rich-editor__preview{background:radial-gradient(circle at 20% 0,rgba(229,57,53,.08),transparent 32%),#070b10}.gd-rich-editor__visual p,.gd-rich-editor__preview p{margin:0 0 14px}.gd-rich-editor__visual h2,.gd-rich-editor__preview h2{font-size:28px;line-height:1.15;margin:20px 0 12px}.gd-rich-editor__visual h3,.gd-rich-editor__preview h3{font-size:22px;line-height:1.2;margin:18px 0 10px}.gd-rich-editor__visual blockquote,.gd-rich-editor__preview blockquote{margin:12px 0;padding:12px 14px;border-left:3px solid var(--gdre-red);border-radius:12px;background:rgba(229,57,53,.08)}.gd-rich-editor__visual table,.gd-rich-editor__preview table{width:100%;border-collapse:collapse;margin:12px 0}.gd-rich-editor__visual th,.gd-rich-editor__visual td,.gd-rich-editor__preview th,.gd-rich-editor__preview td{border:1px solid rgba(255,255,255,.12);padding:9px}.gd-rich-editor__visual img,.gd-rich-editor__preview img{max-width:100%;height:auto;border-radius:12px;background:#05080c}.gd-rich-editor__visual figure,.gd-rich-editor__preview figure{margin:14px 0}.gd-rich-editor__visual figcaption,.gd-rich-editor__preview figcaption{color:var(--gdre-muted);font-size:12px;margin-top:6px}.gd-rich-editor__muted{color:var(--gdre-muted)!important}
.gd-rich-editor__html,.gd-rich-editor__preview{display:none}.gd-rich-editor.is-mode-html .gd-rich-editor__visual,.gd-rich-editor.is-mode-html .gd-rich-editor__preview{display:none}.gd-rich-editor.is-mode-html .gd-rich-editor__html{display:block}.gd-rich-editor.is-mode-preview .gd-rich-editor__visual,.gd-rich-editor.is-mode-preview .gd-rich-editor__html{display:none}.gd-rich-editor.is-mode-preview .gd-rich-editor__preview{display:block}.gd-rich-editor.is-mode-visual .gd-rich-editor__html,.gd-rich-editor.is-mode-visual .gd-rich-editor__preview{display:none}
.gd-rich-editor__footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 14px;border-top:1px solid var(--gdre-line);color:var(--gdre-muted);font-size:12px;background:rgba(255,255,255,.02)}.gd-rich-editor__hint{text-align:right}.ajax-editor-form .gd-rich-editor{margin-top:7px}.admin-form .gd-rich-editor{margin-top:8px}.gd-rich-editor + textarea{display:none!important}@media(max-width:760px){.gd-rich-editor__top,.gd-rich-editor__footer{display:grid}.gd-rich-editor__modes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.gd-rich-editor__mode{width:100%}.gd-rich-editor__visual,.gd-rich-editor__html textarea,.gd-rich-editor__preview{min-height:260px}.gd-rich-editor__hint{text-align:left}}


/* DRAG.SU v5.2.32 — rich editor focus/caret guard.
   Textareas in this CMS are often wrapped by <label>. The JS moves the editor
   outside of the label; these rules keep the label text and editor spacing clean. */
.gd-rich-editor__detached-label{
  margin-bottom:8px!important;
}
.gd-rich-editor__visual{
  cursor:text!important;
  caret-color:#fff!important;
  user-select:text!important;
  -webkit-user-select:text!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
.gd-rich-editor__visual:empty:before{
  content:"Начните писать текст...";
  color:rgba(154,166,180,.72);
  pointer-events:none;
}
.gd-rich-editor.is-focused{
  border-color:rgba(229,57,53,.34);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 0 0 1px rgba(229,57,53,.16),0 14px 32px rgba(0,0,0,.22);
}
.gd-rich-editor__html textarea{
  caret-color:#fff!important;
}


/* DRAG.SU v5.2.43 — editor runtime recovery guard.
   Keeps visual/HTML editors clickable and gives admin/public code textareas their own stable UI. */
.gd-rich-editor,
.gd-rich-editor *,
.gd-code-editor,
.gd-code-editor *{
  box-sizing:border-box!important;
}
.gd-rich-editor{position:relative!important;z-index:1!important;clear:both!important;}
.gd-rich-editor__top,
.gd-rich-editor__toolbar,
.gd-rich-editor__body,
.gd-rich-editor__footer{position:relative!important;z-index:2!important;}
.gd-rich-editor__visual,
.gd-rich-editor__html textarea,
.gd-rich-editor__preview{
  pointer-events:auto!important;
  position:relative!important;
  z-index:3!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
.gd-rich-editor__visual{
  -webkit-user-modify:read-write!important;
  word-break:normal!important;
}
.gd-rich-editor__html textarea{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  resize:vertical!important;
  white-space:pre-wrap!important;
  tab-size:2!important;
}
.gd-rich-editor__mode,
.gd-rich-editor__btn{
  pointer-events:auto!important;
  user-select:none!important;
}
.gd-rich-editor__detached-label + .gd-rich-editor,
.admin-form .gd-rich-editor,
.public-editor-form .gd-rich-editor,
.ajax-editor-form .gd-rich-editor{
  margin-top:8px!important;
}

/* Shared Code/HTML textarea editor styles. Admin layout does not load public style.css,
   so the component must be styled from this always-loaded editor stylesheet. */
.gd-code-editor-lock{overflow:hidden!important;}
.gd-code-editor{
  width:100%!important;
  min-width:0!important;
  display:grid!important;
  border-radius:16px!important;
  border:1px solid rgba(255,176,32,.20)!important;
  background:linear-gradient(180deg,rgba(9,14,20,.96),rgba(5,8,12,.98))!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.045),0 14px 34px rgba(0,0,0,.18)!important;
  overflow:hidden!important;
  margin-top:8px!important;
  color:#dce6f0!important;
  text-transform:none!important;
  white-space:normal!important;
}
.gd-code-editor__toolbar{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  padding:9px!important;
  border-bottom:1px solid rgba(255,255,255,.08)!important;
  background:rgba(255,255,255,.035)!important;
}
.gd-code-editor__title{display:grid!important;gap:2px!important;min-width:150px!important;}
.gd-code-editor__title b{color:#fff!important;font-size:12px!important;line-height:1!important;font-weight:1000!important;letter-spacing:.10em!important;text-transform:uppercase!important;}
.gd-code-editor__title small{color:#8f9cab!important;font-size:10px!important;line-height:1.1!important;font-weight:850!important;text-transform:none!important;white-space:normal!important;}
.gd-code-editor__actions{display:flex!important;flex-wrap:wrap!important;justify-content:flex-end!important;gap:6px!important;}
.gd-code-editor__btn{
  min-height:28px!important;
  padding:0 9px!important;
  border-radius:9px!important;
  border:1px solid rgba(255,255,255,.10)!important;
  background:#101820!important;
  color:#dce6f0!important;
  font-size:11px!important;
  line-height:1!important;
  font-weight:950!important;
  cursor:pointer!important;
  text-transform:none!important;
  white-space:nowrap!important;
}
.gd-code-editor__btn:hover{color:#fff!important;border-color:rgba(255,176,32,.38)!important;background:rgba(255,176,32,.09)!important;}
.gd-code-editor__body{display:grid!important;grid-template-columns:54px minmax(0,1fr)!important;min-height:220px!important;max-height:620px!important;overflow:hidden!important;}
.gd-code-editor--html .gd-code-editor__body{min-height:420px!important;}
.gd-code-editor__lines{margin:0!important;padding:12px 9px!important;overflow:hidden!important;text-align:right!important;background:#05080c!important;color:#53606d!important;font:12px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace!important;user-select:none!important;border-right:1px solid rgba(255,255,255,.08)!important;}
.gd-code-editor__lines span{display:block!important;height:1.55em!important;}
.gd-code-editor__textarea{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  height:100%!important;
  min-height:220px!important;
  max-height:620px!important;
  margin:0!important;
  padding:12px 14px!important;
  border:0!important;
  border-radius:0!important;
  outline:0!important;
  resize:vertical!important;
  background:#070b10!important;
  color:#dce6f0!important;
  caret-color:#ffb020!important;
  font:13px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace!important;
  tab-size:2!important;
  white-space:pre!important;
  overflow:auto!important;
  pointer-events:auto!important;
  text-transform:none!important;
}
.gd-code-editor--text .gd-code-editor__textarea{white-space:pre-wrap!important;}
.gd-code-editor__textarea:focus{box-shadow:inset 0 0 0 2px rgba(255,176,32,.16)!important;}
.gd-code-editor__footer{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;padding:7px 10px!important;border-top:1px solid rgba(255,255,255,.08)!important;background:rgba(255,255,255,.025)!important;color:#7f8a96!important;font-size:11px!important;font-weight:850!important;text-transform:none!important;}
.gd-code-editor.is-fullscreen{position:fixed!important;inset:18px!important;z-index:100000!important;border-radius:20px!important;box-shadow:0 0 0 9999px rgba(0,0,0,.72),0 30px 110px rgba(0,0,0,.72)!important;}
.gd-code-editor.is-fullscreen .gd-code-editor__body{height:calc(100vh - 132px)!important;max-height:none!important;}
.gd-code-editor.is-fullscreen .gd-code-editor__textarea{max-height:none!important;height:100%!important;}
@media(max-width:760px){.gd-code-editor__toolbar{display:grid!important}.gd-code-editor__actions{justify-content:flex-start!important}.gd-code-editor__body{grid-template-columns:42px minmax(0,1fr)!important}.gd-code-editor.is-fullscreen{inset:8px!important}}

/* DRAG.SU v5.2.44 — short Code Editor guard.
   Short textareas (excerpt, short description, SEO description) are mounted outside labels
   and kept compact so label clicks/admin grid rules do not break focus or buttons. */
.gd-code-editor__detached-label{
  margin-bottom:8px!important;
}
.admin-form label.gd-code-editor__detached-label,
.public-editor-form label.gd-code-editor__detached-label,
.ajax-editor-form label.gd-code-editor__detached-label{
  margin-bottom:8px!important;
}
.gd-code-editor__detached-label + .gd-code-editor{
  margin-top:0!important;
  margin-bottom:14px!important;
}
.gd-code-editor--short .gd-code-editor__toolbar{
  padding:7px 8px!important;
}
.gd-code-editor--short .gd-code-editor__body{
  min-height:var(--gd-code-editor-min-height,124px)!important;
  max-height:220px!important;
}
.gd-code-editor--short .gd-code-editor__textarea{
  min-height:var(--gd-code-editor-min-height,124px)!important;
  max-height:220px!important;
}
.gd-code-editor--short .gd-code-editor__footer{
  padding:6px 9px!important;
}
.gd-code-editor--short .gd-code-editor__hint{
  display:none!important;
}
.gd-code-editor--short .gd-code-editor__btn{
  min-height:26px!important;
  padding-inline:8px!important;
}
@media(max-width:760px){
  .gd-code-editor--short .gd-code-editor__title{min-width:0!important;}
}

/* v5.2.44b — override legacy admin-form editor height rules for short editors. */
body.admin-body .admin-form .gd-code-editor--short .gd-code-editor__toolbar,
body.admin-body .admin-form .gd-code-editor--short .gd-code-editor__footer{
  padding-top:7px!important;
  padding-bottom:7px!important;
}
body.admin-body .admin-form .gd-code-editor--short .gd-code-editor__body,
.public-editor-form .gd-code-editor--short .gd-code-editor__body,
.ajax-editor-form .gd-code-editor--short .gd-code-editor__body{
  min-height:var(--gd-code-editor-min-height,124px)!important;
  height:auto!important;
  max-height:220px!important;
}
body.admin-body .admin-form .gd-code-editor--short .gd-code-editor__textarea,
.public-editor-form .gd-code-editor--short .gd-code-editor__textarea,
.ajax-editor-form .gd-code-editor--short .gd-code-editor__textarea{
  min-height:var(--gd-code-editor-min-height,124px)!important;
  height:auto!important;
  max-height:220px!important;
  padding:12px 14px!important;
  line-height:1.55!important;
}
body.admin-body .admin-form .gd-code-editor--short{
  margin-bottom:14px!important;
}
