/* 대문 광고 슬롯 + 포스터 팝업 — _ad_slot.html, js/ad_slot.js */

/* ── 슬롯 (우측, 통계 바와 높이·바닥선 맞춤) ─────────── */
.ad-slot {
	position: relative;
	float: right;
	clear: right;
	width: 567px;
	height: 100px;
	margin-top: 14px;
	overflow: hidden;
	border-radius: 14px;
	box-shadow: 0 2px 8px rgba(30, 43, 69, .08);
	font-family: 'Nanum Gothic', sans-serif;
}
.ad-track {
	display: flex;
	height: 100%;
	transition: transform .6s cubic-bezier(.4, 0, .2, 1);
}
.ad-slide {
	position: relative;
	display: flex;
	flex: 0 0 100%;
	align-items: center;
	gap: 16px;
	height: 100%;
	margin: 0;
	padding: 0 22px 0 26px;
	box-sizing: border-box;
	overflow: hidden;
	border: 0;
	font: inherit;
	text-align: left;
	cursor: pointer;
}
.ad-slide::after {
	/* 우측 장식 원 */
	content: "";
	position: absolute;
	right: -40px;
	top: -60px;
	width: 200px;
	height: 200px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .08);
	pointer-events: none;
}
.ad-tag {
	position: absolute;
	left: 26px;
	top: 12px;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: -.2px;
}
.ad-body { flex: 1; min-width: 0; padding-top: 16px; }
.ad-title {
	display: block;
	overflow: hidden;
	font-size: 23px;
	font-weight: 800;
	letter-spacing: -1px;
	line-height: 1.25;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.ad-sub { display: block; margin-top: 3px; font-size: 14px; font-weight: 700; opacity: .85; }
.ad-sub b { font-weight: 800; opacity: 1; }
.ad-cta {
	position: relative;
	z-index: 1;
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 2px;
	padding: 9px 12px 9px 16px;
	border-radius: 20px;
	font-size: 14px;
	font-weight: 800;
	transition: transform .2s;
}
.ad-cta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ad-slide:hover .ad-cta, .ad-slide:focus-visible .ad-cta { transform: translateX(3px); }

.ad-s1 { background: linear-gradient(120deg, #1e2b45 0%, #2b4a6b 100%); color: #fff; }
.ad-s1 .ad-tag { background: #38a8bd; color: #fff; }
.ad-s1 .ad-sub b { color: #7fd6e4; }
.ad-s1 .ad-cta { background: #fff; color: #1e2b45; }

.ad-s2 { background: linear-gradient(120deg, #2f9fb4 0%, #38a8bd 60%, #4dbccd 100%); color: #fff; }
.ad-s2 .ad-tag { background: rgba(255, 255, 255, .22); color: #fff; }
.ad-s2 .ad-sub b { color: #fff6c9; }
.ad-s2 .ad-cta { background: #1e2b45; color: #fff; }

.ad-s3 { background: #fff; color: #1e2b45; box-shadow: inset 0 0 0 1px #dbe4ec; border-radius: 14px; }
.ad-s3::after { background: #fdeeee; }
.ad-s3 .ad-tag { background: #fdeeee; color: #e5484d; }
.ad-s3 .ad-sub { color: #6b7a90; opacity: 1; }
.ad-s3 .ad-sub b { color: #e5484d; }
.ad-s3 .ad-cta { background: #e5484d; color: #fff; }

.ad-dots {
	position: absolute;
	right: 22px;
	top: 12px;
	z-index: 2;
	display: flex;
	gap: 5px;
}
.ad-dots button {
	width: 6px;
	height: 6px;
	padding: 0;
	border: 0;
	border-radius: 3px;
	background: rgba(150, 165, 185, .55);
	cursor: pointer;
	transition: width .3s, background .3s;
}
.ad-dots button.is-on { width: 16px; background: #e5484d; }

/* ── 포스터 팝업 ─────────────────────────────────── */
.ad-poster {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 40px 16px;
	overflow-y: auto;
	background: rgba(15, 23, 38, .6);
	font-family: 'Nanum Gothic', sans-serif;
	animation: ap-fade .25s ease-out;
}
.ad-poster[hidden] { display: none; }
html.ap-lock, html.ap-lock body { overflow: hidden; }
.ap-sheet {
	position: relative;
	width: 100%;
	max-width: 880px;
	overflow: hidden;
	border-radius: 20px;
	background: #f4f7fa;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
	color: #1e2b45;
	animation: ap-up .35s cubic-bezier(.2, .9, .3, 1.1);
}
.ap-close {
	position: absolute;
	right: 14px;
	top: 14px;
	z-index: 2;
	width: 38px;
	height: 38px;
	padding: 9px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .15);
	cursor: pointer;
}
.ap-close svg { display: block; width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.ap-close:hover { background: rgba(255, 255, 255, .28); }

.ap-head {
	position: relative;
	padding: 40px 44px 30px;
	overflow: hidden;
	background: linear-gradient(135deg, #1e2b45 0%, #23456a 55%, #2f8fa6 100%);
	color: #fff;
}
.ap-head::before,
.ap-head::after {
	content: "";
	position: absolute;
	border-radius: 50%;
	pointer-events: none;
}
.ap-head::before { right: -80px; top: -120px; width: 340px; height: 340px; background: rgba(56, 168, 189, .25); }
.ap-head::after { right: 140px; bottom: -90px; width: 180px; height: 180px; background: rgba(229, 72, 77, .18); }
.ap-kicker {
	position: relative;
	display: inline-block;
	padding: 5px 12px;
	border-radius: 14px;
	background: rgba(255, 255, 255, .14);
	font-size: 13px;
	font-weight: 700;
}
.ap-title {
	position: relative;
	margin: 14px 0 6px;
	font-size: 46px;
	font-weight: 800;
	letter-spacing: -2px;
	line-height: 1.1;
	color: #fff;
}
.ap-title small { display: block; margin-bottom: 4px; font-size: 22px; letter-spacing: 1px; color: #7fd6e4; }
.ap-topics { position: relative; margin: 0; font-size: 20px; font-weight: 800; color: #fff6c9; }
.ap-topics i { display: inline-block; width: 5px; height: 5px; margin: 0 8px 4px; border-radius: 50%; background: #fff6c9; opacity: .7; }
.ap-info { position: relative; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.ap-info div {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	border-radius: 12px;
	background: rgba(255, 255, 255, .95);
	color: #1e2b45;
}
.ap-info span { padding: 2px 8px; border-radius: 8px; background: #e5484d; color: #fff; font-size: 12px; font-weight: 800; }
.ap-info b { font-size: 16px; font-weight: 800; }

.ap-rooms {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
	padding: 24px 24px 8px;
}
.ap-room {
	padding: 18px 18px 8px;
	border: 1px solid #dbe4ec;
	border-radius: 16px;
	background: #fff;
}
.ap-room.is-dm { grid-column: 1 / -1; border-color: #f6c6c8; }
.ap-room h3 {
	display: inline-block;
	margin: 0 0 8px;
	padding: 5px 12px;
	border-radius: 10px;
	background: #1e2b45;
	color: #fff;
	font-size: 15px;
	font-weight: 800;
}
.ap-room.is-dm h3 { background: #e5484d; }
.ap-room ol { margin: 0; padding: 0; list-style: none; }
.ap-room li {
	display: grid;
	grid-template-columns: 1fr;
	padding: 10px 0;
	border-top: 1px dashed #e6eef3;
}
/* 당뇨관(전체 폭)은 시간 | 강의 2열 */
.ap-room.is-dm li { grid-template-columns: 92px 1fr; column-gap: 12px; }
.ap-room li:first-child { border-top: 0; }
.ap-room time { margin-bottom: 2px; color: #2f9fb4; font-size: 13px; font-weight: 800; }
.ap-room.is-dm time { grid-row: span 2; padding-top: 2px; color: #e5484d; }
.ap-room li p { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.4; letter-spacing: -.3px; }
.ap-room li em { margin-top: 3px; color: #6b7a90; font-size: 13px; font-style: normal; font-weight: 700; }
.ap-badge {
	display: inline-block;
	margin-right: 6px;
	padding: 1px 7px;
	border-radius: 8px;
	background: #fff6c9;
	color: #a06a00;
	font-size: 11px;
	vertical-align: 2px;
}
.ap-note {
	margin: 6px 0 10px;
	padding: 12px 14px;
	border-radius: 12px;
	background: #fdeeee;
	color: #1e2b45;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.5;
}
.ap-note b { color: #e5484d; }
.ap-foot {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 22px;
	padding: 16px 28px 26px;
	color: #6b7a90;
	font-size: 14px;
	font-weight: 700;
}
.ap-foot span { margin-right: 8px; color: #1e2b45; font-weight: 800; }

@keyframes ap-fade { from { opacity: 0; } }
@keyframes ap-up { from { transform: translateY(24px); opacity: 0; } }

@media (max-width: 768px) {
	.ad-slot { float: none; width: 100%; height: 80px; margin: 10px 0 0; }
	.ad-slide { gap: 10px; padding: 0 14px 0 18px; }
	.ad-tag { left: 18px; top: 10px; font-size: 10px; }
	.ad-dots { right: 14px; top: 11px; }
	.ad-body { padding-top: 14px; }
	.ad-title { font-size: 17px; }
	.ad-sub { font-size: 12px; }
	.ad-cta { padding: 7px 8px 7px 12px; font-size: 12px; }

	.ad-poster { padding: 0; }
	.ap-sheet { min-height: 100%; border-radius: 0; }
	.ap-head { padding: 34px 22px 24px; }
	.ap-title { font-size: 34px; }
	.ap-title small { font-size: 18px; }
	.ap-topics { font-size: 16px; }
	.ap-info b { font-size: 14px; }
	.ap-rooms { grid-template-columns: 1fr; gap: 12px; padding: 16px 14px 6px; }
	.ap-room.is-dm li { grid-template-columns: 1fr; }
	.ap-room.is-dm time { grid-row: auto; padding-top: 0; }
	.ap-room li p { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
	.ad-track { transition: none; }
	.ad-poster, .ap-sheet { animation: none; }
}

/* ── 캠페인 영상 슬라이드 (.ad-vid) — 왼쪽 16:9 움직이는 미리보기 + 오른쪽 문구 ───────── */
.ad-vid { gap: 18px; padding-left: 0; background: linear-gradient(120deg, #1e2b45 0%, #26425f 70%, #2b5470 100%); color: #fff; }
.ad-vid .av-thumb { position: relative; flex: none; width: 178px; height: 100%; overflow: hidden; background: #1e2b45; }
.ad-vid .av-loop { display: block; width: 100%; height: 100%; object-fit: cover; }
.ad-vid .av-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(30, 43, 69, 0) 60%, rgba(30, 43, 69, .55) 100%); }
.ad-vid .av-play {
	position: absolute; left: 50%; top: 50%; z-index: 1;
	display: flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; margin: -20px 0 0 -20px;
	border-radius: 50%; background: rgba(255, 255, 255, .92);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
	transition: transform .2s;
}
.ad-vid .av-play svg { width: 18px; height: 18px; margin-left: 3px; fill: #1e2b45; }
.ad-vid:hover .av-play, .ad-vid:focus-visible .av-play { transform: scale(1.1); }
.ad-vid .av-len { position: absolute; right: 6px; bottom: 6px; z-index: 1; padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 10px; font-weight: 800; }
.ad-vid .ad-tag { left: 196px; background: #e5484d; color: #fff; }
.ad-vid .ad-sub b { color: #7fd6e4; }
.ad-vid .ad-cta { background: #fff; color: #1e2b45; }

/* ── 캠페인 영상 창 ───────── */
.ad-video {
	position: fixed; inset: 0; z-index: 10060;
	display: flex; align-items: center; justify-content: center;
	padding: 24px; box-sizing: border-box;
	background: rgba(10, 16, 28, .82);
	animation: ap-fade .25s ease-out;
	font-family: 'Nanum Gothic', sans-serif;
}
.ad-video[hidden] { display: none; }
.av-box { width: 100%; max-width: 960px; animation: ap-up .3s ease-out; }
.av-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: #fff; }
.av-head strong { font-size: 18px; font-weight: 800; letter-spacing: -.5px; }
.av-head small { margin-left: 8px; color: #9fb3c8; font-size: 13px; font-weight: 700; }
.av-close {
	display: flex; flex: none; align-items: center; justify-content: center;
	width: 38px; height: 38px; margin: 0; padding: 0; border: 0; border-radius: 50%;
	background: rgba(255, 255, 255, .16); cursor: pointer; transition: background .2s;
}
.av-close svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; }
.av-close:hover { background: rgba(255, 255, 255, .3); }
.av-frame { position: relative; overflow: hidden; border-radius: 14px; background: #000; box-shadow: 0 16px 50px rgba(0, 0, 0, .45); aspect-ratio: 16 / 9; }
.av-player { display: block; width: 100%; height: 100%; background: #000; }
/* 영상이 끝나면: 다시 보기 · 모프회원 되기 */
.av-end {
	position: absolute; inset: 0;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
	background: rgba(14, 22, 38, .78); color: #fff; text-align: center;
	animation: ap-fade .3s ease-out;
}
.av-end[hidden] { display: none; }
.av-end-msg { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.av-end-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.av-btn {
	display: inline-flex; align-items: center; gap: 6px;
	height: 48px; margin: 0; padding: 0 20px; border: 0; border-radius: 24px;
	font: inherit; font-size: 16px; font-weight: 800; text-decoration: none !important; cursor: pointer;
	transition: transform .15s, background .2s;
}
.av-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.av-btn:hover { transform: translateY(-1px); }
.av-mopf { background: #e5484d; color: #fff !important; box-shadow: 0 6px 18px rgba(229, 72, 77, .35); }
.av-mopf:hover { background: #d43c41; }
.av-replay { background: rgba(255, 255, 255, .16); color: #fff; }
.av-replay:hover { background: rgba(255, 255, 255, .28); }

@media (max-width: 768px) {
	.ad-vid { gap: 12px; padding-left: 0; }
	.ad-vid .av-thumb { width: 142px; }
	.ad-vid .av-play { width: 32px; height: 32px; margin: -16px 0 0 -16px; }
	.ad-vid .av-play svg { width: 14px; height: 14px; }
	.ad-vid .ad-tag { left: 154px; }
	.ad-vid .ad-title { font-size: 16px; }
	.ad-vid .ad-cta { display: none; }
	.ad-video { padding: 12px; }
	.av-head strong { font-size: 16px; }
	.av-end { gap: 12px; }
	.av-end-msg { font-size: 17px; }
	.av-btn { height: 42px; padding: 0 16px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
	.ad-video, .av-box, .av-end { animation: none; }
}
/* 영상·포스터 창이 열려 있는 동안만 Rx 플로팅 버튼(button_addon, z-index 999999)을 배경 뒤로. 닫으면 원래대로 */
html.ap-lock .rx-intervene-floating-btn { z-index: 1000 !important; }
