/* ==================================================
   INTEGRATED VIDEO GALLERY SKIN
   Kukje Gallery Style + Video Support
   ================================================== */

.bo-gallery {
    max-width: 1600px;
    width: 100%;
    margin: 80px auto 60px;
    padding: 0 4vw;
    box-sizing: border-box;
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
}

/* ── 헤더 ── */
.bo-gallery__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 2px solid #111;
    margin-bottom: 40px;
}

.bo-gallery__header > div {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
}

.bo-gallery__title {
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: #111;
    margin: 0;
}

.bo-gallery__count {
    display: inline-block;
    font-size: 0.85rem;
    color: #999;
    letter-spacing: 0.05em;
    margin: 0;
}


/* ── 글쓰기 버튼 (Header/Footer) ── */
.bo-gallery__write-btn {
    display: inline-block;
    padding: 10px 28px;
    background: #111;
    color: #fff !important;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-decoration: none;
    border: 1px solid #111;
    transition: all 0.3s ease;
}

.bo-gallery__write-btn:hover {
    background: transparent;
    color: #111 !important;
}

/* ── 카테고리 ── */
.bo-gallery__cate {
    padding: 16px 0;
    margin-bottom: 24px;
}

.bo-gallery__cate ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 24px;
}

.bo-gallery__cate a {
    font-size: 0.85rem;
    color: #888;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: color 0.2s;
}

.bo-gallery__cate a:hover,
.bo-gallery__cate a.on {
    color: #111;
}

/* ── 그리드 ── */
.bo-gallery__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

@media (min-width: 768px) {
    .bo-gallery__grid {
        grid-template-columns: repeat(var(--bo-gallery-cols, 4), 1fr);
    }
}

.bo-gallery__card {
    position: relative;
}

.bo-gallery__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.bo-gallery__thumb {
    position: relative;
    width: 100%;
    /* Use fluid aspect ratio dynamically calculated from sizes */
    aspect-ratio: var(--bo-gallery-width, 280) / var(--bo-gallery-height, 200);
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 2px;
}

.bo-gallery__thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bo-gallery__card:hover .bo-gallery__thumb img {
    transform: scale(1.06);
}

/* 재생 버튼 오버레이 */
.bo-gallery__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 54px;
    height: 54px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.bo-gallery__play svg {
    width: 22px;
    height: 22px;
    color: #111;
    margin-left: 3px;
}

.bo-gallery__card:hover .bo-gallery__play {
    transform: translate(-50%, -50%) scale(1.1);
    background: #fff;
}

/* 카드 정보 */
.bo-gallery__info {
    padding: 14px 0 0;
}

.bo-gallery__subject {
    font-size: 0.95rem;
    font-weight: 500;
    color: #222;
    margin: 0 0 6px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.bo-gallery__badge {
    display: inline-block;
    padding: 1px 6px;
    background: #111;
    color: #fff;
    font-size: 0.65rem;
    font-style: normal;
    font-weight: 600;
    margin-right: 6px;
    border-radius: 2px;
}

.bo-gallery__comment {
    font-size: 0.78rem;
    color: #aaa;
}

.bo-gallery__meta {
    font-size: 0.78rem;
    color: #aaa;
    display: flex;
    gap: 12px;
}

/* ── 관리자 영역 ── */
.bo-gallery__admin {
    margin: 32px 0;
    padding: 16px;
    background: #fcfcfc;
    border: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

/* ── 게시판 공통 버튼 스타일 (View Page) ── */
.btn_b01, .btn_b02, .btn_admin {
    display: inline-block !important;
    padding: 8px 20px !important;
    font-size: 0.82rem !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    border-radius: 2px !important;
    letter-spacing: 0.02em !important;
    vertical-align: middle !important;
    margin: 2px !important;
    font-weight: 400 !important;
}

.btn_b01 { /* 목록, 수정, 답변 등 기본 버튼 */
    background: #fff !important;
    color: #555 !important;
    border: 1px solid #ddd !important;
}
.btn_b01:hover {
    border-color: #111 !important;
    color: #111 !important;
}

.btn_b02 { /* 글쓰기 등 강조 버튼 */
    background: #111 !important;
    color: #fff !important;
    border: 1px solid #111 !important;
}
.btn_b02:hover {
    background: transparent !important;
    color: #111 !important;
}

.btn_admin { /* 관리자 전용 버튼 */
    background: #fff !important;
    color: #900 !important;
    border: 1px solid #ecc !important;
}
.btn_admin:hover {
    background: #900 !important;
    color: #fff !important;
    border-color: #900 !important;
}

/* 리스트 버튼 오버라이드 유효하게 */
.bo-v_nb, .bo_v_com {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.bo-v_nb li, .bo_v_com li {
    display: inline-block;
}

/* ── 검색 ── */
.bo-gallery__search {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    padding: 24px 0 0;
    border-top: 1px solid #f0f0f0;
}

.bo-gallery__search select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    font-size: 0.82rem;
    background: #fff;
    color: #555;
    outline: none;
}

.bo-gallery__search input[type="text"] {
    padding: 8px 16px;
    border: 1px solid #ddd;
    font-size: 0.82rem;
    width: 200px;
    outline: none;
    transition: border-color 0.2s;
}

.bo-gallery__search input[type="text"]:focus {
    border-color: #111;
}

.bo-gallery__search button {
    padding: 8px 20px;
    background: #111;
    color: #fff;
    border: 1px solid #111;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 400;
}

.bo-gallery__search button:hover {
    background: transparent;
    color: #111;
}

/* ── 반응형 ── */
@media (max-width: 768px) {
    .bo-gallery {
        margin: 20px auto 40px !important;
        padding: 0 16px;
    }


    .bo-gallery__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .bo-gallery__header {
        flex-direction: row !important;
        align-items: baseline !important;
        justify-content: flex-start !important;
        padding-bottom: 14px !important;
        gap: 12px !important;
        flex-wrap: wrap !important;
        margin-bottom: 0 !important;
    }

    .bo-gallery__title {
        font-size: 1.8rem;
    }

    .bo-gallery__count {
        font-size: 12px !important;
        margin-top: 0 !important;
    }

    .bo-gallery__write-btn {
        padding: 6px 14px !important;
        font-size: 11px !important;
        flex-shrink: 0;
        margin-top: 0 !important;
        margin-left: auto !important; /* Push write button to the right */
    }

    .bo-gallery__sep {
        margin-top: 30px !important;
        margin-bottom: 0 !important;
    }

    .bo-gallery__pages {
        padding-top: 10px !important;
    }
}



