@charset "UTF-8";

/* ======================================================= */
/* 1. 전체 컨테이너 및 기본 레이아웃
/* ======================================================= */
.feed-write-container {
    max-width: 935px; /* 너비 확장 */
    margin: 40px auto;
    background-color: #ffffff;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    overflow: hidden; /* 내부 요소가 경계를 넘지 않도록 */
}

.page-title {
    text-align: center;
    font-size: 16px; /* 인스타그램 스타일과 유사하게 변경 */
    font-weight: 600;
    padding: 12px 0;
    border-bottom: 1px solid #efefef;
    margin: 0;
}

/* [신규] 2단 컬럼 레이아웃 */
.form-columns {
    display: flex;
}

.image-upload-section {
    flex: 1 1 60%; /* 왼쪽 컬럼 (60%) */
    border-right: 1px solid #efefef;
    padding: 20px;
}
.content-section {
    flex: 1 1 40%; /* 오른쪽 컬럼 (40%) */
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* ======================================================= */
/* 2. 이미지 업로드 영역
/* ======================================================= */
.existing-images-group, .new-images-group {
    margin-bottom: 20px;
}
.existing-images-group label, .new-images-group label, .hashtag-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
}

.image-preview-container {
    display: grid; /* [수정] flex에서 grid로 변경하여 더 깔끔한 정렬 */
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    min-height: 150px;
    border: 2px dashed #dbdbdb;
    border-radius: 8px;
    padding: 10px;
    background-color: #fafafa;
}
.image-preview-container:has(:not(.upload-placeholder)) {
    min-height: auto; /* [수정] 이미지가 있을 경우 최소 높이 제거 */
}

.upload-placeholder {
    grid-column: 1 / -1; /* 그리드 전체를 차지하도록 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}
.upload-label-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    color: #8e8e8e;
}
.upload-label-wrapper svg { margin-bottom: 16px; color: #c7c7c7; }
.upload-label-wrapper .btn { margin-top: 16px; }

.preview-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 비율 */
    border-radius: 6px;
    overflow: hidden;
}
.preview-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* [신규] 기존 이미지 삭제 버튼 */
.delete-existing-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}
.preview-image-wrapper:hover .delete-existing-image-btn {
    opacity: 1;
}

/* ======================================================= */
/* 3. 내용 입력 영역
/* ======================================================= */
.writer-profile {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    flex-shrink: 0; /* 줄어들지 않도록 */
}
.profile-image-small { width: 28px; height: 28px; border-radius: 50%; margin-right: 12px; }
.writer-nickname { font-weight: 600; font-size: 14px; }

#feed-content {
    border: none;
    resize: none;
    min-height: 150px;
    padding: 0;
    flex-grow: 1; /* 남은 공간을 모두 차지 */
    font-size: 14px;
}
#feed-content:focus { outline: none; box-shadow: none; }
.hashtag-group { margin-top: 15px; }
#feed-hashtags { font-size: 14px; padding: 8px; }

/* ======================================================= */
/* 4. 버튼 영역
/* ======================================================= */
.action-section {
    margin-top: auto; /* [수정] 버튼을 항상 하단에 위치시킴 */
    padding-top: 20px;
    border-top: 1px solid #efefef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
}
.btn-primary { background-color: #0095f6; color: white; border-color: #0095f6; }
.btn-secondary { background-color: #efefef; color: #262626; border-color: transparent; }
.btn:disabled { background-color: #b2dffc; border-color: #b2dffc; cursor: not-allowed; }