/* 게시판 글 뷰어 모달 컴포넌트 — 파트너 게시판 페이지와 파트너 상세 프로젝트 후기 카드가 같이 쓴다.
   빈 댓글 상태는 detail-shared.css의 .detail-empty-state를 쓰므로 이 시트를 싣는 지면은 그 시트도 함께 싣는다. */

.news-tag {
    display: inline-block;
    background: var(--gray-200);
    color: var(--text-sub);
    font-size: 14px;
    border-radius: 4px;
    padding: 2px 8px 3px;
    margin-right: 4px;
}

.comment-partner-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    background: linear-gradient(135deg, rgba(155, 125, 212, 0.12), rgba(124, 92, 184, 0.10));
    border: 1px solid rgba(155, 125, 212, 0.2);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--secondary, #9B7DD4);
    line-height: 1;
}

body.theme-dark .comment-partner-badge {
    background: linear-gradient(135deg, rgba(155, 125, 212, 0.15), rgba(124, 92, 184, 0.12));
    border-color: rgba(180, 154, 232, 0.25);
    color: #B49AE8;
}

.message-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--gray-50, #f9fafb);
    border: 1px solid var(--gray-200);
}

.message-item .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-right: 8px; /* 구 detail-shared의 bare .user-name이 주던 간격 — 삭제와 함께 이 규칙이 승계 */
}

.message-date {
    font-size: 12px;
    color: var(--text-muted);
}

.message-content {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-sub);
    margin: 0;
    word-break: break-word;
}

body.theme-dark .message-item {
    background: rgba(255, 255, 255, 0.04);
}

.post-viewer-modal .ui-modal {
    width: min(1000px, 90vw);
    max-height: 90vh;
}

.post-viewer-modal .ui-modal__body {
    padding: 0;
    background: rgba(245, 246, 250, 0.5);
}

body.theme-dark .post-viewer-modal .ui-modal__body {
    background: rgba(255, 255, 255, 0.03);
}

/* 공백 없는 영문·숫자·URL 연속 문자열은 끊을 자리가 없어 모달 밖으로 뚫고 나간다 — 제목·본문·댓글을 루트 한 곳에서 끊는다 */
.post-viewer {
    padding: 24px 30px 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-wrap: anywhere;
}

.post-viewer-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-viewer-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.4;
}

.post-viewer-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
}

.post-viewer-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-sub, #6b7280);
}

.post-viewer-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    border-radius: 9999px;
    background: var(--gray-50, #f9fafb);
    border: 1px solid var(--gray-200, #e5e7eb);
    font-size: 12px;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.post-viewer-meta__item:hover {
    background: var(--gray-100, #f3f4f6);
    border-color: var(--gray-300, #d1d5db);
}

body.theme-dark .post-viewer-meta__item {
    background: var(--surface-glass, rgba(255, 255, 255, 0.055));
    border-color: var(--border-default, rgba(255, 255, 255, 0.09));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.theme-dark .post-viewer-meta__item:hover {
    background: var(--surface-glass-hover, rgba(255, 255, 255, 0.095));
    border-color: rgba(255, 255, 255, 0.15);
}

.post-viewer-meta__item--author {
    background: rgba(59, 130, 246, 0.06);
    border-color: rgba(59, 130, 246, 0.15);
    color: var(--text-main, #111827);
    font-weight: 600;
}

.post-viewer-meta__item--author:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.25);
}

body.theme-dark .post-viewer-meta__item--author {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.2);
    color: var(--text-main);
}

body.theme-dark .post-viewer-meta__item--author:hover {
    background: rgba(59, 130, 246, 0.12);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.15);
}

.post-viewer-meta__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1D4ED8, #3B82F6);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
    flex-shrink: 0;
}

.post-viewer-meta__avatar i {
    font-size: 10px;
    color: #ffffff;
}

.post-viewer-meta__icon {
    font-size: 12px;
    color: var(--text-desc, #9ca3af);
    margin-left: 6px;
}

.post-viewer-reactions {
    display: flex;
    justify-content: center;
    padding: 24px 0 20px;
}

.post-viewer-like-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.post-viewer-like-btn:active .post-viewer-like-icon {
    transform: scale(0.88);
}

.post-viewer-like-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gray-100, #f3f4f6);
    border: 2px solid var(--gray-200, #e5e7eb);
    font-size: 20px;
    color: var(--text-desc, #9ca3af);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-viewer-like-btn:hover .post-viewer-like-icon {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.25);
    color: #f87171;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.1);
}

.post-viewer-like-btn.is-liked .post-viewer-like-icon {
    background: linear-gradient(135deg, #fecaca, #fca5a5);
    border-color: #f87171;
    color: #dc2626;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
}

.post-viewer-like-btn.is-liked:hover .post-viewer-like-icon {
    background: linear-gradient(135deg, #fca5a5, #f87171);
    box-shadow: 0 6px 24px rgba(239, 68, 68, 0.3);
}

.post-viewer-like-btn.is-liked .post-viewer-like-icon i {
    font-weight: 900;
}

.post-viewer-like-count {
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-sub);
}

.post-viewer-like-btn.is-liked .post-viewer-like-count {
    color: #dc2626;
}

body.theme-dark .post-viewer-like-icon {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-desc);
}

body.theme-dark .post-viewer-like-btn:hover .post-viewer-like-icon {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.15);
}

body.theme-dark .post-viewer-like-btn.is-liked .post-viewer-like-icon {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.25);
}

body.theme-dark .post-viewer-like-btn.is-liked:hover .post-viewer-like-icon {
    background: rgba(239, 68, 68, 0.22);
    box-shadow: 0 6px 28px rgba(239, 68, 68, 0.35);
}

body.theme-dark .post-viewer-like-count {
    color: var(--text-sub);
}

body.theme-dark .post-viewer-like-btn.is-liked .post-viewer-like-count {
    color: #ef5350;
}

.post-viewer-meta__right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.post-viewer-meta__actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.post-viewer-meta__actions[hidden] {
    display: none;
}

.post-viewer-meta__action-btn[hidden] {
    display: none;
}

.post-viewer-meta__action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: var(--radius-md, 6px);
    background: transparent;
    color: var(--text-sub);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.post-viewer-meta__action-btn:hover {
    color: var(--text-main);
    background: var(--gray-50, #f9fafb);
    border-color: var(--gray-200, #e5e7eb);
}

.post-viewer-meta__action-btn.is-disabled, .post-viewer-meta__action-btn:disabled {
    position: relative;
    opacity: 0.45;
    cursor: not-allowed;
}

.post-viewer-meta__action-btn[data-disabled-reason] {
    opacity: 1;
    background: var(--gray-50, #f9fafb);
    border-color: var(--gray-300);
    color: var(--text-desc, #9ca3af);
}

.post-viewer-meta__action-btn.is-disabled:hover, .post-viewer-meta__action-btn:disabled:hover {
    color: var(--text-desc, #9ca3af);
    background: transparent;
    border-color: transparent;
}

.post-viewer-meta__action-btn[data-disabled-reason]::after {
    content: attr(data-disabled-reason);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    z-index: var(--z-dropdown, 50);
    width: max-content;
    max-width: 230px;
    padding: 8px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: #fff;
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: normal;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
}

.post-viewer-meta__action-btn[data-disabled-reason]::after {
    left: auto;
    right: calc(100% + 8px);
    top: 50%;
    bottom: auto;
    max-width: 180px;
    transform: translate(4px, -50%);
}

.post-viewer-meta__action-btn[data-disabled-reason]:hover::after, .post-viewer-meta__action-btn[data-disabled-reason]:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.post-viewer-meta__action-btn[data-disabled-reason]:hover::after, .post-viewer-meta__action-btn[data-disabled-reason]:focus-visible::after {
    transform: translate(0, -50%);
}

body.theme-dark .post-viewer-meta__action-btn[data-disabled-reason]::after {
    background: #1f2937;
    border-color: var(--border-default);
    color: var(--text-main);
}

body.theme-dark .post-viewer-meta__action-btn:hover {
    background: var(--surface-glass, rgba(255, 255, 255, 0.055));
    border-color: var(--border-default, rgba(255, 255, 255, 0.09));
}

.post-viewer-meta__action-btn.is-active {
    color: var(--accent-partner);
    background: rgba(155, 125, 212, 0.1);
    border-color: rgba(155, 125, 212, 0.28);
}

.post-viewer-meta__action-btn.is-active:hover {
    color: var(--accent-partner);
    background: rgba(155, 125, 212, 0.16);
    border-color: rgba(155, 125, 212, 0.38);
}

body.theme-dark .post-viewer-meta__action-btn.is-active {
    background: rgba(180, 154, 232, 0.14);
    border-color: rgba(180, 154, 232, 0.28);
    color: #B49AE8;
}

.post-viewer-meta__action-btn--danger:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

body.theme-dark .post-viewer-meta__action-btn--danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.25);
}

.post-viewer-tags {
    display: flex;
    gap: 5px;
}

.post-viewer-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-viewer-text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-sub);
    padding: 18px 20px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    white-space: pre-line;
}

.post-viewer-text p {
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .post-viewer-modal .ui-modal {
        width: min(1000px, 95vw);
    }
    .post-viewer {
        padding: 20px;
    }
    .post-viewer-title {
        font-size: 20px;
    }
    .post-viewer-meta {
        gap: 6px;
    }
}

.popup-support-section {
    border-top: 1px solid var(--gray-200);
    padding-top: 24px;
}

.support-title {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-main);
}

.support-title__icon {
    margin-right: 6px;
    font-size: 14px;
    color: var(--text-desc);
}

body.theme-dark .support-title__icon {
    color: #60A5FA;
}

/* 다른 글 목록 — 행 DOM은 board-post-viewer.js(renderOthers)가 만든다 */
.post-viewer-others {
    border-top: 1px solid var(--gray-200);
    padding-top: 24px;
}

.post-viewer-others__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.post-viewer-others__head .support-title {
    margin-bottom: 0;
}

.post-viewer-others__pager {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-viewer-others__page {
    min-width: 44px;
    text-align: center;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: var(--text-sub);
}

.post-viewer-others__pager-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: #fff;
    color: var(--text-sub);
    font-size: 11px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.post-viewer-others__pager-btn:hover:not(:disabled) {
    border-color: var(--text-sub);
    color: var(--text-main);
}

.post-viewer-others__pager-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.post-viewer-others__list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    border-top: 1px solid var(--gray-200);
}

.post-viewer-others__item {
    border-bottom: 1px solid var(--gray-200);
}

.post-viewer-others__link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 6px;
    border: 0;
    background: none;
    text-align: left;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.15s;
}

.post-viewer-others__link:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.03);
}

.post-viewer-others__link:disabled {
    cursor: default;
}

.post-viewer-others__item.is-current .post-viewer-others__title {
    font-weight: 700;
    color: var(--action-blue);
}

.post-viewer-others__pin {
    flex: none;
    font-size: 11px;
    color: var(--accent-partner);
}

.post-viewer-others__title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-viewer-others__meta {
    flex: none;
    font-size: 12px;
    color: var(--text-desc);
    font-variant-numeric: tabular-nums;
}

body.theme-dark .post-viewer-others__pager-btn {
    background: transparent;
}

body.theme-dark .post-viewer-others__link:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
}

.popup-support-form {
    margin-bottom: 20px;
}

.form-label {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text-main);
}

.comment-form-wrap {
    position: relative;
}

.comment-textarea {
    width: 100%;
    min-height: 80px;
    padding: 14px 16px 40px;
    border: 1px solid var(--gray-300, #d1d5db);
    border-radius: 10px;
    background: var(--gray-50, #f9fafb);
    font-family: 'Pretendard Variable', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main, #111827);
    resize: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-textarea::placeholder {
    color: var(--text-desc, #9ca3af);
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--action-blue, #3B82F6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

body.theme-dark .comment-textarea {
    background: var(--surface-glass, rgba(255, 255, 255, 0.055));
    border-color: var(--border-default, rgba(255, 255, 255, 0.09));
    color: var(--text-main);
}

body.theme-dark .comment-textarea:focus {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.comment-submit-wrap {
    position: absolute;
    bottom: 10px;
    right: 10px;
}

.comment-submit-btn {
    font-family: 'Pretendard Variable', sans-serif;
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

body.theme-dark .comment-submit-btn {
}

.comment-submit-btn.disabled {
    background: var(--gray-200, #e5e7eb);
    color: var(--text-desc, #9ca3af);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

body.theme-dark .comment-submit-btn.disabled {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-desc);
    box-shadow: none;
}

.comment-inline-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.comment-inline-textarea {
    width: 100%;
    min-height: 72px;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: var(--gray-50);
    font-family: 'Pretendard Variable', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.comment-inline-textarea:focus {
    outline: none;
    border-color: var(--action-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

body.theme-dark .comment-inline-textarea {
    background: var(--surface-glass);
    border-color: var(--border-default);
    color: var(--text-main);
}

body.theme-dark .comment-inline-textarea:focus {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.comment-inline-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.comment-inline-actions button {
    font-family: 'Pretendard Variable', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.comment-inline-cancel {
    background: transparent;
    border-color: var(--gray-300);
    color: var(--text-sub);
}

.comment-inline-cancel:hover {
    background: var(--gray-100);
    color: var(--text-main);
}

body.theme-dark .comment-inline-cancel {
    border-color: var(--border-default);
    color: var(--text-muted);
}

body.theme-dark .comment-inline-cancel:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

.comment-inline-save {
    background: var(--action-blue);
    border-color: var(--action-blue);
    color: #fff;
}

.comment-inline-save:hover {
    background: var(--action-blue-hover);
    border-color: var(--action-blue-hover);
}

.comment-inline-save:disabled {
    background: var(--gray-300);
    border-color: var(--gray-300);
    color: var(--text-desc);
    cursor: not-allowed;
}

body.theme-dark .comment-inline-save:disabled {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-desc);
}

.board-comment-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.board-comment-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.board-comment-messages .message-item {
    gap: 10px;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.message-header__actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.message-date__edited {
    margin-left: 4px;
    color: var(--text-desc);
}


body.theme-dark .post-viewer-meta__icon {
    color: var(--text-desc);
}

body.theme-dark .post-viewer-text {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

body.theme-dark .popup-support-section {
    border-color: var(--border-default);
}
