/* ============ 광고 영역 공통 ============ */
.ad-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tab-bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  overflow: hidden;
}

.ad-label {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ============ 상단 배너 광고 ============ */
.ad-banner-wrap {
  background: var(--bg);
  padding: 14px 0 0;
}

.ad-slot-top {
  width: 100%;
  min-height: 90px;
}

/* ============ 좌/우 사이드 광고 + 본문 레이아웃 ============ */
.page-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 160px;
  gap: 24px;
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 20px;
  align-items: start;
  box-sizing: border-box;
}

.ad-rail {
  position: sticky;
  top: 20px;
}

.ad-slot-rail {
  width: 160px;
  height: 600px;
}

.page-content {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

@media (max-width: 1300px) {
  .page-layout {
    grid-template-columns: 1fr;
    max-width: 1080px;
    padding: 0;
  }
  .ad-rail {
    display: none;
  }
}

/* ============ 팝업 광고 ============ */
.popup-ad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.popup-ad-overlay.hidden {
  display: none;
}

.popup-ad-box {
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  padding: 34px 20px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  max-width: 340px;
  width: 100%;
}

.popup-ad-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--tab-bg);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-ad-close:hover {
  background: var(--border);
}

.ad-slot-popup {
  width: 300px;
  height: 300px;
  max-width: 100%;
}
