/* ===== 메인 레이아웃 ===== */
.jw-main {
    background: #fff;
    padding: 25px 0 50px;
}

.jw-main-container {
    width: 70%;
    max-width: 1100px;
    margin: 0 auto; /* header와 동일한 중앙정렬 */
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* ===== 좌측 토론글 ===== */
.jw-hot-section {
    flex: 7;
}

.jw-hot-section h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #222;
}

/* 게시글 리스트 */
.hot-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hot-list li {
    display: flex;
    align-items: stretch;   /* ✅ flex-start 대신 stretch로 수정 */
    border-bottom: 1px solid #eee;
    transition: background 0.2s ease;
    cursor: pointer;
}

.hot-list li:hover {
    background: #fafafa;
}

/* 썸네일 영역 */
.hot-list .thumb {
    flex-shrink: 0;
    flex-grow: 0;
    width: 120px;
    height: auto;           /* ✅ 고정 높이 제거 */
    aspect-ratio: 3 / 2;    /* ✅ 비율 유지 (가로:세로) */
    background: #f4f4f4;
    border-radius: 6px;
    overflow: hidden;
    display: block;
    margin-right: 12px;
}

.hot-list .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* 게시글 정보 */
.hot-list .post-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 제목 줄 */
.title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 15px;
}

.title-line .cat {
    font-weight: 600;
    margin-right: 4px;
}

.title-line .title {
    color: #222;
    font-weight: 500;
    text-decoration: none;
    flex: 1;
}

.title-line .title:hover {
    text-decoration: underline;
}

.title-line .comment-count {
    color: #d83535;
    font-size: 13px;
    font-weight: 600;
}

/* 메타 정보 */
.meta-line {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-line .dot {
    color: #ccc;
}

.meta-line .writer {
    color: #555;
    font-weight: 500;
}

.meta-line .views {
    color: #555;
}

/* 카테고리 색상 */
.cat.여당 { color: #e74c3c; }
.cat.야당 { color: #3498db; }
.cat.미국정치 { color: #1abc9c; }
.cat.중국정치 { color: #f39c12; }
.cat.유머 { color: #888; }

/* ===== 우측 사이드 영역 ===== */
.jw-side {
    flex: 3;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.keyword-box h3,
.chart-box h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #222;
}

/* 실시간 검색어 */
.keyword-rank {
    list-style: none;
    margin: 0;
    padding: 0;
}

.keyword-rank li {
    display: flex;
    /*justify-content: space-between;*/
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px dashed #eee;
    color: #333;
}

.keyword-rank .rank {
    font-weight: 600;
    color: #666;
    width: 22px;
}

.keyword-rank .up { color: #e74c3c; }
.keyword-rank .down { color: #3498db; }

/* 차트 */
.chart-box {
    /*background: #fafafa;*/
    /*border: 1px solid #eee;*/
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.chart-box canvas {
    margin-top: 8px;
}

/* ===== 반응형 (모바일 대응) ===== */
@media (max-width: 900px) {
    .jw-main-container {
        flex-direction: column;
        width: 92%;
    }

    .jw-hot-section {
        width: 100%;
    }

    /* 🔹 리스트 구조 2줄로 변경 */
    .hot-list li {
        display: flex;
        flex-direction: row;      /* 가로로 (썸넬 + 내용 한 줄) */
        align-items: flex-start;
        gap: 10px;
        padding: 8px 0;
    }

    .hot-list .thumb {
        width: 70px;
        height: 70px;
        border-radius: 6px;
        margin: 0;
    }

    .hot-list .post-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* 제목 + 댓글 한 줄 */
    .title-line {
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 14px;
        line-height: 1.3;
    }

    .title-line .title {
        flex: 1;
        color: #222;
        text-decoration: none;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;  /* 긴 제목 말줄임표 */
    }

    .title-line .comment-count {
        color: #d83535;
        font-size: 12.5px;
        font-weight: 600;
    }

    /* 작성자, 시간, 조회수 — 두 번째 줄 */
    .meta-line {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-top: 3px;
        font-size: 12.5px;
        color: #777;
        flex-wrap: wrap;
    }

    .meta-line .dot {
        color: #ccc;
    }

    .meta-line .writer {
        font-weight: 500;
    }

    /* 🔹 우측 사이드 (아래로 이동) */
    .jw-side {
        width: 100%;
        margin-top: 25px;
    }

    .keyword-box,
    .chart-box {
        border-radius: 10px;
        padding: 14px;
    }

    .chart-box canvas {
        width: 100% !important;
        height: auto !important;
    }
}

/* 🔹 글쓰기 버튼 (중립톤) */
.write-btn {
    position: fixed;
    right: 40px;
    bottom: 40px;
    background: #6b7280;        /* 🌫 중립적 쿨그레이 */
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 999;
    white-space: nowrap;
}

.write-btn:hover {
    background: #52575e;        /* hover 시 살짝 진하게 */
    transform: translateY(-2px);
}

/* 🔹 모바일 (작고 자연스럽게) */
@media (max-width: 768px) {
    .write-btn {
        right: 14px;
        bottom: 14px;
        padding: 6px 14px;
        font-size: 13.5px;
        border-radius: 10px;
        background: #6b7280;
        line-height: normal;
    }

    .write-btn:active {
        transform: scale(0.97);
        background: #52575e;
    }
}

/* 🔹 리스트 기본 구조 */
.hot-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ✅ li 안의 a.post-link가 실제 flex 컨테이너가 되도록 변경 */
.hot-list li a.post-link {
    display: flex;
    align-items: stretch;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #eee;
    padding: 8px 0 10px;
    transition: background 0.2s ease;
}

.hot-list li a.post-link:hover {
    background: #fafafa;
}

/* 썸네일 */
.hot-list .thumb {
    flex-shrink: 0;
    flex-grow: 0;
    width: 100px;
    aspect-ratio: 3 / 2;
    background: #f4f4f4;
    border-radius: 6px;
    overflow: hidden;
    margin-right: 12px;
}

.hot-list .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 게시글 정보 */
.hot-list .post-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 제목 + 댓글 */
.title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 15px;
}

.title-line .title {
    color: #222;
    font-weight: 500;
    text-decoration: none;
    flex: 1;
}

.title-line .title:hover {
    text-decoration: underline;
}

/* 메타 정보 */
.meta-line {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-line .dot {
    color: #ccc;
}

/* 모바일 대응 */
@media (max-width: 900px) {
    .hot-list li a.post-link {
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
        padding: 8px 0;
    }

    .hot-list .thumb {
        width: 70px;
        height: 70px;
        margin: 0;
    }

    .title-line {
        font-size: 14px;
        line-height: 1.3;
    }

    .meta-line {
        font-size: 12.5px;
        gap: 6px;
    }
}

