@import url("./common.css");

/*--------------------------------------------------
  콘텐츠 섹션
  --------------------------------------------------*/
.content-section {
    width: 100%;
    padding-top: 0;
    position: relative;
    margin-bottom: 0;
}

.news-container {
    width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.news-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    padding-bottom: 28px;
    margin-bottom: 0;
}

.total-count {
    font-size: 20px;
    font-weight: 600;
    color: #555555;
    margin: 24px 0 0;
}

.total-count strong {
    color: #117d8d;
}

.mobile-count {
    display: none;
}

/* news-lab에만 있는 서치 영역 */
.search-area {
    display: flex;
    gap: 9px;
}

.select-box,
.search-box {
    position: relative;
    height: 55px;
    border: 1px solid #dddddd;
    border-radius: 8px;
    background: #ffffff;
    box-sizing: border-box;
}

.select-box {
    width: 228px;
}

.select-box select {
    width: 100%;
    height: 100%;
    padding: 0 35px;
    border: none;
    background: transparent;
    font-weight: 400;
    font-size: 18px;
    color: #000000;
    appearance: none;
    cursor: pointer;
    outline: none;
}

.select-box::after {
    content: '';
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 8px;
    background: url('../images/icon-arrow-down.svg') no-repeat center;
}

.search-box {
    width: 538px;
    padding: 0 42px;
}

.search-box input {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 18px;
    color: #000000;
    outline: none;
    padding-right: 40px;
}

.search-box input::placeholder {
    color: #000000;
}

.search-box .btn-search {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    outline: none;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box .btn-search img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* 리스트 헤더 */
.list-header {
    display: flex;
    justify-items: center;
    padding: 22px 55px;
    height: 59px;
    background: #f8f8f8;
    border-top: 2px solid #000000;
    font-size: 16px;
    color: #000000;
}

.list-header .col-num {
    width: 60px;
    text-align: center;
}

.list-header .col-title {
    flex: 1;
    text-align: center;
    margin: 0 100px;
}

.list-header .col-date {
    width: 110px;
    text-align: center;
}

/* 리스트 콘텐츠 */
.news-list {
    /* border-top: 2px solid #000000; */
}

.list-content {
    margin: 0;
    padding: 0;
    list-style: none;
}

.list-content li {
    display: flex;
    align-items: center;
    padding: 0 55px;
    border-bottom: 1px solid #dddddd;
    height: 66px;
    transition: background-color 0.2s;
}

/* .list-content li:hover {
    background-color: #f8f8f8;
} */

.list-content .num {
    width: 60px;
    font-size: 16px;
    color: #000000;
    text-align: center;
}

.list-content .title {
    flex: 1;
    margin: 0 100px;
    font-weight: 400;
    font-size: 18px;
    color: #1d1d1d;
    text-decoration: none;
    line-height: 1.5;
}

.list-content .title:hover {
    text-decoration: underline;
}

.list-content .date {
    width: 110px;
    font-size: 16px;
    color: #000000;
    text-align: center;
}

.list-content .no-data {
    text-align: center;
    padding: 50px 0;
    color: #555555;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 56px 30px;
    margin-bottom: 50px;
    padding-top: 28px;
    border-top: 2px solid #000;
}

.news-item {
    background-color: #fff;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
}

.news-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-item:hover .news-image img {
    transform: scale(1.05);
}

.news-content {
    padding: 14px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.news-title {
    font-weight: 700;
    font-size: 18px;
    color: #1D1D1D;
    line-height: 1.4;

}

.news-date {
    margin-top: 14px;
    font-weight: 500;
    font-size: 16px;
    color: #666;
}

/*--------------------------------------------------
  페이지네이션
  --------------------------------------------------*/
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 30px 0 150px;
    height: 40px;
}

.pagination .btn-prev,
.pagination .btn-next {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    background: #ffffff;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.pagination .btn-prev img,
.pagination .btn-next img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    opacity: 0.4;
}

.pagination .btn-prev:hover img,
.pagination .btn-next:hover img {
    opacity: 0.8;
}

.pagination .btn-prev:disabled img,
.pagination .btn-next:disabled img {
    opacity: 0.2;
}

.pagination .page-numbers {
    display: flex;
    gap: 4px;
    margin: 0 8px;
    padding: 0;
    list-style: none;
}

.pagination .page-numbers a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 400;
    color: #555555;
    text-decoration: none;
    transition: all 0.2s ease;
    background: transparent;
    margin: 2px;
}

.pagination .page-numbers a:hover {
    background-color: #f5f5f5;
}

.pagination .page-numbers a.active {
    background: #000000;
    color: #ffffff;
    font-weight: 500;
}

@media screen and (max-width: 1200px) {
    .news-container {
        width: 100%;
    }
    .news-grid {
        grid-template-columns:repeat(2, 1fr);
        margin-top: 8px;
    }
}

/*==================================================
  모바일 스타일
  ==================================================*/
@media screen and (max-width: 768px) {

    .container,
    .news-section {
        width: 100%;
        overflow-x: hidden;
        margin: 0;
    }

    .news-section .news-header {
        margin-top: var(--header-height);
    }

    .news-section .news-header .category {
        margin-bottom: 9px;
    }

    .news-section .news-header .title {
        text-align: center;
    }

    .content-section {
        padding-top: 0;
    }

    .news-container {
        width: 100%;
        padding: 0 30px;
    }

    .news-filter {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding-bottom: 0;
    }

    .total-count {
        font-size: 14px;
        line-height: 1.2;
        margin: 8px 0 0;
        text-align: right;
        width: 100%;
        order: 2;
    }

    .web-count {
        display: none;
    }

    .mobile-count {
        display: inline;
    }

    /* news-lab에만 있는 서치 영역 */
    .search-area {
        width: 100%;
        flex-direction: column;
        gap: 10px;
        order: 1;
    }

    .select-box,
    .search-box {
        width: 100%;
        height: 55px;
        border-radius: 6px;
    }

    .select-box select {
        padding: 0 15px;
        font-size: 16px;
    }

    .search-box {
        padding: 0;
    }

    .search-box input {
        padding: 0 40px 0 15px;
        font-size: 16px;
    }

    .search-box .btn-search {
        width: 20px;
        height: 20px;
        right: 14px;
    }

    .search-box .btn-search img {
        width: 20px;
        height: 20px;
    }

    /* 리스트 헤더 */
    .list-header {
        display: none;
    }

    .news-list {
        border-top: none;
    }

    .list-content {
        border-top: 1px solid #000000;
        margin-top: 8px;
        padding-top: 10px;
    }

    .list-content li {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 15px 5px;
        border-bottom: 1px solid #cccccc;
        height: 75px;
    }

    .list-content .num {
        display: none;
    }

    .list-content .title {
        margin: 0;
        font-weight: bold;
        font-size: 17px;
        line-height: 1.2;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .list-content .date {
        width: auto;
        font-weight: normal;
        font-size: 14px;
        line-height: 1.2;
        text-align: left;
        margin: 0;
    }

    /* 페이지네이션 */
    .pagination {
        margin: 20px 0 60px;
    }

    .pagination .page-numbers {
        margin: 0;
        gap: 4px;
    }

    .pagination .page-numbers a {
        position: relative;
        width: 40px;
        height: 40px;
        font-size: 13px;
        margin: 0;
        z-index: 0;
    }

    .pagination .page-numbers a.active {
        background: none;
    }

    .pagination .page-numbers a.active:after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #000;
        transform: translate(-50%, -50%);
        z-index: -1;
    }

    .pagination .btn-prev,
    .pagination .btn-next {
        width: 40px;
        height: 40px;
    }

    .pagination .btn-prev img,
    .pagination .btn-next img {
        width: 16px;
        height: 16px;
        opacity: 0.3;
    }

    .news-grid {
        grid-template-columns:repeat(2, 1fr);
        margin-top: 8px;
    }
    .news-image{
        height: 179px;
    }

    .news-content {
        padding: 20px;
    }
}

@media screen and (max-width: 480px) {
    .news-grid {
        grid-template-columns:repeat(1, 1fr);
    }
}