/* /static/css/post-common.css */

/* ========== 컨테이너 ========== */
.sub-container {
    max-width: 50%;
    margin: 20px auto 40px;
    padding: 40px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    min-height: calc(100vh - 400px);
}

/* ========== 헤더 영역 ========== */
.write-header, .post-header {
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.write-title, .post-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #666;
    font-size: 14px;
}

.post-meta span {
    white-space: nowrap;
}

/* ========== 폼 요소 ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    font-size: 16px;
}

.form-control, .form-select {
    font-size: 16px;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
}

/* ========== 게시글 내용 ========== */
.post-content {
    min-height: 300px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 30px;
    font-size: 15px;
    word-wrap: break-word;
}

.post-content img {
    max-width: 100%;
    height: auto;
}

/* ========== 첨부파일 ========== */
.post-attachments {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.post-attachments h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 16px;
}

.attachment-item a {
    color: #0066cc;
    text-decoration: none;
    font-size: 16px;
}

.attachment-item a:hover {
    text-decoration: underline;
}

/* ========== 버튼 ========== */
.btn-primary-custom {
    background: #0066cc;
    color: white;
    padding: 12px 35px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary-custom:hover {
    background: #0052a3;
    color: white;
}

.btn-secondary-custom {
    background: #6c757d;
    color: white;
    padding: 12px 35px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    display: inline-block;
    transition: all 0.3s;
}

.btn-secondary-custom:hover {
    background: #5a6268;
    color: white;
}

.btn-success-custom {
    background: #28a745;
    color: white;
    padding: 12px 35px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    display: inline-block;
    transition: all 0.3s;
}

.btn-success-custom:hover {
    background: #218838;
    color: white;
}

.btn-danger-custom {
    background: #dc3545;
    color: white;
    padding: 12px 35px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-danger-custom:hover {
    background: #c82333;
    color: white;
}

/* ========== 액션 영역 ========== */
.form-actions, .post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.admin-actions {
    display: flex;
    gap: 10px;
}

/* ========== 안내 텍스트 ========== */
.text-muted {
    font-size: 14px;
    color: #6c757d;
}

small.text-muted {
    font-size: 14px;
}

/* ========== 태블릿 반응형 ========== */
@media (max-width: 1024px) {
    .sub-container {
        max-width: 85%;
        padding: 30px;
    }
}

/* ========== 모바일 반응형 ========== */
@media (max-width: 768px) {
    .sub-container {
        max-width: 100%;
        margin: 20px 0;
        padding: 20px 15px;
        border-radius: 0;
        box-shadow: none;
    }

    .write-title, .post-title {
        font-size: 20px;
    }

    .form-control, .form-select {
        font-size: 16px;
        padding: 14px;
    }

    .form-actions, .post-actions {
        flex-direction: column;
        gap: 10px;
    }

    .admin-actions {
        width: 100%;
        flex-direction: column;
    }

    .btn-primary-custom,
    .btn-secondary-custom,
    .btn-success-custom,
    .btn-danger-custom {
        width: 100%;
        text-align: center;
    }

    .post-meta {
        flex-direction: column;
        gap: 8px;
    }

    .attachment-item {
        font-size: 15px;
    }
}

/* ========== 작은 모바일 ========== */
@media (max-width: 480px) {
    .sub-container {
        padding: 15px 10px;
    }

    .write-title, .post-title {
        font-size: 18px;
    }

    .form-label {
        font-size: 14px;
    }

    .post-content {
        font-size: 14px;
    }
}