/* ********** 홈페이지 팝업 ********** */
/* 관리자(교정비서) 팝업 미리보기도 같은 내용의 파일(hansung/public/css/hp_popup.css)을 사용하므로 수정 시 두 파일을 같이 고칠 것 */
/* --hp_vw, --hp_vh : 화면 크기. 홈페이지는 실제 화면 크기, 미리보기는 미리보기 화면 크기를 넣는다 */
/* --hp_popup_color, --hp_popup_font : 업체 홈페이지 대표색·글꼴. 지정하지 않으면 남색(#0a2381)·나눔스퀘어 */

/* 팝업 묶음(표시 방식별로 하나) */
.hp_popup_layer {
	position: fixed;
	z-index: 10000;
	font-family: var(--hp_popup_font, "NanumSquare", "Noto Sans KR", sans-serif);
	font-size: 15px;
	line-height: 1.6;
	color: #191f26;
	letter-spacing: -0.02em;
}
.hp_popup_layer * {
	box-sizing: border-box;
}

/* 중앙: 화면 전체를 어둡게 하고 가운데에 띄운다 */
.hp_popup_layer.hp_popup_center {
	top: 0;
	left: 0;
	width: var(--hp_vw, 100vw);
	height: var(--hp_vh, 100vh);
	display: flex;
	align-items: center;
	justify-content: center;
}
.hp_popup_dim {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
}

/* 우측 하단: 배경을 막지 않고 구석에 띄운다 */
.hp_popup_layer.hp_popup_corner {
	right: 24px;
	bottom: 24px;
}

/* 팝업 상자: 화면보다 커질 수 없게 최대 크기를 화면 크기 - 여백으로 막는다 */
.hp_popup_box {
	position: relative;
	display: flex;
	flex-direction: column;
	max-width: calc(var(--hp_vw, 100vw) - 32px);
	max-height: calc(var(--hp_vh, 100vh) - 32px);
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.hp_popup_corner .hp_popup_box {
	max-width: calc(var(--hp_vw, 100vw) - 48px);
	max-height: calc(var(--hp_vh, 100vh) - 48px);
}

/* 팝업 한 건. 크기는 작게/보통/크게 세 가지만 쓴다 */
.hp_popup_item {
	display: none;
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	/* 팝업 글을 끝까지 스크롤해도 뒤 페이지까지 이어서 스크롤되지 않게 */
	overscroll-behavior: contain;
	width: 480px;
	max-width: 100%;
}
.hp_popup_item.on {
	display: flex;
	flex-direction: column;
}
.hp_popup_item > * {
	flex-shrink: 0;
}
.hp_popup_item.hp_popup_size_s {
	width: 360px;
}
.hp_popup_item.hp_popup_size_m {
	width: 480px;
}
.hp_popup_item.hp_popup_size_l {
	width: 640px;
}

/* 이미지: 상자 폭에 맞춰 줄어든다 */
.hp_popup_img {
	display: block;
	position: relative;
}
.hp_popup_img_link {
	display: block;
}
.hp_popup_img img {
	display: block;
	width: 100%;
	height: auto;
	/* 세로로 아주 긴 이미지도 스크롤 없이 한 화면에 다 보이도록 높이를 제한(남는 좌우는 흰 여백) */
	max-height: calc(var(--hp_vh, 100vh) - 140px);
	object-fit: contain;
}

/* ***** 이미지/글 배치 (이미지와 글이 둘 다 있을 때만 적용) ***** */
/* 이미지 위·글 아래, 글 위·이미지 아래: 글이 함께 보이도록 이미지 높이를 화면의 절반으로 제한 */
.hp_popup_item.hp_popup_both .hp_popup_img img {
	max-height: calc(var(--hp_vh, 100vh) * 0.5);
}
.hp_popup_layout_text_top.hp_popup_both .hp_popup_text {
	order: -1;
}

/* 이미지 왼쪽/오른쪽: 가로로 나란히(폭은 크기별로 넓게) */
.hp_popup_item.hp_popup_side.on {
	flex-direction: row;
	align-items: center;
}
.hp_popup_layout_image_right.hp_popup_side.on {
	flex-direction: row-reverse;
}
.hp_popup_item.hp_popup_side.hp_popup_size_s {
	width: 600px;
}
.hp_popup_item.hp_popup_side.hp_popup_size_m {
	width: 760px;
}
.hp_popup_item.hp_popup_side.hp_popup_size_l {
	width: 920px;
}
.hp_popup_side .hp_popup_img {
	flex: 0 0 50%;
	align-self: stretch;
	display: flex;
	align-items: center;
	background: #f8f9fa;
}
.hp_popup_side .hp_popup_img_link,
.hp_popup_side .hp_popup_img > picture {
	width: 100%;
}
.hp_popup_side .hp_popup_img img {
	max-height: calc(var(--hp_vh, 100vh) - 140px);
}
.hp_popup_side .hp_popup_text {
	flex: 1 1 50%;
	min-width: 0;
	align-self: stretch;
	overflow-y: auto;
}

/* 이미지 위에 글 겹치기: 반투명 띠 위에 흰 글씨 (위/가운데/아래) */
.hp_popup_item.hp_popup_overlay {
	position: relative;
}
.hp_popup_overlay .hp_popup_text {
	position: absolute;
	left: 0;
	right: 0;
	max-height: 100%;
	overflow-y: auto;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
}
.hp_popup_overlay .hp_popup_title,
.hp_popup_overlay .hp_popup_body,
.hp_popup_overlay .hp_popup_body * {
	color: #fff !important;
}
.hp_popup_layout_overlay_top.hp_popup_overlay .hp_popup_text {
	top: 0;
}
.hp_popup_layout_overlay_center.hp_popup_overlay .hp_popup_text {
	top: 50%;
	transform: translateY(-50%);
}
.hp_popup_layout_overlay_bottom.hp_popup_overlay .hp_popup_text {
	bottom: 0;
}
.hp_popup_overlay .hp_popup_text .hp_popup_btn {
	border-color: #fff;
}

/* 글(제목/본문/버튼) */
.hp_popup_text {
	padding: 24px 24px 20px;
}
.hp_popup_title {
	margin: 0 0 12px;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.4;
	color: var(--hp_popup_color, #0a2381);
	word-break: keep-all;
}
.hp_popup_body {
	word-break: keep-all;
	overflow-wrap: anywhere;
}
/* 에디터에서 Enter 한 번 = 한 줄로 보이게 문단 사이 여백을 없앤다(빈 줄을 넣으면 그만큼 띄워짐) */
.hp_popup_body p {
	margin: 0;
}
.hp_popup_body img {
	max-width: 100%;
	height: auto;
}
/* 바로가기 버튼: 업체 색을 쓰지 않고 모든 홈페이지에서 같은 기본 모양(연한 회색 바탕 + 회색 테두리) */
.hp_popup_btn {
	display: block;
	padding: 11px 16px;
	border: 1px solid #c9ced6;
	border-radius: 6px;
	background: #f1f3f5;
	color: #222 !important;
	font-weight: 700;
	text-align: center;
	text-decoration: none !important;
	transition: background 0.2s, border-color 0.2s;
}
.hp_popup_btn:hover {
	border-color: #8e97a3;
	background: #e2e5e9;
}

/* ***** 버튼 위치 ***** */
/* 글 아래: 본문 다음 */
.hp_popup_btn_wrap {
	margin-top: 16px;
}
/* 팝업 맨 아래: 이미지·글이 어떤 순서든 항상 마지막 */
.hp_popup_btn_area {
	order: 1;
	padding: 16px 24px 20px;
}
.hp_popup_btn_area .hp_popup_btn_wrap {
	margin-top: 0;
}
/* 이미지 왼쪽/오른쪽 배치에서는 한 줄을 다 차지하도록 */
.hp_popup_item.hp_popup_side.on {
	flex-wrap: wrap;
}
.hp_popup_side .hp_popup_btn_area {
	flex: 0 0 100%;
}
/* 이미지 위에 겹치기: 이미지 아래쪽 안에 띄운다 */
.hp_popup_btn_wrap.hp_popup_btn_overlay {
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 16px;
	margin-top: 0;
}
.hp_popup_btn_overlay .hp_popup_btn {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* ***** 버튼 모양: 가로 꽉 채우기(기본) / 가운데 / 왼쪽 / 오른쪽 ***** */
.hp_popup_btn_align_center,
.hp_popup_btn_align_left,
.hp_popup_btn_align_right {
	display: flex;
}
.hp_popup_btn_align_center {
	justify-content: center;
}
.hp_popup_btn_align_left {
	justify-content: flex-start;
}
.hp_popup_btn_align_right {
	justify-content: flex-end;
}
.hp_popup_btn_align_center .hp_popup_btn,
.hp_popup_btn_align_left .hp_popup_btn,
.hp_popup_btn_align_right .hp_popup_btn {
	display: inline-block;
	min-width: 160px;
	padding: 10px 28px;
}

/* 여러 건일 때 넘기기 */
.hp_popup_nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	flex: 0 0 auto;
	padding: 8px 0;
	border-top: 1px solid #e3e5e8;
	font-size: 13px;
	color: #767678;
}
.hp_popup_nav button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 1px solid #d7dce5;
	border-radius: 50%;
	background: #fff;
	color: #555;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.hp_popup_nav button:hover {
	border-color: #8e97a3;
	background: #f3f4f6;
}

/* 하단 버튼줄: 업체 색 없이 모든 홈페이지 같은 기본 모양(흰 바탕 + 위쪽 얇은 선). 왼쪽 '다시 보지 않기', 오른쪽 '닫기'
   높이·줄높이를 직접 정해서 다른 화면의 버튼 공통 스타일(높이 고정 등)이 있어도 글자가 가운데에 온다 */
.hp_popup_footer {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	height: 50px;
	padding: 0 10px 0 16px;
	border-top: 1px solid #e3e5e8;
	background: #fff;
}
.hp_popup_footer button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	height: 32px;
	margin: 0;
	padding: 0 6px;
	border: 0;
	background: transparent;
	color: #555;
	font-family: inherit;
	font-size: 14px;
	line-height: 1;
	letter-spacing: -0.02em;
	white-space: nowrap;
	cursor: pointer;
	transition: color 0.2s, background 0.2s, border-color 0.2s;
}
/* 다시 보지 않기: 앞에 체크 상자 모양 */
.hp_popup_footer .hp_popup_hide::before {
	content: "";
	flex: 0 0 auto;
	width: 15px;
	height: 15px;
	border: 1.5px solid #b5bcc6;
	border-radius: 3px;
	box-sizing: border-box;
}
.hp_popup_footer .hp_popup_hide:hover {
	color: #222;
}
.hp_popup_footer .hp_popup_hide:hover::before {
	border-color: #8e97a3;
}
/* 닫기: 오른쪽 끝, 연한 회색 바탕 + 회색 테두리 + x 표시 */
.hp_popup_footer .hp_popup_close {
	margin-left: auto;
	padding: 0 14px;
	border: 1px solid #c9ced6;
	border-radius: 6px;
	background: #f1f3f5;
	color: #222;
	font-weight: 700;
}
.hp_popup_footer .hp_popup_close::after {
	content: "\2715";
	font-size: 12px;
	font-weight: 400;
}
.hp_popup_footer .hp_popup_close:hover {
	border-color: #8e97a3;
	background: #e2e5e9;
}

/* 상단 띠배너: 화면 맨 위에 한 줄로 띄운다 */
.hp_popup_layer.hp_popup_bar {
	top: 0;
	left: 0;
	width: var(--hp_vw, 100vw);
}
.hp_popup_bar_item {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 48px;
	padding: 8px 16px 8px 24px;
	background: var(--hp_popup_color, #0a2381);
	color: #fff;
}
.hp_popup_bar_item + .hp_popup_bar_item {
	border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.hp_popup_bar_text {
	flex: 1 1 auto;
	min-width: 0;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.hp_popup_bar_text a {
	color: #fff !important;
	text-decoration: none !important;
}
.hp_popup_bar_item .hp_popup_bar_link {
	flex: 0 0 auto;
	padding: 4px 12px;
	border: 1px solid rgba(255, 255, 255, 0.6);
	border-radius: 999px;
	color: #fff !important;
	font-size: 13px;
	text-decoration: none !important;
	white-space: nowrap;
}
.hp_popup_bar_item button {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	height: 30px;
	margin: 0;
	padding: 0 8px;
	border: 0;
	background: transparent;
	color: #fff;
	font-family: inherit;
	font-size: 13px;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
}
.hp_popup_bar_item .hp_popup_close {
	font-size: 20px;
	line-height: 1;
}

/* ***** 모바일(폭 768px 미만) : 중앙/우측하단 모두 화면 아래에서 올라오는 형태 ***** */
.hp_popup_mobile.hp_popup_center {
	align-items: flex-end;
}
.hp_popup_mobile.hp_popup_corner {
	right: 0;
	bottom: 0;
	left: 0;
}
/* 모바일에서 중앙 팝업과 우측하단 팝업이 같이 있으면 둘 다 아래에서 올라와 겹치므로, 중앙 팝업을 닫은 뒤에 우측하단 팝업을 보여준다 */
.hp_popup_mobile.hp_popup_center ~ .hp_popup_mobile.hp_popup_corner {
	display: none;
}
.hp_popup_mobile .hp_popup_box {
	width: var(--hp_vw, 100vw);
	max-width: var(--hp_vw, 100vw);
	max-height: calc(var(--hp_vh, 100vh) * 0.85);
	border-radius: 16px 16px 0 0;
}
.hp_popup_mobile .hp_popup_item {
	width: 100%;
}
.hp_popup_mobile .hp_popup_img img {
	max-height: calc(var(--hp_vh, 100vh) * 0.85 - 110px);
}
/* 모바일은 폭이 좁아 이미지 왼쪽/오른쪽 배치도 이미지 위·글 아래로 쌓는다 */
.hp_popup_mobile .hp_popup_item.hp_popup_side.on {
	flex-direction: column;
	align-items: stretch;
	width: 100%;
}
.hp_popup_mobile .hp_popup_side .hp_popup_img {
	flex-basis: auto;
}
.hp_popup_mobile .hp_popup_side .hp_popup_img img {
	max-height: calc(var(--hp_vh, 100vh) * 0.4);
}
.hp_popup_mobile .hp_popup_side .hp_popup_text {
	overflow-y: visible;
}
.hp_popup_mobile .hp_popup_title {
	font-size: 18px;
}
.hp_popup_mobile .hp_popup_text {
	padding: 20px 20px 16px;
}
.hp_popup_mobile .hp_popup_btn_area {
	padding: 12px 20px 16px;
}
/* 휴대폰: 손가락으로 누르기 쉽게 하단 줄을 조금 높게 */
.hp_popup_mobile .hp_popup_footer {
	height: 56px;
}
.hp_popup_mobile .hp_popup_footer button {
	height: 36px;
}
.hp_popup_mobile .hp_popup_bar_item {
	padding: 8px 8px 8px 16px;
}
.hp_popup_mobile .hp_popup_bar_hide {
	display: none;
}

/* ***** 한국교정기술원(kcti) 홈페이지 모양 : 상위 요소에 hp_popup_theme_kcti 가 있을 때 적용 *****
   창 모서리·그림자만 업체 홈페이지에 맞춘다(버튼은 모든 홈페이지 공통 기본 모양) */
.hp_popup_theme_kcti .hp_popup_box {
	border-radius: 20px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
/* 휴대폰: 아래에서 올라오는 창 윗모서리 */
.hp_popup_theme_kcti .hp_popup_mobile .hp_popup_box {
	border-radius: 20px 20px 0 0;
}

/* ***** 대영티엠아이(dytmi) 홈페이지 모양 : 상위 요소에 hp_popup_theme_dytmi 가 있을 때 적용 *****
   창 모서리·그림자만 업체 홈페이지에 맞춘다(버튼은 모든 홈페이지 공통 기본 모양) */
.hp_popup_theme_dytmi .hp_popup_box {
	border-radius: 6px;
	box-shadow: 0 16px 40px rgba(16, 33, 92, 0.3);
}
/* 휴대폰: 아래에서 올라오는 창 윗모서리 */
.hp_popup_theme_dytmi .hp_popup_mobile .hp_popup_box {
	border-radius: 10px 10px 0 0;
}

/* ***** 한국측정기술원(korea) 홈페이지 모양 : 상위 요소에 hp_popup_theme_korea 가 있을 때 적용 *****
   창 모서리·그림자만 업체 홈페이지에 맞춘다(버튼은 모든 홈페이지 공통 기본 모양) */
.hp_popup_theme_korea .hp_popup_box {
	border-radius: 0;
	box-shadow: 0 16px 40px rgba(12, 33, 54, 0.35);
}
/* 휴대폰: 아래에서 올라오는 창 윗모서리 */
.hp_popup_theme_korea .hp_popup_mobile .hp_popup_box {
	border-radius: 0;
}

/* ***** 유진코퍼레이션(yujin) 홈페이지 모양 : 상위 요소에 hp_popup_theme_yujin 이 있을 때 적용 *****
   창 모서리·그림자만 업체 홈페이지에 맞춘다(버튼은 모든 홈페이지 공통 기본 모양) */
.hp_popup_theme_yujin .hp_popup_box {
	border-radius: 14px;
	box-shadow: 0 16px 40px rgba(33, 37, 41, 0.3);
}
/* 휴대폰: 아래에서 올라오는 창 윗모서리 */
.hp_popup_theme_yujin .hp_popup_mobile .hp_popup_box {
	border-radius: 14px 14px 0 0;
}

/* ***** 한국투엠(k2m) 홈페이지 모양 : 상위 요소에 hp_popup_theme_k2m 이 있을 때 적용 *****
   창 모서리·그림자만 업체 홈페이지에 맞춘다(버튼은 모든 홈페이지 공통 기본 모양) */
.hp_popup_theme_k2m .hp_popup_box {
	border-radius: 0;
	box-shadow: 0 16px 40px rgba(33, 37, 41, 0.35);
}
/* 휴대폰: 아래에서 올라오는 창 윗모서리 */
.hp_popup_theme_k2m .hp_popup_mobile .hp_popup_box {
	border-radius: 0;
}

/* ***** 성우표준기술연구원(swcms) 홈페이지 모양 : 상위 요소에 hp_popup_theme_swcms 가 있을 때 적용 *****
   창 모서리·그림자만 업체 홈페이지에 맞춘다(버튼은 모든 홈페이지 공통 기본 모양) */
.hp_popup_theme_swcms .hp_popup_box {
	border-radius: 16px;
	box-shadow: 0 16px 40px rgba(17, 24, 39, 0.25);
}
/* 휴대폰: 아래에서 올라오는 창 윗모서리 */
.hp_popup_theme_swcms .hp_popup_mobile .hp_popup_box {
	border-radius: 16px 16px 0 0;
}
