.junsung-gallery {
    color: #fff;
}

.junsung-gallery__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 54px;
}

.junsung-gallery__path {
    margin: 0 0 5px;
    color: #69747d;
    font-size: 16px;
    white-space: nowrap;
}

.junsung-gallery__path span {
    margin: 0 4px;
    color: #1693f4;
}

.junsung-gallery__header h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(30px, 3vw, 40px);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.junsung-gallery__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 56px 42px;
}

.junsung-gallery__grid--fieldphoto {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 42px;
}

.junsung-gallery__grid--document .junsung-gallery-card__image {
    aspect-ratio: 3 / 4;
    background: #fff;
}

.junsung-gallery__grid--document .junsung-gallery-card img {
    object-fit: cover;
    filter: none;
}

.junsung-gallery-card {
    min-width: 0;
}

.junsung-gallery-card a {
    display: block;
    color: #fff;
    text-decoration: none;
}

.junsung-gallery-card__image {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    background: #202020;
}

.junsung-gallery-card__image::after {
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: inherit;
    content: "";
    pointer-events: none;
    transition: border-color .25s ease;
}

.junsung-gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(.72);
    transition: filter .3s ease, transform .45s ease;
}

.junsung-gallery-card h2 {
    margin: 18px 2px 0;
    color: #fff;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.junsung-gallery-card a:hover img,
.junsung-gallery-card a:focus-visible img {
    filter: brightness(1);
    transform: scale(1.035);
}

.junsung-gallery-card a:hover .junsung-gallery-card__image::after,
.junsung-gallery-card a:focus-visible .junsung-gallery-card__image::after {
    border-color: #1693f4;
}

.junsung-gallery-card a:focus-visible,
.junsung-gallery-button:focus-visible,
.junsung-gallery-search input:focus-visible,
.junsung-gallery-search button:focus-visible,
.junsung-gallery input:focus-visible,
.junsung-gallery textarea:focus-visible {
    outline: 2px solid #1693f4;
    outline-offset: 3px;
}

.junsung-gallery__empty,
.junsung-gallery-form__warning {
    margin: 0;
    padding: 42px 30px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 14px;
    background: #202020;
    color: #a7a7a7;
    text-align: center;
}

.junsung-gallery__tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 46px;
}

.junsung-gallery-search {
    display: flex;
    max-width: 440px;
    flex: 1 1 440px;
}

.junsung-gallery-search input,
.junsung-gallery-search button,
.junsung-gallery-form input[type="text"],
.junsung-gallery-form input[type="file"] {
    min-height: 48px;
    border: 1px solid rgba(255, 255, 255, .2);
    background: #202020;
    color: #fff;
    font: inherit;
}

.junsung-gallery-search input {
    min-width: 0;
    flex: 1;
    padding: 0 16px;
    border-radius: 10px 0 0 10px;
}

.junsung-gallery-search button {
    padding: 0 20px;
    border-left: 0;
    border-radius: 0 10px 10px 0;
    background: #1693f4;
    font-weight: 700;
    cursor: pointer;
}

.junsung-gallery-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 0 22px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.junsung-gallery-button:hover {
    border-color: #1693f4;
}

.junsung-gallery-button--primary {
    border-color: #1693f4;
    background: #1693f4;
}

.junsung-gallery-button--danger {
    border-color: #bd4e4e;
    color: #ffb1b1;
}

.junsung-gallery-pagination {
    margin-top: 46px;
    text-align: center;
}

.junsung-gallery-pagination a,
.junsung-gallery-pagination strong {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    margin: 0 3px;
    border-radius: 50%;
    color: #d6d6d6;
    text-decoration: none;
}

.junsung-gallery-pagination strong {
    background: #1693f4;
    color: #fff;
}

.junsung-gallery-view__header {
    max-width: 980px;
}

.junsung-gallery-view figcaption {
    padding: 12px 16px;
    color: #a7a7a7;
    font-size: 14px;
}

.junsung-gallery-view__description {
    margin-top: 42px;
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    background: #202020;
    color: #e7e7e7;
    font-size: 17px;
    overflow-wrap: anywhere;
}

.junsung-gallery-view__description > :first-child {
    margin-top: 0;
}

.junsung-gallery-view__description > :last-child {
    margin-bottom: 0;
}

.junsung-gallery-view__description img {
    max-width: 100%;
    height: auto;
}

.junsung-gallery-view__thumbnail-marked {
    position: relative;
    display: inline-block;
    max-width: 100%;
    vertical-align: top;
}

.junsung-gallery-view__thumbnail-marked img {
    display: block;
}

.junsung-gallery-view__thumbnail-label {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(17, 47, 74, .8);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.junsung-gallery-view__downloads h3,
.junsung-gallery-form__files h3 {
    margin: 0 0 20px;
    color: #fff;
    font-size: 24px;
}

.junsung-gallery-view__download-list {
    display: grid;
    gap: 10px;
}

.junsung-gallery-download {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 17px 20px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
    background: #202020;
    color: #fff;
    text-decoration: none;
}

.junsung-gallery-download:hover,
.junsung-gallery-download:focus-visible {
    border-color: #1693f4;
}

.junsung-gallery-download span {
    min-width: 0;
    overflow: hidden;
    color: #ddd;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.junsung-gallery-download strong {
    flex: 0 0 auto;
    color: #1693f4;
}

.junsung-gallery-view__actions,
.junsung-gallery-form__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 54px;
    padding-top: 26px;
    border-top: 1px solid rgba(255, 255, 255, .14);
}

.junsung-gallery-form {
    display: grid;
    gap: 34px;
}

.junsung-gallery-form__field > label,
.junsung-gallery-file-field > label:first-child {
    display: block;
    margin-bottom: 10px;
    color: #fff;
    font-weight: 700;
}

.junsung-gallery-form label span,
.junsung-gallery-file-field > label span {
    color: #1693f4;
    font-size: 13px;
}

.junsung-gallery-form input[type="text"] {
    width: 100%;
    padding: 0 16px;
    border-radius: 10px;
}

.junsung-gallery-form__pin {
    padding: 20px 22px;
    border: 1px solid rgba(22, 147, 244, .45);
    border-radius: 12px;
    background: rgba(22, 147, 244, .07);
}

.junsung-gallery-form__pin > label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
}

.junsung-gallery-form__pin input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #1693f4;
}

.junsung-gallery-form__pin p {
    margin: 8px 0 0 28px;
    color: #a7a7a7;
    font-size: 14px;
}

.junsung-gallery-form__content textarea {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 10px;
    background: #202020;
    color: #fff;
    font: inherit;
    resize: vertical;
}

.junsung-gallery-form__files {
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    background: #202020;
}

.junsung-gallery-form__files > p {
    margin: -10px 0 26px;
    color: #a7a7a7;
}

.junsung-gallery-file-field {
    padding: 22px 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.junsung-gallery-file-field--representative {
    margin: 0 -14px;
    padding: 22px 14px;
    border: 1px solid rgba(22, 147, 244, .45);
    border-radius: 12px;
    background: rgba(22, 147, 244, .07);
}

.junsung-gallery-file-field input[type="file"] {
    width: 100%;
    height: auto;
    padding: 10px;
    border-radius: 10px;
}

.junsung-gallery-file-field__edit-note {
    margin: 10px 0 0;
    color: #a7a7a7;
    font-size: 14px;
    line-height: 1.55;
}

.junsung-image-editor,
.junsung-image-editor-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.junsung-image-editor__panel {
    display: grid;
    grid-template-columns: minmax(150px, 230px) minmax(0, 1fr);
    grid-template-areas:
        "heading heading"
        "preview controls"
        "preview info";
    gap: 14px 20px;
    padding: 16px;
    border: 1px solid rgba(22, 147, 244, .35);
    border-radius: 12px;
    background: rgba(22, 147, 244, .06);
}

.junsung-image-editor__heading {
    grid-area: heading;
    margin: 0;
    color: #fff;
    font-weight: 700;
}

.junsung-image-editor__preview {
    grid-area: preview;
    display: grid;
    min-height: 150px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 9px;
    background: #151515;
}

.junsung-image-editor__preview img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 220px;
    object-fit: contain;
}

.junsung-image-editor__controls {
    grid-area: controls;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 9px;
}

.junsung-image-editor__button,
.junsung-image-editor__size select {
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    background: #202020;
    color: #fff;
    font: inherit;
}

.junsung-image-editor__button {
    padding: 0 13px;
    cursor: pointer;
}

.junsung-image-editor__button:hover,
.junsung-image-editor__button:focus-visible {
    border-color: #1693f4;
}

.junsung-image-editor__button--reset {
    color: #a7a7a7;
}

.junsung-image-editor__size {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #e7e7e7;
    font-size: 14px;
}

.junsung-image-editor__size select {
    padding: 0 10px;
}

.junsung-image-editor__info {
    grid-area: info;
    margin: 0;
    align-self: end;
    color: #a7a7a7;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.junsung-image-editor__panel.is-processing {
    opacity: .65;
    pointer-events: none;
}

.junsung-gallery-file-field__current {
    margin: 10px 0 0;
    color: #a7a7a7;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.junsung-gallery-file-field__delete {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    color: #ffb1b1;
    font-size: 14px;
}

.junsung-gallery-file-field--additional {
    display: grid;
    gap: 12px;
}

.junsung-gallery-dropzone {
    display: grid;
    min-height: 132px;
    place-content: center;
    gap: 6px;
    padding: 22px;
    border: 1px dashed rgba(22, 147, 244, .7);
    border-radius: 12px;
    background: rgba(22, 147, 244, .07);
    color: #fff;
    cursor: pointer;
    text-align: center;
    transition: border-color .2s ease, background-color .2s ease;
}

.junsung-gallery-dropzone span,
.junsung-gallery-selected-files {
    color: #a7a7a7;
    font-size: 14px;
}

.junsung-gallery-dropzone.is-dragging,
.junsung-gallery-dropzone:hover,
.junsung-gallery-dropzone:focus-visible {
    border-color: #1693f4;
    background: rgba(22, 147, 244, .14);
    outline: 0;
}

.junsung-gallery-selected-files {
    margin: 0;
    overflow-wrap: anywhere;
}

.junsung-gallery-file-slots {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.junsung-gallery-file-field__current-file {
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

@media (max-width: 640px) {
    .junsung-image-editor__panel {
        grid-template-columns: 1fr;
        grid-template-areas:
            "heading"
            "preview"
            "controls"
            "info";
    }

    .junsung-image-editor__preview {
        min-height: 190px;
    }
}

.junsung-gallery-form__actions button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.junsung-html-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.junsung-html-toolbar button {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #b8c8d4;
    border-radius: 8px;
    background: #fff;
    color: #20242a;
    font: 14px/1 stm, "Noto Sans KR", "Malgun Gothic", sans-serif;
    cursor: pointer;
}

.junsung-html-toolbar button:hover,
.junsung-html-toolbar button:focus-visible,
.junsung-html-toolbar button[aria-pressed="true"] {
    border-color: #1693f4;
    background: #eaf5ff;
    color: #0d6fbe;
    outline: 0;
}

.junsung-html-toolbar span {
    color: #5e6872;
    font-size: 13px;
}

.junsung-gallery-form textarea.is-html-mode {
    font-family: Consolas, "Courier New", monospace;
    line-height: 1.6;
}

.junsung-gallery-view__attachment {
    width: 100%;
    max-width: 100%;
    margin: 28px 0;
    text-align: center;
}

.junsung-gallery-view__attachment img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.junsung-gallery-view__attachment--width-25 { width: 25%; }
.junsung-gallery-view__attachment--width-50 { width: 50%; }
.junsung-gallery-view__attachment--width-75 { width: 75%; }
.junsung-gallery-view__attachment--width-100 { width: 100%; }
.junsung-gallery-view__attachment--align-left { margin-right: auto; margin-left: 0; }
.junsung-gallery-view__attachment--align-center { margin-right: auto; margin-left: auto; }
.junsung-gallery-view__attachment--align-right { margin-right: 0; margin-left: auto; }

.junsung-inserted-image-settings {
    margin: 14px 0;
    padding: 18px;
    border: 1px solid #cfd8df;
    border-radius: 12px;
    background: #fff;
    color: #20242a;
}

.junsung-inserted-image-settings legend {
    padding: 0 6px;
    font-weight: 700;
}

.junsung-inserted-image-settings > p {
    margin: 0 0 14px;
    color: #69747d;
    font-size: 14px;
}

.junsung-inserted-image-settings__grid {
    display: grid;
    gap: 10px;
}

.junsung-inserted-image-settings__row {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) repeat(2, minmax(150px, .7fr));
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #e3e8ec;
    border-radius: 10px;
    background: #f7f9fb;
}

.junsung-inserted-image-settings__row label {
    display: grid;
    grid-template-columns: auto minmax(82px, 1fr);
    gap: 8px;
    align-items: center;
}

.junsung-inserted-image-settings select {
    width: 100%;
    min-height: 40px;
    border: 1px solid #cfd8df;
    border-radius: 8px;
    background: #fff;
    color: #20242a;
}

@media (max-width: 640px) {
    .junsung-inserted-image-settings__row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .junsung-gallery__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .junsung-html-toolbar {
        display: grid;
        grid-template-columns: 1fr;
    }

    .junsung-html-toolbar button {
        width: 100%;
        min-height: 44px;
    }

    .junsung-gallery__header {
        display: block;
        margin-bottom: 28px;
    }

    .junsung-gallery__path {
        margin-top: 8px;
        font-size: 14px;
        white-space: normal;
    }

    .junsung-gallery__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 12px;
    }

    .junsung-gallery-card__image {
        border-radius: 14px;
    }

    .junsung-gallery-card h2 {
        display: block;
        margin-top: 13px;
        font-size: 14px;
        font-weight: 400;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        -webkit-line-clamp: unset;
    }

    .junsung-gallery__tools {
        display: block;
        margin-top: 34px;
    }

    .junsung-gallery-search {
        max-width: none;
    }

    .junsung-gallery__tools > .junsung-gallery-button {
        width: 100%;
        margin-top: 12px;
    }

    .junsung-gallery-view__description {
        margin-top: 28px;
        padding: 22px;
        font-size: 16px;
    }

    .junsung-gallery-view__downloads {
        margin-top: 40px;
    }

    .junsung-gallery-download {
        display: block;
        padding: 16px;
    }

    .junsung-gallery-download span {
        display: block;
        white-space: normal;
    }

    .junsung-gallery-download strong {
        display: block;
        margin-top: 8px;
    }

    .junsung-gallery-view__actions,
    .junsung-gallery-form__actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 38px;
    }

    .junsung-gallery-form__files {
        padding: 20px;
    }
}

/* 밝은 게시판 화면 */
.junsung-gallery { color: #20242a; }
.junsung-gallery__header h1,
.junsung-gallery-card a,
.junsung-gallery-card h2,
.junsung-gallery-view__header h1 { color: #20242a; }
.junsung-gallery-card__image {
    border-color: #dce3e8;
    background: #f5f7f8;
}
.junsung-gallery__empty,
.junsung-gallery-form__warning,
.junsung-gallery-view__description,
.junsung-gallery-view__downloads,
.junsung-gallery-view__additional,
.junsung-gallery-form__content,
.junsung-gallery-form__files {
    border-color: #dce3e8;
    background: #f7f9fa;
    color: #5e6872;
}
.junsung-gallery-search input,
.junsung-gallery-form input[type="text"],
.junsung-gallery-form input[type="file"],
.junsung-gallery-form textarea,
.junsung-gallery-form select {
    border-color: #cfd8df;
    background: #fff;
    color: #20242a;
}
.junsung-gallery-button {
    border-color: #c4d0d8;
    background: #fff;
    color: #20242a;
}
.junsung-gallery-button--primary,
.junsung-gallery-search button {
    border-color: #1693f4;
    background: #1693f4;
    color: #fff;
}
.junsung-gallery-button--danger { color: #ad3f3f; }
.junsung-gallery-view__downloads h3,
.junsung-gallery-form__files h3,
.junsung-gallery-form__field > label,
.junsung-gallery-file-field > label:first-child,
.junsung-gallery-form__pin > label { color: #20242a; }
.junsung-gallery-form__files > p,
.junsung-gallery-form__pin p { color: #69747d; }
.junsung-gallery-file-field { border-top-color: #e3e8ec; }
.junsung-gallery-dropzone { background: #f5faff; color: #20242a; }
.junsung-gallery-dropzone span,
.junsung-gallery-selected-files { color: #69747d; }
.junsung-gallery-file-field__current-file { border-top-color: #e3e8ec; }
.junsung-gallery-file-field__edit-note,
.junsung-image-editor__info { color: #69747d; }
.junsung-image-editor__panel {
    border-color: #b9d9f4;
    background: #f5faff;
}
.junsung-image-editor__heading { color: #20242a; }
.junsung-image-editor__preview {
    border-color: #dce3e8;
    background: #fff;
}
.junsung-image-editor__button,
.junsung-image-editor__size select {
    border-color: #cfd8df;
    background: #fff;
    color: #20242a;
}
.junsung-image-editor__button--reset { color: #5e6872; }
.junsung-image-editor__size { color: #20242a; }

.junsung-gallery-download {
    border-color: #dce3e8;
    background: #fff;
    color: #20242a;
}

.junsung-gallery-download span {
    color: #20242a;
}

.junsung-gallery-download small {
    color: #69747d;
}

.junsung-gallery-file-field--representative {
    border-color: #b9d9f4;
    background: #f5faff;
}

@media (prefers-reduced-motion: reduce) {
    .junsung-gallery-card img,
    .junsung-gallery-card__image::after {
        transition: none;
    }
}

/* 일반 서브 페이지 제목과 맞춘 갤러리 제목 */
.junsung-gallery__header h1 {
    font-family: "steb", "Noto Sans KR", "Malgun Gothic", sans-serif;
    font-size: 36px;
    font-weight: 400;
    line-height: 1.4;
}

@media (min-width: 901px) {
    .junsung-gallery-list .junsung-gallery__header {
        position: relative;
        display: block;
        padding-top: 36px;
        margin-bottom: 80px;
    }

    .junsung-gallery-list .junsung-gallery__path {
        position: absolute;
        right: 0;
        bottom: 4px;
        margin: 0;
        color: #666;
        font-size: 14px;
    }
}

.junsung-gallery-view__header {
    display: block;
    max-width: none;
    margin-bottom: 44px;
}

.junsung-gallery-view__header .junsung-gallery__path {
    margin: 0 0 14px;
}

.junsung-gallery-view__header h1 {
    max-width: 1100px;
    font-size: clamp(24px, 1.9vw, 28px);
    line-height: 1.42;
}

@media (max-width: 640px) {
    .junsung-gallery-view__header { margin-bottom: 32px; }
    .junsung-gallery-view__header h1 { font-size: 24px; }
}

.junsung-gallery-write .junsung-gallery__header {
    display: block;
}

.junsung-gallery-write .junsung-gallery__eyebrow {
    margin: 0 0 26px;
    color: #20242a;
    font-family: steb, "Noto Sans KR", "Malgun Gothic", sans-serif;
    font-size: 36px;
    font-weight: 400;
    line-height: 1.4;
}

.junsung-gallery-write .junsung-gallery__header h1 {
    font-family: stm, "Noto Sans KR", "Malgun Gothic", sans-serif;
    font-size: 28px;
    font-weight: 400;
    line-height: 1.5;
}

@media (max-width: 640px) {
    .junsung-gallery-write .junsung-gallery__eyebrow {
        margin-bottom: 18px;
        font-size: 28px;
    }

    .junsung-gallery-write .junsung-gallery__header h1 {
        font-size: 22px;
    }
}

/* Small white labels need a darker brand-blue surface for WCAG contrast. */
.junsung-gallery-search button {
    border-color: #1373c7;
    background: #1373c7;
}

/* Mobile gallery layout: preserve a readable two-column document list. */
@media (max-width: 640px) {
    .junsung-gallery__grid,
    .junsung-gallery__grid--fieldphoto {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}