/* =========================================================
   메인 배너 문구 편집 레이어 (관리자 메인관리 > 배너 행 > 문구 편집)
   ========================================================= */

/* ---------- 배너 행: 문구 요약 ---------- */
.cap-row { display: flex; align-items: flex-start; gap: 10px; }
.cap-row .cap-summary { flex: 1; min-width: 0; border: 1px solid #d1d5db; border-radius: 3px; background: #F8F9FC; padding: 7px 10px; min-height: 40px; }
.cap-row .cap-summary-text { font-size: 14px; color: #1A1D2E; line-height: 1.4; white-space: pre-line; max-height: 40px; overflow: hidden; word-break: keep-all; }
.cap-row .cap-summary-text.is-empty { color: #9AA0B4; }
.cap-row .cap-summary-meta { margin-top: 4px; font-size: 12px; color: #5A6078; display: flex; align-items: center; gap: 6px; }
.cap-row .cap-summary-meta .cap-dot { width: 12px; height: 12px; border-radius: 6px; border: 1px solid #C9CEDC; display: inline-block; }
.cap-row .cap-summary-meta .cap-changed { color: #B55A12; font-weight: 700; }
.cap-row .cap-edit-btn { flex: 0 0 auto; height: 40px; padding: 0 14px; border: 1px solid #002359; color: #002359; background: #fff; border-radius: 3px; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.cap-row .cap-edit-btn:hover { background: #EEF2FC; }
.admin-main-section-guide { margin: -4px 0 8px; font-size: 12px; color: #5A6078; line-height: 1.6; }
.admin-main-modal-footer .cap-dirty-note { margin-right: auto; font-size: 13px; color: #B55A12; font-weight: 700; display: none; }
.admin-main-modal-footer.is-dirty .cap-dirty-note { display: inline; }

/* ---------- 레이어 ---------- */
.cap-modal { position: fixed; inset: 0; z-index: 9200; display: none; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow: auto; background: rgba(0,0,0,.45); font-family: "Pretendard GOV", Pretendard, -apple-system, "Noto Sans KR", sans-serif; color: #1A1D2E; font-size: 14px; }
.cap-modal.is-open { display: flex; }
.cap-modal * { box-sizing: border-box; }
.cap-dialog { position: relative; width: 948px; max-width: 100%; background: #fff; border-radius: 4px; box-shadow: 0 16px 40px rgba(0,0,0,.25); display: flex; flex-direction: column; }
.cap-head { display: flex; justify-content: space-between; align-items: center; padding: 24px 32px 16px; border-bottom: 1px solid #E3E5EC; }
.cap-head h1 { margin: 0; font-size: 18px; font-weight: 700; }
.cap-head h1 small { font-weight: 500; color: #5A6078; font-size: 14px; margin-left: 10px; }
.cap-close { border: 0; background: none; font-size: 24px; cursor: pointer; line-height: 1; color: #333; }
.cap-body { padding: 20px 32px 8px; }
.cap-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 16px 32px 24px; border-top: 1px solid #E3E5EC; }
.cap-notice { display: flex; align-items: center; gap: 12px; margin: 0 32px 16px; padding: 12px 16px; background: #FFF1E6; border: 1px solid #F3C9A6; border-left: 5px solid #E8731A; border-radius: 8px; font-size: 15px; color: #7A3B00; line-height: 1.5; }
.cap-notice b { color: #C4500A; font-weight: 800; }
.cap-notice-icon { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 12px; background: #E8731A; color: #fff; font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }

.cap-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.cap-form .span2 { grid-column: 1 / -1; }
.cap-field { margin-bottom: 14px; }
.cap-field > label.t, .cap-field > .t { display: block; font-size: 13px; font-weight: 700; color: #4A5068; margin-bottom: 6px; }
.cap-field .sub { font-weight: 400; color: #8A90A8; }
.cap-select, .cap-textarea { width: 100%; border: 1px solid #C9CEDC; border-radius: 8px; font: inherit; padding: 8px 10px; background: #fff; }
.cap-textarea { min-height: 76px; resize: vertical; line-height: 1.5; }

.cap-sizes, .cap-pos { display: flex; flex-wrap: wrap; gap: 6px; }
.cap-size, .cap-pos-btn { border: 1px solid #C9CEDC; border-radius: 8px; background: #fff; padding: 6px 0; text-align: center; font: inherit; cursor: pointer; }
.cap-size { width: 54px; }
.cap-pos-btn { width: 72px; }
.cap-size.is-on, .cap-pos-btn.is-on { border-color: #002359; background: #002359; color: #fff; font-weight: 700; }
.cap-size:disabled { color: #B8BED2; background: #F3F4F8; cursor: not-allowed; text-decoration: line-through; }

.cap-colors { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cap-swatch { width: 28px; height: 28px; border-radius: 14px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.cap-swatch.is-on { border-color: #002359; box-shadow: 0 0 0 2px #fff inset; }
.cap-colors input[type="color"] { width: 36px; height: 30px; border: 1px solid #C9CEDC; border-radius: 6px; padding: 2px; background: #fff; }
.cap-colors input[type="text"] { width: 92px; border: 1px solid #C9CEDC; border-radius: 6px; font: inherit; padding: 5px 8px; }

.cap-status { border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.6; }
.cap-status.ok { background: #E8F5EE; color: #1B6B3A; }
.cap-status.warn { background: #FFF1E6; color: #9A4B00; }
.cap-status.bad { background: #FDE9E9; color: #A12626; }
.cap-status b { font-weight: 700; }

details.cap-more { margin-top: 10px; }
details.cap-more summary { cursor: pointer; font-size: 12px; color: #5A6078; }
.cap-guide { font-size: 12px; color: #5A6078; margin-top: 8px; line-height: 1.7; }
.cap-guide table { border-collapse: collapse; width: 100%; margin: 6px 0 8px; }
.cap-guide th, .cap-guide td { border: 1px solid #E3E5EC; padding: 4px 6px; text-align: center; }
.cap-guide th { background: #F3F4F8; font-weight: 600; }
.cap-guide td.now { font-weight: 700; color: #002359; }
.cap-guide td.no { color: #B8BED2; }

.cap-btn { border: 0; border-radius: 8px; padding: 10px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.cap-btn.primary { background: #002359; color: #fff; }
.cap-btn.primary:disabled { background: #B8BED2; cursor: not-allowed; }
.cap-btn.line { background: #fff; border: 1px solid #C9CEDC; color: #2A2F45; }

/* ---------- 미리보기 (실제 크기로 그린 뒤 0.62배 축소) ---------- */
.cap-previews { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 20px; }
.cap-pv-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.cap-pv-head h3 { margin: 0; font-size: 13px; font-weight: 600; }
.cap-pv-head span { font-size: 11px; color: #8A90A8; }
.cap-pv-box { position: relative; overflow: hidden; }
.cap-pv-box.pc { width: 567px; height: 199px; }
.cap-pv-box.mo { width: 224px; height: 232px; }
.cap-pv-box > .cap-banner, .cap-pv-box > .cap-phone { transform: scale(.62); transform-origin: top left; }
.cap-banner { position: relative; overflow: hidden; border-radius: 8px; box-shadow: 4px 4px 20px rgba(0,35,89,.2); background: #D9DDE8; flex-shrink: 0; }
.cap-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cap-banner img[src=""] { display: none; }
.cap-banner.pc { width: 914px; height: 320px; }
.cap-banner.mo { width: 338px; height: 229px; }
.cap-noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #8A90A8; font-size: 16px; }
.cap-banner img:not([src=""]) + .cap-noimg { display: none; }

/* 모바일 페이지 흉내 (360px 폰) */
.cap-phone { width: 360px; height: 372px; background: #fff; border: 1px solid #D5D9E4; border-radius: 10px; overflow: hidden; }
.cap-phone-head { height: 85px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px 0 26px; border-bottom: 1px solid #ECEEF3; }
.cap-phone-logo { width: 200px; height: 48px; background: url(/resources/img/logo_header.png) no-repeat left center / contain; }
.cap-phone-menu { font-size: 14px; font-weight: 700; color: #222; text-align: center; line-height: 1.2; }
.cap-phone-menu i { display: block; width: 22px; height: 2px; background: #222; margin: 6px auto 10px; box-shadow: 0 6px 0 #222, 0 -6px 0 #222; }
.cap-phone-body { padding: 16px 11px 0; }
.cap-phone .cap-banner.mo { box-shadow: 4px 4px 20px rgba(0,35,89,.1); }
.cap-phone-dots { display: flex; justify-content: center; gap: 8px; padding: 14px 0; }
.cap-phone-dots i { width: 8px; height: 8px; border-radius: 4px; background: #B9BDC9; }
.cap-phone-dots i:first-child { width: 20px; background: #2E6BFF; }

/* 실제 .banner-caption 과 동일한 배치 */
.cap-caption {
    position: absolute; left: 2%; bottom: 5%; width: 96%;
    padding: 8px 12px; background: rgba(255,255,255,.7); border-radius: 4px;
    color: #333; font-weight: 600; font-size: 18px; line-height: 1;
    white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; overflow: hidden;
}
.cap-caption.is-top { bottom: auto; top: 5%; }
.cap-banner.pc .cap-caption { max-height: 80px; }   /* 320 * 0.25 */
.cap-banner.mo .cap-caption { max-height: 57px; }   /* 229 * 0.25 */
.cap-limitline { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(255,80,80,.9); pointer-events: none; }
.cap-limitline::after { content: "문구 자리 (25%)"; position: absolute; right: 6px; top: 2px; font-size: 10px; color: #ff5050; background: rgba(255,255,255,.8); padding: 0 4px; border-radius: 3px; }
.cap-banner.pc .cap-limitline { bottom: calc(5% + 80px); }
.cap-banner.mo .cap-limitline { bottom: calc(5% + 57px); }
.cap-banner.pc .cap-limitline.is-top { bottom: auto; top: calc(5% + 80px); }
.cap-banner.mo .cap-limitline.is-top { bottom: auto; top: calc(5% + 57px); }
.cap-banner .cap-limitline.is-top::after { top: auto; bottom: 2px; }

/* 측정용 (화면에 보이지 않음) */
#cap-measure { position: absolute; left: -99999px; top: 0; visibility: hidden; white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; line-height: 1; padding: 0; font-family: "Pretendard GOV", Pretendard, -apple-system, "Noto Sans KR", sans-serif; }

/* ---------- 메인 배너 실제 표시: 여러 줄 + 위치 ---------- */
.top-section .main-banner-slider .banner-caption { white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.top-section .main-banner-slider .banner-caption.is-top { bottom: auto; top: 5%; }
