/* 경제뉴스 - 커스텀 CSS */

/* ===== 모바일 UX (P31.2) ===== */

/* P31.2.1: Safe Area - iOS 노치/홈바 대응 */
header {
    padding-top: env(safe-area-inset-top);
}

footer {
    padding-bottom: env(safe-area-inset-bottom);
}

body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* P31.2.3: 스크롤 동작 조정 */
html, body {
    overscroll-behavior: none;
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

/* 뉴스 카드 - hover 효과 + 터치 UX (P31.2.2) */
.news-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark .news-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 무한 스크롤 - 하단 상태 */
.scroll-bottom-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 0;
}

.scroll-spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.dark .scroll-spinner {
    border-color: #4b5563;
    border-top-color: #60a5fa;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.scroll-sentinel {
    height: 1px;
}

/* 로딩 스켈레톤 */
.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 폰트 크기 - data-font-size 속성 기반 */
[data-font-size="small"] .news-title { font-size: 0.75rem; line-height: 1rem; }
[data-font-size="small"] .news-description { font-size: 0.75rem; line-height: 1rem; }
[data-font-size="small"] .news-time { font-size: 0.75rem; line-height: 1rem; }

[data-font-size="medium"] .news-title { font-size: 0.875rem; line-height: 1.25rem; }
[data-font-size="medium"] .news-description { font-size: 0.75rem; line-height: 1rem; }
[data-font-size="medium"] .news-time { font-size: 0.875rem; line-height: 1.25rem; }

[data-font-size="large"] .news-title { font-size: 1rem; line-height: 1.5rem; }
[data-font-size="large"] .news-description { font-size: 0.875rem; line-height: 1.25rem; }
[data-font-size="large"] .news-time { font-size: 1rem; line-height: 1.5rem; }

/* 폰트 크기 - 기사 본문 */
[data-font-size="small"] .article-content h1 { font-size: 1.125rem; line-height: 1.5rem; }
[data-font-size="small"] .article-body { font-size: 0.75rem; line-height: 1.25rem; }

[data-font-size="medium"] .article-content h1 { font-size: 1.25rem; line-height: 1.75rem; }
[data-font-size="medium"] .article-body { font-size: 0.875rem; line-height: 1.5rem; }

[data-font-size="large"] .article-content h1 { font-size: 1.5rem; line-height: 2rem; }
[data-font-size="large"] .article-body { font-size: 1rem; line-height: 1.75rem; }

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}
