section {
    width:100%;
    /* height: 100vh; */
    margin:0 auto;
    margin-bottom:50px;
}

.non-bg {
    height:550px !important;
}
@media (max-width: 1920px) {
    #sub_content {
        padding-top:0 !important;
    }
    .non-bg {
        height:550px !important;
    }
}

.history-nav-box {
    width:100%;
    max-width:1440px;
    margin:0 auto;
    display:flex;
    justify-content: space-between;
    align-items: center;
    padding:0 20px;
    gap:10px;
    margin-bottom:60px;
}
.history-nav-item {
    width:100%;
    height:70px;
    border-bottom:4px solid #000;
    display:flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color:#000;
    font-family: "Godo B";
    font-size: 18px;
    font-weight: 400;
    line-height: 100%;
}
.history-nav-item.menu {
    border-bottom:4px solid #afafaf;
    color:#afafaf;
}
.history-nav-item.menu.active {
    border-bottom:4px solid #EF2E4F;
    color:#EF2E4F;
}
.history-content-box-youtube {
    width:100%;
    max-width:1440px;
    margin:0 auto;
    padding:0 20px;
    margin-bottom:60px;
    display:grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap:20px;
    box-sizing: border-box;
}
.history-content-box-youtube-item {
    width:100%;
    height:100%;
    display:flex;
    align-items: center;
    flex-direction: column;
    padding:0 20px;
    gap:10px;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
    max-width: 100%;
    /* overflow: hidden; */
}

.history-content-box-youtube-item:link,
.history-content-box-youtube-item:visited,
.history-content-box-youtube-item:hover,
.history-content-box-youtube-item:active {
    color: inherit;
    text-decoration: none;
}
.history-content-box-youtube-item-img {
    width:100%;
    height:100%;
    min-height:270px;
    max-height:270px;
    display:flex;
    justify-content: center;
    align-items: center;
    padding:0 20px;
    gap:10px;
    border-top:2px solid #000;
    border-bottom:2px solid #000;
    padding:10px;
    position:relative;
    /* overflow:hidden; */
}
.history-content-box-youtube-item-img > img.thumbnail {
    width:100%;
    height:100%;
    /* max-height:200px; */
    /* min-height:240px; */
    object-fit:cover;
    padding: 10px;
    border:1px solid #C7C7C7;
    background-color:#f5f5f5;
}

/* Instagram 전용 스타일 - 4:5 비율 및 위아래 두루마리 */
.history-instagram-item {
    padding: 0 !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    overflow: hidden !important;
    padding:0 20px !important;
    margin-bottom: 10px;
}

.history-instagram-item-img {
    aspect-ratio: 4 / 5;
    min-height: auto !important;
    max-height: 500px !important;
    height: auto !important;
    padding: 10px 5px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    overflow: visible !important;
    border-left:2px solid #000;
    border-right:2px solid #000;
    padding:10px;
    border-top:none;
    border-bottom:none;
}

.history-instagram-item-img > img.thumbnail {
    width: calc(100% - 20px) !important;
    height: calc(100% - 20px) !important;
    max-height: none !important;
    padding: 0 !important;
    border: 1px solid #C7C7C7 !important;
    background-color: #f5f5f5 !important;
    object-fit: cover !important;
    box-sizing: border-box !important;
}

/* 위아래 두루마리 디자인 (notice.css 참고) */
.history-instagram-item-img .scroll-top,
.history-instagram-item-img .scroll-bottom {
    position: absolute !important;
    left: -10px !important;
    right: 0 !important;
    width: calc(100% + 20px) !important;
    height: 18px !important;
    background-color: #dcdcdc !important;
    border: 2px solid #000 !important;
    border-radius: 6px !important;
    z-index: 2 !important;
    box-sizing: border-box !important;
}

.history-instagram-item-img .scroll-top {
    top: 0 !important;
}

.history-instagram-item-img .scroll-bottom {
    bottom: 0 !important;
}
.history-content-box-youtube-item-text {
    width:100%;
    display:flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap:10px;
}
.history-content-box-youtube-item-text > p {
    display:flex;
    align-items: center;
    gap:10px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    color:#8C8C8C;
    font-family: "Godo";
    text-align: center;
}
.list_l, .list_r {
    position:absolute;
    top:-5px;
    object-fit: cover;
    z-index:1;
}
.list_l {
    left:-5px;
}
.list_r {
    right:-5px;
}
.history-board {
    margin-bottom:250px;
}

/* 페이징 스타일 */
.history-pagination {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 50px !important;
    margin-bottom: 50px !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    grid-column: 1 / -1 !important;
    text-align: center !important;
}

.pagination-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 12px !important;
    border: 1px solid #ddd !important;
    background-color: #fff !important;
    color: #333 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-family: "Godo", sans-serif !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.pagination-btn:hover {
    background-color: #EF2E4F !important;
    color: #fff !important;
    border-color: #EF2E4F !important;
}

.pagination-btn.pagination-active {
    background-color: #EF2E4F !important;
    color: #fff !important;
    border-color: #EF2E4F !important;
    cursor: default !important;
    font-weight: 600 !important;
}

.pagination-btn.pagination-prev,
.pagination-btn.pagination-next {
    min-width: 60px !important;
    font-weight: 600 !important;
}

.pagination-ellipsis {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 40px !important;
    color: #999 !important;
    font-size: 14px !important;
}

@media screen and (max-width: 768px) {
    .history-content-box-youtube {
        grid-template-columns: 1fr;
        padding:0;
    }
    .history-board {
        margin-bottom:100px;
    }
    .history-instagram-item-img {
        aspect-ratio: 4 / 5;
    }
    /* 모바일에서는 페이징 숨김 */
    .history-pagination {
        display: none !important;
    }
}

/* Instagram 릴스 임베드 스타일 - UI 제거 */
.instagram-reel-item {
    grid-column: 1 / -1;
    max-width: 100%;
    padding: 20px;
}

.instagram-reel-wrapper {
    max-width: 540px;
    margin: 0 auto;
    position: relative;
    width: 100%;
}

.instagram-reel-container {
    position: relative;
    height: 0;
    overflow: hidden;
    /* background: #000; */
    border-radius: 8px;
}

/* 모바일 대응 */
@media screen and (max-width: 768px) {
    .instagram-reel-wrapper {
        max-width: 100%;
    }
    
    .instagram-reel-container {
        border-radius: 0;
    }
    
    .instagram-reel-container iframe {
        top: -60px !important;
        height: calc(100% + 120px) !important;
        transform: scale(1.15) !important;
    }
    .instagram-media {
        width:100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .history-nav-item.menu {
        font-size: 14px;
    }
    .history-content-box-youtube-item-img > img.thumbnail {
        max-height:200px;
    }
    .history-instagram-item-img > img.thumbnail {
        max-height: none !important;
    }
}

a {
    text-decoration: none;
    color: inherit;
}
a:link, a:visited, a:hover, a:active {
    text-decoration: none;
    color: inherit;
}

@media screen and (max-width: 480px) {
    .non-bg {
        height: 300px !important;
        /* height: 35vh !important; */
    }
    section {
        margin-bottom:20px;
    }
    .history-content-box-youtube-item-img {
        min-height:150px;
    }
    .history-instagram-item-img {
        min-height: auto !important;
        aspect-ratio: 4 / 5;
    }
    .list_l, .list_r {
        height:250px;
    }
    .history-content-box-youtube-item-text {
        padding:0 5px;
    }
    .history-content-box-youtube-item {
        gap:15px;
    }
}

/* YouTube 모달 레이어 스타일 */
#youtube-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 20px;
    box-sizing: border-box;
}

#youtube-modal.show {
    display: flex;
}

#youtube-modal > div {
    position: relative;
    width: 90%;
    max-width: 900px;
    background-color: #000;
    margin: auto;
    flex-shrink: 0;
}

#youtube-modal > div::before {
    content: '';
    display: block;
    padding-top: 56.25%; /* 16:9 비율 */
}

#youtube-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    z-index: 10001;
    padding: 5px 15px;
    line-height: 1;
    transition: opacity 0.3s;
}

#youtube-modal-close:hover {
    opacity: 0.7;
}

#youtube-modal-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* 반응형 처리 */
@media screen and (max-width: 768px) {
    #youtube-modal {
        padding: 10px;
    }
    
    #youtube-modal > div {
        width: 95%;
        max-width: 100%;
    }
    
    #youtube-modal-close {
        top: -40px;
        font-size: 24px;
        padding: 5px 10px;
    }
}

@media screen and (max-width: 480px) {
    #youtube-modal {
        padding: 5px;
    }
    
    #youtube-modal > div {
        width: 100%;
    }
    
    #youtube-modal-close {
        top: -35px;
        font-size: 20px;
        padding: 3px 8px;
    }
}

@media screen and (max-width: 430px) {
    .list_l, .list_r {
        height:250px;
    }
}

@media screen and (max-width: 400px) {
    .list_l, .list_r {
        height:230px;
    }
}

@media screen and (max-width: 390px) {
    .list_l, .list_r {
        height:230px;
    }
}

@media screen and (max-width: 380px) {
    .list_l, .list_r {
        height:200px;
    }
}

@media screen and (max-width: 360px) {
    .list_l, .list_r {
        height:190px;
    }
}

@media screen and (max-width: 340px) {
    .list_l, .list_r {
        height:190px;
    }
}


@media screen and (max-width: 320px) {
    .list_l, .list_r {
        height:190px;
    }
}

/* Instagram 이미지 모달 레이어 스타일 */
#instagram-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 20px;
    box-sizing: border-box;
}

#instagram-modal.show {
    display: flex;
}

.instagram-modal-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    background-color: transparent;
    margin: auto;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

#instagram-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    z-index: 10001;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.3s;
}

#instagram-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.instagram-modal-image-wrapper {
    width: 100%;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#instagram-modal-image {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}

/* Instagram 모달 반응형 처리 */
@media screen and (max-width: 768px) {
    #instagram-modal {
        padding: 10px;
    }
    
    .instagram-modal-content {
        width: 95%;
        max-width: 100%;
    }
    
    #instagram-modal-close {
        top: 5px;
        right: 5px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
    
    #instagram-modal-image {
        max-height: 80vh;
    }
}

@media screen and (max-width: 480px) {
    #instagram-modal {
        padding: 5px;
    }
    
    .instagram-modal-content {
        width: 100%;
        border-radius: 0;
    }
    
    #instagram-modal-close {
        top: 5px;
        right: 5px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
    
    #instagram-modal-image {
        max-height: 70vh;
    }
}

