/**
 * Trenue Community CSS
 * 
 * @package Trenue_Community
 * @version 2.3.6
 * @since 2024-12-19 21:00 KST
 */

/* ========== 나눔고딕 폰트 적용 ========== */
@import url('https://fonts.googleapis.com/css2?family=Nanum+Gothic:wght@400;700;800&display=swap');

.community-archive-wrapper,
.community-layout,
.community-sidebar,
.community-main,
.trenue-boards-widget,
.trenue-write-container,
.single-community {
    font-family: 'Nanum Gothic', 'Malgun Gothic', '맑은 고딕', sans-serif !important;
}

/* ========== 사이드바 검색창, Recent Comments 숨김 ========== */
.community-sidebar .widget_search,
.community-sidebar .search-widget,
.community-sidebar .wp-block-search,
.community-sidebar .widget_recent_comments,
.community-sidebar .wp-block-latest-comments {
    display: none !important;
}

/* ========== 공통 레이아웃 ========== */
.community-layout {
    display: grid !important;
    grid-template-columns: 300px 1fr !important;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 60px; /* 주식 티커 가림 방지 */
}

.community-sidebar {
    position: sticky;
    top: 160px; /* 티커 높이 + 여백 고려 */
    height: fit-content;
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
}

.community-main {
    min-width: 0;
    max-width: 100%;
    overflow: hidden; /* 콘텐츠 오버플로우 방지 */
}

/* 모든 자식 요소가 그리드를 깨뜨리지 않도록 */
.community-main > * {
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

@media (max-width: 992px) {
    .community-layout {
        grid-template-columns: 1fr !important;
        padding-top: 40px;
        padding-bottom: 70px; /* 하단 네비 공간 확보 */
    }
    
    .community-sidebar {
        display: none;
    }
    
    /* On Top 버튼 위치 조정 - 하단 네비 위로 */
    .scroll-to-top,
    .back-to-top,
    #scroll-to-top,
    .to-top,
    a[href="#top"],
    .scrollup,
    [class*="scroll-top"],
    [class*="back-top"],
    [id*="scroll-top"] {
        bottom: 90px !important;
    }
}

/* ========== 글쓰기 컨테이너 ========== */
.trenue-write-container {
    max-width: 100%;
    padding-top: 60px; /* 주식 티커 가림 방지 */
}

@media (max-width: 768px) {
    .trenue-write-container {
        padding-top: 40px;
    }
}

.write-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.write-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary, #1a1a1a);
}

.write-notice {
    font-size: 14px;
    color: var(--text-muted, #9ca3af);
    margin: 0;
}

/* ========== 공통 ========== */
.trenue-login-required {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 12px;
}

.trenue-login-required p {
    margin-bottom: 20px;
    color: var(--text-secondary, #666);
}

/* ========== 글쓰기 폼 ========== */
.trenue-write-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.trenue-write-form {
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 30px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary, #1a1a1a);
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color, #2563eb);
}

/* 에디터 툴바 */
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-color, #e5e7eb);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.toolbar-btn {
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary, #666);
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: var(--bg-tertiary, #e5e7eb);
    color: var(--text-primary, #1a1a1a);
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color, #e5e7eb);
    margin: 0 4px;
}

/* 에디터 영역 */
.editor-content {
    min-height: 300px;
    padding: 16px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0 0 8px 8px;
    font-size: 15px;
    line-height: 1.8;
    outline: none;
    overflow-y: auto;
}

.editor-content:empty:before {
    content: attr(placeholder);
    color: var(--text-muted, #9ca3af);
}

.editor-content:focus {
    border-color: var(--primary-color, #2563eb);
}

.editor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

/* 링크 입력 */
.link-input-wrapper {
    display: flex;
    gap: 10px;
}

.link-input-wrapper input {
    flex: 1;
}

/* OpenGraph 미리보기 */
.og-preview {
    margin-top: 12px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    overflow: hidden;
}

.og-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-muted, #9ca3af);
}

.og-content {
    display: flex;
    gap: 16px;
    padding: 16px;
    position: relative;
}

.og-image {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.og-info {
    flex: 1;
    min-width: 0;
}

.og-site {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 4px;
}

.og-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.og-description {
    font-size: 13px;
    color: var(--text-secondary, #666);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.og-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

/* 라디오 그룹 */
.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

/* 폼 액션 */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color, #2563eb);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover, #1d4ed8);
}

.btn-secondary {
    background: var(--bg-secondary, #f8f9fa);
    color: var(--text-secondary, #666);
    border: 1px solid var(--border-color, #e5e7eb);
}

.btn-secondary:hover {
    background: var(--bg-tertiary, #e5e7eb);
}

/* 제출 상태 */
.submit-status {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    text-align: center;
}

.submit-status.success {
    background: #d1fae5;
    color: #065f46;
}

.submit-status.error {
    background: #fee2e2;
    color: #991b1b;
}

/* ========== 게시판 위젯 ========== */
.trenue-boards-widget {
    padding: 0;
}

.btn-write-post {
    display: block;
    padding: 12px 16px;
    background: var(--primary-color, #2563eb);
    color: white !important;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 16px;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-write-post:hover {
    background: var(--primary-hover, #1d4ed8);
}

.board-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.board-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-left: 4px;
}

.board-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.board-item {
    margin-bottom: 2px;
}

.board-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--text-primary, #1a1a1a) !important;
    text-decoration: none;
    transition: background 0.2s;
    font-size: 14px;
}

.board-link:hover {
    background: var(--bg-secondary, #f8f9fa);
}

.board-item.current .board-link {
    background: var(--primary-color, #2563eb);
    color: white !important;
}

.board-item.locked .board-link {
    opacity: 0.6;
}

.board-icon {
    font-size: 16px;
}

.board-name {
    flex: 1;
}

.level-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-secondary, #f8f9fa);
    color: var(--text-muted, #9ca3af);
}

.level-badge.silver { background: #e5e7eb; color: #4b5563; }
.level-badge.gold { background: #fef3c7; color: #92400e; }
.level-badge.platinum { background: #e0e7ff; color: #3730a3; }
.level-badge.diamond { background: #d1fae5; color: #065f46; }

.lock-icon {
    font-size: 12px;
}

.post-count {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    background: var(--bg-secondary, #f8f9fa);
    padding: 2px 8px;
    border-radius: 10px;
}

/* 사용자 정보 박스 */
.user-info-box {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    margin-bottom: 12px;
}

.user-avatar img {
    border-radius: 50%;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.user-level {
    font-size: 13px;
    color: var(--text-secondary, #666);
}

.user-points {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
}

.user-links {
    display: flex;
    gap: 12px;
}

.user-links a {
    font-size: 13px;
    color: var(--text-secondary, #666) !important;
    text-decoration: none;
}

.user-links a:hover {
    color: var(--primary-color, #2563eb) !important;
}

/* ========== 투표 버튼 ========== */
.trenue-vote-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary, #666);
    transition: all 0.2s;
}

.vote-btn:hover {
    border-color: var(--primary-color, #2563eb);
}

.vote-btn.upvote.active {
    background: #d1fae5;
    border-color: #10b981;
    color: #059669;
}

.vote-btn.downvote.active {
    background: #fee2e2;
    border-color: #ef4444;
    color: #dc2626;
}

.vote-score {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary, #1a1a1a);
    min-width: 30px;
    text-align: center;
}

.bookmark-btn {
    padding: 6px 10px;
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary, #666);
    transition: all 0.2s;
}

.bookmark-btn.active {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #d97706;
}

/* ========== OG 임베드 (본문 내) ========== */
.og-embed {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    margin: 20px 0;
}

.og-embed-image {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.og-embed-info {
    flex: 1;
    min-width: 0;
}

.og-embed-site {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 4px;
}

.og-embed-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 6px;
}

.og-embed-title a {
    color: var(--text-primary, #1a1a1a);
    text-decoration: none;
}

.og-embed-title a:hover {
    color: var(--primary-color, #2563eb);
    text-decoration: underline;
}

.og-embed-desc {
    font-size: 13px;
    color: var(--text-secondary, #666);
    line-height: 1.5;
}

/* ========== 반응형 ========== */
@media (max-width: 768px) {
    .trenue-write-form {
        padding: 20px;
    }
    
    .og-content {
        flex-direction: column;
    }
    
    .og-image {
        width: 100%;
        height: 150px;
    }
    
    .og-embed {
        flex-direction: column;
    }
    
    .og-embed-image {
        width: 100%;
        height: 150px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* ========== 검색 UI ========== */
.community-search-box {
    margin: 16px 0;
    padding: 0;
}

.community-search-form {
    display: flex;
    gap: 8px;
    width: 100%;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 14px;
    color: #9ca3af;
    pointer-events: none;
}

.community-search-input {
    width: 100%;
    padding: 12px 12px 12px 44px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    font-size: 14px;
    background: var(--bg-primary, #fff);
    transition: all 0.2s;
}

.community-search-input::placeholder {
    text-align: left;
    padding-left: 0;
}

.community-search-input:focus {
    outline: none;
    border-color: var(--primary-color, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.community-search-btn {
    padding: 12px 24px;
    background: var(--primary-color, #2563eb);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.community-search-btn:hover {
    background: var(--primary-hover, #1d4ed8);
}

/* 검색 결과 표시 */
.search-results-header {
    padding: 12px 16px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-secondary, #6b7280);
}

.search-results-header strong {
    color: var(--primary-color, #2563eb);
}

/* 사이드바 위젯 공통 스타일 */
.community-widget {
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.community-widget .widget-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    color: var(--text-primary, #1a1a1a);
}

/* ========== 사이드바 검색 위젯 스타일 ========== */
.community-sidebar .widget_search,
.community-sidebar .wp-block-search {
    background: var(--bg-primary, #fff);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.community-sidebar .widget_search .widget-title,
.community-sidebar .wp-block-search__label {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-primary, #1a1a1a);
    display: block;
}

/* 검색 폼 컨테이너 */
.community-sidebar .search-form,
.community-sidebar .wp-block-search__inside-wrapper,
.community-sidebar form[role="search"] {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    align-items: stretch !important;
    width: 100% !important;
}

/* 검색 레이블 (flex:1로 확장) */
.community-sidebar .search-form > label,
.community-sidebar form[role="search"] > label {
    flex: 1 !important;
    margin: 0 !important;
    display: block !important;
}

/* 검색 입력창 - 강력한 선택자 */
.community-sidebar input[type="search"],
.community-sidebar input[type="text"].search-field,
.community-sidebar input.search-field,
.community-sidebar .search-field,
.community-sidebar .wp-block-search__input {
    width: 100% !important;
    min-width: 150px !important;
    max-width: none !important;
    padding: 10px 14px !important;
    border: 1px solid var(--border-color, #e5e7eb) !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    background: var(--bg-primary, #fff) !important;
    box-sizing: border-box !important;
    transition: all 0.2s !important;
    flex: 1 !important;
    height: auto !important;
    line-height: 1.4 !important;
}

.community-sidebar input[type="search"]:focus,
.community-sidebar input.search-field:focus,
.community-sidebar .search-field:focus,
.community-sidebar .wp-block-search__input:focus {
    outline: none !important;
    border-color: var(--primary-color, #2563eb) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

/* 검색 버튼 */
.community-sidebar input[type="submit"].search-submit,
.community-sidebar button.search-submit,
.community-sidebar .search-submit,
.community-sidebar .wp-block-search__button {
    padding: 10px 16px !important;
    background: var(--primary-color, #2563eb) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: all 0.2s !important;
    flex-shrink: 0 !important;
    height: auto !important;
    line-height: 1.4 !important;
}

.community-sidebar input[type="submit"].search-submit:hover,
.community-sidebar button.search-submit:hover,
.community-sidebar .search-submit:hover,
.community-sidebar .wp-block-search__button:hover {
    background: var(--primary-hover, #1d4ed8) !important;
}

/* 검색 아이콘만 있는 버튼 대응 */
.community-sidebar .wp-block-search__button.has-icon {
    padding: 10px 12px !important;
}

.community-sidebar .wp-block-search__button svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    .community-search-form {
        flex-direction: column;
    }
    
    .community-search-btn {
        width: 100%;
    }
}

/* ========== 댓글 섹션 스타일 ========== */
.comments-section {
    background: var(--bg-primary, #fff);
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
    overflow: hidden; /* 레이아웃 깨짐 방지 */
}

.comments-section .comments-title,
.comments-section h2,
.comments-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    color: var(--text-primary, #1a1a1a);
}

/* 댓글 목록 */
.comments-section .comment-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.comments-section .comment {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.comments-section .comment:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.comments-section .comment-body {
    display: block;
}

.comments-section .comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.comments-section .comment-author .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.comments-section .comment-author .fn {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary, #1a1a1a);
}

.comments-section .comment-meta,
.comments-section .comment-metadata {
    font-size: 12px;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 8px;
}

.comments-section .comment-metadata a {
    color: var(--text-secondary, #6b7280);
    text-decoration: none;
}

.comments-section .comment-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary, #1a1a1a);
}

.comments-section .comment-content p {
    margin: 0 0 10px 0;
}

.comments-section .comment-content p:last-child {
    margin-bottom: 0;
}

.comments-section .reply {
    margin-top: 10px;
}

.comments-section .reply a,
.comments-section .comment-reply-link {
    font-size: 12px;
    color: var(--primary-color, #2563eb);
    text-decoration: none;
    font-weight: 500;
}

.comments-section .reply a:hover,
.comments-section .comment-reply-link:hover {
    text-decoration: underline;
}

/* 대댓글 */
.comments-section .children {
    list-style: none !important;
    margin: 16px 0 0 30px !important;
    padding: 0 !important;
    border-left: 2px solid var(--border-color, #e5e7eb);
    padding-left: 20px !important;
}

.comments-section .children .comment {
    margin-bottom: 16px;
    padding-bottom: 16px;
}

/* 댓글 폼 */
.comments-section .comment-respond {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.comments-section .comment-reply-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--text-primary, #1a1a1a);
}

.comments-section .comment-reply-title small {
    font-size: 12px;
    margin-left: 10px;
}

.comments-section .comment-reply-title small a {
    color: var(--text-secondary, #6b7280);
}

.comments-section .comment-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comments-section .comment-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary, #1a1a1a);
}

.comments-section .comment-form input[type="text"],
.comments-section .comment-form input[type="email"],
.comments-section .comment-form input[type="url"],
.comments-section .comment-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-primary, #fff);
    transition: all 0.2s;
    box-sizing: border-box;
}

.comments-section .comment-form input:focus,
.comments-section .comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.comments-section .comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comments-section .comment-form .form-submit {
    margin: 0;
}

.comments-section .comment-form .submit,
.comments-section .comment-form input[type="submit"] {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color, #2563eb);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.comments-section .comment-form .submit:hover,
.comments-section .comment-form input[type="submit"]:hover {
    background: var(--primary-hover, #1d4ed8);
}

/* 로그인 필요 메시지 */
.comments-section .must-log-in {
    text-align: center;
    padding: 20px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary, #6b7280);
}

.comments-section .must-log-in a {
    color: var(--primary-color, #2563eb);
    font-weight: 500;
}

/* 댓글 없음 */
.comments-section .no-comments {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary, #6b7280);
    font-size: 14px;
}

/* 댓글 네비게이션 */
.comments-section .comment-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.comments-section .comment-navigation a {
    color: var(--primary-color, #2563eb);
    text-decoration: none;
    font-size: 14px;
}

/* 댓글 수 표시 오버라이드 */
.comments-section .comments-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 폼 요소 그리드 방지 */
.comments-section .comment-form-comment,
.comments-section .comment-form-author,
.comments-section .comment-form-email,
.comments-section .comment-form-url,
.comments-section .comment-form-cookies-consent {
    display: block;
    width: 100%;
}

.comments-section .comment-form p {
    margin: 0;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .comments-section {
        padding: 16px;
    }
    
    .comments-section .children {
        margin-left: 15px !important;
        padding-left: 12px !important;
    }
    
    .comments-section .comment-author .avatar {
        width: 30px;
        height: 30px;
    }
}

/* ========== 최신댓글 위젯 (커뮤니티) ========== */
.trenue-recent-comments-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.trenue-recent-comments-list .recent-comment-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.trenue-recent-comments-list .recent-comment-item:last-child {
    border-bottom: none;
}

.trenue-recent-comments-list .recent-comment-item a {
    display: block;
    color: var(--text-primary, #1a1a1a);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.5;
    transition: color 0.2s;
}

.trenue-recent-comments-list .recent-comment-item a:hover {
    color: var(--primary-color, #2563eb);
}

.trenue-recent-comments-list .comment-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 사이드바 검색창 개선 ========== */
/* 검색 버튼 텍스트 숨기고 아이콘으로 대체 */
.community-sidebar .search-submit,
.community-sidebar input[type="submit"].search-submit,
.community-sidebar button.search-submit {
    font-size: 0 !important;
    padding: 10px 14px !important;
    position: relative;
}

.community-sidebar .search-submit::after,
.community-sidebar input[type="submit"].search-submit::after,
.community-sidebar button.search-submit::after {
    content: "🔍";
    font-size: 14px;
}

/* 검색 폼 가운데 정렬 */
.community-sidebar .widget_search,
.community-sidebar .search-widget {
    text-align: center;
}

.community-sidebar .search-form {
    justify-content: center !important;
}

/* 검색 입력창 placeholder 위치 조정 */
.community-search-input::placeholder,
.community-sidebar input[type="search"]::placeholder,
.community-sidebar .search-field::placeholder {
    padding-left: 4px;
    text-indent: 4px;
}

/* ========== 커뮤니티 본문 검색창 placeholder ========== */
.search-input-wrapper .community-search-input::placeholder {
    text-align: center !important;
}

/* 검색창 placeholder 가운데 정렬 - 강화 */
.community-search-input {
    text-align: center !important;
}

.community-search-input::placeholder {
    text-align: center !important;
}

.community-search-input:focus,
.community-search-input:not(:placeholder-shown) {
    text-align: left !important;
}

/* 모든 검색 입력창 가운데 정렬 */
input[placeholder*="검색"]::placeholder,
input[placeholder*="게시글"]::placeholder {
    text-align: center !important;
}

input[placeholder*="검색"]:placeholder-shown,
input[placeholder*="게시글"]:placeholder-shown {
    text-align: center !important;
}

/* ========== 좋아요/싫어요 메타 스타일 ========== */
.post-meta-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
}

.post-meta-bottom .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.post-meta-bottom .meta-vote-up {
    color: #2563eb;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.post-meta-bottom .meta-vote-up:hover {
    background: #eff6ff;
}

.post-meta-bottom .meta-vote-down {
    color: #64748b;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.post-meta-bottom .meta-vote-down:hover {
    background: #fef2f2;
    color: #ef4444;
}

.post-meta-bottom svg {
    vertical-align: middle;
}

/* ========== 티커와 컨텐츠 간격 ========== */
.community-layout {
    padding-top: 80px !important; /* 티커 높이 증가 대응 */
}

@media (max-width: 992px) {
    .community-layout {
        padding-top: 60px !important;
    }
}
