/* =====================================
   INFODAM 글쓰기 페이지
   /admin/write.css
===================================== */

.write-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 25px;
    align-items: start;
}

.write-main,
.write-sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
    min-width: 0;
}

/* 기본 패널 */
.write-panel {
    background: #fff;
    border: 1px solid #e9edf2;
    border-radius: 10px;
    padding: 28px;
}

.write-panel-title {
    padding-bottom: 20px;
    margin-bottom: 25px;
    border-bottom: 1px solid #edf0f3;
}

.write-panel-title h2 {
    font-size: 19px;
    font-weight: 800;
    color: #222;
    margin-bottom: 5px;
}

.write-panel-title p {
    font-size: 13px;
    color: #999;
}

/* 입력 필드 */
.write-field {
    margin-bottom: 25px;
}

.write-field:last-child {
    margin-bottom: 0;
}

.write-field label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.write-field input,
.write-field select,
.write-field textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #dfe3e9;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.write-field input:focus,
.write-field select:focus,
.write-field textarea:focus {
    border-color: #3478f6;
}

.write-field textarea {
    line-height: 1.7;
    resize: vertical;
}

.write-field input::placeholder,
.write-field textarea::placeholder {
    color: #aaa;
}

.field-help {
    font-size: 12px;
    color: #999;
    margin-top: 9px;
    line-height: 1.6;
}

/* 본문 에디터 */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    padding: 9px;
    background: #f9fafc;
    border: 1px solid #dfe3e9;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.editor-toolbar button {
    min-width: 36px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #e2e5e9;
    border-radius: 4px;
    background: #fff;
    color: #444;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

.editor-toolbar button:hover {
    background: #eaf1ff;
    border-color: #b6cdfc;
    color: #3478f6;
}

.content-editor {
    min-height: 420px;
    padding: 20px;
    border: 1px solid #dfe3e9;
    border-radius: 0 0 6px 6px;
    background: #fff;
    font-size: 15px;
    line-height: 1.9;
    outline: none;
    overflow-wrap: anywhere;
}

.content-editor:focus {
    border-color: #3478f6;
}

.content-editor:empty::before {
    content: attr(data-placeholder);
    color: #aaa;
    pointer-events: none;
}

.content-editor h2 {
    font-size: 24px;
    margin: 20px 0 12px;
}

.content-editor h3 {
    font-size: 19px;
    margin: 18px 0 10px;
}

.content-editor ul,
.content-editor ol {
    padding-left: 25px;
    margin: 12px 0;
}

.content-editor a {
    color: #3478f6;
    text-decoration: underline;
}

/* 카테고리 구분 */
.category-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 22px;
    color: #aaa;
    font-size: 12px;
}

.category-divider::before,
.category-divider::after {
    content: "";
    height: 1px;
    background: #e8ebef;
    flex: 1;
}

/* 저장 버튼 */
.write-submit {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 6px;
    background: #3478f6;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.write-submit:hover {
    background: #2165df;
}

/* 오류 메시지 */
.write-error {
    background: #fff0f0;
    border: 1px solid #f3c8c8;
    color: #c0392b;
    border-radius: 7px;
    padding: 15px 20px;
    margin-bottom: 25px;
    font-size: 14px;
}

/* 반응형 */
@media (max-width: 1100px) {
    .write-layout {
        grid-template-columns: minmax(0, 1fr) 250px;
        gap: 15px;
    }

    .write-panel {
        padding: 22px;
    }
}

@media (max-width: 900px) {
    .write-layout {
        grid-template-columns: 1fr;
    }

    .write-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .write-panel {
        padding: 20px 16px;
    }

    .write-sidebar {
        grid-template-columns: 1fr;
    }

    .content-editor {
        min-height: 320px;
    }
}
