/* community-detail.css */
/* ======================
   Variables & Base
   ====================== */
.cpd-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* ======================
   Nav
   ====================== */
.cpd-nav {
    padding: 20px 0 16px;
}

.cpd-nav-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #444;
    text-decoration: none;
    transition: color 0.15s;
}

.cpd-nav-back:hover {
    color: #333;
}

/* ======================
   Layout
   ====================== */
.cpd-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 32px;
    align-items: start;
}

.cpd-main,
.cpd-post-wrap,
.cpd-post,
.cpd-comments-section,
.cpd-comment-body {
    min-width: 0;
}

@media (max-width: 860px) {
    .cpd-layout {
        grid-template-columns: 1fr;
    }
    .cpd-sidebar {
        order: -1;
    }
}

/* ======================
   Avatar
   ====================== */
.cpd-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    overflow: hidden;
}

.cpd-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.av-blue   { background: #e0ecff; color: #1a5fc8; }
.av-coral  { background: #fdeae4; color: #c0401a; }
.av-green  { background: #e4f5e1; color: #2a7a1e; }
.av-amber  { background: #fef3dc; color: #a05e08; }
.av-purple { background: #eeecfd; color: #5040b8; }
.av-teal   { background: #e0f5ee; color: #0f7055; }
.av-gray   { background: #f0efea; color: #666; }

.cpd-post-wrap {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 14px;
    overflow: hidden;
}

/* ======================
   Post Article
   ====================== */
.cpd-post {
    padding: 28px 32px 24px;
}

.cpd-post-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.cpd-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cpd-author-name {
    font-size: 14px;
    font-weight: 600;
    color: #222;
}

.cpd-post-time {
    font-size: 12px;
    color: #aaa;
}

.cpd-post-title {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    line-height: 1.4;
    margin: 0 0 18px;
    letter-spacing: -0.02em;
}
/* 
.cpd-post-body {
    font-size: 15px;
    line-height: 1.75;
    color: #444;
} 
*/

.cpd-post-body {
    font-size: 15px;
    line-height: 1.75;
    color: #444;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
}
/* 
.cpd-post-body p {
    margin: 0 0 14px;
}
 */
.cpd-post-body p {
    margin: 0 0 14px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.cpd-post-body p:last-child {
    margin-bottom: 0;
}

.cpd-post-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #f0f0f0;
}

.cpd-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #444;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.cpd-action-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.cpd-like-btn.is-liked {
    color: #e0444a;
}

.cpd-like-btn.is-liked i {
    font-weight: 900;
}

.cpd-action-count {
    font-weight: 500;
}

.cpd-comment-count-btn {
    cursor: default;
}

.cpd-comment-count-btn:hover {
    background: none;
    color: #888;
}

/* ======================
   Comments Section
   ====================== */
.cpd-comments-section {
    padding: 24px 32px 28px;
    border-top: 1px solid #f0f0f0;
}

.cpd-comments-header {
    margin-bottom: 20px;
}

.cpd-comments-title {
    font-size: 15px;
    font-weight: 700;
    color: #111;
}

.cpd-comments-cnt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0efea;
    color: #666;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 20px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ======================
   Compose (댓글 작성)
   ====================== */
.cpd-comment-compose {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    align-items: flex-start;
}

.cpd-compose-inner {
    flex: 1;
    min-width: 0;
}

.cpd-compose-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    color: #222;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    overflow: hidden;
    background: #fafafa;
}

.cpd-compose-textarea:focus {
    border-color: #aac4f5;
    box-shadow: 0 0 0 3px rgba(100, 160, 240, 0.12);
    background: #fff;
}

.cpd-reply-textarea {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
}

.cpd-compose-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.cpd-compose-cancel {
    background: none;
    border: none;
    font-size: 13px;
    color: #999;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}

.cpd-compose-cancel:hover {
    background: #f5f5f5;
    color: #555;
}

.cpd-compose-submit {
    background: #1a5fc8;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    padding: 6px 16px;
    border-radius: 6px;
    transition: background 0.15s, transform 0.1s;
    font-family: inherit;
}

.cpd-compose-submit:hover {
    background: #154da8;
}

.cpd-compose-submit:active {
    transform: scale(0.97);
}

/* ======================
   Comment List
   ====================== */
.cpd-comment-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cpd-comment {
    display: flex;
    gap: 12px;
    padding: 18px 0;
    border-top: 1px solid #f3f3f3;
}

.cpd-comment:first-child {
    border-top: none;
    padding-top: 0;
}

.cpd-comment-body {
    flex: 1;
    min-width: 0;
}

.cpd-comment-meta {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: center;
	column-gap: 8px;
	margin-bottom: 5px;
	min-width: 0;
}

.cpd-comment-author {
	font-size: 13px;
	font-weight: 600;
	color: #222;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cpd-comment-time {
	font-size: 12px;
	color: #444;
	white-space: nowrap;
}

.cpd-comment-text {
    font-size: 14px;
    line-height: 1.65;
    color: #444;
    margin-bottom: 8px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.cpd-comment-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cpd-comment-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #444;
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 5px;
    transition: color 0.15s, background 0.15s;
    font-family: inherit;
}

.cpd-comment-like-btn:hover {
    background: #fdf0f0;
    color: #e0444a;
}

.cpd-comment-like-btn.is-liked {
    color: #e0444a;
}

.cpd-reply-toggle-btn {
    font-size: 12px;
    font-weight: 600;
    color: #5b6bff;
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 0;
    border-radius: 5px;
    transition: color 0.15s;
    font-family: inherit;
    letter-spacing: 0.02em;
}

.cpd-reply-toggle-btn:hover {
    color: #333;
    background: none;
}

/* ======================
   Reply Compose
   ====================== */
.cpd-reply-compose {
    display: none;
    gap: 8px;
    margin-top: 12px;
    align-items: flex-start;
}

.cpd-reply-compose.is-open {
    display: flex;
}

/* ======================
   답글 N개 버튼
   ====================== */
.cpd-reply-count-wrap {
    margin-top: 6px;
}

.cpd-reply-count-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: #444;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 0;
    transition: opacity 0.15s;
    letter-spacing: 0.01em;
}

.cpd-reply-count-btn:hover {
    opacity: 0.7;
}

.cpd-reply-count-btn i {
    font-size: 10px;
}

/* ======================
   답글 더보기 / 숨기기 버튼
   ====================== */
.cpd-reply-more-btn,
.cpd-reply-hide-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: #444;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 0;
    margin-top: 2px;
    transition: opacity 0.15s;
    letter-spacing: 0.01em;
}

.cpd-reply-more-btn:hover,
.cpd-reply-hide-btn:hover {
    opacity: 0.7;
}

.cpd-reply-more-btn i,
.cpd-reply-hide-btn i {
    font-size: 10px;
}

/* ======================
   Replies (대댓글)
   ====================== */
.cpd-replies {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 4px;
    border-left: 2px solid #f0f0f0;
}

.cpd-reply {
    display: flex;
    gap: 10px;
    padding: 12px 0 12px 14px;
    border-top: 1px solid #f7f7f7;
}

.cpd-reply:first-child {
    border-top: none;
    padding-top: 8px;
}

/* ======================
   Sidebar
   ====================== */
.cpd-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 20px;
}

.cpd-sidebar-block {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 14px;
    padding: 20px;
}

.cpd-sidebar-title {
    font-size: 13px;
    font-weight: 700;
    color: #111;
    margin-bottom: 14px;
    letter-spacing: 0.01em;
}

.cpd-hot-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cpd-hot-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s;
    cursor: pointer;
}

.cpd-hot-item:hover {
    background: #f8f8f8;
}

.cpd-hot-num {
    font-size: 12px;
    font-weight: 700;
    color: #ccc;
    width: 16px;
    flex-shrink: 0;
    padding-top: 1px;
}

.cpd-hot-text {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    margin-bottom: 3px;
    font-weight: 500;
}

.cpd-hot-meta {
    font-size: 11px;
    color: #bbb;
}

/* ======================
   Post Menu (점 3개)
   ====================== */
.cpd-post-menu-wrap {
    position: relative;
    margin-left: auto;
}

.cpd-post-menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s;
}

.cpd-post-menu-btn:hover {
    background: #f5f5f5;
}

.cpd-post-menu-btn span {
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #aaa;
}

.cpd-post-menu-btn:hover span {
    background: #555;
}

.cpd-post-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    min-width: 120px;
    z-index: 100;
    overflow: hidden;
}

.cpd-post-dropdown.is-open {
    display: block;
}

.cpd-dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 11px 16px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.12s;
    font-family: inherit;
}

.cpd-dropdown-item:hover {
    background: #f8f8f8;
}

.cpd-dropdown-item--danger {
    color: #d94040;
}

.cpd-dropdown-item--danger:hover {
    background: #fff5f5;
}

/* ======================
   Post Edit Input
   ====================== */
.cpd-post-edit-wrap {
    display: none;
}

.cpd-post-edit-wrap.is-open {
    display: block;
    margin-bottom: 4px;
}

.cpd-edit-title {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 18px;
    font-weight: 700;
    color: #111;
    outline: none;
    margin-bottom: 10px;
    font-family: inherit;
    letter-spacing: -0.02em;
    transition: border-color 0.15s;
}

.cpd-edit-title:focus {
    border-color: #aac4f5;
    box-shadow: 0 0 0 3px rgba(100, 160, 240, 0.12);
}

.cpd-edit-body {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 15px;
    line-height: 1.75;
    color: #444;
    outline: none;
    resize: none;
    font-family: inherit;
    min-height: 120px;
    transition: border-color 0.15s;
    overflow: hidden;
}

.cpd-edit-body:focus {
    border-color: #aac4f5;
    box-shadow: 0 0 0 3px rgba(100, 160, 240, 0.12);
}

/* ======================
   답글 더보기 버튼
   ====================== */
.cpd-reply-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    color: #444;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    margin-top: 4px;
    transition: opacity 0.15s;
}

.cpd-reply-more-btn:hover {
    opacity: 0.75;
}

.cpd-reply-more-btn i {
    font-size: 11px;
}

/* ======================
   답글 숨기기 버튼
   ====================== */
   .cpd-reply-hide-btn {
       display: inline-flex;
       align-items: center;
       gap: 5px;
       background: none;
       border: none;
       cursor: pointer;
       color: #444;
       font-size: 13px;
       font-weight: 600;
       padding: 8px 14px;
       margin-top: 4px;
       transition: opacity 0.15s;
   }

   .cpd-reply-hide-btn:hover {
       opacity: 0.75;
   }

   .cpd-reply-hide-btn i {
       font-size: 11px;
   }
   
/* ======================
   Responsive
   ====================== */
@media (max-width: 600px) {
    .cpd-post {
        padding: 20px;
    }
    .cpd-comments-section {
        padding: 18px 20px 24px;
    }
    .cpd-post-title {
        font-size: 18px;
    }
}

/* 댓글 삭제 버튼 */
.cpd-comment-remove-btn {
	background: #fff;
	border: 1px solid #f0b8b8;
	border-radius: 6px;
	color: #d94040;
	font-size: 12px;
	font-weight: 600;
	padding: 3px 8px;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	white-space: nowrap;
}

.cpd-comment-remove-btn:hover {
	background: #fff5f5;
	border-color: #d94040;
	color: #b91c1c;
}