/* 사용자 공통 레이어 팝업 — 등록 위치마다 창을 따로 띄우고, 떠 있는 동안 배경을 어둡게 */
#site-popup-mount {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 1000010;
}

.site-popup-backdrop {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: auto;
	background: rgba(0, 0, 0, 0.6);
}

.site-popup-carousel {
	pointer-events: auto;
	position: fixed;
	left: 50%;
	top: 50%;
	z-index: 1;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	width: 480px;
	height: 734px;
	max-width: calc(100vw - 16px);
	max-height: calc(100vh - 16px);
	overflow: hidden;
	transform: translate(-50%, -50%);
	background: #fff;
	border: 0;
	border-radius: 24px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
	color: #18171c;
}

.site-popup-carousel__viewport {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	height: auto;
	min-height: 0;
	overflow: hidden;
	cursor: grab;
	touch-action: pan-y;
	user-select: none;
}

.site-popup-carousel__viewport:active {
	cursor: grabbing;
}

.site-popup-carousel__track {
	display: flex;
	flex: 1 1 auto;
	height: 100%;
	min-height: 0;
	transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.site-popup-carousel__track.is-dragging {
	transition: none;
}

.site-popup-carousel__slide {
	flex: 0 0 100%;
	width: 100%;
	min-width: 100%;
	height: 100%;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}

.site-popup-carousel__dots {
	display: none;
}

.site-popup-carousel__dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.45);
	cursor: pointer;
}

.site-popup-carousel__dot.is-active {
	background: #fff;
}

/* 레이어 셸 — 슬라이드 안 본문·닫기 영역 */
.site-popup-layer {
	pointer-events: auto;
	position: fixed;
	z-index: 1;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	max-width: calc(100vw - 16px);
	max-height: calc(100vh - 16px);
	overflow: hidden;
	border-radius: 0px;
	background-color: #fff;
	border: 1px solid #e6e6e6;
	box-shadow: 0 24px 60px rgba(17, 17, 17, 0.18);
	font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
	color: #171717;
}

.site-popup-layer__head {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	padding: 5px 10px;
	background: transparent;
	border-bottom: 1px solid #eee;
	cursor: grab;
	touch-action: none;
	display: none;
}

.site-popup-layer__title {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-family: inherit;
	font-size: 1.125rem;
	font-weight: 700;
	letter-spacing: -0.04em;
	line-height: 1.35;
	color: #171717;
}

.site-popup-layer__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	transform: translateY(-50%);
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	color: #18171c;
	box-shadow: none;
	cursor: pointer;
}

.site-popup-layer__nav--prev {
	left: 12px;
}

.site-popup-layer__nav--next {
	right: 12px;
}

.site-popup-layer__nav svg {
	width: 18px;
	height: 18px;
	display: block;
}

.site-popup-layer__nav:hover,
.site-popup-layer__nav:focus-visible {
	background: #fff;
	color: #18171c;
	outline: none;
}

.site-popup-layer__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
	overscroll-behavior: contain;
	padding: 0;
	font-family: inherit;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: inherit;
	background: transparent;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
}

.site-popup-layer__body-main {
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
	height: 100%;
	max-width: 100%;
	overflow: hidden;
	cursor: grab;
	/* 에디터 본문은 일반 문서처럼 블럭이 위에서 아래로 쌓이게 표시 */
	display: block;
	box-sizing: border-box;
	touch-action: none;
}
.site-popup-layer__body-main p:has(> img:only-child) {
	line-height: 0;
	font-size: 0;
}

.site-popup-layer__body-main > * {
	max-width: 100%;
	min-height: 0;
	flex-shrink: 0;
	box-sizing: border-box;
}

.site-popup-layer__body-main p,
.site-popup-layer__body-main div,
.site-popup-layer__body-main figure {
	margin: 0;
}

.site-popup-layer__body-main img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	max-height: none;
	object-fit: fill;
	margin: 0;
	-webkit-user-drag: none;
	user-select: none;
}

.site-popup-layer__body-main:has(> img:only-child),
.site-popup-layer__body-main:has(> p:only-child > img:only-child),
.site-popup-layer__body-main:has(> div:only-child > img:only-child),
.site-popup-layer__body-main:has(> figure:only-child > img:only-child) {
	padding: 0;
}

.site-popup-layer__body-main:has(img) > p:has(> img:only-child),
.site-popup-layer__body-main:has(img) > div:has(> img:only-child),
.site-popup-layer__body-main:has(img) > figure:has(> img:only-child) {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	overflow: hidden;
}

.site-popup-layer__body-main :first-child {
	margin-top: 0;
}

.site-popup-layer__body-main :last-child {
	margin-bottom: 0;
}

.site-popup-layer__body-main a {
	color: #105bab;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* 팝업 본문 기본 테이블 스타일 — 에디터에서 만든 표가 테두리·셀 간격 그대로 보이게 */
.site-popup-layer__body-main table {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
	margin: 12px 0;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: #171717;
	background: #fff;
}

.site-popup-layer__body-main table th,
.site-popup-layer__body-main table td {
	padding: 8px 10px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	text-align: left;
	vertical-align: middle;
	word-break: break-word;
}

.site-popup-layer__body-main table th {
	background: #f5f6f8;
	font-weight: 700;
}

.site-popup-layer__body-main table caption {
	padding: 6px 0;
	font-weight: 700;
	text-align: left;
}

.site-popup-layer__foot {
	flex: 0 0 45px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	height: 45px;
	margin-top: 0;
	padding: 0 10px;
	background: #fff;
	border: 0;
	font-family: inherit;
	color: #18171c;
	touch-action: none;
}

.site-popup-layer__foot-left {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	align-self: stretch;
}

.site-popup-layer__today,
.site-popup-layer__foot-close {
	margin: 0;
	padding: 1px 6px;
	border: 0;
	border-radius: 0;
	background: transparent;
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	line-height: 17px;
	letter-spacing: 0;
	color: rgba(24, 23, 28, 0.55);
	cursor: pointer;
	white-space: nowrap;
}

.site-popup-layer__today[hidden] {
	display: none;
}

.site-popup-layer__foot-close {
	position: relative;
	flex: 0 0 auto;
	margin-left: auto;
	color: #18171c;
	font-weight: 700;
}

.site-popup-layer__today:hover,
.site-popup-layer__today:focus-visible,
.site-popup-layer__foot-close:hover,
.site-popup-layer__foot-close:focus-visible {
	opacity: 0.7;
	outline: none;
}

/* 드래그 중에는 잡는 커서로 바꾸고 텍스트 선택을 막는다 */
.site-popup-layer.is-dragging,
.site-popup-layer.is-dragging * {
	cursor: grabbing !important;
	user-select: none !important;
}

/* 크기 측정 중에는 고정 높이 전제의 레이아웃 규칙을 끄고 실제 내용 크기를 잰다 */
.site-popup-layer.is-measuring {
	visibility: hidden;
}

.site-popup-layer.is-measuring .site-popup-layer__body {
	height: auto;
	overflow: visible;
	justify-content: flex-start;
}

.site-popup-layer.is-measuring .site-popup-layer__body-main {
	display: block;
	height: auto;
	overflow: visible;
}

.site-popup-layer.is-measuring .site-popup-layer__body-main:has(img) > p:has(> img:only-child),
.site-popup-layer.is-measuring .site-popup-layer__body-main:has(img) > div:has(> img:only-child),
.site-popup-layer.is-measuring .site-popup-layer__body-main:has(img) > figure:has(> img:only-child) {
	display: block;
	height: auto;
}

/* 폭·높이·좌표는 site-popup.js 가 뷰포트에 맞춰 계산하므로 여기서 덮어쓰지 않는다 */
@media (max-width: 768px) {
	.site-popup-layer__head {
		padding-left: 0;
		padding-right: 0;
	}
	.site-popup-layer__body {
		padding-left: 0;
		padding-right: 0;
	}
	.site-popup-layer__foot {
		padding-left: 16px;
		padding-right: 16px;
	}
}
