/* News Main 1 Styles */
.news-main-1-wrapper {
    width: 100%;
    margin: 30px 0 25px 0;
}

.news-main-1-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 440px 1fr;
    /* 📌 가운데 이미지를 440px로 고정하여 정사각형 생성 */
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    height: 440px;
    /* 📌 전체 높이를 440px로 축소 */
}

.n1-item {
    position: relative;
    overflow: hidden;
    background-color: #1a1a1a;
    border-radius: 0;
}

.n1-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
}

.n1-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.n1-item:hover .n1-bg {
    transform: scale(1.05);
}

.n1-img-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    pointer-events: none;
}

.n1-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    z-index: 2;
}

.n1-title {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    word-break: keep-all;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Grid Positioning for the 5-item rotation */
.n1-item-0 {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
}

.n1-item-0 .n1-content {
    padding: 30px;
}

.n1-item-0 .n1-title {
    font-size: 28px;
}

.n1-item-1 {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
}

.n1-item-2 {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
}

.n1-item-3 {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
}

.n1-item-4 {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
}

.n1-sub-wrap {
    display: contents;
}

/* Responsive: 992px 이하 (태블릿+모바일) 통합 — flex 레이아웃 */
@media (max-width: 992px) {
    .news-main-1-wrapper {
        margin: 15px 0;
    }

    .news-main-1-container {
        display: flex;
        flex-direction: column;
        height: auto;
        padding: 0;
    }

    .n1-item-0 {
        width: 100%;
        height: 55vw;
        min-height: 250px;
        max-height: 400px;
    }

    .n1-sub-wrap {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 15px;
        scroll-snap-type: x mandatory;
        padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
    }

    .n1-sub-wrap::-webkit-scrollbar {
        height: 5px;
    }

    .n1-sub-wrap::-webkit-scrollbar-track {
        background: #e0e0e0;
    }

    .n1-sub-wrap::-webkit-scrollbar-thumb {
        background: #888;
    }

    .n1-sub-wrap::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

    .n1-item-1,
    .n1-item-2,
    .n1-item-3,
    .n1-item-4 {
        flex: 0 0 45%;
        height: 250px;
        scroll-snap-align: start;
    }

    .n1-item-0 .n1-title {
        font-size: 26px;
    }

    .n1-title {
        font-size: 20px;
    }
}

/* 모바일(768px 이하): 서브 아이템 크기만 조정 */
@media (max-width: 768px) {
    .n1-item-0 {
        height: 60vw;
        max-height: 350px;
    }

    .n1-item-1,
    .n1-item-2,
    .n1-item-3,
    .n1-item-4 {
        flex: 0 0 80%;
        height: 220px;
    }

    .n1-item-0 .n1-title {
        font-size: 24px;
    }
}