/* ======================================================================
   BoardTns 게시판 테마 (2026 리뉴얼)
   - 색상은 아래 변수만 바꾸면 테마 전체에 반영됩니다
   ====================================================================== */
.board-theme {
    --bt-primary: #1f4e9c;        /* 한소망 블루 : 선택/강조 */
    --bt-primary-dark: #173c78;
    --bt-primary-soft: #eef3fb;   /* 배지/hover 배경 */
    --bt-primary-line: #c9d6ec;
    --bt-accent: #e63946;         /* PDF 등 파일 버튼 */
    --bt-accent-dark: #c92a37;
    --bt-ink: #222;               /* 제목 */
    --bt-text: #444;              /* 본문 */
    --bt-muted: #8a8f98;          /* 날짜/보조 정보 */
    --bt-line: #e6e8ec;           /* 구분선 */
    --bt-bg: #f6f7f9;             /* 옅은 배경 */
    --bt-notice-bg: #f8fafd;
    --bt-radius: 10px;
    --bt-shadow: 0 6px 18px rgba(20, 30, 50, 0.08);
    color: var(--bt-text);
}

/* ======================================================================
   공통 : 분류 선택 / 페이지 번호
   ====================================================================== */
.board-theme .theme-list {
    font-family: 'NanumSquare', sans-serif;
    display: flow-root;
    width: 100%;
}

    .board-theme .theme-list .list-categories {
        margin-bottom: 20px;
    }

        .board-theme .theme-list .list-categories select.form-control {
            height: 42px;
            border: 1px solid var(--bt-line);
            border-radius: 8px;
            box-shadow: none;
            color: var(--bt-text);
            font-size: 14px;
        }

            .board-theme .theme-list .list-categories select.form-control:focus {
                border-color: var(--bt-primary);
                box-shadow: 0 0 0 3px var(--bt-primary-soft);
            }

        /* 버튼형 분류 */
        .board-theme .theme-list .list-categories .btn {
            border-radius: 999px;
            border-color: var(--bt-line);
            color: var(--bt-text);
            background: #fff;
            padding: 7px 16px;
            font-size: 14px;
            margin: 0 4px 6px 0;
        }

            .board-theme .theme-list .list-categories .btn:hover {
                border-color: var(--bt-primary);
                color: var(--bt-primary);
            }

            .board-theme .theme-list .list-categories .btn.btn-gray {
                background: var(--bt-primary);
                border-color: var(--bt-primary);
                color: #fff;
            }

        .board-theme .theme-list .list-categories .category-group {
            vertical-align: top;
        }

            .board-theme .theme-list .list-categories .category-group .btn {
                margin-right: 0;
            }

            .board-theme .theme-list .list-categories .category-group .category-btn:not(:last-child) {
                border-radius: 999px 0 0 999px;
            }

            .board-theme .theme-list .list-categories .category-group .addon-btn {
                border-radius: 0 999px 999px 0;
                padding-left: 8px;
                padding-right: 10px;
            }

            .board-theme .theme-list .list-categories .category-group {
                margin-right: 4px;
            }

            .board-theme .theme-list .list-categories .category-group ul {
                min-width: 100%;
                padding: 6px 0;
                margin: 4px 0 0;
                border: 1px solid var(--bt-line);
                border-radius: 8px;
                box-shadow: var(--bt-shadow);
            }

                .board-theme .theme-list .list-categories .category-group ul li a {
                    cursor: pointer;
                    font-size: 13px;
                    padding: 7px 14px;
                }

                .board-theme .theme-list .list-categories .category-group ul li.selected a {
                    background: var(--bt-primary-soft);
                    color: var(--bt-primary);
                }

    .board-theme .theme-list .no-document {
        text-align: center;
        padding: 60px 0;
        color: var(--bt-muted);
        font-size: 15px;
        border-top: 2px solid var(--bt-ink);
        border-bottom: 1px solid var(--bt-line);
    }

.board-theme .board-pages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 32px 0 40px;
    max-width: 1040px;
    margin: 0 auto;
}

    .board-theme .board-pages > span.page {
        min-width: 38px;
        height: 38px;
        line-height: 36px;
        padding: 0 8px;
        margin: 0;
        border: 1px solid var(--bt-line);
        border-radius: 8px;
        background: #fff;
        color: var(--bt-text);
        font-size: 14px;
        cursor: pointer;
        box-shadow: none;
        transition: all 0.15s ease;
    }

        .board-theme .board-pages > span.page:hover {
            border-color: var(--bt-primary);
            color: var(--bt-primary);
            background: #fff;
        }

        .board-theme .board-pages > span.page.selected,
        .board-theme .board-pages > span.page.selected:hover {
            background: var(--bt-primary);
            border-color: var(--bt-primary);
            color: #fff;
            font-weight: 700;
        }

    .board-theme .board-pages > span.dots {
        color: var(--bt-muted);
        padding: 0 2px;
    }

    .board-theme .board-pages > span.prev,
    .board-theme .board-pages > span.next {
        cursor: pointer;
        color: var(--bt-muted);
        padding: 0 8px;
        font-size: 16px;
    }

        .board-theme .board-pages > span.prev:hover,
        .board-theme .board-pages > span.next:hover {
            color: var(--bt-primary);
        }

/* ======================================================================
   목록형(List)
   ====================================================================== */
.board-theme .theme-list table {
    border-top: 2px solid var(--bt-ink);
    border-collapse: collapse;
    margin-bottom: 0;
}

    .board-theme .theme-list table th,
    .board-theme .theme-list table td {
        font-size: 15px;
        text-align: center;
        vertical-align: middle;
        padding: 16px 12px;
        border-top: 0;
        border-bottom: 1px solid var(--bt-line);
    }

    .board-theme .theme-list table > thead > tr > th {
        background: var(--bt-bg);
        border-bottom: 1px solid #d7dae0;
        color: var(--bt-ink);
        font-size: 15px;
        font-weight: 700;
        min-width: 70px;
        white-space: nowrap;
    }

        .board-theme .theme-list table th.document-title {
            width: 50%;
        }

    .board-theme .theme-list table td {
        color: var(--bt-muted);
    }

        .board-theme .theme-list table td.document-title {
            text-align: left;
        }

    .board-theme .theme-list table.table-hover > tbody > tr:hover {
        background: var(--bt-notice-bg);
    }

    .board-theme .theme-list table tbody td.document-title a {
        color: var(--bt-ink);
        font-size: 16px;
        text-decoration: none;
        transition: color 0.15s ease;
    }

        .board-theme .theme-list table tbody tr:hover td.document-title a,
        .board-theme .theme-list table tbody td.document-title a.active {
            color: var(--bt-primary);
        }

        .board-theme .theme-list table tbody td.document-title a.comment-count {
            display: inline-block;
            margin-left: 6px;
            padding: 0 7px;
            border-radius: 999px;
            background: var(--bt-primary-soft);
            color: var(--bt-primary);
            font-size: 12px;
            font-weight: 700;
            line-height: 20px;
        }

    .board-theme .theme-list table tbody td.document-title span.file {
        color: var(--bt-muted);
        vertical-align: middle;
    }

    .board-theme .theme-list table tbody td.document-title span.reserved {
        display: inline-block;
        margin-left: 6px;
        padding: 0 7px;
        border-radius: 4px;
        background: #fff4e5;
        color: #c46a00;
        font-size: 12px;
        line-height: 20px;
    }

    /* 공지 */
    .board-theme .theme-list table tbody tr.notice {
        background: var(--bt-notice-bg);
    }

        .board-theme .theme-list table tbody tr.notice td.document-number,
        .board-theme .theme-list table tbody tr.notice td.document-no {
            color: var(--bt-primary);
            font-weight: 700;
            font-size: 13px;
        }

        .board-theme .theme-list table tbody tr.notice td.document-title a {
            font-weight: 700;
        }

    .board-theme .theme-list table tbody td.document-category span {
        display: inline-block;
        padding: 2px 10px;
        border-radius: 999px;
        background: var(--bt-bg);
        color: var(--bt-text);
        font-size: 13px;
    }

    .board-theme .theme-list table tr td.document-added_file {
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .board-theme .theme-list table th input,
    .board-theme .theme-list table td input {
        margin: 0;
    }

/* ======================================================================
   갤러리형(Gallery)
   ====================================================================== */
.board-theme.gallery .theme-list table {
    margin-bottom: 24px;
}

.GalleryType {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--width)), 1fr));
    gap: var(--gap);
    --gap: 36px 28px;
    --width: 20%;
}

.board-theme.gallery .theme-list .GalleryType > .each-document {
    display: block;
    min-width: 0;
}

    .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > a.title-image {
        display: block;
        width: 100%;
        height: var(--height);
        --height: 260px;
        position: relative;
        overflow: hidden;
        border-radius: var(--bt-radius);
        background-repeat: no-repeat;
        background-size: cover;
        background-position: 50% 50%;
        box-shadow: 0 1px 3px rgba(20, 30, 50, 0.06);
        transition: box-shadow 0.25s ease, transform 0.25s ease;
    }

        .board-theme.gallery .theme-list .GalleryType > .each-document:hover > .thumb > a.title-image {
            box-shadow: var(--bt-shadow);
            transform: translateY(-3px);
        }

        .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > a.title-image .document-checkbox {
            display: flex;
            z-index: 2;
            position: absolute;
            top: 10px;
            left: 10px;
        }

        .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > a.title-image > .no-image {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background: var(--bt-bg);
            color: var(--bt-muted);
            text-align: center;
        }

            .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > a.title-image > .no-image span {
                position: absolute;
                top: 50%;
                left: 0;
                width: 100%;
                margin-top: -9px;
                font-size: 13px;
            }

        /* 마우스를 올리면 나타나는 정보(분류/날짜 등) */
        .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > a.title-image > .list-items {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: flex-end;
            background: linear-gradient(to top, rgba(10, 20, 40, 0.7) 0%, rgba(10, 20, 40, 0) 60%);
            opacity: 0;
            transition: opacity 0.25s ease;
        }

        .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > a.title-image:hover > .list-items {
            opacity: 1;
        }

        .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > a.title-image > .list-items .items-wrapper {
            width: 100%;
            padding: 14px 16px;
            color: #fff;
            text-align: left;
        }

            .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > a.title-image > .list-items .items-wrapper > .list-item {
                display: inline-block;
                margin-right: 8px;
                font-size: 13px;
                opacity: 0.95;
            }

    .board-theme.gallery .theme-list .GalleryType > .each-document > a.title {
        display: block;
        width: 100%;
        margin-top: 12px;
        overflow: hidden;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: var(--bt-ink);
        font-size: 16px;
        font-weight: 700;
        line-height: 1.5;
        text-decoration: none;
        transition: color 0.15s ease;
    }

    .board-theme.gallery .theme-list .GalleryType > .each-document:hover > a.title {
        color: var(--bt-primary);
    }

/* ======================================================================
   웹진형(Webzine) - 강사소개처럼 사진 + 이름 + 정보 카드
   ====================================================================== */
.board-theme.webzine .WebzineType {
    border-top: 2px solid var(--bt-ink);
}

.board-theme.webzine .each-document {
    display: flex;
    gap: 28px;
    padding: 24px 8px;
    border-bottom: 1px solid var(--bt-line);
    color: var(--bt-text);
    text-decoration: none;
    transition: background 0.2s ease;
}

    .board-theme.webzine .each-document:hover {
        background: var(--bt-notice-bg);
        text-decoration: none;
    }

    .board-theme.webzine .each-document > span {
        display: block;
    }

    .board-theme.webzine .each-document .list-img {
        position: relative;
        flex: 0 0 180px;
        width: 180px;
        aspect-ratio: 4 / 5;
        overflow: hidden;
        border-radius: var(--bt-radius);
        background-color: var(--bt-bg);
        background-repeat: no-repeat;
        background-size: cover;
        background-position: 50% 0;
        box-shadow: 0 1px 3px rgba(20, 30, 50, 0.08);
        transition: box-shadow 0.25s ease, transform 0.25s ease;
    }

    .board-theme.webzine .each-document:hover .list-img {
        box-shadow: var(--bt-shadow);
        transform: translateY(-2px);
    }

        .board-theme.webzine .each-document .list-img .no-image {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #c3c7ce;
            font-size: 32px;
        }

    .board-theme.webzine .each-document .list-content {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding-top: 4px;
    }

        .board-theme.webzine .each-document .list-content .category {
            display: inline-block;
            margin-bottom: 10px;
            padding: 3px 10px;
            border-radius: 999px;
            background: var(--bt-primary-soft);
            color: var(--bt-primary);
            font-size: 12px;
            font-weight: 700;
        }

        .board-theme.webzine .each-document .list-content .title {
            max-width: 100%;
            color: var(--bt-ink);
            font-size: 21px;
            font-weight: 800;
            line-height: 1.4;
            word-break: keep-all;
            transition: color 0.15s ease;
        }

    .board-theme.webzine .each-document:hover .list-content .title {
        color: var(--bt-primary);
    }

        .board-theme.webzine .each-document .list-content .meta {
            display: flex;
            flex-wrap: wrap;
            gap: 6px 16px;
            margin-top: 10px;
            color: var(--bt-muted);
            font-size: 14px;
        }

            .board-theme.webzine .each-document .list-content .meta:empty {
                display: none;
            }

            .board-theme.webzine .each-document .list-content .meta .meta-item i {
                margin-right: 5px;
            }

            .board-theme.webzine .each-document .list-content .meta .meta-item b {
                margin-right: 6px;
                color: var(--bt-text);
                font-weight: 700;
            }

        .board-theme.webzine .each-document .list-content .content {
            display: -webkit-box;
            margin-top: 14px;
            overflow: hidden;
            color: var(--bt-text);
            font-size: 15px;
            line-height: 1.7;
            word-break: keep-all;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
        }

        .board-theme.webzine .each-document .list-content .more {
            margin-top: auto;
            padding-top: 16px;
            color: var(--bt-primary);
            font-size: 14px;
            font-weight: 700;
        }

            .board-theme.webzine .each-document .list-content .more i {
                margin-left: 4px;
                transition: margin 0.15s ease;
            }

    .board-theme.webzine .each-document:hover .list-content .more i {
        margin-left: 8px;
    }

/* ======================================================================
   상세보기(Detail)
   ====================================================================== */
/* 1줄 : 회색 바 - 제목(왼쪽) / 날짜(오른쪽) */
.board-theme .theme-detail .detail-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 14px;
    border-top: 1px solid var(--bt-line);
    border-bottom: 1px solid var(--bt-line);
    background: #fafafa;
}

    .board-theme .theme-detail .detail-top .document-title {
        flex: 1 1 auto;
        min-width: 0;
        margin: 0;
        color: var(--bt-ink);
        font-size: 16px;
        font-weight: 700;
        line-height: 1.5;
        word-break: keep-all;
    }

        .board-theme .theme-detail .detail-top .document-title .category {
            display: inline-block;
            margin-right: 6px;
            padding: 1px 9px;
            border-radius: 999px;
            background: var(--bt-primary-soft);
            color: var(--bt-primary);
            font-size: 12px;
            font-weight: 700;
            vertical-align: 2px;
        }

    .board-theme .theme-detail .detail-top .document-regdate {
        flex: 0 0 auto;
        color: #333;
        font-size: 15px;
        white-space: nowrap;
    }

/* 2줄 : 작성자 / 조회수 */
.board-theme .theme-detail .detail-upper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--bt-line);
    font-size: 15px;
}

    .board-theme .theme-detail .detail-upper .document-writer {
        color: #333;
    }

    .board-theme .theme-detail .detail-upper .document-readed_count {
        color: var(--bt-muted);
        font-size: 13px;
        white-space: nowrap;
    }

.board-theme .theme-detail .detail-video > * {
    margin-top: 8px;
}

.board-theme .theme-detail .detail-video > a.video-button {
    display: block;
    width: 100%;
    padding: 16px 0;
    border-radius: var(--bt-radius);
    background: var(--bt-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

    .board-theme .theme-detail .detail-video > a.video-button:hover {
        background: var(--bt-primary-dark);
    }

.board-theme .theme-detail .detail-video .video-js {
    width: 100%;
    height: auto;
}

    .board-theme .theme-detail .detail-video .video-js .vjs-tech {
        height: auto;
        position: relative;
    }

/* 영상은 화면 너비에 맞춰 16:9 로 */
.board-theme .theme-detail .detail-video iframe,
.board-theme .theme-detail .detail-video video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 0;
    background: #000;
}

@supports not (aspect-ratio: 16 / 9) {
    .board-theme .theme-detail .detail-video iframe {
        height: 540px;
    }
}

.board-theme .theme-detail .detail-audio > * {
    margin-top: 16px;
}

.board-theme .theme-detail .detail-audio audio {
    width: 100%;
}

.board-theme .theme-detail .detail-audio-downlad {
    text-align: center;
    margin: 16px 0 24px;
}

    .board-theme .theme-detail .detail-audio-downlad > a {
        display: inline-block;
        padding: 12px 28px;
        border-radius: 999px;
        background: var(--bt-primary);
        color: #fff;
        font-size: 14px;
        font-weight: 700;
        text-decoration: none;
    }

        .board-theme .theme-detail .detail-audio-downlad > a:hover {
            background: var(--bt-primary-dark);
        }

.board-theme .theme-detail .detail-pdf iframe {
    width: 100%;
    height: 550px;
    border: 0;
}

/* 확장필드(설교일, 본문 등) */
.board-theme .theme-detail .document-extended_keys {
    margin-top: 20px;
}

    .board-theme .theme-detail .document-extended_keys table {
        margin: 0;
        border-top: 1px solid var(--bt-line);
    }

        .board-theme .theme-detail .document-extended_keys table th,
        .board-theme .theme-detail .document-extended_keys table td {
            padding: 12px 16px;
            border-top: 0;
            border-bottom: 1px solid var(--bt-line);
            font-size: 14px;
            vertical-align: middle;
        }

        .board-theme .theme-detail .document-extended_keys table th {
            background: var(--bt-bg);
            color: var(--bt-ink);
            font-weight: 700;
            text-align: center;
        }

        .board-theme .theme-detail .document-extended_keys table td {
            color: var(--bt-text);
        }

.board-theme .theme-detail .detail-content {
    padding: 20px 14px;
    border-bottom: 1px solid var(--bt-line);
    color: var(--bt-text);
    font-size: 15px;
    line-height: 1.8;
    word-break: break-all;
}

    .board-theme .theme-detail .detail-content img {
        max-width: 100%;
        height: auto !important;
        cursor: pointer;
    }

/* ======================================================================
   글쓰기(Write)
   ====================================================================== */
.board-theme .theme-write {
    padding: 24px 24px 4px;
    border: 1px solid var(--bt-line);
    border-radius: var(--bt-radius);
    background: var(--bt-bg);
}

    .board-theme .theme-write .form-control {
        border-color: var(--bt-line);
        border-radius: 6px;
        box-shadow: none;
    }

        .board-theme .theme-write .form-control:focus {
            border-color: var(--bt-primary);
            box-shadow: 0 0 0 3px var(--bt-primary-soft);
        }

    .board-theme .theme-write .title-category {
        padding: 0;
    }

    .board-theme .theme-write .title-content {
        padding: 0;
    }

    .board-theme .theme-write .document-title {
        margin: 0;
    }

    .board-theme .theme-write .document-extended_keys {
        margin-top: 12px;
        padding: 1px;
    }

        .board-theme .theme-write .document-extended_keys table {
            border: 1px solid var(--bt-line);
            background: #fff;
        }

            .board-theme .theme-write .document-extended_keys table tr {
                background: #fff;
            }

                .board-theme .theme-write .document-extended_keys table tr th {
                    font-size: 13px;
                    color: var(--bt-ink);
                    vertical-align: middle;
                }

                .board-theme .theme-write .document-extended_keys table tr td select,
                .board-theme .theme-write .document-extended_keys table tr td input {
                    font-size: 13px;
                }

                .board-theme .theme-write .document-extended_keys table tr td textarea {
                    width: 100% !important;
                    height: 120px;
                    min-height: 70px;
                }

        .board-theme .theme-write .document-extended_keys select {
            max-width: 210px;
        }

    .board-theme .theme-write .document-content {
        margin-top: 12px;
    }

        .board-theme .theme-write .document-content #cke_content {
            margin: 0 auto;
        }

@media (min-width: 768px) {
    .board-theme .theme-write .title-category {
        padding-right: 15px;
    }
}

/* ======================================================================
   반응형
   ====================================================================== */
@media (max-width: 1199px) {
    .GalleryType {
        --width: 30%;
    }
}

@media (max-width: 992px) {
    .GalleryType {
        --width: 40%;
    }
}

@media (max-width: 767px) {
    .GalleryType {
        --width: 100%;
        --gap: 28px;
    }

    .board-theme.gallery {
        text-align: center;
    }

    /* 웹진 : 사진을 줄이고 요약은 2줄 */
    .board-theme.webzine .each-document {
        gap: 16px;
        padding: 18px 4px;
    }

        .board-theme.webzine .each-document .list-img {
            flex-basis: 104px;
            width: 104px;
        }

        .board-theme.webzine .each-document .list-content .title {
            font-size: 17px;
        }

        .board-theme.webzine .each-document .list-content .meta {
            font-size: 13px;
            margin-top: 6px;
        }

        .board-theme.webzine .each-document .list-content .content {
            margin-top: 8px;
            font-size: 14px;
            -webkit-line-clamp: 2;
        }

        .board-theme.webzine .each-document .list-content .more {
            display: none;
        }

    /* 상세 */
    /* 제목이 길면 날짜는 제목 아래로 */
    .board-theme .theme-detail .detail-top {
        flex-wrap: wrap;
        gap: 4px;
        padding: 14px 12px;
    }

        .board-theme .theme-detail .detail-top .document-title {
            flex-basis: 100%;
            font-size: 16px;
        }

        .board-theme .theme-detail .detail-top .document-regdate {
            color: var(--bt-muted);
            font-size: 13px;
        }

    .board-theme .theme-detail .detail-upper {
        padding: 10px 12px;
        font-size: 14px;
    }

    .board-theme .theme-detail .detail-content {
        padding: 16px 4px;
    }

    .board-theme .theme-write {
        padding: 16px 16px 4px;
    }
}

/* ======================================================================
   갤러리 썸네일 비율 고정
   - 기존 : height 260px 고정 → 화면 너비에 따라 비율이 계속 달라짐
   - 변경 : --ratio 로 비율을 잡고 높이는 너비에 맞춰 자동 계산
   - 문서(교재/주보) 썸네일이 잘리지 않도록 contain 사용
     사진 위주 게시판이면 아래 background-size 를 cover 로 바꾸면 됩니다
   ====================================================================== */
.board-theme.gallery .theme-list .GalleryType > .each-document {
    position: relative;
}

    .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > a.title-image {
        height: auto;
        aspect-ratio: var(--ratio, 4 / 3);
        background-size: contain;
        background-color: var(--bt-bg);
        border: 1px solid var(--bt-line);
    }

/* aspect-ratio 미지원 구형 브라우저 대비 */
@supports not (aspect-ratio: 1 / 1) {
    .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > a.title-image {
        height: var(--height, 260px);
    }
}

/* ======================================================================
   갤러리 썸네일 위 첨부파일(PDF) 버튼
   ====================================================================== */
.board-theme.gallery .theme-list .GalleryType > .each-document > .file-btns {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: flex;
    gap: 6px;
    line-height: 0;
}

    .board-theme.gallery .theme-list .GalleryType > .each-document > .file-btns > .file-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(0,0,0,0.55);
        color: #fff;
        font-size: 16px;
        text-decoration: none;
        transition: background 0.2s ease, transform 0.2s ease;
    }

        .board-theme.gallery .theme-list .GalleryType > .each-document > .file-btns > .file-btn:hover,
        .board-theme.gallery .theme-list .GalleryType > .each-document > .file-btns > .file-btn:focus {
            background: #c0392b;
            color: #fff;
            text-decoration: none;
            transform: translateY(-2px);
        }

/* ======================================================================
   상세화면 첨부파일 카드
   - 기존 donw-pdf(38px 글자 + 회색 테두리 박스) 대체
   - 파일이 여러 개일 때 이름으로 구분되도록 파일명 표시
   - "새 창으로 보기" / "다운로드" 를 각각 별도 버튼으로 분리
   ====================================================================== */
.board-theme .theme-detail .detail-files {
    margin: 16px 0;
}

    .board-theme .theme-detail .detail-files .detail-files-head {
        font-size: 14px;
        color: #888;
        margin-bottom: 8px;
    }

    .board-theme .theme-detail .detail-files .file-item {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 14px 18px;
        margin-bottom: 10px;
        border: 1px solid #ececec;
        border-radius: 12px;
        background: #fafafa;
        color: #333;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

        .board-theme .theme-detail .detail-files .file-item:last-child {
            margin-bottom: 0;
        }

        .board-theme .theme-detail .detail-files .file-item:hover {
            border-color: #e0c3c0;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }

        .board-theme .theme-detail .detail-files .file-item .file-icon {
            flex: 0 0 42px;
            width: 42px;
            height: 42px;
            border-radius: 10px;
            background: var(--bt-accent);
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 21px;
        }

        .board-theme .theme-detail .detail-files .file-item .file-info {
            flex: 1 1 auto;
            min-width: 0;
        }

            .board-theme .theme-detail .detail-files .file-item .file-info .file-name {
                display: block;
                font-size: 16px;
                font-weight: 700;
                line-height: 1.4;
                color: #222;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            .board-theme .theme-detail .detail-files .file-item .file-info .file-meta {
                display: block;
                font-size: 12px;
                color: #999;
                margin-top: 3px;
            }

        .board-theme .theme-detail .detail-files .file-item .file-actions {
            flex: 0 0 auto;
            display: flex;
            align-items: center;
            gap: 8px;
        }

            .board-theme .theme-detail .detail-files .file-item .file-actions .file-btn {
                display: inline-flex;
                align-items: center;
                gap: 6px;
                height: 40px;
                padding: 0 18px;
                border-radius: 999px;
                font-size: 14px;
                font-weight: 600;
                white-space: nowrap;
                text-decoration: none;
                transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
            }

                .board-theme .theme-detail .detail-files .file-item .file-actions .file-btn:hover,
                .board-theme .theme-detail .detail-files .file-item .file-actions .file-btn:focus {
                    text-decoration: none;
                }

            /* 새 창으로 보기 : 강조(채워진) 버튼 */
            .board-theme .theme-detail .detail-files .file-item .file-actions .file-btn-view {
                background: var(--bt-accent);
                border: 1px solid var(--bt-accent);
                color: #fff;
            }

                .board-theme .theme-detail .detail-files .file-item .file-actions .file-btn-view:hover,
                .board-theme .theme-detail .detail-files .file-item .file-actions .file-btn-view:focus {
                    background: var(--bt-accent-dark);
                    border-color: var(--bt-accent-dark);
                    color: #fff;
                }

            /* 다운로드 : 보조(외곽선) 버튼 */
            .board-theme .theme-detail .detail-files .file-item .file-actions .file-btn-down {
                background: #fff;
                border: 1px solid #dcdcdc;
                color: #444;
            }

                .board-theme .theme-detail .detail-files .file-item .file-actions .file-btn-down:hover,
                .board-theme .theme-detail .detail-files .file-item .file-actions .file-btn-down:focus {
                    border-color: #aaa;
                    background: #f2f2f2;
                    color: #222;
                }

/* 모바일 : 카드를 세로로 쌓고 버튼은 가로 2등분 */
@media (max-width: 767px) {
    .board-theme .theme-detail .detail-files .file-item {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px;
    }

        .board-theme .theme-detail .detail-files .file-item .file-info {
            flex: 1 1 0;
        }

            .board-theme .theme-detail .detail-files .file-item .file-info .file-name {
                font-size: 15px;
            }

            .board-theme .theme-detail .detail-files .file-item .file-info .file-meta {
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

        .board-theme .theme-detail .detail-files .file-item .file-actions {
            flex: 1 1 100%;
            width: 100%;
        }

            .board-theme .theme-detail .detail-files .file-item .file-actions .file-btn {
                flex: 1 1 50%;
                justify-content: center;
                padding: 0 10px;
            }
}

/* ======================================================================
   PDF 미리보기 (브라우저 내장 뷰어)
   ====================================================================== */
.board-theme .theme-detail .pdf-viewer {
    margin: 16px 0;
}

    .board-theme .theme-detail .pdf-viewer > .pdf-ppt-viewer {
        display: block;
        width: 100%;
        height: 80vh;
        min-height: 520px;
        border: 1px solid var(--bt-line);
        border-radius: 8px;
        background: #f4f4f4;
    }

    .board-theme .theme-detail .pdf-viewer .pdf-viewer-fallback {
        padding: 32px 20px;
        text-align: center;
        border: 1px dashed #d8d8d8;
        border-radius: 12px;
        background: #fafafa;
    }

        .board-theme .theme-detail .pdf-viewer .pdf-viewer-fallback .pdf-viewer-msg {
            margin: 0 0 14px;
            font-size: 14px;
            color: #888;
        }

        /* 상세 첨부파일 카드와 같은 버튼 모양 재사용 */
        .board-theme .theme-detail .pdf-viewer .pdf-viewer-fallback .file-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            height: 40px;
            margin: 0 3px;
            padding: 0 18px;
            border-radius: 999px;
            font-size: 14px;
            font-weight: 600;
            white-space: nowrap;
            text-decoration: none;
            transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
        }

        .board-theme .theme-detail .pdf-viewer .pdf-viewer-fallback .file-btn-view {
            background: var(--bt-accent);
            border: 1px solid var(--bt-accent);
            color: #fff;
        }

            .board-theme .theme-detail .pdf-viewer .pdf-viewer-fallback .file-btn-view:hover,
            .board-theme .theme-detail .pdf-viewer .pdf-viewer-fallback .file-btn-view:focus {
                background: var(--bt-accent-dark);
                border-color: var(--bt-accent-dark);
                color: #fff;
                text-decoration: none;
            }

        .board-theme .theme-detail .pdf-viewer .pdf-viewer-fallback .file-btn-down {
            background: #fff;
            border: 1px solid #dcdcdc;
            color: #444;
        }

            .board-theme .theme-detail .pdf-viewer .pdf-viewer-fallback .file-btn-down:hover,
            .board-theme .theme-detail .pdf-viewer .pdf-viewer-fallback .file-btn-down:focus {
                border-color: #aaa;
                background: #f2f2f2;
                color: #222;
                text-decoration: none;
            }

@media (max-width: 767px) {
    .board-theme .theme-detail .pdf-viewer .pdf-viewer-fallback .file-btn {
        display: flex;
        width: 100%;
        justify-content: center;
        margin: 0 0 8px;
    }

        .board-theme .theme-detail .pdf-viewer .pdf-viewer-fallback .file-btn:last-child {
            margin-bottom: 0;
        }
}

/* ======================================================================
   목록형(List) 게시판 - 모바일 / 태블릿 카드 뷰 (max-width: 992px)
   - 기존에는 thead 와 대부분의 td 를 감추어 제목만 나열되어
     글 사이 구분이 없고 클릭 가능한 영역인지 알기 어려웠음
   - tr 을 카드로 바꾸고 제목 / 메타정보(작성자·날짜·조회수) 를 함께 노출
   ====================================================================== */
@media (max-width: 992px) {

    .board-theme .theme-list table {
        border: 0;
        border-top: 0;
        margin-bottom: 0;
        background: transparent;
    }

    .board-theme .theme-list table thead {
        display: none;
    }

    .board-theme .theme-list table tbody {
        display: block;
    }

    /* ── 한 건 = 카드 한 장 ── */
    .board-theme .theme-list table tbody tr {
        display: block;
        position: relative;
        margin: 0 0 10px 0;
        padding: 0 0 13px 0;
        border: 1px solid var(--bt-line);
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(0,0,0,0.04);
        cursor: pointer;
        transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    }

    .board-theme .theme-list table tbody tr:last-child {
        margin-bottom: 0;
    }

    .board-theme .theme-list table tbody tr:hover,
    .board-theme .theme-list table tbody tr:active {
        border-color: var(--bt-primary-line);
        box-shadow: 0 3px 10px rgba(0,0,0,0.08);
        transform: translateY(-1px);
    }

    /* ── 우측 화살표(클릭 가능 표시) ── */
    .board-theme .theme-list table tbody tr:after {
        content: "";
        position: absolute;
        top: 50%;
        right: 16px;
        width: 8px;
        height: 8px;
        margin-top: -4px;
        border-right: 2px solid #bbb;
        border-bottom: 2px solid #bbb;
        transform: rotate(-45deg);
        transition: border-color 0.18s ease, right 0.18s ease;
    }

    .board-theme .theme-list table tbody tr:hover:after {
        border-color: var(--bt-primary);
        right: 12px;
    }

    /* ── 셀 공통 : 표 레이아웃 해제 ── */
    .board-theme .theme-list table tbody td {
        display: none;
        border: 0;
        text-align: left;
        padding: 0;
    }

    /* ── 제목 ── */
    .board-theme .theme-list table tbody td.document-title {
        display: block;
        padding: 14px 40px 0 16px;
    }

    .board-theme .theme-list table tbody td.document-title a {
        display: inline;
        font-size: 16px;
        font-weight: 600;
        line-height: 1.45;
        color: #222;
        word-break: keep-all;
    }

    .board-theme .theme-list table tbody td.document-title a:hover {
        text-decoration: none;
    }

    /* ── 메타 정보 : 작성자 / 날짜 / 조회수 ── */
    .board-theme .theme-list table tbody td.document-writer,
    .board-theme .theme-list table tbody td.document-regdate,
    .board-theme .theme-list table tbody td.document-readedcount {
        display: inline-block;
        margin: 7px 0 0 16px;
        padding: 0;
        font-size: 12px;
        font-weight: 400;
        color: #999;
        line-height: 1.2;
    }

    /* 메타 항목 사이 구분점 */
    .board-theme .theme-list table tbody td.document-regdate:before,
    .board-theme .theme-list table tbody td.document-readedcount:before {
        content: "";
        display: inline-block;
        width: 2px;
        height: 2px;
        margin: 0 8px 3px -9px;
        border-radius: 50%;
        background: #ccc;
        vertical-align: middle;
    }

    .board-theme .theme-list table tbody td.document-readedcount:after {
        content: " 회";
    }

    /* ── 분류(카테고리) : 제목 위 작은 배지 ── */
    .board-theme .theme-list table tbody td.document-category {
        display: block;
        padding: 14px 16px 0 16px;
    }

    .board-theme .theme-list table tbody td.document-category:empty {
        display: none;
    }

    .board-theme .theme-list table tbody td.document-category span {
        display: inline-block;
        padding: 2px 8px;
        border-radius: 3px;
        background: var(--bt-primary-soft);
        font-size: 11px;
        font-weight: 600;
        color: var(--bt-primary);
        line-height: 1.6;
    }

    /* 분류가 있으면 제목 위 여백은 분류가 담당 */
    .board-theme .theme-list table tbody td.document-category + td.document-title {
        padding-top: 6px;
    }

    /* ── 공지 글 ── */
    .board-theme .theme-list table tbody tr.notice {
        border-color: var(--bt-primary-line);
        background: var(--bt-notice-bg);
    }

    .board-theme .theme-list table tbody tr.notice td.document-no,
    .board-theme .theme-list table tbody tr.notice td.document-number {
        display: block;
        padding: 13px 16px 0 16px;
        font-size: 0;
    }

    .board-theme .theme-list table tbody tr.notice td.document-no:before,
    .board-theme .theme-list table tbody tr.notice td.document-number:before {
        content: "공지";
        display: inline-block;
        padding: 2px 8px;
        border-radius: 3px;
        background: var(--bt-primary);
        font-size: 11px;
        font-weight: 600;
        color: #fff;
        line-height: 1.6;
    }

    .board-theme .theme-list table tbody tr.notice td.document-no + td.document-title,
    .board-theme .theme-list table tbody tr.notice td.document-number + td.document-title {
        padding-top: 6px;
    }

    /* ── 첨부파일 / 댓글수 표시 ── */
    .board-theme .theme-list table tbody td.document-title span.file,
    .board-theme .theme-list table tbody td.document-title a.comment-count,
    .board-theme .theme-list table tbody td.document-title span.reserved {
        font-size: 12px;
        vertical-align: middle;
    }

    /* ── 관리자 체크박스 ── */
    .board-theme .theme-list table tbody td.document-checkbox {
        display: block;
        position: absolute;
        top: 12px;
        right: 38px;
        padding: 0;
    }

    .board-theme .theme-list table tbody tr:has(td.document-checkbox) td.document-title {
        padding-right: 70px;
    }

    /* ── 글이 없을 때 ── */
    .board-theme .theme-list .no-document {
        padding: 40px 16px;
        border: 1px dashed #e0e0e0;
        border-radius: 8px;
        color: #999;
        font-size: 14px;
    }
}

/* ── 태블릿 : 2단 배치 ── */
@media (min-width: 768px) and (max-width: 992px) {

    .board-theme .theme-list table tbody {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .board-theme .theme-list table tbody tr {
        margin: 0;
        height: 100%;
    }
}

/* ======================================================================
   반응형 보완
   ====================================================================== */

/* 휴대폰 가로 / 큰 휴대폰 : 갤러리 2장씩 */
@media (min-width: 480px) and (max-width: 767px) {
    .GalleryType {
        --width: 40%;
        --gap: 24px 14px;
    }

    .board-theme.gallery .theme-list .GalleryType > .each-document > a.title {
        margin-top: 8px;
        font-size: 14px;
    }
}

/* 모바일 : 페이지 번호 / issuu PDF 높이 */
@media (max-width: 767px) {
    .board-theme .board-pages {
        gap: 4px;
        padding: 24px 0 32px;
    }

        .board-theme .board-pages > span.page {
            min-width: 34px;
            height: 34px;
            line-height: 32px;
            padding: 0 6px;
            font-size: 13px;
        }

        .board-theme .board-pages > span.prev,
        .board-theme .board-pages > span.next {
            padding: 0 4px;
        }

    .board-theme .theme-detail .detail-pdf iframe {
        height: 70vh;
        min-height: 420px;
    }
}

/* 아주 작은 화면 : 웹진 사진 축소 */
@media (max-width: 360px) {
    .board-theme.webzine .each-document {
        gap: 12px;
    }

        .board-theme.webzine .each-document .list-img {
            flex-basis: 88px;
            width: 88px;
        }

        .board-theme.webzine .each-document .list-content .title {
            font-size: 16px;
        }
}

/* 터치 기기 : 떠오르는 hover 효과가 탭 후 남지 않도록 해제 */
@media (hover: none) {
    .board-theme.gallery .theme-list .GalleryType > .each-document:hover > .thumb > a.title-image,
    .board-theme.webzine .each-document:hover .list-img,
    .board-theme .theme-list table tbody tr:hover,
    .board-theme.gallery .theme-list .GalleryType > .each-document > .file-btns > .file-btn:hover {
        transform: none;
    }

    .board-theme.gallery .theme-list .GalleryType > .each-document:hover > .thumb > a.title-image,
    .board-theme.webzine .each-document:hover .list-img {
        box-shadow: 0 1px 3px rgba(20, 30, 50, 0.06);
    }

    /* 마우스가 없으니 갤러리 정보(분류/날짜 등)는 항상 표시 - 표시할 항목이 있을 때만 */
    .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > a.title-image:has(.list-item) > .list-items {
        opacity: 1;
    }
}

/* ======================================================================
   갤러리 사진 더미 (첨부 이미지 2장 이상)
   - 대표 이미지 뒤로 다른 사진 최대 2장이 살짝 기울어져 겹쳐 보임
   - 마우스를 올리면 부채꼴로 펼쳐짐
   ====================================================================== */
.board-theme.gallery .theme-list .GalleryType > .each-document > .thumb {
    position: relative;
}

    .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > .stack-layer {
        position: absolute;
        inset: 0;
        z-index: 0;
        border: 3px solid #fff;
        border-radius: var(--bt-radius);
        background-color: var(--bt-bg);
        background-repeat: no-repeat;
        background-size: cover;
        background-position: 50% 50%;
        box-shadow: 0 2px 8px rgba(20, 30, 50, 0.16);
        transition: transform 0.35s ease;
    }

    .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > .stack-layer.layer-1 {
        transform: rotate(-3deg) translate(-3px, -4px);
    }

    .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > .stack-layer.layer-2 {
        transform: rotate(3.5deg) translate(5px, -6px);
    }

    /* 앨범이므로 대표 사진은 꽉 채우고 인화지처럼 흰 테두리 */
    .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb.is-stack > a.title-image {
        z-index: 1;
        border: 3px solid #fff;
        background-size: cover;
        box-shadow: 0 3px 10px rgba(20, 30, 50, 0.18);
    }

.board-theme.gallery .theme-list .GalleryType > .each-document:hover > .thumb > .stack-layer.layer-1 {
    transform: rotate(-8deg) translate(-14px, -6px);
}

.board-theme.gallery .theme-list .GalleryType > .each-document:hover > .thumb > .stack-layer.layer-2 {
    transform: rotate(7deg) translate(14px, -10px);
}

/* 사진 장수 배지 */
.board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > a.title-image > .photo-count {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(10, 20, 40, 0.6);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
}

    .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > a.title-image > .photo-count i {
        margin-right: 5px;
    }

/* 터치 기기 : 펼침 효과 없이 기본 겹침 상태 유지 */
@media (hover: none) {
    .board-theme.gallery .theme-list .GalleryType > .each-document:hover > .thumb > .stack-layer.layer-1 {
        transform: rotate(-3deg) translate(-3px, -4px);
    }

    .board-theme.gallery .theme-list .GalleryType > .each-document:hover > .thumb > .stack-layer.layer-2 {
        transform: rotate(3.5deg) translate(5px, -6px);
    }
}

/* ======================================================================
   갤러리 영상 썸네일 (videoValue : 유튜브 / 비메오)
   ====================================================================== */
.board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > a.title-image.is-video {
    background-color: #111;
    background-size: cover;
}

    .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > a.title-image.is-video > .play-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        z-index: 2;
        width: 56px;
        height: 56px;
        margin: -28px 0 0 -28px;
        border-radius: 50%;
        background: rgba(10, 20, 40, 0.55);
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85);
        color: #fff;
        font-size: 20px;
        line-height: 56px;
        text-align: center;
        transition: background 0.2s ease, transform 0.2s ease;
    }

        /* 재생 삼각형은 시각적으로 가운데 오도록 살짝 오른쪽 */
        .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > a.title-image.is-video > .play-icon i {
            margin-left: 4px;
        }

.board-theme.gallery .theme-list .GalleryType > .each-document:hover > .thumb > a.title-image.is-video > .play-icon {
    background: var(--bt-primary);
    transform: scale(1.08);
}

@media (max-width: 767px) {
    .board-theme.gallery .theme-list .GalleryType > .each-document > .thumb > a.title-image.is-video > .play-icon {
        width: 46px;
        height: 46px;
        margin: -23px 0 0 -23px;
        font-size: 16px;
        line-height: 46px;
    }
}
