/* 뉴스 페이지 전용 스타일 */


/* 뉴스 섹션 */
.news-section {
    padding: 3rem 0;
    background: #f8fafc;
    min-height: 70vh;
}

/* 뉴스 컨트롤 */
.news-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    gap: 2rem;
}

.news-info h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
}

.news-count {
    color: #6b7280;
    font-size: 1rem;
    margin: 0;
}

.news-count strong {
    color: #4f46e5;
    font-weight: 600;
}

/* 검색 및 필터 */
.news-search {
    min-width: 400px;
}

.search-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.category-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    min-width: 150px;
    transition: border-color 0.2s;
}

.category-select:focus {
    outline: none;
    border-color: #4f46e5;
}

.search-input-group {
    display: flex;
    gap: 0;
}

.search-input {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 1rem;
    min-width: 200px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #4f46e5;
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background: #4f46e5;
    color: white;
    border: 2px solid #4f46e5;
    border-radius: 0 8px 8px 0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.search-btn:hover {
    background: #3730a3;
    border-color: #3730a3;
}

/* 뉴스 그리드 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* 뉴스 카드 */
.news-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    height: fit-content;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.news-card.notice {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(to right, #fef3c7, white);
}

.news-card.featured {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(to right, #dbeafe, white);
}

/* 카드 헤더 */
.news-card-header {
    padding: 1.5rem 1.5rem 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.news-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.notice-badge {
    background: #fbbf24;
    color: #92400e;
}

.featured-badge {
    background: #60a5fa;
    color: #1e40af;
}

.attachment-icon {
    font-size: 1.2rem;
    color: #6b7280;
}

.news-meta {
    display: flex;
    align-items: center;
}

.category-tag {
    background: #f3f4f6;
    color: #4b5563;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* 카드 콘텐츠 */
.news-card-content {
    padding: 1rem 1.5rem;
}

.news-title {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    line-height: 1.4;
    /* 1줄 제한 및 말줄임표 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-link {
    color: #1f2937;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.news-link:hover {
    color: #4f46e5;
}

.news-summary {
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
    /* 1줄 제한 및 말줄임표 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 카드 푸터 */
.news-card-footer {
    padding: 0 1.5rem 1.5rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f3f4f6;
    margin-top: 1rem;
    padding-top: 1rem;
}

.news-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.news-date,
.news-views {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #6b7280;
    font-size: 0.85rem;
}

.news-author {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #6b7280;
    font-size: 0.85rem;
}

.icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

/* 검색 결과 없음 */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.no-results p {
    font-size: 1.2rem;
    color: #6b7280;
    margin: 0 0 2rem 0;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 1rem 2rem;
    background: #4f46e5;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #3730a3;
    transform: translateY(-2px);
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0rem;
    min-width: 44px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.page-link:hover {
    background: #f9fafb;
    border-color: #4f46e5;
    color: #4f46e5;
}

.page-link.active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: white;
}

.page-link.active:hover {
    background: #3730a3;
    border-color: #3730a3;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .news-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }
    
    .news-search {
        min-width: auto;
    }
    
    .search-filters {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-input-group {
        width: 100%;
    }
    
    .search-input {
        flex: 1;
        min-width: auto;
    }
    
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .news-section {
        padding: 2rem 0;
    }
    
    .news-info h2 {
        font-size: 1.75rem;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .news-card-header {
        padding: 1rem 1rem 0 1rem;
    }
    
    .news-card-content {
        padding: 1rem;
    }
    
    .news-card-footer {
        padding: 0 1rem 1rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .pagination {
        gap: 0.25rem;
        flex-wrap: wrap;
    }
    
    .page-link {
        padding: 0.5rem 0.75rem;
        min-width: 40px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .news-card-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .news-badges {
        order: 2;
    }
    
    .news-meta {
        order: 1;
    }
    
    .search-filters {
        gap: 0.75rem;
    }
    
    .category-select {
        min-width: auto;
        width: 100%;
    }
    
    .news-info {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* 로딩 상태 애니메이션 */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.loading-card {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* 접근성 향상 */
.news-link:focus,
.page-link:focus,
.search-btn:focus,
.category-select:focus,
.search-input:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .news-card {
        border: 2px solid #000;
    }
    
    .badge {
        border: 1px solid currentColor;
    }
    
    .category-tag {
        border: 1px solid #6b7280;
    }
}

/* 모션 감소 선호 사용자 지원 */
@media (prefers-reduced-motion: reduce) {
    .news-card {
        transition: none;
    }
    
    .news-card:hover {
        transform: none;
    }
    
    .btn-primary:hover {
        transform: none;
    }
}
