/* 제목 영역 */
.write-title-wrap {
    margin-bottom: 15px;
}

.write-title {
    width: 100%;
    padding: 10px 18px;
    border: 1px solid #d0d0d0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    outline: none;
    box-sizing: border-box;
    transition: 0.2s;
    background: #fff;
    color: #222;
}

.write-title:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* 에디터 외곽 */
#editor {
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.07);
    overflow: hidden;
    margin-bottom: 25px;
    background: #fff;
}

/* 버튼 영역 → 중앙 정렬 */
.write-btn-area {
    text-align: center;
    margin-top: 30px;
}

/* 등록 버튼 */
.write-submit-btn {
    background: #4a90e2;
    border: none;
    color: #fff;
    padding: 5px 28px;
    font-size: 17px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 600;
}

.write-submit-btn:hover {
    background: #357ac8;
    transform: translateY(-2px);
}

/* ------------------------------- */
/*            다크모드            */
/* ------------------------------- */

body.dark-mode .write-title {
    background: #2b2b2b;
    border-color: #444;
    color: #f1f1f1;
}

body.dark-mode .write-title:focus {
    border-color: #7ab4ff;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.35);
}

body.dark-mode #editor {
    background: #1f1f1f;
    box-shadow: 0 3px 12px rgba(0,0,0,0.35);
}

body.dark-mode .write-submit-btn {
    background: #3d7ccf;
}

body.dark-mode .write-submit-btn:hover {
    background: #2f68b1;
}

/* Toast UI Editor 다크모드 내부 텍스트 */
body.dark-mode .toastui-editor-defaultUI {
    background-color: #222 !important;
    color: #ddd !important;
}

body.dark-mode .toastui-editor-contents {
    background-color: #222 !important;
    color: #f1f1f1 !important;
}

body.dark-mode .toastui-editor-md-preview {
    background-color: #222 !important;
    color: #f1f1f1 !important;
}

/* 모바일 대응 */
@media (max-width: 600px) {

    .write-title {
        font-size: 16px;
        padding: 14px 16px;
    }

    .write-submit-btn {
        width: 100%;
        padding: 14px 0;
        margin-top: 15px;
    }

    #editor {
        margin-bottom: 18px;
    }
}

/* ============================= */
/*  ToastUI Editor Dark Mode Fix */
/* ============================= */

body.dark-mode .toastui-editor-defaultUI,
body.dark-mode .toastui-editor-defaultUI * {
    color: #e5e5e5 !important;
}

/* WYSIWYG 영역 */
body.dark-mode .toastui-editor-defaultUI .toastui-editor-ww-container {
    background-color: #1e1e1e !important;
}

body.dark-mode .toastui-editor-defaultUI .toastui-editor-ww-container .ProseMirror {
    background-color: #1e1e1e !important;
    color: #e5e5e5 !important;
}

body.dark-mode .toastui-editor-defaultUI .toastui-editor-ww-container .ProseMirror * {
    color: #e5e5e5 !important;
}

/* Markdown 영역 */
body.dark-mode .toastui-editor-defaultUI .toastui-editor-md-container {
    background-color: #1e1e1e !important;
    color: #e5e5e5 !important;
}

body.dark-mode .toastui-editor-defaultUI .toastui-editor-md-container * {
    color: #e5e5e5 !important;
}

/* 에디터 컨텐츠 */
body.dark-mode .toastui-editor-defaultUI .toastui-editor-contents {
    background-color: #1e1e1e !important;
    color: #e5e5e5 !important;
}

body.dark-mode .toastui-editor-defaultUI .toastui-editor-contents * {
    color: #e5e5e5 !important;
}

/* placeholder */
body.dark-mode .toastui-editor-contents p.placeholder {
    color: #999 !important;
}

/* 툴바 */
body.dark-mode .toastui-editor-defaultUI .toastui-editor-toolbar {
    background-color: #2a2a2a !important;
    border-color: #444 !important;
}

body.dark-mode .toastui-editor-defaultUI .toastui-editor-toolbar button {
    color: #e5e5e5 !important;
}

/* 코드/blockquote 등 */
body.dark-mode pre,
body.dark-mode code {
    background-color: #111 !important;
    color: #f5f5f5 !important;
}
