/*
 * 통합 레이어/배너 — 골격 조각의 스타일 (건·전 공용 한 벌).
 *
 * 싣는 곳 = 레이아웃 4종의 레이어 컨테이너. 열기·닫기는 로더(`js/shared/display/loader.js`).
 *
 * 선언의 출처 = CI3 이미지형 레이어 조각 안 <style> + 공용 CSS(`common.css` 의 `.center_layer_wrap`·
 * `#blackPanel` · `ij_layout.css` 의 `.ij_popup`·`.ij_checkbox`·`.ij_btn`·`.submitWrap`). 재구축 레이아웃은 이 아톰들을 전역으로
 * 갖고 있지 않아(화면마다 자기 CSS 에 옮겨 쓴다) 골격이 쓰는 만큼만 여기로 옮겼다.
 *
 * ⚠ 선택자는 전부 레이어 컨테이너(`#display_layers`) 또는 조각 루트(`.display_banner`) 안쪽만 가리킨다 — 화면의 같은 이름 아톰에 새지 않게.
 * ⚠ 자리별 배치 보정(CI3 `resource/common/css/display.css` 의 `#display_banner_*` 규칙)은 여기 없다 — 그 자리를 끼우는 화면의 자리 시트가 더한다.
 */

/* 브랜드 색 — 헤더·기본 버튼(CI3 `body.jungi` 초록 화이트리스트 안).
   레이아웃마다 토큰 유무가 달라(팝업·업체정보 레이아웃은 `layout.css` 를 싣지 않는다) 여기서 사이트 값으로 직접 가른다. */
#display_layers { --display-brand: #3267e9; }
body[data-site="jungi"] #display_layers,
body.jungi #display_layers { --display-brand: #00993a; }

/* 덮개 — CI3 `#blackPanel`(common.css:48 · 50% 어둡기). 페이지의 다른 덮개와 id 가 겹치지 않게 클래스로 둔다. */
#display_layers .display-dimmer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000000;
    background: rgba(0, 0, 0, .5);
}

/* ── 팝업 아톰 — ij_layout.css:2525-2620 ── */
#display_layers .ij_popup {
    position: relative;
    width: 100%;
    background: #ffffff;
    box-sizing: border-box;
}
#display_layers .ij_popup header {
    height: 60px;
    padding: 0 30px;
    font-weight: 700;
    line-height: 60px;
    font-size: 24px;
    color: #fff;
    background-color: var(--display-brand);
}
#display_layers .ij_popup header .close {
    position: absolute;
    top: -2px;
    right: 20px;
    width: 19px;
    height: 19px;
    cursor: pointer;
}
#display_layers .ij_popup section { padding: 30px; }
#display_layers .ij_popup footer.close_layer {
    text-align: right;
    background-color: #000000;
    width: 100%;
    padding: 0 4px 2px;
    box-sizing: border-box;
}
#display_layers .ij_popup footer.close_layer div {
    color: #ffffff;
    font-size: 12px;
    line-height: 18px;
}
#display_layers .me-4 { margin-right: 24px !important; }
#display_layers .pb-0 { padding-bottom: 0 !important; }

/* 체크박스 아톰 — ij_layout.css:255-355. 파랑 고정 — CI3 body.jungi 초록 화이트리스트 밖 */
#display_layers input.ij_checkbox[type="checkbox"] {
    position: absolute;
    opacity: 0;
}
#display_layers input.ij_checkbox[type="checkbox"] + div {
    margin-right: 4px;
    box-sizing: border-box;
    position: relative;
    padding-left: 20px;
    display: inline-block;
    line-height: 16px;
    vertical-align: baseline;
}
#display_layers input.ij_checkbox[type="checkbox"] + div:hover {
    color: #3267e9;
    cursor: pointer;
}
#display_layers input.ij_checkbox[type="checkbox"] + div:before {
    position: absolute;
    top: 1px;
    left: 0;
    display: inline-block;
    content: "";
    border: 1px solid #3267e9;
    border-radius: 2px;
    background: #ffffff;
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    cursor: pointer;
}
#display_layers input.ij_checkbox.dark[type="checkbox"] + div { color: #ffffff; }
#display_layers input.ij_checkbox.dark[type="checkbox"] + div:hover { color: #fffacd; }

/* ── 이미지형 레이어 — 원문 조각의 <style> ── */
#display_layers .mainLayerWrap {
    width: 100%;
    height: 0;
    position: absolute;
    margin-top: 20px;
    z-index: 1000000;
}
#display_layers .mainLayerWrap .ij_popup {
    width: 600px;
    margin: 0 auto;
}
#display_layers .mainLayerWrap .mainLayerContent {
    width: 600px;
    position: relative;
}
#display_layers .mainLayerWrap .mainLayerContent img {
    display: block;
    width: 600px;
    max-width: 100%;
}
#display_layers .mainLayerWrap .mainLayerContent a {
    display: block;
    cursor: pointer;
}
#display_layers .mainLayerWrap .btn-close {
    width: 34px;
    height: 34px;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, .45);
    border: 0;
    border-radius: 17px;
    color: #fff;
    font-size: 20px;
    line-height: 34px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    opacity: 1;
}
#display_layers .mainLayerWrap .close_layer {
    position: static;
    margin-top: 4px;
}

/* ── 공지형 레이어 — common.css:121-139(.center_layer_wrap) + 원문 공지 레이어의 인라인 스타일 ──
   원문 규칙의 `display: none` 은 옮기지 않았다 — 조각 루트가 인라인으로 숨긴 채 내려오고 로더가 연다. */
#display_layers .center_layer_wrap {
    position: absolute;
    z-index: 1000000;
    width: 100%;
    margin-top: 20px;
    height: 0;
}
#display_layers .center_layer_wrap > div {
    width: 1000px;
    margin: 0 auto;
    height: 0;
}
#display_layers .center_layer_wrap > div > div {
    margin: 0 auto;
    width: 600px;
    position: relative;
    height: 600px;
}
/* 나의방 갈래(자리 `layer_myroom` — 조각이 나의방이면 바깥 클래스를 이것으로 바꾼다 · 63) — common.css:113-115(건 · 전 `common_jungi.css` 같음).
   화면에 고정(fixed · 위 153px)이라 목록을 내려도 제자리다. 원문 나의방은 그림형 레이어 <style> 을 싣지 않아 위 `.mainLayerWrap` 의 위 여백 20px 이 없다 — 되돌린다. */
#display_layers .myroom_center_layer_wrap {
    position: fixed;
    z-index: 1000000;
    width: 100%;
    top: 153px;
    margin-top: 0;
    height: 0;
}
#display_layers .myroom_center_layer_wrap > div {
    width: 1000px;
    margin: 0 auto;
    height: 0;
}
#display_layers .myroom_center_layer_wrap > div > div {
    margin: 0 auto;
    width: 600px;
    position: relative;
    height: 600px;
}
#display_layers .center_layer_wrap .ij_popup section { padding: 38px 28px; }
#display_layers .center_layer_wrap table { width: 100%; }
#display_layers .center_layer_wrap th.left { text-align: left; }
#display_layers .center_layer_wrap .notice-title {
    font-size: 18px;
    font-weight: bold;
    color: red;
}
#display_layers .center_layer_wrap .notice-content {
    line-height: 1.8em;
    font-size: 14px;
}
#display_layers .center_layer_wrap .bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    height: 25px;
    padding: 0 10px 0 0;
    background-color: #0e0e0e;
    color: #fff;
    box-sizing: border-box;
    position: relative;
}
#display_layers .center_layer_wrap .bar > label {
    cursor: pointer;
    display: flex;
}
#display_layers .center_layer_wrap .bar input[type="checkbox"] {
    display: inherit;
    cursor: pointer;
}

/* 제출 영역·버튼 아톰 — ij_layout.css:106-119 · 1331-1345 · 1381-1427 · 1639-1642 */
#display_layers .submitWrap {
    width: 100%;
    text-align: center;
    padding: 40px 0 20px;
}
#display_layers .submitWrap button {
    margin-right: 8px;
    width: 150px;
}
#display_layers .submitWrap button:last-child { margin-right: 0; }
#display_layers button.ij_btn {
    font-size: 13px;
    font-weight: 500;
    padding: 4px 8px 5px;
    color: #5c667b;
    border: 1px solid #aab6cb;
    box-sizing: border-box;
    vertical-align: baseline;
    background-color: #fff;
    cursor: pointer;
}
#display_layers button.ij_btn.primary {
    color: var(--display-brand);
    border: 1px solid var(--display-brand);
}
#display_layers button.ij_btn.primary:hover {
    color: #fff;
    background-color: var(--display-brand);
}
#display_layers button.ij_btn.cancel {
    color: #5c667b;
    border: 1px solid #aab6cb;
}
#display_layers button.ij_btn.cancel:hover {
    color: #fff;
    border-color: #aab6cb;
    background: #aab6cb;
}
#display_layers button.ij_btn.medium {
    font-size: 14px;
    padding: 9px 35px;
}

/* ── 이미지형 배너 — 원문 조각의 인라인 스타일. 크기·여백은 자리(컨테이너)가 정한다 ── */
.display_banner { width: 100%; }
.display_banner > a {
    display: block;
    cursor: default;
}
.display_banner > a.is-clickable { cursor: pointer; }
.display_banner > a > img {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* ── 자리 로딩 상태 — 로더가 응답을 기다리는 동안 자리 컨테이너에 `is-loading` 을 단다(`loader.js` · 요청 직전 → 조각 삽입·finish 때 해제).
   여기는 공용 모양(연회색 맥박)뿐이다 — 어느 자리에 어떤 크기의 상자를 그릴지는 자리 시트(`slots-*.css`)가 자리마다 정한다(규칙이 없는 자리 = 아무것도 안 그림).
   `display: contents` 자리(홈 중앙·우측)는 자기 상자가 없어 의사요소로 그린다 — 의사요소는 contents 요소에서도 상자를 만든다.
   ⚠ 원문 통합 판(`display.js` · `display.css`)에는 없는 상태다 — 재구축의 UX 보강.
   로드 실패 표식(`is-failed`)은 같은 상자를 맥박 없이 남긴다 — 맥박은 기다리는 동안(`is-loading`)에만 건다. */
:root { --display-skeleton-bg: #eef1f5; }
@keyframes display-skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
}
[id^="display_banner_"].is-loading,
[id^="display_slide_"].is-loading,
[id^="display_banner_"].is-loading::before,
[id^="display_banner_"].is-loading::after { animation: display-skeleton-pulse 1.4s ease-in-out infinite; }
