/* editor.css - halaman editor (new_post.php) */

/* anti horizontal scroll */
html, body { width: 100%; overflow-x: hidden; }
* { box-sizing: border-box; }
img { max-width: 100%; height: auto; }

.page--editor{ padding: 24px 18px 46px; }

.editor-shell{
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
}

.editor-top{
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  align-items: start;
  margin: 10px 0 14px;
}

.editor-title h1{
  margin: 0 0 6px;
  font-size: clamp(22px, 2.1vw, 30px);
  letter-spacing: -0.3px;
}

.hint-card{
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.65);
  border-radius: 18px;
  padding: 14px 14px;
  box-shadow: 0 10px 26px rgba(16,24,40,.08);
}

.hint-badge{
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  background: rgba(245,158,11,.18);
  border: 1px solid rgba(245,158,11,.30);
  margin-bottom: 8px;
}

.editor-card{
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.70);
  border-radius: 26px;
  padding: 22px;
  box-shadow: 0 18px 60px rgba(16,24,40,.10);
}

.grid-2{
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 14px;
}

.mt-8{ margin-top: 8px; }
.mt-10{ margin-top: 10px; }

/* ===== Editor layout ===== */
.editor-wrap{
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,.80);
  position: relative;
}

/* bar kontrol tambahan (fullscreen + spacing) */
.editor-controls{
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(10px);
}

.ctrl-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.75);
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  transition: .18s ease;
  font-size: 13px;
}
.ctrl-pill:hover{ transform: translateY(-1px); }

.ctrl-select{
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.75);
  font-weight: 800;
  font-size: 13px;
  outline: none;
}

/* toolbar Quill tetap terlihat */
.editor-toolbar{
  position: sticky;
  top: 72px;
  z-index: 40;
  border: 0;
  border-bottom: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(10px);
}

/* ===== AREA NULIS BESAR ===== */
#editor.ql-container{ min-height: 62vh; }
#editor .ql-editor{
  min-height: 60vh;
  padding: 18px 20px;
  font-size: 15.8px;
  line-height: 1.85;
}

#editor .ql-editor p{ margin: 0 0 14px; }
#editor .ql-editor h1{ font-size: 26px; margin: 18px 0 10px; }
#editor .ql-editor h2{ font-size: 20px; margin: 18px 0 10px; }
#editor .ql-editor h3{ font-size: 17px; margin: 18px 0 10px; }

#editor .ql-editor blockquote{
  border-left: 3px solid rgba(99,102,241,.45);
  margin: 12px 0;
  padding: 10px 14px;
  background: rgba(99,102,241,.06);
  border-radius: 16px;
}

#editor .ql-editor pre.ql-syntax{
  background: rgba(15,23,42,.92);
  color: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  overflow: auto;
  margin: 12px 0;
}

/* ===== Spacing modes ===== */
.editor-wrap[data-spacing="compact"] #editor .ql-editor{ line-height: 1.65; }
.editor-wrap[data-spacing="compact"] #editor .ql-editor p{ margin-bottom: 10px; }

.editor-wrap[data-spacing="normal"] #editor .ql-editor{ line-height: 1.85; }
.editor-wrap[data-spacing="normal"] #editor .ql-editor p{ margin-bottom: 14px; }

.editor-wrap[data-spacing="lega"] #editor .ql-editor{ line-height: 2.05; }
.editor-wrap[data-spacing="lega"] #editor .ql-editor p{ margin-bottom: 18px; }

/* ===== Attachments ===== */
.attachments{
  border: 1px dashed rgba(15,23,42,.16);
  background: rgba(255,255,255,.55);
  border-radius: 18px;
  padding: 14px;
}

.attachments-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
}

.file-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.75);
  cursor: pointer;
  font-weight: 800;
  user-select:none;
  transition: .18s ease;
}
.file-btn:hover{ transform: translateY(-1px); }
.file-btn input{ display:none; }

.file-list{
  display:flex;
  flex-direction:column;
  gap: 10px;
  margin-top: 12px;
}
.file-row{
  display:flex;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.70);
}
.file-name{
  font-weight: 800;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 72%;
}

.editor-actions{ margin-top: 14px; }

.btn--xl{
  padding: 14px 16px !important;
  font-size: 14px !important;
  font-weight: 900 !important;
}

.center-text{ text-align:center; }
.small{ font-size: 12.5px; }

/* ===== FULLSCREEN MODE (FIX) ===== */
/* Kita set class di <html> & <body> supaya tidak ketabrak CSS lain */
html.sdn-fullscreen,
body.sdn-fullscreen { overflow: hidden; }

/* Sembunyikan header/footer saat fullscreen */
html.sdn-fullscreen .topbar,
body.sdn-fullscreen .topbar,
html.sdn-fullscreen footer,
body.sdn-fullscreen footer { display:none !important; }

/* Hilangkan padding halaman */
html.sdn-fullscreen .page--editor,
body.sdn-fullscreen .page--editor { padding:0 !important; margin:0 !important; }

html.sdn-fullscreen .editor-shell,
body.sdn-fullscreen .editor-shell { max-width:none; width:100%; margin:0; padding:0; }

html.sdn-fullscreen .editor-top,
body.sdn-fullscreen .editor-top { display:none !important; }

/* Jadikan card editor overlay fixed dan bisa discroll */
html.sdn-fullscreen .editor-card,
body.sdn-fullscreen .editor-card {
  position: fixed;
  inset: 0;
  border-radius: 0;
  padding: 16px;
  box-shadow: none;
  background: rgba(255,255,255,.96);
  overflow: auto; /* kunci: kalau konten tinggi, tetap bisa discroll */
}

html.sdn-fullscreen .editor-card form,
body.sdn-fullscreen .editor-card form {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* input judul/kategori jadi 1 kolom agar tidak sempit */
html.sdn-fullscreen .grid-2,
body.sdn-fullscreen .grid-2 { grid-template-columns: 1fr; }

/* editor area ambil sisa tinggi */
html.sdn-fullscreen .editor-wrap,
body.sdn-fullscreen .editor-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 60vh;
}

/* bar kontrol sticky biar tombol 'Keluar Fullscreen' selalu kelihatan */
html.sdn-fullscreen .editor-controls,
body.sdn-fullscreen .editor-controls {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
}

/* toolbar quill sticky tepat di bawah kontrol */
html.sdn-fullscreen .editor-toolbar,
body.sdn-fullscreen .editor-toolbar { top: 54px; }

/* container quill fleksibel (tanpa hitung-hitungan calc yang sering bikin kepotong) */
html.sdn-fullscreen #editor.ql-container,
body.sdn-fullscreen #editor.ql-container {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

html.sdn-fullscreen #editor .ql-editor,
body.sdn-fullscreen #editor .ql-editor { min-height: 100%; }

/* Responsif */
@media (max-width: 980px){
  .editor-top{ grid-template-columns: 1fr; }
  .grid-2{ grid-template-columns: 1fr; }
  .editor-toolbar{ top: 64px; }
  #editor.ql-container{ min-height: 58vh; }
  #editor .ql-editor{ min-height: 56vh; }
}

@media (max-width: 560px){
  .editor-card{ padding: 16px; border-radius: 22px; }
  #editor .ql-editor{ padding: 14px 14px; font-size: 15.2px; }
  .file-name{ max-width: 62%; }
}


/* Fullscreen hardening */
body.sdn-fullscreen{overflow:hidden;}
