/* 사용자 공통 레이어 팝업 (user_tb_popup)
 * 홈 .site-modal(뉴스레터 등)과 톤 맞춤 — 각진 카드 · ink/accent · 헤어라인 보더
 */
#site-popup-mount {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 1000010;
	font-family: inherit;
	color: var(--ink, var(--color-dark, #151515));
}

/* 어두운 배경 — 팝업이 있을 때만 JS로 삽입 (.site-modal__backdrop 과 동일 톤) */
.site-popup-backdrop {
	position: fixed;
	inset: 0;
	pointer-events: auto;
	z-index: 0;
	background: rgba(0, 0, 0, 0.45);
}

.site-popup-layer {
	pointer-events: auto;
	position: fixed;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 0;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
	display: flex;
	flex-direction: column;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 32px);
	overflow: hidden;
	overscroll-behavior: contain;
	z-index: 1;
}

.site-popup-layer__head,
.site-popup-layer__title {
	display: none !important;
}

.site-popup-layer__body {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	overscroll-behavior: contain;
	padding: 0;
	font-size: 0.875rem;
	line-height: 1.55;
	color: var(--ink-soft, #333);
}

.site-popup-slides {
	position: relative;
	flex: 1 1 auto;
	width: 100%;
	min-height: 0;
	height: auto;
}

.site-popup-slide {
	display: none;
	box-sizing: border-box;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	padding: 0;
}

.site-popup-slide.is-active {
	display: block;
}

.site-popup-slide--clickable,
.site-popup-slide--clickable img {
	cursor: pointer;
}

/* 슬라이드 본문: 이미지·텍스트 모두 팝업 본문 박스 안에 맞춤 */
.site-popup-slide__content {
	position: absolute;
	inset: 0;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: safe center;
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
	padding: 0;
	overflow-x: hidden;
	overflow-y: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
	container-type: size;
	container-name: popup-slide;
}

.site-popup-slide__content::-webkit-scrollbar {
	width: 0;
	height: 0;
	display: none;
}

.site-popup-slide__content:not(.site-popup-slide__content--image-only) {
	padding: 0.6rem 0.7rem 0.5rem;
}

.site-popup-slide__fit {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	transform-origin: center center;
}

/* 자식 레이아웃은 유지(가로 flex 강제 금지). 블록 자체만 가운데에 둠 */
.site-popup-slide__content > * {
	box-sizing: border-box;
	flex: 0 1 auto;
	max-width: 100%;
	width: auto;
	min-width: 0;
	max-height: 100%;
}

/* 이미지(또는 picture/video)만 있는 슬라이드: 팝업 크기 안에 contain */
.site-popup-slide__content:has(> p:only-child > img:only-child) > p,
.site-popup-slide__content:has(> p:only-child > picture:only-child) > p,
.site-popup-slide__content:has(> figure:only-child) > figure,
.site-popup-slide__content--image-only > * {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 100%;
	max-height: 100%;
	min-width: 0;
	min-height: 0;
	height: 100%;
	margin: 0;
}

.site-popup-slide__content img,
.site-popup-slide__content picture,
.site-popup-slide__content video {
	display: block;
	max-width: 100% !important;
	max-height: 100cqh !important;
	width: auto !important;
	height: auto !important;
	object-fit: contain;
	vertical-align: middle;
	margin-left: auto;
	margin-right: auto;
}

.site-popup-slide__content--image-only {
	padding: 0;
	overflow: hidden;
}

.site-popup-slide__content--image-only img,
.site-popup-slide__content:has(> img:only-child) > img,
.site-popup-slide__content:has(> picture:only-child) > picture,
.site-popup-slide__content:has(> video:only-child) > video,
.site-popup-slide__content:has(> p:only-child > img:only-child) img,
.site-popup-slide__content:has(> p:only-child > picture:only-child) picture,
.site-popup-slide__content:has(> figure:only-child) img {
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: 100cqh !important;
	object-fit: contain;
}

.site-popup-slide__content :first-child {
	margin-top: 0;
}

.site-popup-slide__content :last-child {
	margin-bottom: 0;
}

.site-popup-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
	transition: color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.site-popup-nav--prev {
	left: 0.35rem;
}

.site-popup-nav--next {
	right: 0.35rem;
}

.site-popup-nav:hover {
	color: var(--accent, #F44265);
	opacity: 1;
}

.site-popup-nav:focus-visible {
	outline: 2px solid var(--accent, #F44265);
	outline-offset: 2px;
}

.site-popup-nav__icon {
	display: block;
	width: 1.35rem;
	height: 1.35rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.25;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.site-popup-dots {
	position: static;
	flex: 0 0 auto;
	z-index: 2;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.4rem;
	margin: 0;
	padding: 0.55rem 0.75rem 0.65rem;
	background: #fff;
	border-top: 0;
	pointer-events: none;
}

.site-popup-dot {
	pointer-events: auto;
	width: 0.4rem;
	height: 0.4rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(21, 21, 21, 0.22);
	box-shadow: none;
	cursor: pointer;
	transition: width 0.18s var(--ease, ease), background 0.18s ease;
}

.site-popup-dot:hover {
	background: rgba(21, 21, 21, 0.4);
}

.site-popup-dot.is-active {
	width: 1.15rem;
	background: var(--accent, #F44265);
	box-shadow: none;
}

.site-popup-dot:focus-visible {
	outline: 2px solid var(--accent, #F44265);
	outline-offset: 2px;
}

/* 하단: 왼쪽 오늘 하루 보지 않기 · 오른쪽 닫기 — 홈 모달 헤어라인과 동일 */
.site-popup-layer__foot {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 1rem;
	background: #fff;
	border-top: 1px solid var(--line, #e8e8e8);
	font-family: inherit;
}

.site-popup-layer__foot-left {
	flex: 1;
	min-width: 0;
}

.site-popup-layer__foot label {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	cursor: pointer;
	user-select: none;
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.4;
	color: #767676;
}

.site-popup-layer__foot label input[type="checkbox"] {
	margin: 0;
	accent-color: var(--accent, var(--color-main, #00ced1));
}

.site-popup-layer__foot-close {
	flex: 0 0 auto;
	margin: 0;
	padding: 0.35rem 0.65rem;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 0;
	background: #fff;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--ink, #151515);
	cursor: pointer;
	line-height: 1.3;
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.site-popup-layer__foot-close:hover {
	background: #f0f0f0;
	border-color: rgba(0, 0, 0, 0.28);
	color: var(--ink, #111);
}

.site-popup-layer__foot-close:focus-visible {
	outline: 2px solid var(--accent, var(--color-main, #00ced1));
	outline-offset: 1px;
}

/* 세로 높이 auto + !important 는 JS 인라인 height 를 덮어 본문(flex:1)이 높이 0으로 무너짐 → 사용 금지 */
@media (max-width: 768px) {
	.site-popup-layer {
		width: min(100%, calc(100vw - 20px));
		max-width: calc(100vw - 20px);
		max-height: calc(100vh - 24px);
		height: auto !important;
	}
}
