/*
---------------------------------------------------------
BookTeeOff Gallery
Version : 1.0
---------------------------------------------------------
*/


/* =======================================================
   Hero Image
======================================================= */

.bto-hero-image{
    width:100%;
    margin-bottom:-6px;
    cursor:pointer;
}

.bto-hero-image img{

    width:100%;
    height:340px !important;

    object-fit:cover;

    border-radius: var(--bto-radius-sm, 8px);

    display:block;

}


/* =======================================================
   Gallery Grid
======================================================= */

.bto-gallery-grid{

    display:grid;

    grid-template-columns:repeat(3,1fr);

    gap:12px;

}


.bto-gallery-item{

    cursor:pointer;

    overflow:hidden;

    border-radius: var(--bto-radius-sm, 8px);

    background:#f5f5f5;

}


.bto-gallery-item img{

    display:block;

    width:100%;

    height:130px;

    object-fit:cover;

    transition:0.25s;

}


.bto-gallery-item:hover img{

    transform:scale(1.05);

}


/* =======================================================
   Category Hidden Items
   (그리드에는 카테고리당 대표 이미지 1장만 노출.
   나머지 이미지는 DOM에는 남겨두어 라이트박스에서
   전체 넘기기가 가능하도록 하되, 화면에는 표시하지 않는다.)
======================================================= */

.bto-gallery-item-hidden{

    display:none;

}


/* =======================================================
   Lightbox
======================================================= */

#bto-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
}

#bto-lightbox.active {
    display: block;
    animation: bto-lb-in .18s ease-out;
}

@keyframes bto-lb-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* =======================================================
   Overlay (achromatic — registered §7 exception)
======================================================= */

.bto-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .92);
}

/* =======================================================
   Content — image figure + caption bar
======================================================= */

.bto-lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    /* biased up a touch — the thumbnail strip owns the bottom edge */
    transform: translate(-50%, calc(-50% - 34px));
    width: calc(100% - 32px);
    max-width: 1200px;
    text-align: center;
}

/* The arrows anchor on the FIGURE, not the content block, so they sit on
   the vertical centre of the photo itself (the caption below used to pull
   the 50% line off-centre). */
.bto-lightbox-figure {
    position: relative;
    margin: 0;
}

.bto-lightbox-image {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 72vh;
    border-radius: var(--bto-radius-sm, 8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, .5);
}

/* =======================================================
   Controls — quiet dark discs, thin white glyphs.
   Hover styles live behind (hover:hover): on touch the old white
   :hover state stuck after a tap and covered the photo as a big
   white disc.
======================================================= */

#bto-lightbox .bto-close,
#bto-lightbox .bto-prev,
#bto-lightbox .bto-next {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    line-height: 1;
    box-shadow: none;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, .5);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .15s;
}

#bto-lightbox .bto-close svg,
#bto-lightbox .bto-prev svg,
#bto-lightbox .bto-next svg {
    display: block;
}

.bto-close {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    z-index: 2;
}

.bto-prev,
.bto-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    z-index: 1;
}

.bto-prev { left: 12px; }
.bto-next { right: 12px; }

/* Wide screens: the arrows step outside the photo. */
@media (min-width: 1360px) {
    .bto-prev { left: -60px; }
    .bto-next { right: -60px; }
}

@media (hover: hover) {
    #bto-lightbox .bto-close:hover,
    #bto-lightbox .bto-prev:hover,
    #bto-lightbox .bto-next:hover {
        background: rgba(255, 255, 255, .25);
    }
}

#bto-lightbox .bto-close:active,
#bto-lightbox .bto-prev:active,
#bto-lightbox .bto-next:active {
    background: rgba(255, 255, 255, .32);
}

/* =======================================================
   Caption bar — title + counter on one quiet line
======================================================= */

.bto-lightbox-bar {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
    padding: 0 8px;
    min-height: 20px;
}

.bto-lightbox-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    min-width: 0;
}

.bto-lightbox-title:empty { display: none; }

.bto-lightbox-count {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, .65);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

/* =======================================================
   Thumbnail filmstrip — bottom edge, current photo ringed
======================================================= */

.bto-lightbox-thumbs {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    display: flex;
    justify-content: safe center;
    gap: 6px;
    padding: 4px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.bto-lightbox-thumbs::-webkit-scrollbar { display: none; }

#bto-lightbox .bto-lightbox-thumb {
    flex: 0 0 auto;
    width: 64px;
    height: 44px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, .08); /* placeholder tile while the photo loads */
    cursor: pointer;
    opacity: .5;
    transition: opacity .15s;
    -webkit-tap-highlight-color: transparent;
}

#bto-lightbox .bto-lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#bto-lightbox .bto-lightbox-thumb.is-current {
    opacity: 1;
    outline: 2px solid #fff;
    outline-offset: 1px;
}

@media (hover: hover) {
    #bto-lightbox .bto-lightbox-thumb:hover { opacity: 1; }
}

/* =======================================================
   Mobile
======================================================= */

@media (max-width: 768px) {

    .bto-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .bto-gallery-item img {
        height: 100px;
    }

    .bto-hero-image img {
        height: 190px;
    }

    .bto-lightbox-content {
        width: calc(100% - 20px);
    }

    .bto-lightbox-image {
        max-height: 72vh;
    }

    .bto-close {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
    }

    .bto-prev,
    .bto-next {
        width: 38px;
        height: 38px;
    }

    .bto-prev { left: 8px; }
    .bto-next { right: 8px; }

    .bto-lightbox-bar {
        margin-top: 12px;
        gap: 10px;
    }

    .bto-lightbox-title { font-size: 14.5px; }

    .bto-lightbox-content {
        transform: translate(-50%, calc(-50% - 30px));
    }

    .bto-lightbox-image { max-height: 62vh; }

    #bto-lightbox .bto-lightbox-thumb {
        width: 52px;
        height: 38px;
    }

    .bto-lightbox-thumbs { bottom: 10px; }
}
