/**
 * 최근 사진 위젯 스타일
 *
 * 파일: css/recent-photos.css
 * 사용: widgets/main/recent-photos.php
 *
 * Netflix/YouTube 스타일의 깔끔한 가로형 카드 디자인
 */

/* ========== 위젯 컨테이너 ========== */
.recent-photos-widget {
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

/* ========== 위젯 헤더 ========== */
.recent-photos-widget .widget-header {
    border-bottom: 1px solid #f0f1f3;
    padding-bottom: 0.625rem;
    margin-bottom: 0.75rem;
}

.recent-photos-widget .widget-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #212529;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
}

.recent-photos-widget .widget-title i {
    font-size: 0.9375rem;
    color: #6366f1;
}

/* ========== 게시글 그리드 - 가로 스크롤 ========== */
[data-widget-id="main-recent-photos"] .category-posts-grid {
    display: flex;
    gap: 0.625rem;
    overflow-x: auto;
    padding: 0.25rem 0 0.625rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #dee2e6 transparent;
}

/* 스크롤바 스타일 */
[data-widget-id="main-recent-photos"] .category-posts-grid::-webkit-scrollbar {
    height: 6px;
}

[data-widget-id="main-recent-photos"] .category-posts-grid::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 3px;
}

[data-widget-id="main-recent-photos"] .category-posts-grid::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
    transition: background 0.2s;
}

[data-widget-id="main-recent-photos"] .category-posts-grid::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* ========== 개별 게시글 카드 ========== */
[data-widget-id="main-recent-photos"] .category-post-item {
    flex: 0 0 auto;
    width: 150px;
    text-decoration: none;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

[data-widget-id="main-recent-photos"] .category-post-item:hover {
    transform: translateY(-2px);
}

/* ========== 썸네일 이미지 컨테이너 ========== */
[data-widget-id="main-recent-photos"] .category-post-thumbnail {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f1f3f5;
    border-radius: 5px;
    position: relative;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.25s ease;
}

[data-widget-id="main-recent-photos"] .category-post-item:hover .category-post-thumbnail {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

[data-widget-id="main-recent-photos"] .category-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* 호버 시 이미지 확대 */
[data-widget-id="main-recent-photos"] .category-post-item:hover .category-post-thumbnail img {
    transform: scale(1.05);
}

/* ========== 이미지 없을 때 플레이스홀더 ========== */
[data-widget-id="main-recent-photos"] .category-post-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #adb5bd;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* ========== 게시글 제목 (이미지 아래) ========== */
[data-widget-id="main-recent-photos"] .category-post-title {
    font-size: 0.75rem;
    font-weight: 400;
    color: #495057;
    line-height: 1.4;
    margin: 0;
    padding: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: keep-all;
    letter-spacing: -0.01em;
    transition: color 0.2s ease;
}

[data-widget-id="main-recent-photos"] .category-post-item:hover .category-post-title {
    color: #6366f1;
}

/* ========== 반응형 ========== */
@media (max-width: 992px) {
    [data-widget-id="main-recent-photos"] .category-post-item {
        width: 140px;
    }
}

@media (max-width: 768px) {
    .recent-photos-widget {
        padding: 0.875rem 1rem;
    }

    [data-widget-id="main-recent-photos"] .category-posts-grid {
        gap: 0.5rem;
    }

    [data-widget-id="main-recent-photos"] .category-post-item {
        width: 130px;
        gap: 0.25rem;
    }

    [data-widget-id="main-recent-photos"] .category-post-title {
        font-size: 0.6875rem;
    }
}

@media (max-width: 576px) {
    .recent-photos-widget {
        padding: 0.75rem;
        border-radius: 5px;
    }

    [data-widget-id="main-recent-photos"] .category-posts-grid {
        gap: 0.5rem;
        padding: 0.125rem 0 0.5rem;
    }

    [data-widget-id="main-recent-photos"] .category-post-item {
        width: 120px;
        gap: 0.25rem;
    }

    [data-widget-id="main-recent-photos"] .category-post-thumbnail {
        border-radius: 4px;
    }

    [data-widget-id="main-recent-photos"] .category-post-title {
        font-size: 0.6875rem;
        line-height: 1.3;
    }
}
