/* 게시글 상세 페이지 스타일 */
.post-header {
    margin-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
}

.post-title {
    font-size: 24px;
    color: var(--text-main);
    margin: 0 0 15px;
    word-break: break-word;
    display: flex;
    align-items: center;
}

.post-status {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 8px;
    font-size: 13px;
    font-weight: normal;
    color: #fff;
    background-color: #888;
    border-radius: 4px;
}

.post-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-sub2);
    gap: 15px;
}

.post-author {
    font-weight: 500;
    color: var(--text-sub1);
}

.post-content {
    min-height: 300px;
    line-height: 1.8;
    word-break: break-word;
    color: var(--text-main);
    margin-bottom: 40px;
}

.post-content img {
    max-width: 100%;
    height: auto;
}

.post-files {
    margin-bottom: 40px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.post-files h3 {
    font-size: 16px;
    margin: 0 0 15px;
    color: var(--text-main);
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-list li {
    margin-bottom: 10px;
    padding-left: 22px;
    position: relative;
}

.file-list li:last-child {
    margin-bottom: 0;
}

.file-list li:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'%3E%3C/path%3E%3Cpolyline points='14 2 14 8 20 8'%3E%3C/polyline%3E%3Cline x1='16' y1='13' x2='8' y2='13'%3E%3C/line%3E%3Cline x1='16' y1='17' x2='8' y2='17'%3E%3C/line%3E%3Cpolyline points='10 9 9 9 8 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.file-link {
    color: var(--text-sub1);
    text-decoration: none;
    transition: color 0.3s;
}

.file-link:hover {
    color: var(--main-color);
    text-decoration: underline;
}

.file-size {
    margin-left: 8px;
    color: var(--text-sub2);
    font-size: 13px;
}

/* 버튼 컨테이너 */
.post-actions-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    flex-wrap: wrap;
}

/* SNS 공유 버튼 */
.post-share {
    display: flex;
    gap: 10px;
}

.btn-share {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-share svg {
    width: 16px;
    height: 16px;
}

.btn-share-x {
    background-color: #f8f9fa;
    color: #000;
    border: 1px solid #e0e0e0;
}

.btn-share-x:hover {
    background-color: #000;
    color: #fff;
}

.btn-share-facebook {
    background-color: #f8f9fa;
    color: #1877F2;
    border: 1px solid #e0e0e0;
}

.btn-share-facebook:hover {
    background-color: #1877F2;
    color: #fff;
}

/* 버튼 스타일 통일 */
.post-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 0;
}

.btn-edit,
.btn-hide,
.btn-delete,
.btn-list {
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px; /* 고정 너비 줄임 */
    height: 38px; /* 모든 버튼 높이 통일 */
    line-height: 1;
    border: none;
}

.btn-edit {
    background-color: #4A90E2;
    color: white;
}

.btn-edit:hover {
    background-color: #3A7EC9;
    box-shadow: 0 2px 5px rgba(74, 144, 226, 0.3);
}

.btn-hide {
    background-color: #F9A825;
    color: white;
}

.btn-hide:hover {
    background-color: #E59819;
    box-shadow: 0 2px 5px rgba(249, 168, 37, 0.3);
}

.btn-delete {
    background-color: #E53935;
    color: white;
}

.btn-delete:hover {
    background-color: #D32F2F;
    box-shadow: 0 2px 5px rgba(229, 57, 53, 0.3);
}

.btn-list {
    background-color: #ECEFF1;
    color: #455A64;
    border: 1px solid #CFD8DC;
}

.btn-list:hover {
    background-color: #CFD8DC;
    color: #263238;
    box-shadow: 0 2px 5px rgba(69, 90, 100, 0.1);
}

/* 모든 버튼에 transform 효과 제거 - 정렬 문제 해결 */
.btn-edit:hover,
.btn-hide:hover,
.btn-delete:hover,
.btn-list:hover {
    transform: none;
}

/* 모든 버튼의 위치 정렬 확실히 맞추기 */
.post-actions a,
.post-actions button {
    position: relative;
    top: 0;
    vertical-align: middle;
}

/* === SunEditor 콘텐츠 표시 (비디오 등) === */

/* 비디오 컨테이너를 block으로 처리하여 본문 영역 안에 배치.
   float 대신 margin으로 정렬하여 레이아웃 깨짐 방지. */
.post-content .se-video-container,
.data-content .se-video-container,
.content-area .se-video-container,
.popup-body .se-video-container {
    display: block;
    max-width: 100%;
    margin-bottom: 1em;
}

/* 정렬: float 대신 margin 사용 */
.post-content .se-video-container.__se__float-right,
.data-content .se-video-container.__se__float-right,
.content-area .se-video-container.__se__float-right {
    margin-left: auto;
    margin-right: 0;
}
.post-content .se-video-container.__se__float-left,
.data-content .se-video-container.__se__float-left,
.content-area .se-video-container.__se__float-left {
    margin-right: auto;
    margin-left: 0;
}
.post-content .se-video-container.__se__float-center,
.data-content .se-video-container.__se__float-center,
.content-area .se-video-container.__se__float-center,
.post-content .se-video-container.__se__float-none,
.data-content .se-video-container.__se__float-none,
.content-area .se-video-container.__se__float-none {
    margin-left: auto;
    margin-right: auto;
}

/* figure를 relative 기준으로, iframe을 absolute로 채움.
   SunEditor가 figure에 height:56.25% + padding-bottom:56.25% 인라인 스타일을 같이 넣는데,
   height:%는 부모 높이 기준이라 auto 컨테이너에서 0이 되어 padding-bottom 트릭을 망친다.
   따라서 figure의 height를 0으로 강제하고 padding-bottom(56.25% = 16:9)으로 종횡비를 만든다. */
.post-content .se-video-container figure,
.data-content .se-video-container figure,
.content-area .se-video-container figure,
.popup-body .se-video-container figure {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 0 !important;
    overflow: hidden;
}

.post-content .se-video-container iframe,
.data-content .se-video-container iframe,
.content-area .se-video-container iframe,
.popup-body .se-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* 반응형 조정 */
@media (max-width: 768px) {
    .post-title {
        font-size: 20px;
    }

    .post-actions-container {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .post-share {
        justify-content: center;
        order: 2;
    }

    .post-actions {
        flex-direction: column;
        order: 1;
        width: 100%;
    }

    .btn-edit,
    .btn-hide,
    .btn-delete,
    .btn-list {
        width: 100%;
        margin-bottom: 5px;
    }
}