/**
 * v7/post/view.css - 게시판 글 읽기 페이지 스타일
 *
 * v7 전용 CSS. Bootstrap 미사용.
 * Web Awesome Pro CSS 변수 활용.
 */

/* === 에러 상태 === */
.post-view-error {
    padding: 2rem;
    text-align: center;
    color: #dc2626;
    font-size: 0.85rem;
}

/* === 브레드크럼 === */
.post-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0;
    font-size: 0.75rem;
    color: var(--wa-color-neutral-400, #94a3b8);
}

.post-breadcrumb a {
    color: var(--wa-color-neutral-500, #64748b);
    text-decoration: none;
}

.post-breadcrumb a:hover {
    color: var(--wa-color-brand-600, #2563eb);
}

.post-breadcrumb i {
    font-size: 0.6rem;
}

/* === 카테고리 뱃지 === */
.post-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--wa-color-brand-700, #1d4ed8);
    background: var(--wa-color-brand-50, #eff6ff);
    border-radius: 20px;
    margin-bottom: 0.5rem;
}

.post-category-badge i {
    font-size: 0.6rem;
}

/* === 글 헤더 === */
.post-view-header {
    padding: 1rem 0 0.85rem;
    border-bottom: 1px solid var(--wa-color-neutral-200, #e2e8f0);
}

.post-view-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.85rem;
    color: var(--wa-color-neutral-900, #0f172a);
    line-height: 1.45;
    word-break: break-word;
}

/* 작성자 행: 아바타 + 이름/날짜 */
.post-view-author-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.post-view-author-row wa-avatar {
    --size: 2.25rem;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.post-view-author-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.post-view-author {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--wa-color-neutral-700, #334155);
}

.post-view-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.72rem;
    color: var(--wa-color-neutral-400, #94a3b8);
    flex-wrap: wrap;
}

.post-view-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.post-view-stat i {
    font-size: 0.65rem;
}

/* === 글 본문 === */
.post-view-content {
    padding: 1.5rem 0 1.25rem;
    font-size: 0.92rem;
    line-height: 1.85;
    color: var(--wa-color-neutral-800, #1e293b);
    word-break: break-word;
    overflow-wrap: break-word;
    min-height: 3rem;
}

.post-view-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.post-view-content a {
    color: var(--wa-color-brand-600, #2563eb);
    text-decoration: underline;
}

.post-view-content iframe {
    max-width: 100%;
}

/* === 차단된 글 === */
.post-blocked-notice {
    padding: 2rem;
    text-align: center;
    color: var(--wa-color-neutral-400, #94a3b8);
}

.post-blocked-notice i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.post-blocked-notice p {
    margin: 0;
    font-size: 0.85rem;
}

/* === 사용자 차단 블라인드 (회원 간 차단) === */
.post-user-blocked-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: #f8fafc;
    border-radius: 12px;
}

/* 차단 아이콘 래퍼: 연한 빨간 원형 배경 */
.post-blocked-ban-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fef2f2;
    color: #f87171;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* 메시지 영역 */
.post-blocked-ban-msg strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--wa-color-neutral-40, #334155);
    margin-bottom: 0.25rem;
}

.post-blocked-ban-msg p {
    font-size: 0.8rem;
    color: var(--wa-color-neutral-60, #64748b);
    margin: 0;
    line-height: 1.5;
}

/* 코멘트 차단 블라인드 */
.comment-user-blocked {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--wa-color-neutral-400, #94a3b8);
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.unblock-comment-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--wa-color-neutral-300, #cbd5e1);
    border-radius: 0.25rem;
    background: transparent;
    color: var(--wa-color-neutral-500, #64748b);
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.15s;
}

.unblock-comment-btn:hover {
    background: var(--wa-color-neutral-100, #f1f5f9);
}

/* 차단 버튼 활성 상태 (액션바) */
.post-block-active {
    color: var(--wa-color-red-50, #ef4444) !important;
}

/* 코멘트 차단 버튼 활성 상태 */
.comment-block-active {
    color: var(--wa-color-red-50, #ef4444) !important;
}

/* === 첨부파일 === */
.post-files-section {
    padding: 0.85rem 0;
    margin-top: 0.25rem;
    border-top: 1px dashed var(--wa-color-neutral-200, #e2e8f0);
}

.post-files-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--wa-color-neutral-600, #475569);
    margin: 0 0 0.5rem;
}

.post-files-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-file-image {
    display: block;
}

.post-file-image img {
    max-width: 200px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--wa-color-neutral-200, #e2e8f0);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.post-file-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-file-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
    color: var(--wa-color-brand-600, #2563eb);
    background: var(--wa-color-brand-50, #eff6ff);
    border: 1px solid var(--wa-color-brand-100, #dbeafe);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.post-file-link:hover {
    background: var(--wa-color-brand-100, #dbeafe);
    border-color: var(--wa-color-brand-200, #bfdbfe);
}

/* === 액션 바 === */
.post-action-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem 0;
}

.post-action-buttons {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

.post-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--wa-color-neutral-500, #64748b);
    background: transparent;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
    white-space: nowrap;
}

.post-action-btn i {
    font-size: 0.75rem;
}

.post-action-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--wa-color-neutral-600, #475569);
}

/* 좋아요 버튼: 블루 텍스트 */
.post-like-btn {
    color: var(--wa-color-brand-600, #2563eb);
}

.post-like-btn:hover {
    background: rgba(37, 99, 235, 0.06);
    color: var(--wa-color-brand-700, #1d4ed8);
}

.post-action-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: inherit;
}

/* 삭제 버튼: 다른 버튼과 동일 (create.css 오버라이드 방지) */
.post-action-buttons .post-delete-btn {
    color: var(--wa-color-neutral-500, #64748b);
    background: transparent;
    border: none;
}

/* 삭제 확인 버튼: 빨간 배경 (확인 단계만) */
.post-delete-confirm-btn {
    color: #fff;
    background: #dc2626;
}

.post-delete-confirm-btn:hover {
    background: #b91c1c;
}

/* === 코멘트 영역 === */
.post-comments-section {
    padding: 1.25rem 0 1rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--wa-color-neutral-200, #e2e8f0);
}

.post-comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.post-comments-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
    color: var(--wa-color-neutral-800, #1e293b);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.post-comments-title i {
    color: var(--wa-color-brand-500, #3b82f6);
    font-size: 0.85rem;
}

.post-comments-title wa-badge {
    font-size: 0.6rem;
}

.post-comments-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--wa-color-neutral-50, #475569);
    background: var(--wa-color-neutral-95, #f8fafc);
    border: none;
    border-radius: 12px;
    margin-top: 0.5rem;
}

.post-comments-empty i {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--wa-color-neutral-60, #94a3b8);
}

.post-comments-empty p {
    margin: 0 0 0.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--wa-color-neutral-40, #475569);
}

.post-comments-empty span {
    font-size: 0.75rem;
    color: var(--wa-color-neutral-50, #64748b);
}

/* === 코멘트 목록 === */
.post-comment-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* === 코멘트 아이템 (레거시 flat 구조) === */
.post-comment-item {
    display: flex;
    gap: 0.65rem;
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    transition: background-color 0.15s ease;
    position: relative;
}

.post-comment-item:hover {
    background-color: var(--wa-color-neutral-50, #f8fafc);
}

.post-comment-item + .post-comment-item {
    border-top: 1px solid var(--wa-color-neutral-100, #f1f5f9);
}

/* 대댓글 들여쓰기 + 좌측 연결선 */
.post-comment-item.depth-2 {
    margin-left: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--wa-color-brand-200, #bfdbfe);
    border-radius: 0 8px 8px 0;
}

.post-comment-item.depth-3 {
    margin-left: 3rem;
    padding-left: 1rem;
    border-left: 2px solid var(--wa-color-brand-100, #dbeafe);
    border-radius: 0 8px 8px 0;
}

.post-comment-item.depth-4 {
    margin-left: 4rem;
    padding-left: 1rem;
    border-left: 2px solid var(--wa-color-neutral-200, #e2e8f0);
    border-radius: 0 8px 8px 0;
}

/* 레거시 대댓글 아이콘 (border-left로 대체) */
.comment-reply-icon {
    display: none;
}

/* === 코멘트 아바타 (레거시) === */
.comment-avatar {
    flex-shrink: 0;
    padding-top: 0.1rem;
}

.comment-avatar wa-avatar {
    --size: 2rem;
    font-size: 0.75rem;
}

.post-comment-item.depth-2 .comment-avatar wa-avatar,
.post-comment-item.depth-3 .comment-avatar wa-avatar,
.post-comment-item.depth-4 .comment-avatar wa-avatar {
    --size: 1.75rem;
    font-size: 0.7rem;
}

/* === 코멘트 본문 래퍼 === */
.comment-body-wrap {
    flex: 1;
    min-width: 0;
}

/* === 코멘트 헤더 === */
.post-comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.comment-author {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--wa-color-neutral-700, #334155);
}

.comment-date {
    font-size: 0.7rem;
    color: var(--wa-color-neutral-400, #94a3b8);
}

.comment-date wa-relative-time {
    font-size: inherit;
    color: inherit;
}

/* === 코멘트 본문 === */
.post-comment-body {
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--wa-color-neutral-700, #334155);
    word-break: break-word;
}

.comment-blocked {
    color: var(--wa-color-neutral-400, #94a3b8);
    font-style: italic;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* === 코멘트 첨부 이미지 === */
.comment-files {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.comment-image {
    max-width: 200px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--wa-color-neutral-200, #e2e8f0);
    transition: transform 0.15s ease;
}

.comment-image:hover {
    transform: scale(1.02);
}

/* === 하단 글 목록 === */
.post-bottom-list {
    padding-top: 1.25rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--wa-color-neutral-200, #e2e8f0);
}

.post-bottom-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    margin-bottom: 0;
}

.post-bottom-list-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: var(--wa-color-neutral-900, #0f172a);
}

/* 현재 보고 있는 글 하이라이트 */
.post-list-row.current-post {
    background: rgba(37, 99, 235, 0.06);
}

.post-list-row.current-post .post-subject {
    color: var(--wa-color-brand-700, #1d4ed8);
    font-weight: 700;
}

/* 위젯 기반 현재 글 하이라이트 (post-list-widget.php에서 사용) */
.post-tile-current-wrapper .post-tile-row {
    background: rgba(37, 99, 235, 0.06);
}

.post-tile-current-wrapper .post-tile-subject {
    color: var(--wa-color-brand-700, #1d4ed8);
    font-weight: 700;
}

/* ================================================
   코멘트 작성 폼 — 깔끔하고 모던한 디자인
   ================================================ */
/* --- 기본 댓글 작성 폼 컨테이너 --- */
.comment-create-form {
    margin-bottom: 1.25rem;
    transition: all 0.25s ease;
}

/* --- 접힌 상태 (한 줄) --- */
.comment-collapsed-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--wa-color-neutral-95, #f8fafc);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comment-collapsed-row:hover {
    background: var(--wa-color-neutral-90, #f1f5f9);
}

.comment-collapsed-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--wa-color-neutral-500, #64748b);
    cursor: pointer;
    padding: 0.3rem 0;
    font-family: inherit;
}

.comment-collapsed-input::placeholder {
    color: var(--wa-color-neutral-50, #64748b);
}

.comment-camera-btn {
    width: 2.4rem;
    height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 50%;
    color: var(--wa-color-neutral-50, #64748b);
    cursor: pointer;
    font-size: 1.15rem;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.comment-camera-btn:hover {
    color: var(--wa-color-brand-50, #3b82f6);
    background: var(--wa-color-brand-95, #eff6ff);
}

.comment-send-btn {
    width: 2.1rem;
    height: 2.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 50%;
    color: var(--wa-color-neutral-50, #64748b);
    cursor: pointer;
    font-size: 1.05rem;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.comment-send-btn:hover {
    color: var(--wa-color-brand-600, #2563eb);
}

/* --- 펼친 상태 --- */
.comment-create-form.expanded {
    padding: 0.75rem;
    background: var(--wa-color-neutral-95, #f8fafc);
    border-radius: 10px;
    border: none;
    animation: commentExpandIn 0.25s ease-out;
}

@keyframes commentExpandIn {
    from {
        opacity: 0.8;
        transform: scaleY(0.95);
        transform-origin: top;
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

.comment-create-form.expanded:focus-within {
    background: var(--wa-color-neutral-90, #f1f5f9);
}

.comment-expanded-area {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.comment-expanded-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.comment-expanded-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.comment-save-btn {
    padding: 0.45rem 1rem !important;
    font-size: 0.82rem !important;
    border-radius: 8px !important;
    gap: 0.35rem !important;
}

.comment-form-error {
    padding: 0.4rem 0.6rem;
    background: #fef2f2;
    border: none;
    border-radius: 6px;
    color: #dc2626;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.comment-input-row {
    display: flex;
    gap: 0.4rem;
    align-items: flex-end;
}

.comment-textarea {
    flex: 1;
    padding: 0.55rem 0.7rem;
    font-size: 0.84rem;
    border: 1px solid var(--wa-color-neutral-200, #e2e8f0);
    border-radius: 8px;
    outline: none;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
    min-height: 2.5rem;
    box-sizing: border-box;
    background: #fff;
    color: var(--wa-color-neutral-800, #1e293b);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.comment-textarea:focus {
    border-color: var(--wa-color-brand-400, #60a5fa);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.06);
}

.comment-textarea::placeholder {
    color: var(--wa-color-neutral-400, #94a3b8);
}

.comment-input-actions {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    flex-shrink: 0;
}

.comment-attach-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--wa-color-neutral-400, #94a3b8);
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.15s ease;
}

.comment-attach-btn:hover {
    background: var(--wa-color-brand-95, #eff6ff);
    color: var(--wa-color-brand-600, #2563eb);
}

.comment-submit-btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    background: var(--wa-color-brand-600, #2563eb);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.comment-submit-btn:hover {
    background: var(--wa-color-brand-700, #1d4ed8);
}

.comment-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comment-upload-area {
    margin-top: 0.5rem;
}

/* === 코멘트 액션 버튼 === */
.comment-actions-wrap {
    margin-top: 0.3rem;
}

.comment-action-buttons {
    display: flex;
    gap: 0.1rem;
}

.comment-action-link {
    background: none;
    border: none;
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    color: var(--wa-color-neutral-400, #94a3b8);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    border-radius: 4px;
    transition: all 0.15s;
}

.comment-action-link:hover {
    color: var(--wa-color-brand-600, #2563eb);
    background: var(--wa-color-brand-50, #eff6ff);
}

.comment-action-danger:hover {
    color: #dc2626 !important;
    background: #fef2f2 !important;
}

/* 수정 폼 기본 스타일 */
.comment-edit-form {
    margin-top: 0.5rem;
    padding: 0.6rem;
    background: var(--wa-color-neutral-95, #f8fafc);
    border-radius: 8px;
    border: none;
}

/* 대댓글(답글) 폼 — 개선된 디자인 */
.comment-reply-form {
    margin-top: 0.6rem;
    padding: 0.75rem 0.85rem;
    background: var(--wa-color-neutral-95, #f8fafc);
    border-radius: 10px;
    border: none;
    border-left: 3px solid var(--wa-color-brand-400, #60a5fa);
    transition: background 0.2s ease;
    animation: replyFormSlideIn 0.2s ease-out;
}

@keyframes replyFormSlideIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-reply-form:focus-within {
    background: var(--wa-color-neutral-90, #f1f5f9);
    border-left-color: var(--wa-color-brand-500, #3b82f6);
}

/* 대댓글 폼 내부: 세로 배치 (textarea 상단, 버튼 하단) */
.comment-reply-form .comment-input-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
}

/* 대댓글 폼 textarea 전체 너비 */
.comment-reply-form .comment-textarea {
    width: 100%;
    min-height: 3.5rem;
    border-radius: 8px;
}

/* 대댓글 폼 버튼 그룹 — 우측 정렬 */
.comment-reply-form .comment-input-actions {
    align-self: flex-end;
    gap: 0.4rem;
}

.comment-edit-actions {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.35rem;
    align-items: center;
}

.comment-cancel-link {
    background: var(--wa-color-neutral-90, #f1f5f9);
    border: none;
    padding: 0.35rem 0.75rem;
    font-size: 0.76rem;
    color: var(--wa-color-neutral-600, #475569);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}

.comment-cancel-link:hover {
    background: var(--wa-color-neutral-85, #e2e8f0);
}

/* === 코멘트 모바일 반응형 (레거시 flat 구조) === */
@media (max-width: 640px) {
    .post-comment-item.depth-2 {
        margin-left: 0.75rem;
    }

    .post-comment-item.depth-3 {
        margin-left: 1.25rem;
    }

    .post-comment-item.depth-4 {
        margin-left: 1.5rem;
    }

    .comment-avatar wa-avatar {
        --size: 1.75rem;
        font-size: 0.7rem;
    }

    .post-comment-item.depth-2 .comment-avatar wa-avatar,
    .post-comment-item.depth-3 .comment-avatar wa-avatar,
    .post-comment-item.depth-4 .comment-avatar wa-avatar {
        --size: 1.5rem;
        font-size: 0.65rem;
    }
}

/* ============================================
   Reddit 스타일 코멘트 스레드

   핵심: 아바타 바로 아래에서 세로선이 시작하며,
   마지막 직접 자식의 아바타 중앙까지만 세로선 표시.
   세로선 높이는 JS(adjustThreadLines)로 동적 계산.
   ============================================ */

/* 코멘트 노드: 절대위치 thread-line의 기준 */
.comment-node {
    position: relative;
    padding: 0.4rem 0;
}

/* 코멘트 행: avatar-col + body-col */
.comment-row {
    display: flex;
    align-items: flex-start;
    position: relative;
}

/* 최상위 코멘트 간 구분선 */
.reddit-threads > .comment-node + .comment-node {
    border-top: 1px solid var(--wa-color-neutral-100, #f1f5f9);
    margin-top: 0.15rem;
    padding-top: 0.5rem;
}

/* === 아바타 컬럼: 아바타 + 세로선 시작점 === */
.comment-avatar-col {
    width: 36px;
    flex: 0 0 36px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 6px;
}

/* 아바타 크기 */
.comment-avatar-col wa-avatar {
    --size: 1.75rem;
    font-size: 0.7rem;
}

/* 최상위 코멘트 아바타 (약간 더 크게) */
.reddit-threads > .comment-node > .comment-row > .comment-avatar-col wa-avatar {
    --size: 2rem;
    font-size: 0.75rem;
}

/* === 절대 위치 세로선: 아바타 바로 아래에서 시작 === */
/* height는 JS adjustThreadLines()로 동적 계산 */
.thread-line {
    position: absolute;
    left: 17px;       /* 아바타 컬럼 중앙 (36px/2 - 1px) */
    top: 40px;        /* 초기값, JS adjustThreadLines()에서 재계산 */
    width: 1px;
    background-color: var(--wa-color-neutral-300, #cbd5e1);
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.15s, width 0.15s;
}

.thread-line:hover {
    background-color: var(--wa-color-brand-500, #3b82f6);
    width: 3px;
    left: 16px;
}

/* 접힌 상태에서 세로선 숨김 */
.comment-node.collapsed > .thread-line {
    display: none;
}

/* === 코멘트 본문 컬럼 === */
.comment-body-col {
    flex: 1;
    min-width: 0;
    padding: 4px 0 4px 4px;
}

/* === 접힌 상태 처리 === */
.comment-node.collapsed > .comment-row .post-comment-body,
.comment-node.collapsed > .comment-row .comment-files,
.comment-node.collapsed > .comment-row .post-comment-actions,
.comment-node.collapsed > .thread-children {
    display: none;
}

/* 접힌 상태 알림 텍스트 (기본 숨김) */
.thread-collapsed-info {
    display: none;
    font-size: 0.72rem;
    color: var(--wa-color-brand-600, #2563eb);
    cursor: pointer;
    font-weight: 500;
    margin-left: 0.25rem;
}

/* 접힌 상태: "[+N개 답글]" 텍스트 표시 */
.comment-node.collapsed .thread-collapsed-info {
    display: inline;
}

/* === 자식 코멘트 영역: 아바타 중앙 기준 들여쓰기 === */
.thread-children {
    margin-left: 18px;
    padding-left: 18px;
}

/* === L자 곡선: 마지막 직접 자식에 곡선 연결선 (Reddit 동일) === */
/* 모든 직접 자식에 곡선 연결선 */
.thread-children > .comment-node::before {
    content: '';
    position: absolute;
    left: -19px;       /* 부모 세로선 위치와 정렬 */
    top: 0;
    width: 15px;
    height: 20px;      /* 아바타 중앙까지 (padding 6px + avatar/2 14px) */
    border-left: 1px solid var(--wa-color-neutral-300, #cbd5e1);
    border-bottom: 1px solid var(--wa-color-neutral-300, #cbd5e1);
    border-bottom-left-radius: 10px;
    border-right: none;
    border-top: none;
    z-index: 5;
}

/* === 모바일 반응형 === */
@media (max-width: 640px) {
    /* 모바일 글 헤더 */
    .post-view-title {
        font-size: 1.1rem;
    }

    .post-view-author-row wa-avatar {
        --size: 2rem;
    }

    /* 모바일 액션 바 */
    .post-action-btn {
        padding: 0.3rem 0.55rem;
        font-size: 0.72rem;
    }

    /* 모바일 댓글 폼 */
    .comment-create-form {
        padding: 0.6rem;
    }

    .comment-input-row {
        flex-direction: column;
        gap: 0.4rem;
    }

    .comment-input-actions {
        align-self: flex-end;
    }

    /* 모바일 스레드 */
    .comment-avatar-col {
        width: 30px;
        flex: 0 0 30px;
        padding-top: 4px;
    }

    .comment-avatar-col wa-avatar {
        --size: 1.5rem;
        font-size: 0.65rem;
    }

    .reddit-threads > .comment-node > .comment-row > .comment-avatar-col wa-avatar {
        --size: 1.75rem;
        font-size: 0.7rem;
    }

    .thread-line {
        left: 14px;
    }

    .thread-line:hover {
        left: 13px;
    }

    .comment-body-col {
        padding-left: 2px;
    }

    .thread-children {
        margin-left: 15px;
        padding-left: 15px;
    }

    .thread-children > .comment-node::before {
        left: -16px;
        width: 12px;
        height: 16px;
        border-bottom-left-radius: 8px;
    }
}
