@charset "utf-8";

/* =========================================================
   배너 목록 / 메인 위젯
========================================================= */
.banner-board {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.banner-showcase {
    width: min(100%, 440px);
    margin: 0 auto;
}

/* 일반 배너 페이지에서만 출력되는 상단 버튼 */
.banner-page-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
}

.banner-page-button,
.banner-widget-manage,
.banner-manager-add,
.banner-manager-close {
    border: 0;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
}

.banner-page-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 11px;
    border-radius: 5px;
    background: var(--btn-primary-bg, #545e6d);
    color: var(--btn-primary-text, #fff);
    font-size: 12px;
}

/* 메인 위젯 우측 상단의 목록 관리 버튼 */
.banner-widget-manage {
    position: absolute;
    z-index: 20;
    top: 0;
    right: 0;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #545e6d;
    color: #fff;
    transition: transform .18s ease, background .18s ease;
}

.banner-widget-manage:hover,
.banner-widget-manage:focus-visible {
    background: #EF4444;
    transform: translateY(-2px);
}

.banner-board.is-widget {
    padding-top: 42px;
}

/* 내 홈페이지 배너 */
.banner-home-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.banner-home-copy {
    appearance: none;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: copy;
}

.banner-home-copy .banner-img {
    width: min(200px, 100%);
}

.banner-home-empty {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: rgba(255,255,255,.48);
    color: var(--content-font-color, #444);
    text-align: center;
    font-size: 12px;
}

.banner-copy-status {
    min-height: 17px;
    margin-top: 4px;
    color: #EF4444;
    font-size: 11px;
    text-align: center;
}

/* 공통 이미지 호버 */
.banner-hover-card {
    position: relative;
    display: block;
    max-width: 100%;
    overflow: hidden;
    background: #fff;
    transform: translateY(0);
    transition: transform .22s ease, filter .22s ease;
}

.banner-hover-card::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    background: rgba(255,255,255,.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}

.banner-hover-card:hover,
.banner-hover-card:focus-visible {
    transform: translateY(-3px);
    filter: drop-shadow(0 6px 7px rgba(0,0,0,.15));
}

.banner-hover-card:hover::before,
.banner-hover-card:focus-visible::before {
    opacity: 1;
}

.banner-img {
    position: relative;
    z-index: 0;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 1;
    object-fit: contain;
}

/* 이미지 중앙의 지정 이름 */
.banner-tooltip {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 50%;
    width: max-content;
    max-width: calc(100% - 18px);
    padding: 6px 10px;
    border-radius: 999px;
    background: #EF4444;
    color: #fff;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, calc(-50% + 3px)) scale(.96);
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}

.banner-hover-card:hover .banner-tooltip,
.banner-hover-card:focus-visible .banner-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* 다른 홈페이지 배너: 2열 × 2행 */
.banner-slider,
.banner-slides {
    width: 100%;
}

.banner-slide {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.banner-slide.is-active {
    display: grid;
    animation: bannerFade .22s ease;
}

@keyframes bannerFade {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
}

.banner-external-item,
.banner-external-link {
    min-width: 0;
    width: 100%;
}

.banner-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 5 / 1;
    background: var(--gray-100, #eee);
    color: var(--text-muted, #888);
    font-size: 11px;
}

/* 도트 */
.banner-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 10px;
}

.banner-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #FFE684;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(0,0,0,.05);
    transition: transform .18s ease, background .18s ease;
}

.banner-dot:hover,
.banner-dot:focus-visible {
    transform: scale(1.18);
}

.banner-dot.is-active {
    background: #EF4444;
}

.empty-list {
    text-align: center;
    padding: 38px 15px;
    color: var(--text-muted, #888);
}

/* =========================================================
   배너 관리 팝업
========================================================= */
.banner-board.is-manage {
    padding: 18px;
    background: #fff;
    min-height: 100vh;
}

.banner-manager {
    width: min(100%, 580px);
    margin: 0 auto;
}

.banner-manager-header {
    position: sticky;
    z-index: 3;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0 14px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.banner-manager-header h2 {
    margin: 0;
    font-size: 18px;
}

.banner-manager-header-actions,
.banner-manager-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.banner-manager-add,
.banner-manager-close,
.banner-manager-edit,
.banner-manager-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 12px;
}

.banner-manager-add,
.banner-manager-edit {
    background: #545e6d;
    color: #fff;
}

.banner-manager-delete {
    background: #EF4444;
    color: #fff;
}

.banner-manager-close {
    width: 30px;
    padding: 0;
    background: #eee;
    color: #444;
    font-size: 20px;
}

.banner-manager-list {
    display: flex;
    flex-direction: column;
}

.banner-manager-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid #eee;
}

.banner-manager-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    aspect-ratio: 5 / 1;
    overflow: hidden;
    background: #f3f3f3;
    font-size: 10px;
}

.banner-manager-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.banner-manager-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.banner-manager-info strong,
.banner-manager-info span,
.banner-manager-info a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.banner-manager-info strong {
    font-size: 13px;
}

.banner-manager-info span,
.banner-manager-info a {
    color: #777;
    font-size: 11px;
}

/* =========================================================
   작성 폼 기존 스타일
========================================================= */
.write_div {
    background: var(--container-bg-color);
    border: 1px solid var(--border-light);
    border-radius: 5px;
    padding: 20px;
}

.write_flex {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.bo_w_select { flex: 0 0 150px; }
.bo_w_tit { flex: 1; }

.bo_w_select label,
.bo_w_tit label,
.bo_w_banner label,
.bo_w_link label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 13px;
}

.bo_w_banner label small {
    font-weight: normal;
    color: var(--text-muted);
    margin-left: 5px;
}

.bo_w_select select,
.frm_input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-light);
    border-radius: 3px;
    font-size: 14px;
    background: var(--white);
}

.full_input { width: 100%; }
.bo_w_banner,
.bo_w_link { margin-top: 15px; }

.banner_input_wrap {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.banner_upload,
.banner_url { flex: 1; }

.banner_upload label,
.banner_url label {
    font-weight: normal !important;
    font-size: 12px !important;
    color: var(--text-muted);
}

.file_del,
.frm_info {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

.btn_confirm {
    margin-top: 20px;
    text-align: center;
}

.btn_submit,
.btn_cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 25px;
    border: none;
    border-radius: 3px;
    text-decoration: none;
    font-size: 14px;
}

.btn_submit {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    cursor: pointer;
}

.btn_cancel {
    margin-left: 5px;
    background: var(--gray-200);
    color: var(--content-font-color);
}

@media (max-width: 640px) {
    .banner-showcase {
        width: min(100%, 380px);
    }

    .banner-manager-row {
        grid-template-columns: 100px minmax(0, 1fr);
    }

    .banner-manager-thumb {
        width: 100px;
    }

    .banner-manager-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 360px) {
    .banner-slide {
        grid-template-columns: 1fr;
    }

    .write_flex,
    .banner_input_wrap {
        flex-direction: column;
    }

    .bo_w_select {
        flex: none;
    }
}

/* 기본적으로 메인용 목록 버튼은 숨김 */
.banner-widget-manage {
    display: none !important;
}

/* 메인 iframe 안에서는 관리자·등록·글자형 목록 관리 버튼 숨김 */
html.banner-in-main .banner-page-actions,
html.banner-in-main .bo_admbtn {
    display: none !important;
}

/* 메인 iframe에서는 우측 상단 목록 아이콘 하나만 표시 */
html.banner-in-main .banner-widget-manage {
    display: none !important;
}

/* ========================================
   메인 iframe 배너 최종 레이아웃
======================================== */

html.banner-in-main,
html.banner-in-main body {
    width: 100% !important;
    height: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* iframe 내부 전체 영역 */
html.banner-in-main #banner_board {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;

    margin: 0 !important;
    padding: 6px 8px !important;

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

    box-sizing: border-box !important;
}

/* 내 배너 + 외부 배너 + 도트 묶음 */
html.banner-in-main .banner-showcase {
    width: min(100%, 350px) !important;

    margin: auto !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;

    gap: 8px !important;

    box-sizing: border-box !important;
}

/* 내 홈페이지 배너가 없을 때 안내판 */
html.banner-in-main .banner-home-placeholder {
    width: max-content !important;
    max-width: calc(100% - 20px) !important;
    min-height: 34px !important;

    margin: 0 auto !important;
    padding: 6px 12px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box !important;

    color: var(--content-font-color, #333) !important;
    background: rgba(190, 190, 190, 0.75) !important;

    border-radius: 0 !important;

    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    text-align: center !important;
    white-space: nowrap !important;
}

/* 실제 내 홈페이지 배너 */
html.banner-in-main .banner-home-wrap {
    width: 100% !important;
    margin: 0 !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* 외부 배너 슬라이더 */
html.banner-in-main .banner-slider,
html.banner-in-main .banner-slides {
    width: 100% !important;
    margin: 0 auto !important;
}

/*
 * 모든 슬라이드는 기본적으로 숨김.
 * 한 페이지는 항상 2열 × 2행.
 */
html.banner-in-main .banner-slide {
    width: 100% !important;

    display: none !important;

    grid-template-columns:
        repeat(2, minmax(0, 1fr)) !important;

    grid-template-rows:
        repeat(2, auto) !important;

    gap: 7px 8px !important;

    margin: 0 auto !important;
}

/* 현재 선택된 슬라이드만 표시 */
html.banner-in-main .banner-slide.is-active {
    display: grid !important;
}

/* 실제 배너와 빈칸은 동일한 크기의 칸 사용 */
html.banner-in-main .banner-external-item,
html.banner-in-main .banner-slot-empty {
    width: 100% !important;
    min-width: 0 !important;

    aspect-ratio: 5 / 1;

    margin: 0 !important;
    box-sizing: border-box !important;
}

/* 빈칸은 공간만 차지하고 보이지 않음 */
html.banner-in-main .banner-slot-empty {
    visibility: hidden !important;
    pointer-events: none !important;
}

/* 외부 배너 링크 */
html.banner-in-main .banner-external-link {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;

    display: block !important;
    margin: 0 !important;
}

/* 외부 배너 이미지 */
html.banner-in-main .banner-external-link .banner-img {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    object-fit: contain !important;
}

/* 이미지가 없는 배너 */
html.banner-in-main .banner-noimg {
    width: 100% !important;
    height: 100% !important;
}

/* 도트 중앙 정렬 */
html.banner-in-main .banner-dots {
    width: 100% !important;

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

    gap: 9px !important;

    margin: 2px auto 0 !important;
}

/* 내 홈페이지 배너 칸을 실제 이미지 크기에 맞춤 */
html.banner-in-main .banner-home-copy {
    display: inline-block !important;

    width: fit-content !important;
    max-width: 100% !important;
    min-width: 0 !important;

    height: auto !important;

    margin: 0 auto !important;
    padding: 0 !important;

    line-height: 0 !important;
    background: transparent !important;
}

/* ========================================
   배너 호버 및 복사 완료 효과 최종
======================================== */

/* D-Day 카드와 같은 떠오르는 효과 */
.banner-hover-card {
    transform: translateY(0);

    filter: none !important;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease !important;
}

.banner-hover-card:hover,
.banner-hover-card:focus-visible {
    transform: translateY(-3px) !important;

    filter: none !important;

    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

/* 이미지 투명도 효과 */
.banner-hover-card .banner-img {
    opacity: 1;

    transition:
        opacity 0.3s ease !important;
}

.banner-hover-card:hover .banner-img,
.banner-hover-card:focus-visible .banner-img {
    opacity: 0.9 !important;
}

/* 내 배너 커서를 기본 화살표로 */
.banner-home-copy {
    cursor: default !important;
}

/* 클릭 완료 상태에서는 기존 제목 툴팁 숨김 */
.banner-home-copy.is-copied .banner-tooltip {
    opacity: 0 !important;
    visibility: hidden !important;

    transform:
        translate(-50%, calc(-50% + 3px))
        scale(0.96) !important;
}

/* 복사 완료 문구 기본 상태 */
.banner-copy-status {
    position: absolute;
    z-index: 5;

    left: 50%;
    top: 50%;

    width: max-content;
    min-height: 0 !important;

    margin: 0 !important;
    padding: 6px 10px;

    color: #ffffff;
    background: #EF4444;
    border-radius: 999px;

    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    /*
     * 숨겨질 때 아래로 내려가면서
     * 조금 작아지는 상태
     */
    transform:
            translate(-50%, calc(-50% + 3px))
            scale(0.96);

    transition:
            opacity 0.18s ease,
            transform 0.18s ease,
            visibility 0s linear 0.18s;
}

/* 클릭한 뒤 복사 완료 문구 표시 */
.banner-home-wrap.is-copy-done
.banner-copy-status {
    opacity: 1;
    visibility: visible;

    /*
     * 호버된 배너가 위로 5px 움직이는 것과 동일하게
     * 복사 완료 문구도 위로 5px 이동
     */
    transform:
            translate(-50%, calc(-50% - 3px))
            scale(1);
    transition:
            opacity 0.18s ease,
            transform 0.18s ease,
            visibility 0s;
}

/* ========================================
   내 배너를 외부 배너 한 칸과 동일한 크기로
======================================== */

html.banner-in-main .banner-home-wrap {
    width: 100% !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/*
 * 외부 배너가 2열이고 간격이 8px이므로
 * 전체 폭에서 간격을 뺀 뒤 절반으로 설정
 */
html.banner-in-main .banner-home-copy {
    display: block !important;

    width: calc((100% - 8px) / 1.5) !important;
    max-width: none !important;
    min-width: 0 !important;

    height: auto !important;
    aspect-ratio: 5 / 1 !important;

    margin: 0 auto !important;
    padding: 0 !important;

    overflow: hidden !important;
    background: transparent !important;
    box-sizing: border-box !important;
}

/* 내 배너 이미지도 외부 배너와 같은 비율 */
html.banner-in-main .banner-home-copy .banner-img {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    max-width: none !important;
    max-height: none !important;

    aspect-ratio: 5 / 1 !important;
    object-fit: contain !important;
}

/* 복사 완료 상태에서는 기존 제목 툴팁 숨김 */
.banner-home-wrap.is-copy-done
.banner-tooltip {
    opacity: 0 !important;
    visibility: hidden !important;

    transform:
        translate(-50%, calc(-50% + 3px))
        scale(0.96) !important;
}

/* 내 배너와 외부 배너 사이 간격 */
html.banner-in-main .banner-home-wrap,
html.banner-in-main .banner-home-placeholder {
    margin-bottom: 3px !important;
}

/* ========================================
   외부 배너 도트 간격 및 크기
======================================== */

/* 외부 배너와 도트 사이 간격 */
html.banner-in-main .banner-dots {
    width: 100% !important;

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

    gap: 10px !important;

    /* 외부 배너 아래 간격 */
    margin: 16px auto 0 !important;
}

/* 선택되지 않은 도트: 작게 */
html.banner-in-main .banner-dot {
    width: 8px !important;
    height: 8px !important;

    padding: 0 !important;

    border: 0 !important;
    border-radius: 50% !important;

    background: #FFE684;

    transform: scale(1);
    transform-origin: center;

    transition:
        transform 0.18s ease,
        background 0.18s ease !important;
}

/* 호버하면 기존 10px 정도의 크기로 확대 */
html.banner-in-main .banner-dot:hover,
html.banner-in-main .banner-dot:focus-visible {
    transform: scale(1.25) !important;
}

/* 선택된 도트: 확대된 크기 유지 + 기존 붉은색 유지 */
html.banner-in-main .banner-dot.is-active {
    background: #EF4444 !important;
    transform: scale(1.25) !important;
}

/* ========================================
   기타 카테고리 배너
======================================== */

/* 링크 대신 사용하는 버튼 초기화 */
.banner-other-button {
    appearance: none !important;

    width: 100% !important;
    height: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
    font: inherit !important;

    background: #ffffff;
    cursor: default !important;
}

/* 클릭한 문구도 기존 호버 툴팁과 같은 애니메이션 */
.banner-other-button.is-message-shown
.banner-tooltip {
    opacity: 1 !important;
    visibility: visible !important;

    transform:
        translate(-50%, -50%)
        scale(1) !important;
}

/* 클릭 문구가 길 경우 줄바꿈 허용 */
.banner-other-button.is-message-shown
.banner-tooltip {
    width: max-content;
    max-width: calc(100% - 18px);

    white-space: normal;
    word-break: keep-all;
}

/* 키보드 포커스 테두리가 필요 없을 경우 */
.banner-other-button:focus {
    outline: none;
}

/* 모든 종류의 배너 커서 통일 */
#banner_board .banner-home-copy,
#banner_board .banner-external-link,
#banner_board .banner-other-button {
    cursor: default !important;
}

/* ========================================
   배너 버튼 형태 보강
   기존 떠오름·밝아짐·툴팁 효과는 건드리지 않음
======================================== */

.banner-hover-card {
    box-sizing: border-box;
    border-radius: 6px;
    isolation: isolate;

    /* 평상시에도 살짝 떠 있는 버튼 같은 깊이 */
    box-shadow:
        0 2px 0 rgba(71, 85, 105, 0.22),
        0 4px 8px rgba(15, 23, 42, 0.12);
}

/* 이미지 위에 얇은 테두리와 안쪽 하이라이트 추가 */
.banner-hover-card::after {
    content: "";
    position: absolute;
    z-index: 3;
    inset: 0;

    border-radius: inherit;
    pointer-events: none;

    box-shadow:
        inset 0 0 0 1px rgba(71, 85, 105, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.75),
        inset 0 -2px 0 rgba(71, 85, 105, 0.10);
}

.banner-hover-card:active::after {
    box-shadow:
        inset 0 0 0 1px rgba(71, 85, 105, 0.38),
        inset 0 2px 5px rgba(15, 23, 42, 0.22);
}