/* news.css */
.news-page {
    padding-top: 100px;
}

.news-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.page-title {
    text-align: left;
    font-size: 2rem;
    color: #333;
    border-bottom: 2px solid #ff6a00;
    padding-bottom: 10px;
}

.news-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 10px;
}

.admin-button-container {
    flex-shrink: 0;
    align-self: flex-start;
}

.admin-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #ff6a00;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
    height: 40px;
    box-sizing: border-box;
    line-height: 20px;
}

.admin-button:hover {
    background-color: #e55c00;
}

.search-box {
    display: flex;
    gap: 10px;
    flex-grow: 1;
    align-items: center;
}

.search-box input {
    flex-grow: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    height: 40px;
    box-sizing: border-box;
}

.search-box button {
    padding: 8px 15px;
    border: none;
    background-color: #007bff;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    height: 40px;
    box-sizing: border-box;
}

.search-box button:hover {
    background-color: #0056b3;
}

#news-list {
    list-style: none;
    padding: 0;
}

/* 목록 항목 */
.news-item {
    border-bottom: 1px solid #eee;
    padding: 20px 0;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.news-item:hover {
    background-color: #f9f9f9;
}

/* 이미지 영역 스타일 */
.news-item-image {
    width: 100%;
    max-width: 150px;
    height: auto;
    overflow: hidden;
    border-radius: 4px;
    margin: 0;
    flex-shrink: 0;
    order: 2;
}

.news-item-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

/* 텍스트 영역 스타일 */
.news-item-text {
    flex-grow: 1;
    order: 1;
}

.news-item h3 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
}

.news-item .date {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 10px;
    display: block;
}

/* 내용 미리보기 한 줄만 표시 */
.news-item .content-preview {
    margin-top: 0;
    font-size: 1rem;
    color: #555;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}


.news-detail-page {
    padding-top: 100px;
}

.news-detail-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.news-detail-content h2 {
    font-size: 2.5rem;
    color: #333;
    border-bottom: 2px solid #ff6a00;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.news-detail-content .date {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 20px;
}

.news-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

.news-detail-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    white-space: pre-wrap;
}

.back-button-container {
    text-align: center;
    margin-top: 30px;
    padding-bottom: 50px;
}

.back-button {
    padding: 10px 20px;
    background-color: #ff6a00;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.back-button:hover {
    background-color: #e55c00;
}

/* 페이지네이션 버튼 스타일 */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination-container button {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
    color: #555;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.pagination-container button:hover:not(:disabled) {
    background-color: #ddd;
    color: #333;
    border-color: #ccc;
}

.pagination-container button.active {
    background-color: #ff6a00;
    color: #fff;
    border-color: #ff6a00;
    font-weight: bold;
    cursor: default;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .news-page, .news-detail-page {
        padding-top: 120px;
    }

    .news-content, .news-detail-content {
        padding: 15px;
    }

    .page-title {
        font-size: 1.5rem;
        text-align: center;
    }

    /* 툴바를 세로로 쌓기 */
    .news-toolbar {
        flex-direction: column;
        gap: 15px;
    }

    .admin-button-container {
        width: 100%;
    }

    .admin-button {
        width: 100%;
        text-align: center;
    }

    .search-box {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .search-box input,
    .search-box button {
        width: 100%;
    }

    /* 뉴스 아이템: 모바일에서는 세로로 배치 */
    .news-item {
        padding: 15px 0;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .news-item-text {
        width: 100%;
        order: 1;
    }

    .news-item-image {
        max-width: 100%;
        order: 2;
        margin-top: 10px;
    }

    .news-item h3 {
        font-size: 1.2rem;
    }

    /* 뉴스 상세 */
    .news-detail-content h2 {
        font-size: 1.8rem;
    }

    .news-detail-content p {
        font-size: 0.95rem;
    }

    /* 페이지네이션 버튼 */
    .pagination-container {
        gap: 3px;
        flex-wrap: wrap;
    }

    .pagination-container button {
        padding: 6px 10px;
        font-size: 0.9rem;
        min-width: 35px;
    }

    .back-button-container {
        padding-bottom: 30px;
    }
}

@media (max-width: 480px) {
    .news-page, .news-detail-page {
        padding-top: 100px;
    }

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

    .news-item h3 {
        font-size: 1.1rem;
    }

    .news-detail-content h2 {
        font-size: 1.5rem;
    }

    .pagination-container button {
        padding: 5px 8px;
        font-size: 0.85rem;
        min-width: 30px;
    }
}