/* 게시글 상세 페이지 스타일 */
.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);
}

.member-author-menu {
    position: relative;
    display: inline-block;
    color: inherit;
}

.member-author-menu > summary {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    list-style: none;
    border-radius: 3px;
}

.member-author-menu > summary::-webkit-details-marker {
    display: none;
}

.member-author-menu > summary::after {
    content: "▾";
    color: #999;
    font-size: 10px;
}

.member-author-menu > summary:hover,
.member-author-menu > summary:focus-visible {
    color: var(--main-color);
    text-decoration: underline;
}

.member-author-actions {
    position: absolute;
    z-index: 20;
    top: calc(100% + 7px);
    left: 0;
    min-width: 142px;
    padding: 6px;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
}

.member-author-actions a {
    display: block;
    padding: 9px 11px;
    border-radius: 4px;
    color: #222;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.member-author-actions a:hover,
.member-author-actions a:focus-visible {
    background: #f2f2f2;
    color: #111;
}

.comment-author {
    font-size: 17px;
    font-weight: 700;
}

.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;
}

.public-comments{margin:48px 0 20px;border-top:2px solid #333}.public-comments h3{margin:0;padding:22px 0;border-bottom:1px solid #ddd;font-size:20px}.public-comment{position:relative;display:flex;gap:20px;padding:24px 0 24px min(calc(var(--comment-depth,0) * 42px),210px);border-bottom:1px solid #e5e5e5}.comment-reply-mark{position:absolute;left:max(calc(var(--comment-depth,1) * 42px - 28px),8px);top:30px;color:#aaa;font-size:22px}.comment-avatar{flex:0 0 72px;width:72px;height:72px;border:1px solid #ddd;background:#f5f5f5;display:flex;align-items:center;justify-content:center;color:#aaa;font-size:36px;overflow:hidden}.comment-avatar img{width:100%;height:100%;object-fit:cover}.comment-body{min-width:0;flex:1}.comment-body header{display:flex;align-items:baseline;justify-content:space-between;gap:18px}.comment-identity{display:flex;align-items:baseline;gap:18px}.comment-body header strong{font-size:17px}.comment-body time{color:#888;font-size:14px}.comment-actions{display:flex;gap:4px}.comment-actions button{border:0;background:transparent;color:#777;padding:4px 6px;cursor:pointer}.comment-actions button:hover,.comment-actions button:focus{color:#222;text-decoration:underline}.comment-content{margin:12px 0 0;white-space:pre-wrap;word-break:break-word;line-height:1.65}.comment-content p{margin:0}.public-comment-form{margin-top:24px}.public-comment-form label,.comment-inline-form label{display:block;margin-bottom:8px;font-weight:700}.public-comment-form textarea,.comment-inline-form textarea{display:block;width:100%;min-height:110px;padding:14px;border:1px solid #ccc;resize:vertical}.public-comment-form button{margin-top:10px;padding:10px 22px;border:0;background:var(--main-color);color:#111;font-weight:700;cursor:pointer}.comment-inline-form{margin-top:16px;padding:14px;background:#f7f7f7}.comment-inline-form>div{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}.comment-inline-form button{padding:7px 14px;border:1px solid #ccc;background:#fff;cursor:pointer}.comment-inline-form button[type=submit]{border-color:var(--main-color);background:var(--main-color);font-weight:700}.comment-inline-form [data-comment-error],.public-comment-form [data-comment-error]{margin:8px 0 0;color:#b42318}.comment-empty,.comment-login-guide,.comment-disabled-guide{padding:20px 0;color:#666}.board-comment-count{margin-left:8px;color:#d35400;font-size:13px;font-weight:700}
@media(max-width:640px){.public-comment{gap:12px;padding-left:min(calc(var(--comment-depth,0) * 18px),54px)}.comment-reply-mark{left:max(calc(var(--comment-depth,1) * 18px - 16px),2px)}.comment-avatar{flex-basis:52px;width:52px;height:52px;font-size:26px}.comment-body header{display:block}.comment-identity{display:block}.comment-body time{display:block;margin-top:4px}.comment-actions{margin-top:8px}.comment-inline-form{padding:10px}}

/* XE에서 이전된 기사 본문의 고정 1200px 테이블 레이아웃을 게시글 폭에 맞춘다. */
.post-content .article-view-content,
.post-content .article-view-content > .grid.body {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
}

.post-content .article-view-header [style*="width:"],
.post-content .article-view-content [style*="width:"] {
    max-width: 100% !important;
}

.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;
    }
}
