.gallery-board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 32px;
}

.gallery-write-btn,
.gallery-submit-btn {
    border: 0;
    border-radius: 40px;
    padding: 14px 28px;
    background: #20282d;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.gallery-loading,
.gallery-empty {
    padding: 70px 15px;
    color: #5d666f;
    text-align: center;
}

.gallery-card {
    position: relative;
    cursor: pointer;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-content-preview {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.gallery-edit-btn {
    display: none !important;
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    border: 0;
    border-radius: 30px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.92);
    color: #20282d;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.gallery-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.gallery-popup.is-open {
    display: block;
}

.gallery-image-popup {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.gallery-image-popup.is-open {
    display: flex;
}

.gallery-popup-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.gallery-image-popup-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
}

.gallery-popup-box {
    position: relative;
    width: min(560px, calc(100% - 30px));
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    margin: 30px auto;
    border-radius: 12px;
    padding: 34px;
    background: #fff;
}

.gallery-popup-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #f2f2f2;
    color: #20282d;
    font-size: 24px;
    line-height: 34px;
    cursor: pointer;
}

.gallery-image-popup-box {
    position: relative;
    width: min(1100px, calc(100% - 32px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    margin: 0 auto;
    border: 4px solid #fff;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.gallery-image-popup-box img {
    width: 100%;
    max-height: calc(100vh - 190px);
    object-fit: contain;
    background: #111;
}

.gallery-image-popup-info {
    padding: 22px 26px 26px;
}

.gallery-image-popup-info h3 {
    margin: 0 0 8px;
}

.gallery-image-popup-info p {
    margin: 0;
    color: #5d666f;
    white-space: pre-line;
}

.gallery-form-row {
    margin-top: 18px;
}

.gallery-form-row label {
    display: block;
    margin-bottom: 8px;
    color: #20282d;
    font-weight: 700;
}

.gallery-form-row input,
.gallery-form-row textarea {
    width: 100%;
    border: 1px solid rgba(93, 102, 111, 0.25);
    border-radius: 8px;
    padding: 12px 14px;
    color: #20282d;
    font: inherit;
}

.gallery-form-message {
    min-height: 22px;
    margin: 14px 0 0;
    color: #b42318;
    font-size: 14px;
}

.gallery-image-help {
    margin: 8px 0 0;
    color: #5d666f;
    font-size: 13px;
}

.gallery-submit-btn {
    width: 100%;
    margin-top: 8px;
}

@media (max-width: 767px) {
    .gallery-board-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .gallery-popup-box {
        padding: 28px 20px;
    }
}
