/* mainPage.css 슬라이더와 동일 크기 기준: 모바일 14rem, 데스크톱 22rem */
.grid-items {
    grid-template-columns: repeat(2, 14rem);
    grid-template-rows: repeat(auto-fit, 14rem);
    display: grid;
    width: 100%;
    height: 100%;
    grid-gap: 1.1rem;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

@media (max-width: 767px) {
    .grid-items {
        grid-template-columns: repeat(auto-fill, 14rem);
        grid-template-rows: repeat(auto-fill, 14rem);
        grid-gap: 1.1rem;
    }
}
.grid-item {
    position: relative;
    display: flex;
    aspect-ratio: 1/1;
}
.grid-items .sns,
.grid-item .sns {
    align-items: flex-start;
    aspect-ratio: 16/9;
}
.grid-item a {
    display: block;
    width: 100%;
    height: 100%;
}
.image-wrapper {
    position: relative;
    height: 100%;
    overflow: hidden;
}
.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease-in-out;
}


/* 제목 스타일 */
.image-wrapper .title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 13rem;
    color: #fff;
    font-size: 1.5rem;
    padding: 0.5rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* 호버 효과 */
.image-wrapper:hover img {
    filter: brightness(70%);
}

.image-wrapper:hover .title {
    opacity: 1;
}
/* 데스크톱(768px+): mainPage 슬라이더와 동일 22rem 기준 */
@media (min-width: 768px) {
    .grid-items {
        grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
        grid-template-rows: repeat(auto-fit, minmax(20rem, 1fr));
        grid-gap: 1.1rem;
        max-width: 1080px;
        margin-left: auto;
        margin-right: auto;
    }
    .grid-items.sns {
        grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
        grid-template-rows: repeat(auto-fit, minmax(12.375rem, 1fr)); /* 22 * 9/16 */
        grid-gap: 1.1rem;
    }
    .image-wrapper .title {
        width: 100%;
        font-size: 1.6rem;
        padding: 0.6rem;
    }
}

/* 목록 페이지 링크 (이전 / N 페이지 / 다음) */
.list-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin: 2rem 0 1rem;
    font-size: 0.9rem;
    color: #aaa;
}
.list-pager a {
    color: inherit;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border: 1px solid #555;
    border-radius: 6px;
}
