/**
 * v7/post/popular.css - 인기 게시글 목록 페이지 스타일
 *
 * v7 전용 CSS. Bootstrap 미사용.
 *
 * 디자인 원칙:
 *   - 텍스트는 가독성을 위해 어두운 색을 직접 지정 (#0f172a, #334155, #64748b)
 *   - 보더는 옅은 회색으로 부드럽게 (#e2e8f0, #f1f5f9)
 *   - 호버 시 배경/보더만 살짝 변경, 텍스트 색은 브랜드 컬러로 강조
 *   - WA 변수 fallback이 의도한 색상과 다르게 적용되는 문제를 피하기 위해
 *     주요 색상은 모두 직접 지정한다.
 *
 * @see v7/post/popular.php
 */

/* === 페이지 컨테이너 === */
.v7-popular-page {
    padding: 0;
}

/* === 페이지 헤더 === */
.popular-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1.25rem 0.5rem 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.popular-page-header-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.popular-page-header-title i {
    color: #f97316;
    font-size: 1.5rem;
    filter: drop-shadow(0 1px 2px rgba(249, 115, 22, 0.3));
}

.popular-page-title {
    font-size: 1.45rem;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.popular-page-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: #475569;
    font-weight: 500;
}

.popular-meta-total strong {
    color: #2563eb;
    font-weight: 700;
}

.popular-meta-divider {
    color: #cbd5e1;
}

.popular-meta-page {
    color: #64748b;
}

/* === 글 목록 === */
.popular-page-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.popular-page-row {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    border: 1px solid #eef2f6;
    border-radius: 12px;
    background: #ffffff;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.popular-page-row:hover {
    background: #f8fafc;
    border-color: #dbeafe;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.07);
    transform: translateY(-2px);
}

.popular-page-row:hover .popular-subject {
    color: #1d4ed8;
}

/* === 작성자 아바타 === */
.popular-row-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1d4ed8;
    font-weight: 700;
    font-size: 1rem;
    border: 1px solid #e0e7ff;
}

.popular-row-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.popular-row-avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* === 본문 영역 === */
.popular-row-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.popular-row-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.popular-subject {
    font-size: 0.98rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.18s ease;
    flex: 1;
    min-width: 0;
    letter-spacing: -0.005em;
}

.popular-comment-count {
    color: #dc2626;
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 0.3rem;
}

.popular-icon-image,
.popular-icon-attach {
    color: #64748b;
    font-size: 0.78rem;
    margin-left: 0.25rem;
}

.popular-category-badge {
    font-size: 0.7rem;
    padding: 0.18rem 0.55rem;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 600;
    border: 1px solid #dbeafe;
}

/* === 메타 정보 (작성자, 날짜, 조회수) === */
.popular-row-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
}

.popular-author {
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #334155;
    font-weight: 600;
}

.popular-meta-dot {
    color: #cbd5e1;
}

.popular-date {
    color: #64748b;
}

.popular-views {
    color: #64748b;
}

.popular-views i,
.popular-likes i {
    margin-right: 0.22rem;
    font-size: 0.78rem;
}

.popular-likes {
    color: #dc2626;
    font-weight: 600;
}

/* === 빈 상태 === */
.popular-page-empty {
    padding: 4rem 1rem;
    text-align: center;
    color: #64748b;
    border: 1px dashed #e2e8f0;
    border-radius: 12px;
    background: #fafbfc;
}

.popular-page-empty i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
    color: #cbd5e1;
}

.popular-page-empty p {
    margin: 0;
    font-size: 0.95rem;
    color: #475569;
}

/* === 모바일 반응형 (≤ 640px) === */
@media (max-width: 640px) {
    .popular-page-header {
        padding: 1rem 0.5rem 0.85rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .popular-page-title {
        font-size: 1.25rem;
    }

    .popular-page-header-title i {
        font-size: 1.3rem;
    }

    .popular-page-row {
        padding: 0.85rem 0.85rem;
        gap: 0.75rem;
        border-radius: 10px;
    }

    .popular-row-avatar {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }

    .popular-subject {
        font-size: 0.92rem;
    }

    .popular-row-info {
        font-size: 0.72rem;
        gap: 0.35rem;
    }

    .popular-author {
        max-width: 6rem;
    }
}
