/**
 * v7/post/list.css - 게시판 글 목록 페이지 스타일
 *
 * v7 전용 CSS. Bootstrap 미사용.
 * Web Awesome Pro CSS 변수 활용.
 */

/* === 게시판 헤더 === */
.post-list-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 2px solid var(--wa-color-neutral-800, #1e293b);
    margin-bottom: 0;
}

.post-list-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--wa-color-neutral-900, #0f172a);
}

.post-list-meta {
    font-size: 0.75rem;
    color: var(--wa-color-neutral-500, #64748b);
    flex: 1;
}

.post-write-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--wa-color-brand-600, #2563eb);
    background: transparent;
    border: 1px solid var(--wa-color-brand-500, #3b82f6);
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
}

.post-write-btn:hover {
    background: var(--wa-color-brand-600, #2563eb);
    border-color: var(--wa-color-brand-600, #2563eb);
    color: #fff;
}

/* === 글 목록 테이블 === */
.post-list-table {
    display: flex;
    flex-direction: column;
}

.post-list-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.6rem 0.25rem;
    border-bottom: 1px solid var(--wa-color-neutral-200, #e2e8f0);
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}

.post-list-row:hover {
    background: rgba(0, 0, 0, 0.025);
}

/* 데스크톱: 한 줄 레이아웃 */
@media (min-width: 992px) {
    .post-list-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.5rem 0.5rem;
    }
}

.post-row-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.post-subject {
    font-size: 0.85rem;
    color: var(--wa-color-neutral-800, #1e293b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.post-list-row:hover .post-subject {
    color: #7f1d1d;
}

.post-comment-count {
    color: #dc2626;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.15rem;
}

.post-icon-image {
    color: var(--wa-color-neutral-400, #94a3b8);
    font-size: 0.7rem;
    margin-left: 0.15rem;
}

.post-icon-attach {
    color: var(--wa-color-neutral-400, #94a3b8);
    font-size: 0.65rem;
    margin-left: 0.15rem;
}

.post-category-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    background: var(--wa-color-neutral-100, #f1f5f9);
    color: var(--wa-color-neutral-600, #475569);
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* === 글 정보 (작성자, 날짜, 조회수) === */
.post-row-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.7rem;
    color: var(--wa-color-neutral-400, #94a3b8);
    flex-shrink: 0;
}

.post-author {
    max-width: 5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-views i,
.post-likes i {
    margin-right: 0.15rem;
}

.post-likes {
    color: #dc2626;
}

/* === 에러/빈 상태 === */
.post-list-error {
    padding: 2rem;
    text-align: center;
    color: #dc2626;
    font-size: 0.85rem;
}

.post-list-empty {
    padding: 3rem;
    text-align: center;
    color: var(--wa-color-neutral-400, #94a3b8);
}

.post-list-empty i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.post-list-empty p {
    margin: 0;
    font-size: 0.85rem;
}

/* === buyandsell 인터리빙: 간단 링크 스타일 === */
/* v6의 post-list-simple-link 위젯에 대응하는 v7 스타일 */
.v7-simple-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.25rem;
    text-decoration: none;
    color: var(--wa-color-neutral-600, #475569);
    border-bottom: 1px solid var(--wa-color-neutral-200, #e2e8f0);
    transition: all 0.2s ease;
}

.v7-simple-link:hover {
    background: rgba(0, 0, 0, 0.025);
    transform: translateX(4px);
}

.v7-simple-link i {
    font-size: 0.4rem;
    color: var(--wa-color-brand-600, #2563eb);
    opacity: 0.7;
    flex-shrink: 0;
}

.v7-simple-link:hover i {
    opacity: 1;
}

.v7-simple-link span {
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    line-height: 1.4;
}

.v7-simple-link:hover span {
    color: var(--wa-color-neutral-900, #0f172a);
}

/* ============================================================ */
/* === 게시글 타일 디자인 (v6 100% 동일 재구현) === */
/* ============================================================ */

/* 타일 행 */
.post-tile-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--wa-color-neutral-200, #e2e8f0);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    gap: 1rem;
}

.post-tile-row:hover {
    background: rgba(0, 0, 0, 0.025);
}

/* 제목 행 */
.post-tile-subject-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

/* 관리자 체크박스 */
.post-tile-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    cursor: pointer;
    accent-color: #3b82f6;
    margin: 0;
    flex-shrink: 0;
}

/* 제목 */
.post-tile-subject {
    font-size: 1.15rem;
    color: var(--wa-color-neutral-800, #1e293b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.post-tile-row:hover .post-tile-subject {
    color: #7f1d1d;
}

/* 차단된 사용자 글 타일 */
.post-tile-blocked {
    opacity: 0.65;
}

.post-tile-blocked:hover {
    opacity: 0.85;
}

.post-tile-blocked-text {
    color: var(--wa-color-neutral-400, #94a3b8);
    font-size: 0.9rem;
}

/* 댓글/좋아요 뱃지 */
.post-tile-badge {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 0.25rem;
    flex-shrink: 0;
}

/* 모바일 메타 (데스크톱에서 숨김) */
.post-tile-mobile-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--wa-color-neutral-400, #94a3b8);
}

@media (min-width: 992px) {
    .post-tile-mobile-meta {
        display: none;
    }
}

/* 데스크톱 메타 (모바일에서 숨김) */
.post-tile-desktop-meta {
    display: none;
    flex-shrink: 0;
    min-width: 140px;
    max-width: 140px;
}

@media (min-width: 992px) {
    .post-tile-desktop-meta {
        display: block;
    }
}

.post-tile-meta-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-tile-meta-bottom {
    font-size: 0.7rem;
    color: var(--wa-color-neutral-400, #94a3b8);
    margin-top: 0.25rem;
}

/* 아바타 (데스크톱 36px) */
.post-tile-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: var(--wa-color-neutral-200, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    color: var(--wa-color-neutral-500, #64748b);
}

/* 아바타 (모바일 22px) */
.post-tile-avatar-sm {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    background: var(--wa-color-neutral-200, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.65rem;
    color: var(--wa-color-neutral-500, #64748b);
}

/* 작성자명 */
.post-tile-author {
    max-width: 5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    color: var(--wa-color-neutral-500, #64748b);
}

/* ============================================================ */
/* === 관리자 일괄 작업 UI === */
/* ============================================================ */

.post-admin-footer {
    margin-top: 0.5rem;
}

.post-admin-select-all {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--wa-color-neutral-700, #334155);
}

.post-admin-select-all input {
    width: 20px;
    height: 20px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.post-admin-bulk-actions {
    display: none;
    padding: 0.75rem;
    border: 1px solid var(--wa-color-neutral-200, #e2e8f0);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.post-admin-bulk-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.post-admin-count {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--wa-color-neutral-800, #1e293b);
}

.post-admin-select {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    border: 1px solid var(--wa-color-neutral-300, #d1d5db);
    border-radius: 6px;
    min-width: 180px;
    max-width: 220px;
    background: #fff;
    color: var(--wa-color-neutral-700, #334155);
    flex-shrink: 0;
}

.post-admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.post-admin-btn:hover {
    opacity: 0.85;
}

.post-admin-btn-primary {
    color: #fff;
    background: #3b82f6;
}

.post-admin-btn-secondary {
    color: var(--wa-color-neutral-700, #334155);
    background: transparent;
    border: 1px solid var(--wa-color-neutral-300, #d1d5db);
}

/* ============================================================ */
/* === Masonry 레이아웃 (v6 masonry.php 디자인 재구현) === */
/* ============================================================ */

/* 그리드 컨테이너 */
.v7-masonry-grid {
    position: relative;
    margin: 0.5rem 4px 0;
}

/* 그리드 아이템 크기: 모바일 2단 */
.v7-masonry-sizer,
.v7-masonry-item {
    width: 50%;
    padding: 4px;
}

/* 데스크톱: 3단 */
@media (min-width: 768px) {
    .v7-masonry-grid {
        margin: 0.5rem -4px 0;
    }

    .v7-masonry-sizer,
    .v7-masonry-item {
        width: 33.333%;
        padding: 4px;
    }
}

/* 카드 스타일 */
.v7-masonry-card {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: var(--wa-color-neutral-100, #f1f5f9);
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.v7-masonry-card:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

/* 차단된 사용자 카드 */
.v7-masonry-blocked {
    opacity: 0.65;
}

.v7-masonry-blocked:hover {
    opacity: 0.85;
}

/* 관리자 체크박스 */
.v7-masonry-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 20;
    width: 20px;
    height: 20px;
    accent-color: #3b82f6;
    cursor: pointer;
}

/* 이미지 컨테이너 */
.v7-masonry-image-wrap {
    position: relative;
    width: 100%;
    background: var(--wa-color-neutral-200, #e2e8f0);
}

/* 이미지 */
.v7-masonry-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* 이미지 없음 플레이스홀더 */
.v7-masonry-no-image {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    background: linear-gradient(135deg, #d6defa 0%, #e6ebff 100%);
    color: var(--wa-color-neutral-500, #64748b);
    font-size: 0.8rem;
}

/* 동영상/유튜브 플레이스홀더 */
.v7-masonry-video-placeholder {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: rgba(255, 255, 255, 0.7);
}

.v7-masonry-youtube-placeholder {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: rgba(255, 255, 255, 0.7);
}

/* 제목 오버레이 (하단 그라디언트) */
.v7-masonry-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
    padding: 40px 12px 12px;
    transition: all 0.3s ease;
}

.v7-masonry-card:hover .v7-masonry-overlay {
    padding-bottom: 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 80%, transparent 100%);
}

/* 제목 텍스트 */
.v7-masonry-title {
    color: #fff;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* hover 시 보이는 메타 정보 */
.v7-masonry-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.7rem;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.v7-masonry-card:hover .v7-masonry-meta {
    opacity: 1;
    max-height: 40px;
}

/* 메타 아이템 */
.v7-masonry-meta-item {
    white-space: nowrap;
}

.v7-masonry-meta-item i {
    margin-right: 2px;
    font-size: 0.65rem;
}

/* 아바타 (이니셜) */
.v7-masonry-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
}
