@charset "utf-8";

/* ============================================
   Reddit Thread Skin CSS
   ============================================ */

/* 레딧 컬러 스킴 */
:root {
    --reddit-orange: #FF4500;
    --reddit-blue: #0079D3;
    --upvote-color: #FF4500;
    --downvote-color: #7193FF;
    --bg-gray: #DAE0E6;
    --bg-white: #FFFFFF;
    --border-color: #EDEFF1;
    --text-primary: #1c1c1c;
    --text-secondary: #7c7c7c;
}

/* 메인 래퍼 */
.rb_reddit_wrap {
    max-width: 100%;
    margin: 0 auto;
    background: var(--bg-gray);
    padding: 20px;
}

/* ============================================
   투표 시스템 (Voting)
   ============================================ */

.vote_container {
    width: 40px;
    float: left;
    text-align: center;
    margin-right: 10px;
}

.vote_btn {
    display: block;
    width: 100%;
    padding: 4px;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    transition: all 0.2s;
}

.vote_btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.vote_btn.upvoted {
    color: var(--upvote-color);
    font-weight: bold;
}

.vote_btn.downvoted {
    color: var(--downvote-color);
    font-weight: bold;
}

.vote_count {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: var(--text-primary);
    margin: 4px 0;
}

/* ============================================
   토픽 카드 (Topic Card)
   ============================================ */

.topic_card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 10px;
    padding: 8px;
    display: flex;
    transition: box-shadow 0.2s;
}

.topic_card:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-color: #ccc;
}

.topic_content {
    flex: 1;
    min-width: 0;
}

.topic_title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.topic_title a {
    color: var(--text-primary);
    text-decoration: none;
}

.topic_title a:hover {
    color: var(--reddit-blue);
}

.topic_meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.topic_meta span {
    display: inline-flex;
    align-items: center;
}

/* ============================================
   댓글 (Comments/Threads)
   ============================================ */

#bo_vc {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    margin-top: 20px;
}

.comment_sort {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.comment_sort select {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
}

.thread_item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
}

.thread_item:last-child {
    border-bottom: none;
}

/* 댓글 들여쓰기 (RB 방식) */
.thread_depth_1 { padding-left: 20px; border-left: 2px solid #e0e0e0; }
.thread_depth_2 { padding-left: 40px; border-left: 2px solid #e0e0e0; }
.thread_depth_3 { padding-left: 60px; border-left: 2px solid #e0e0e0; }
.thread_depth_4 { padding-left: 80px; border-left: 2px solid #e0e0e0; }
.thread_depth_5 { padding-left: 100px; border-left: 2px solid #e0e0e0; }

.thread_content {
    flex: 1;
}

.thread_author {
    font-weight: bold;
    color: var(--text-primary);
    margin-right: 8px;
}

.thread_text {
    margin: 8px 0;
    line-height: 1.5;
    color: var(--text-primary);
}

.thread_actions {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.thread_actions button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px 5px;
    font-weight: bold;
}

.thread_actions button:hover {
    color: var(--reddit-blue);
}

/* ============================================
   미디어 그리드
   ============================================ */

.thread_media_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin: 10px 0;
}

.thread_media_item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: #f5f5f5;
}

.thread_media_item img,
.thread_media_item video {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: transform 0.2s;
}

.thread_media_item img:hover,
.thread_media_item video:hover {
    transform: scale(1.05);
}

/* ============================================
   댓글 작성 폼
   ============================================ */

.thread_write_form {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.thread_write_form textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    resize: vertical;
    font-size: 14px;
}

.thread_write_form textarea:focus {
    outline: none;
    border-color: var(--reddit-blue);
}

.thread_media_upload {
    margin: 10px 0;
}

.thread_media_upload input[type="file"] {
    display: none;
}

.thread_media_upload label {
    display: inline-block;
    padding: 8px 15px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.thread_media_upload label:hover {
    background: #f5f5f5;
    border-color: var(--reddit-blue);
}

/* ============================================
   모바일 반응형
   ============================================ */

@media (max-width: 768px) {
    .rb_reddit_wrap {
        padding: 10px;
    }
    
    .vote_container {
        width: 30px;
        margin-right: 5px;
    }
    
    .vote_btn {
        font-size: 16px;
    }
    
    .topic_title {
        font-size: 16px;
    }
    
    .topic_meta {
        font-size: 11px;
    }
    
    /* 모바일에서 댓글 들여쓰기 최소화 */
    .thread_depth_1,
    .thread_depth_2,
    .thread_depth_3,
    .thread_depth_4,
    .thread_depth_5 {
        padding-left: 15px;
    }
    
    .thread_media_grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .rb_reddit_wrap {
        padding: 5px;
    }
    
    .topic_card {
        padding: 6px;
    }
}

/* ============================================
   유틸리티
   ============================================ */

.cb {
    clear: both;
}

.sound_only {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
