/* ════════════════════════════════════════════════════════════
   게시판 첨부파일 UI — 드롭존 + 선택목록 + 기존파일 삭제 토글
   - 기본(JS 미동작): 네이티브 file input + '삭제' 체크박스 노출 (폴백)
   - .is-enhanced(JS 동작): 드롭존 + 선택목록 + 삭제 버튼
   ════════════════════════════════════════════════════════════ */

.board-attach { display: block; }

/* ── 드롭존 ───────────────────────────────────────── */
/* 기본(JS 미동작): 컨테이너만 — 안의 네이티브 input 이 그대로 노출(폴백) */
.board-attach .attach-dropzone { display: block; }
.board-attach.is-enhanced .attach-dropzone {
    position: relative;
    border: 2px dashed #c9ced6;
    border-radius: 10px;
    background: #fafbfc;
    padding: 22px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.board-attach.is-enhanced .attach-dropzone:hover,
.board-attach.is-enhanced .attach-dropzone:focus-visible {
    border-color: #6c8cff;
    background: #f3f6ff;
    outline: none;
}
.board-attach.is-enhanced .attach-dropzone.is-dragover {
    border-color: #4a6cf7;
    background: #eaf0ff;
}
.board-attach .attach-dropzone-inner { display: none; }     /* 기본 숨김 — 향상 시 표시 */
.board-attach.is-enhanced .attach-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;       /* 클릭은 드롭존이 처리 */
    color: #5b6373;
}
.board-attach .attach-icon {
    font-size: 26px;
    line-height: 1;
    color: #6c8cff;
    font-weight: 700;
}
.board-attach .attach-guide { font-size: 14px; }
.board-attach .attach-browse-link {
    color: #4a6cf7;
    font-weight: 600;
    text-decoration: underline;
}

/* 네이티브 input — 향상 시 시각적으로만 숨김(접근성 유지, 제출은 정상) */
.board-attach.is-enhanced .attach-input {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.board-attach .hint { display: block; margin-top: 6px; color: #8a909c; font-size: 12px; }

/* ── 새로 선택한 파일 목록 ───────────────────────── */
.board-attach .attach-selected { list-style: none; margin: 10px 0 0; padding: 0; }
.board-attach .attach-selected:empty { margin: 0; }
.board-attach .attach-selected .as-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: #fff;
    border: 1px solid #e6e8ee;
    border-radius: 8px;
}
.board-attach .as-item .as-ico { color: #6c8cff; flex: 0 0 auto; }
.board-attach .as-item .as-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    color: #2b303b;
}
.board-attach .as-item .as-size { flex: 0 0 auto; color: #8a909c; font-size: 12px; }
.board-attach .as-item .as-remove {
    flex: 0 0 auto;
    border: 0;
    background: #f1f3f7;
    color: #6b7280;
    width: 24px; height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    transition: background-color .15s ease, color .15s ease;
}
.board-attach .as-item .as-remove:hover { background: #ffe3e3; color: #d33; }

.board-attach .attach-warn {
    margin-top: 8px;
    padding: 8px 10px;
    background: #fff8e1;
    border: 1px solid #f7e1a0;
    border-radius: 6px;
    color: #8a6d00;
    font-size: 13px;
}

/* ── 기존 첨부파일 ──────────────────────────────── */
.board-attach .existing-files-wrap { margin-top: 14px; }
.board-attach .existing-files-title {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: #5b6373;
}
.board-attach .existing-files { list-style: none; margin: 0; padding: 0; }
.board-attach .existing-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: #fff;
    border: 1px solid #e6e8ee;
    border-radius: 8px;
}
.board-attach .existing-file .ef-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    color: #2b303b;
}
.board-attach .existing-file .ef-size { flex: 0 0 auto; }
.board-attach .existing-file .ef-status { flex: 0 0 auto; font-size: 12px; font-weight: 600; }

/* '삭제' 체크박스 — 향상 시 숨기고 버튼으로 대체 */
.board-attach .ef-del-check { flex: 0 0 auto; font-size: 13px; }
.board-attach.is-enhanced .ef-del-check { display: none; }

.board-attach .ef-del-btn { display: none; }       /* 기본 숨김 */
.board-attach.is-enhanced .ef-del-btn {
    display: inline-block;
    flex: 0 0 auto;
    border: 1px solid #e6708a;
    background: #fff;
    color: #d33b5a;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color .15s ease, color .15s ease;
}
.board-attach.is-enhanced .ef-del-btn:hover { background: #ffe3ea; }

/* 삭제 표시된 기존 파일 */
.board-attach .existing-file.is-marked-delete {
    background: #fff5f5;
    border-color: #f3c0c9;
}
.board-attach .existing-file.is-marked-delete .ef-name { text-decoration: line-through; color: #b0858c; }
.board-attach .existing-file.is-marked-delete .ef-del-btn {
    border-color: #b9bfca;
    color: #5b6373;
}
.board-attach .existing-file.is-marked-delete .ef-status::before { content: '삭제 예정'; color: #d33b5a; }
.board-attach .ef-help { display: block; margin-top: 4px; }
