@charset "utf-8";

.simple-board-skin {
    padding-top: clamp(18px, 3vh, 34px);
}

/* RA0 Edition - 12칸 고정형 갤러리 스킨 */

.fixed-gallery-board,
.fixed-gallery-write {
    box-sizing: border-box;
}

.gallery-shell {
    position: relative;
    width: fit-content;
    max-width: calc(100vw - 40px);
    /* 헤더 아래의 남는 화면을 기준으로 게시판이 중앙에 보이도록 위 여백 복원 */
    margin: clamp(48px, 6.5vh, 68px) auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-toolbar {
    position: absolute;
    z-index: 30;
    right: 30px;
    bottom: -54px;
    width: auto;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin: 0;
    padding: 0;
}

/* 도트가 있을 때에는 도트와 같은 하단 높이에 맞춥니다. */
.gallery-shell:has(.gallery-page-dots) .gallery-toolbar {
    bottom: 0;
}

.gallery-page-create-form {
    margin: 0;
}

.gallery-toolbar-btn {
    position: relative;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #EF4444;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.28);
    transition: transform 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease;
}

.gallery-toolbar-btn::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 6px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.42);
    filter: blur(12px);
    pointer-events: none;
}

.gallery-toolbar-btn:hover,
.gallery-toolbar-btn:focus-visible {
    background: #dc3b3b;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.34);
    outline: none;
}

.gallery-stage {
    position: relative;
    align-self: center;
}

.fixed-gallery-board {
    /*
     * 기존 섬네일 크기를 유지하기 위해 이전 박스의 실제 콘텐츠 너비는 그대로 두고,
     * box-sizing:content-box 상태에서 바깥 패딩만 50px로 확장합니다.
     */
    width: calc(
        min(72vw, 1140px, calc(127vh - 235px))
        - clamp(18px, 1.8vw, 24px)
        - clamp(18px, 1.8vw, 24px)
    );
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 50px;
    box-sizing: content-box;
    border: 1px solid rgba(244, 196, 73, 0.75);
    border-radius: 20px;
    background: rgba(255, 239, 187, 0.3);
    backdrop-filter: blur(5px) saturate(115%);
    box-shadow:
        0 10px 28px rgba(173, 139, 33, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 1.5vw, 18px);
}

.gallery-pages-viewport {
    width: 100%;
}

.gallery-page-panel {
    display: none;
    width: 100%;
}

.gallery-page-panel.is-active {
    display: block;
    animation: galleryPageFade 0.28s ease;
}

@keyframes galleryPageFade {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.gallery-page-arrow {
    position: absolute;
    z-index: 20;
    top: 50%;
    width: 58px;
    height: 96px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 58px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    text-shadow: 0 4px 14px rgba(92, 72, 16, 0.16);
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.gallery-page-arrow:hover,
.gallery-page-arrow:focus-visible {
    transform: translateY(-50%) scale(1.08);
    outline: none;
}

.gallery-page-arrow[hidden] {
    display: none;
}

.gallery-page-prev {
    left: -78px;
}

.gallery-page-next {
    right: -78px;
}


.gallery-page-delete-form {
    position: absolute;
    z-index: 25;
    left: -58px;
    bottom: 2px;
    margin: 0;
}

.gallery-page-delete-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    text-shadow: 0 4px 14px rgba(92, 72, 16, 0.18);
    transition: transform 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.gallery-page-delete-btn:hover,
.gallery-page-delete-btn:focus-visible {
    color: #EF4444;
    transform: scale(1.08);
    outline: none;
}

.gallery-page-dots {
    min-height: 18px;
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.gallery-page-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(115, 87, 14, 0.08);
    transition: width 0.2s ease, height 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.gallery-page-dot:hover,
.gallery-page-dot:focus-visible {
    transform: scale(1.12);
    outline: none;
}

.gallery-page-dot.is-active {
    width: 16px;
    height: 16px;
    background: #EF4444;
}

.gallery-board {
    width: 100%;
    padding: 8px clamp(10px, 1.2vw, 16px) 10px;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(3, auto);
    gap: clamp(14px, 1.45vw, 22px);
}

.gallery-slot {
    min-width: 0;
    aspect-ratio: 4 / 3;
}

/* visibility:hidden은 크기를 유지하므로 중간 슬롯이 비어도 3×4 배열이 깨지지 않습니다. */
.gallery-slot.is-empty {
    visibility: hidden;
    pointer-events: none;
}

.gallery-item {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border: 1px solid #dce3e6;
    border-radius: 6px;
    background: #9b9b9b;
    box-shadow: 0 3px 8px rgba(66, 73, 79, 0.28);
    cursor: pointer;
    transform: translateY(0);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.gallery-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    filter: brightness(1) blur(0);
    transition: transform 0.35s ease, filter 0.35s ease;
}

.gallery-hover-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    box-sizing: border-box;
    opacity: 0;
    background: rgba(255, 255, 255, 0.26);
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
    transition: opacity 0.3s ease, background 0.3s ease;
}

.gallery-hover-title {
    font-family: 'DnfBitbeatV2', sans-serif;
    font-size: clamp(15px, 1.45vw, 24px);
    line-height: 1.25;
    font-weight: 400;
    color: #475569;
    text-align: center;
    text-shadow: 0 2px 6px rgba(255, 255, 255, 0.45);
    transform: translateY(10px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    word-break: keep-all;
}

.gallery-item:hover,
.gallery-item:focus-visible {
    transform: translateY(-7px);
    box-shadow: 0 10px 18px rgba(62, 68, 74, 0.28);
    outline: none;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
    transform: scale(1.05);
    filter: brightness(1.18) saturate(0.78) blur(2.4px);
}

.gallery-item:hover .gallery-hover-layer,
.gallery-item:focus-visible .gallery-hover-layer {
    opacity: 1;
    background: rgba(255, 255, 255, 0.36);
}

.gallery-item:hover .gallery-hover-title,
.gallery-item:focus-visible .gallery-hover-title {
    transform: translateY(0);
    opacity: 1;
}

.gallery-item.no-image {
    cursor: default;
    box-shadow: none;
    background: transparent;
    border-color: transparent;
}

.gallery-item.no-image .gallery-hover-layer {
    display: none;
}

.gallery-item-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 5px;
}

.gallery-action {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.58);
    color: #fff;
    font-size: 11px;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease;
}

.gallery-action:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.78);
}

.simple-board-category {
    flex: 0 0 auto;
}

.simple-category {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 0;
}

.simple-category li {
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--btn-primary-bg, #555);
    color: var(--btn-primary-text, #fff);
    font-size: 11px;
}

/* 이미지 모달 */
.gallery-modal-open {
    overflow: hidden;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal.is-open {
    display: flex;
}

.modal-content {
    position: relative;
    width: min(1180px, 90vw);
    max-width: 90vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.modal-navigation {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.modal-image-wrap {
    position: relative;
    flex: 0 1 auto;
    width: fit-content;
    max-width: calc(100% - 120px);
    min-width: 0;
    line-height: 0;
}

.modal-img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.48);
}

.modal-title {
    margin: 0;
    font-family: 'DnfBitbeatV2', sans-serif;
    font-size: clamp(18px, 2vw, 28px);
    font-weight: 400;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

.modal-nav-btn,
.modal-close {
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

.modal-nav-btn {
    flex: 0 0 46px;
    width: 46px;
    min-height: 64px;
    font-size: 32px;
    padding: 12px 8px;
}

.modal-close {
    position: absolute;
    top: 8px;
    left: calc(100% + 35px);
    right: auto;
    z-index: 5;

    width: 34px;
    height: 34px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    background: transparent;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
}

/* 글쓰기 폼 */
.fixed-gallery-write {
    width: min(70vw, 760px);
    max-width: calc(100vw - 40px);
    margin: clamp(44px, 8vh, 90px) auto 0;
}

form#fwrite {
    padding: clamp(20px, 3vw, 34px);
    border: 2px solid var(--container-border-color, rgba(0, 0, 0, 0.4));
    border-radius: var(--container-border-radius, 16px);
    background: var(--container-bg-color, rgba(255, 255, 255, 0.12));
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.write_div {
    margin: 0;
}

.form-label,
.write_div label {
    display: block;
    margin-bottom: 6px;
    color: var(--content-font-color, #333);
    font-weight: 700;
}

.write_div input[type="text"],
.write_div input[type="password"],
.write_div select,
.write_div textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    border: 1px solid var(--form-border-color, #bbb);
    border-radius: var(--form-border-radius, 8px);
    background: var(--form-bg-color, #fff);
    color: var(--form-text-color, #333);
    font-family: var(--content-font-family, sans-serif);
    font-size: 14px;
}

.bo_w_info {
    display: flex;
    gap: 10px;
}

.write_div .half_input {
    width: calc(50% - 5px);
}

.bo_v_option {
    margin: 0;
    padding: 0;
    list-style: none;
}

.form-help {
    margin: 7px 0 0;
    color: var(--text-muted, #777);
    font-size: 12px;
}

.btn_confirm {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
}

.btn_confirm .btn {
    min-width: 95px;
    padding: 10px 18px;
    border: 0;
    border-radius: var(--btn-primary-radius, 9px);
    font-size: 14px;
    text-align: center;
    cursor: pointer;
}

.btn_confirm .btn_submit {
    background: var(--btn-primary-bg, #555);
    color: var(--btn-primary-text, #fff);
}

.btn_confirm .btn_cancel {
    background: var(--btn-secondary-bg, #ddd);
    color: var(--btn-secondary-text, #333);
    text-decoration: none;
}



@media (max-width: 1100px) {
    .gallery-page-prev {
        left: -58px;
    }

    .gallery-page-next {
        right: -58px;
    }

    .gallery-page-delete-form {
        left: -48px;
    }
}

@media (max-width: 900px) {
    .gallery-shell {
        max-width: calc(100vw - 24px);
    }

    .gallery-toolbar {
        right: 18px;
        bottom: -48px;
        margin: 0;
        padding: 0;
    }

    .gallery-shell:has(.gallery-page-dots) .gallery-toolbar {
        bottom: 0;
    }

    .fixed-gallery-board {
        width: calc(
            min(88vw, calc(126vh - 190px))
            - 16px
            - 16px
        );
        padding: 34px;
    }

    .gallery-board {
        gap: 10px;
    }

    .gallery-page-arrow {
        width: 42px;
        font-size: 42px;
    }

    .gallery-page-prev {
        left: -42px;
    }

    .gallery-page-next {
        right: -42px;
    }
}

@media (max-width: 700px) {
    .modal {
        padding: 16px;
    }

    .modal-content {
        width: 96vw;
        max-width: 96vw;
    }

    .modal-navigation {
        gap: 4px;
    }

    .modal-img {
        max-width: 100%;
        max-height: 78vh;
    }

    .modal-close {
        top: 5px;
        right: 5px;
        width: 32px;
        height: 32px;
        font-size: 25px;
    }

    .modal-nav-btn {
        flex-basis: 32px;
        width: 32px;
        min-height: 50px;
        font-size: 25px;
        padding: 8px 2px;
    }


    .gallery-shell {
        width: calc(100vw - 20px);
        max-width: none;
        margin-top: 18px;
    }

    .gallery-toolbar {
        right: 8px;
        bottom: -44px;
        margin: 0;
        padding: 0;
        gap: 8px;
    }

    .gallery-shell:has(.gallery-page-dots) .gallery-toolbar {
        bottom: 0;
    }

    .gallery-toolbar-btn {
        width: 31px;
        height: 31px;
        font-size: 13px;
    }

    .fixed-gallery-board {
        width: auto;
        max-width: none;
        padding: 18px;
        box-sizing: border-box;
        border-radius: 13px;
    }

    .gallery-board {
        padding: 4px;
        gap: 6px;
    }

    .gallery-hover-title {
        font-size: 11px;
    }

    .gallery-item-actions {
        top: 4px;
        right: 4px;
    }

    .gallery-action {
        width: 22px;
        height: 22px;
        font-size: 9px;
    }

    .gallery-page-arrow {
        top: auto;
        bottom: -54px;
        width: 36px;
        height: 36px;
        font-size: 28px;
        transform: none;
    }

    .gallery-page-arrow:hover,
    .gallery-page-arrow:focus-visible {
        transform: scale(1.08);
    }

    .gallery-page-prev {
        left: 10px;
    }

    .gallery-page-next {
        right: 10px;
    }

    .gallery-page-dots {
        margin-top: 18px;
        gap: 12px;
    }

    .gallery-page-dot {
        width: 8px;
        height: 8px;
    }

    .gallery-page-dot.is-active {
        width: 12px;
        height: 12px;
    }

    .gallery-page-delete-form {
        left: 4px;
        bottom: -52px;
    }

    .gallery-page-delete-btn {
        width: 36px;
        height: 36px;
        font-size: 28px;
    }

    .fixed-gallery-write {
        width: calc(100vw - 20px);
        margin-top: 28px;
    }
}

/* 모달 원본 이미지 클릭 가능 표시 */
#gallery-modal .modal-img {
    cursor: zoom-in;
}