/*
 * 메인 팝업 (BOS 「메인 팝업관리」 → TC_MAIN_POPUP)
 * 사용처: lifeStudy/main/lifeStudyMain.jsp, BOS mainPopup/reg.jsp(공지형 미리보기)
 * 공지형 팝업의 모양(update-*)은 MainPopupNoticeRenderer 가 만드는 HTML 과 짝이다.
 */
/*
	BOS 「메인 팝업관리」(TC_MAIN_POPUP)에 등록한 팝업을 화면 안 레이어로 띄운다.
	예전 팝업관리는 새 창(window.open)이라 브라우저 팝업 차단에 걸려 끊겼고,
	그 사이 팝업을 이 파일에 직접 하드코딩해 왔다.

	- 위치는 관리자가 정하지 않는다. 너비만 받고 자동 배치한다.
	  PC          : 노출순서대로 왼쪽부터 한 줄로 나란히.
	                한 줄에 다 안 들어가면 계단식으로 겹친다(앞 순서가 위, 뒤 팝업은 오른쪽 아래로 비켜 가장자리가 보임).
	                다음 줄로 넘기지 않는다 - 넘기면 아래 팝업의 닫기 버튼이 화면 밖으로 나가 닫을 수 없다.
	                한 줄에 들어가는지는 CSS 로 알 수 없어 메인 JSP 스크립트가 재서 is-stacked 를 붙인다.
	  1024px 이하 : 가운데 겹침(앞 순서가 위). 각각 따로 닫는다.
	- 본문이 화면보다 길면 본문만 스크롤시켜 하단 닫기 버튼을 항상 화면 안에 남긴다.
	  (1366x768 노트북은 브라우저 UI 를 빼면 실제 뷰포트가 600px 남짓이다)
*/
.popup-container {
	position: fixed;
	top: 20%;	/* 하드코딩 시절 팝업과 같은 높이 */
	left: 5%;
	right: 5%;
	z-index: 10000;
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: 20px;
	pointer-events: none;
}

/*
	한 줄에 다 안 들어갈 때(스크립트가 붙인다). 각 팝업의 비켜선 거리(left/top)와
	본문 최대 높이는 스크립트가 순서대로 넣는다 - 뒤로 갈수록 아래로 내려가는 만큼 본문을 줄여
	닫기 버튼이 화면 밖으로 나가지 않게 한다.
*/
.popup-container.is-stacked {
	display: block;
}

.popup-container.is-stacked .popup-layer {
	position: absolute;
	top: 0;
	left: 0;
}

.popup-layer {
	display: none;
	position: relative;
	/* 한 줄 배치에서 폭이 모자라도 찌그러뜨리지 않는다. 모자라면 겹치기로 넘어간다 */
	flex-shrink: 0;
	max-width: 100%;
	background-color: #fff;
	border: 1px solid #222;
	box-sizing: border-box;
	line-height: 1;
	font-size: 0;
	pointer-events: auto;
}

.popup-layer .cont {
	max-height: calc(76vh - 46px);
	overflow-y: auto;
}

.popup-layer .popup-image img {
	display: block;
	width: 100%;
	height: auto;
}

/* 유형 HTML(직접입력). 에디터 내용이 그대로 들어온다 */
.popup-html {
	padding: 30px 28px;
	box-sizing: border-box;
	color: #222;
	font-size: 16px;
	line-height: 1.6;
	word-break: keep-all;
}

.popup-html p {
	margin: 0 0 8px;
}

.popup-html img {
	max-width: 100%;
	height: auto;
}

/*
	공지형 꾸밈. 에디터 소스보기에서 class 로 붙여 쓴다.
	(하드코딩 시절 작업 안내 팝업과 같은 모양)
	<span class="update-badge">SERVICE NOTICE</span>
	<h2 class="update-title">제목</h2>
	<p class="update-text">설명</p>
	<div class="update-date-box"><span class="update-date-label">작업 예정 일시</span>
		<strong class="update-date"><span>2026.09.10(목)</span> <span>17:00~20:00</span></strong></div>
	<div class="update-date-box is-important">...<p class="update-note">...</p></div>
*/
.popup-html .update-badge {
	display: inline-flex;
	align-items: center;
	height: 30px;
	padding: 0 12px;
	margin-bottom: 16px;
	background-color: #1375df;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
}

.popup-html .update-title {
	margin: 0 0 12px;
	color: #111;
	font-size: 26px;
	font-weight: 800;
	line-height: 1.3;
}

.popup-html .update-text {
	margin: 0 0 20px;
	color: #444;
	font-size: 16px;
	line-height: 1.65;
}

.popup-html .update-date-box {
	padding: 16px 18px;
	background-color: #f5f8fc;
	border-left: 4px solid #1375df;
}

.popup-html .update-date-label {
	display: block;
	margin-bottom: 6px;
	color: #555;
	font-size: 14px;
	font-weight: 700;
}

.popup-html .update-date {
	display: block;
	color: #111;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.3;
}

/* 날짜와 시각을 각각 통째로 묶어 숫자 중간에서 줄이 갈라지지 않게 한다 */
.popup-html .update-date > span,
.popup-html .nobr {
	display: inline-block;
	white-space: nowrap;
}

.popup-html .update-date-box + .update-date-box {
	margin-top: 12px;
}

.popup-html .is-important .update-date-label {
	color: #111;
	font-size: 16px;
	font-weight: 800;
}

.popup-html .update-note {
	margin: 0;
	color: #444;
	font-size: 14px;
	line-height: 1.6;
}

.popup-html .update-note + .update-note {
	margin-top: 8px;
}

.popup-html .update-note b {
	color: #111;
	font-weight: 700;
}

.popup-layer .popup-footer {
	text-align: right;
	padding: 10px;
	background-color: #333;
	color: #fff;
	font-size: 17px;
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: end;
}

.popup-layer label input[type="checkbox"] {
	transform: none;
}
.popup-layer .popup-footer label {
	display: flex;
	align-items: center;
	gap: 4px;
}

.popup-layer .popup-footer button {
	background-color: #777;
	color: #fff;
	border: 0;
	line-height: 1;
	padding: 5px 10px;
}

@media screen and (max-width: 1024px) {
	.popup-container {
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		display: block;
		max-height: none;
		overflow: visible;
	}

	/* 관리자 너비(인라인 style)보다 우선한다 */
	.popup-layer {
		position: fixed;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
		width: 90vw !important;
		max-width: 400px;
	}

	.popup-layer .cont {
		max-height: calc(88vh - 46px);
	}

	.popup-html {
		padding: 26px 22px 24px;
	}

	.popup-html .update-title {
		font-size: 24px;
	}
}

/*
	공지형 강조 - 관리자 [파란색] 버튼(==글자==).
	색만 바꾼다. 굵기는 [굵게] 버튼이 따로 맡아서 파란색 / 굵게 / 굵은 파란색이 서로 구분된다.
*/
.popup-html .hl {
	color: #1375df;
	font-style: normal;
}
