/* =========================
   Footer Advertisement
   ========================= */

.footer-ad {
    width: 100%;
    margin-top: 40px;
    padding: 20px;
    background: #1b1b1b;
    border-top: 1px solid #333;
    text-align: center;
    overflow: hidden;

    --pc-ad-width: 1200px;
    --mobile-ad-height: 120px;
}


.footer-ad a,
.footer-ad picture {
    display: block;
    width: 100%;
}


.footer-ad img {
    display: block;
    width: 100%;
    max-width: var(--pc-ad-width);
    height: auto;
    max-height: 180px;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 8px;
    transition: transform .2s ease;
}


.footer-ad img:hover {
    transform: scale(1.02);
}


@media (max-width:768px){

    .footer-ad {
        padding:10px;
    }


    .footer-ad img {

        width:100%;
        max-width:100%;
        max-height:var(--mobile-ad-height);
        object-fit:contain;

    }

}

.footer-ad {
    min-height: 200px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.footer-ad img {
    min-height: 50px !important;
    visibility: visible !important;
    opacity: 1 !important;
}



.footer-ad picture {
    display:block !important;
}

.footer-ad img {
    display:block !important;
    width:90% !important;
    max-width:1200px !important;
    height:auto !important;
    min-height:50px !important;
    opacity:1 !important;
    visibility:visible !important;
}

.content-layout {
    display:flex;
    gap:30px;
    align-items:flex-start;
}


.content-layout .gallery-grid {
    flex:1;
}


.sidebar-ad {
    flex-shrink:0;
}


.sidebar-ad img {
    display:block;
    border-radius:8px;
}



@media(max-width:768px){

    .content-layout {
        display:block;
    }


    .sidebar-ad {
        margin-top:20px;
        text-align:center;
    }


    .sidebar-ad img {
        max-width:100%;
        height:auto !important;
    }

}


/* sidebar layout */

.content-layout {
    display:flex;
    gap:30px;
    align-items:flex-start;
}


.main-gallery {
    flex:1;
    min-width:0;
}


.sidebar-ad {
    width:300px;
    flex-shrink:0;
    margin-top:60px;
}


.sidebar-ad img {
    display:block;
    width:100%;
    height:auto;
    border-radius:8px;
}



@media(max-width:900px){

    .content-layout {
        display:block;
    }


    .sidebar-ad {
        width:100%;
        margin-top:30px;
        text-align:center;
    }


    .sidebar-ad img {
        max-width:100%;
        height:auto !important;
    }

}



/* sidebar advertisement */
.sidebar-ad {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);

    width: 300px;

    z-index: 99999;
}

.sidebar-ad img {
    width:100%;
    height:auto;
    display:block;
}


@media(max-width:1200px){
    .sidebar-ad{
        display:none;
    }
}



/* sidebar size fix */
.sidebar-ad {
    width: 160px !important;
    max-width:160px !important;
}

.sidebar-ad img {
    width:160px !important;
    max-width:160px !important;
    height:auto !important;
}


/* FINAL SIDEBAR AD */
.sidebar-ad {
    position: fixed !important;
    right: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;

    width:160px !important;
    z-index:99999 !important;
}

.sidebar-ad img {
    width:160px !important;
    height:auto !important;
    display:block;
}

@media(max-width:1200px){
    .sidebar-ad{
        display:none;
    }
}



/* gallery + sidebar layout */

.content-layout {
    display:flex;
    align-items:flex-start;
    gap:20px;
}


.sidebar-ad {
    flex:0 0 160px;
    order:0;
}


.sidebar-ad img {
    width:160px;
    height:auto;
    display:block;
}


.main-gallery {
    flex:1;
}


@media(max-width:900px){

.content-layout {
    flex-direction:column;
}

.sidebar-ad {
    width:100%;
    text-align:center;
}

.sidebar-ad img {
    margin:auto;
}

}



/* SIDEBAR AD FINAL FIX */

.content-layout {
    display:flex;
    align-items:flex-start;
    gap:20px;
}


.sidebar-ad {
    flex:0 0 180px !important;
    width:180px !important;
    max-width:180px !important;

    display:block !important;
}


.sidebar-ad a {
    display:block;
}


.sidebar-ad img {
    width:180px !important;
    max-width:180px !important;
    height:auto !important;

    display:block;
    object-fit:contain;
}


/* 모바일 */
@media(max-width:900px){

    .content-layout {
        display:flex;
        flex-direction:column;
    }


    .sidebar-ad {
        width:100% !important;
        max-width:100% !important;

        order:2;
        text-align:center;
    }


    .sidebar-ad img {
        width:90% !important;
        max-width:400px !important;
        margin:auto;
    }

}



/* ===== SIDEBAR AD CLEAN OVERRIDE ===== */

.content-layout {
    display:flex !important;
    align-items:flex-start !important;
    gap:20px !important;
}


.sidebar-ad {
    position:static !important;

    flex:0 0 180px !important;
    width:180px !important;
    max-width:180px !important;

    display:block !important;

    background:none !important;
}


.sidebar-ad a {
    display:block !important;
}


.sidebar-ad img {
    width:180px !important;
    max-width:180px !important;
    height:auto !important;

    display:block !important;
    object-fit:contain !important;
}



/* 모바일 표시 */
@media(max-width:900px){

    .sidebar-ad {
        display:block !important;

        width:100% !important;
        max-width:100% !important;
    }


    .sidebar-ad img {
        width:90% !important;
        max-width:400px !important;
        margin:0 auto !important;
    }

}


/* sidebar size adjust */
.sidebar-ad {
    flex-basis:220px !important;
    width:220px !important;
    max-width:220px !important;
}

.sidebar-ad img {
    width:220px !important;
    max-width:220px !important;
}



/* sidebar ad vertical stretch */

.sidebar-ad img {
    width:220px !important;
    height:280px !important;

    object-fit:cover !important;
}




/* footer ad normal */

.footer-ad {
    min-height:auto !important;
    background:transparent !important;
    display:flex !important;
    justify-content:center;
    overflow:hidden;
}


.footer-ad img {
    width:auto !important;
    max-width:100% !important;
    height:auto !important;
    margin:0 auto !important;
}










/* ===== AD SYSTEM CLEAN ===== */


/* TOP / BOTTOM CONTAINER */

.top-ad,
.bottom-ad {
    width:100%;
    display:flex;
    justify-content:center;
    align-items:center;
    text-align:center;
    overflow:hidden;
}


/* LINK */

.top-ad a,
.bottom-ad a {
    display:block;
}


/* IMAGE */

.top-ad-image,
.bottom-ad img {

    display:block;

    width:auto;
    height:auto;

    max-width:100%;

    margin:0 auto;

    object-fit:contain;
}



/* PC */

@media(min-width:769px){

    .top-ad-image,
    .bottom-ad img {

        max-width:728px;
        max-height:250px;

    }

}



/* MOBILE */

@media(max-width:768px){

    .top-ad,
    .bottom-ad {

        width:100%;

    }


    .top-ad a,
    .bottom-ad a {

        width:100%;

    }


    .top-ad-image,
    .bottom-ad img {

        width:100%;
        max-width:100%;
        height:auto;

    }



    /* 사이드 광고 숨김 */

    .sidebar-ad {

        display:none !important;

    }

}



/* ===== SIDEBAR AD FIX ===== */

.content-layout {
    display:flex;
    align-items:flex-start;
}


.sidebar-ad {

    position:sticky;
    top:20px;

    width:300px;
    flex-shrink:0;

    margin-left:20px;

    order:2;

}


.sidebar-ad a {

    display:block;

}


.sidebar-ad img {

    display:block;

    width:300px;
    height:auto;

    max-width:300px;

    object-fit:contain;

}



/* MOBILE OFF */

@media(max-width:768px){

    .sidebar-ad {

        display:none !important;

    }

}



/* ===== SIDEBAR FLOAT FIX ===== */


.content-layout {
    position:relative;
}


/* 오른쪽 고정 사이드 광고 */

.sidebar-ad {

    position:fixed !important;

    right:20px;
    top:150px;

    width:300px;

    z-index:100;

}


.sidebar-ad img {

    width:300px;
    height:auto;

    display:block;

}



/* 본문이 광고와 겹치지 않게 */

.main-gallery {

    margin-right:340px;

}



/* 모바일 숨김 */

@media(max-width:768px){

    .sidebar-ad {

        display:none !important;

    }


    .main-gallery {

        margin-right:0;

    }

}




/* ===== AD RESPONSIVE SIZE FINAL ===== */

.top-ad,
.bottom-ad {
    width:100% !important;
    display:flex !important;
    justify-content:center !important;
    align-items:center !important;
    text-align:center !important;
    overflow:hidden !important;
}


.top-ad a,
.bottom-ad a {
    display:block !important;
}


.top-ad-image,
.bottom-ad img {
    display:block !important;
    width:var(--pc-width, auto);
    height:var(--pc-height, auto);
    max-width:728px;
    object-fit:contain;
    margin:0 auto;
}


@media(max-width:768px){

    .top-ad-image,
    .bottom-ad img {

        width:100% !important;
        max-width:100% !important;
        height:auto !important;

    }

}





