/* =========================================================
   cms.css — CMS 추가 스타일 (서브페이지, 리치 콘텐츠, 팝업)
   기존 style.css 의 CSS 변수(--ink, --brand, --line ...) 재사용
   ========================================================= */

/* ---------- 서브페이지에서 헤더를 항상 솔리드로 ---------- */
body.subpage .site-header {
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--line);
}
body.subpage .site-header .brand-mark--light { display: none; }
body.subpage .site-header .brand-mark--dark  { display: block; }
body.subpage .site-header .brand-text        { color: var(--ink); }
body.subpage .site-header .brand-text small  { color: var(--ink-3); }
body.subpage .site-header .gnb-link          { color: var(--ink-2); }
body.subpage .site-header .nav-toggle span   { background: var(--ink); }

/* ---------- 서브페이지 상단 배너 ---------- */
.page-hero {
  padding: calc(var(--header-h) + 58px) 0 44px;
  background: linear-gradient(180deg, var(--brand-soft) 0%, #fff 100%);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.page-hero-eyebrow {
  font-family: "Baloo 2", "Pretendard", sans-serif;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 10px;
}
.page-hero-title { font-size: clamp(1.9rem, 4.4vw, 2.7rem); font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.page-hero-lead { color: var(--ink-2); margin-top: 12px; font-size: 1.05rem; }
/* 배너 다음 첫 섹션은 상단 여백 축소 */
.subpage-main > .section:first-child { padding-top: 3.4rem; }

/* ---------- 홈 하단 CTA 배너 ---------- */
.home-cta { padding: 2rem 0 5rem; }
.home-cta-box {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  border-radius: var(--radius-lg, 28px); padding: clamp(32px, 5vw, 56px);
  display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
  box-shadow: var(--shadow-lg);
}
.home-cta-box .section-title { color: #fff; }
.home-cta-box .section-lead { color: rgba(255,255,255,.88); margin-top: 10px; max-width: 30em; }
.home-cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.home-cta-box .btn-ghost { color: #fff; border: 1px solid rgba(255,255,255,.6); background: transparent; }
.home-cta-box .btn-ghost:hover { background: rgba(255,255,255,.14); }
.home-cta-box .btn-primary { background: #fff; color: var(--brand); box-shadow: none; }
.home-cta-box .btn-primary:hover { background: #f3f6fc; transform: translateY(-2px); }

/* ---------- 일반 페이지 본문 ---------- */
.page-main {
  padding: calc(var(--header-h) + 54px) 0 90px;
  min-height: 62vh;
  background: #fff;
}
.page-article { max-width: 880px; }
.page-head { margin-bottom: 30px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.page-title { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; color: var(--ink); }

.page-content.rich { font-size: 1.02rem; line-height: 1.9; color: var(--ink-2); }
.page-content.rich > *:first-child { margin-top: 0; }
.page-content.rich h2 { font-size: 1.55rem; font-weight: 800; margin: 2em 0 .6em; color: var(--ink); letter-spacing: -.01em; }
.page-content.rich h3 { font-size: 1.25rem; font-weight: 700; margin: 1.6em 0 .5em; color: var(--ink); }
.page-content.rich h4 { font-size: 1.08rem; font-weight: 700; margin: 1.4em 0 .4em; color: var(--ink); }
.page-content.rich p { margin: 0 0 1.1em; }
.page-content.rich a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.page-content.rich ul, .page-content.rich ol { margin: 0 0 1.1em 1.4em; }
.page-content.rich li { margin: .3em 0; }
.page-content.rich img { max-width: 100%; height: auto; border-radius: 10px; margin: .6em 0; }
.page-content.rich blockquote { margin: 1.4em 0; padding: .8em 1.2em; border-left: 4px solid var(--brand); background: var(--surface-2); border-radius: 0 10px 10px 0; color: var(--ink-2); }
.page-content.rich hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.page-content.rich table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .95rem; }
.page-content.rich th, .page-content.rich td { border: 1px solid var(--line); padding: .6em .8em; text-align: left; }
.page-content.rich th { background: var(--surface-2); font-weight: 700; }
.page-content.rich pre { background: #0f1220; color: #e8eaf2; padding: 1em 1.2em; border-radius: 10px; overflow: auto; margin: 1.2em 0; }
.page-content.rich code { background: var(--surface-2); padding: .1em .4em; border-radius: 5px; font-size: .9em; }

/* ---------- 팝업 ---------- */
#cmsPopupBackdrop {
  position: fixed; inset: 0; background: rgba(12,15,30,.5);
  z-index: 9998; display: none;
}
#cmsPopupBackdrop.show { display: block; }
.cms-popup {
  position: fixed; display: none; z-index: 9999;
  background: #fff; color: #1c2233; border-radius: 16px; max-width: 92vw;
  box-shadow: 0 24px 70px rgba(8,12,30,.34); overflow: hidden;
  animation: cmsPopIn .28s cubic-bezier(.2,.8,.25,1);
}
.cms-popup.show { display: block; }
@keyframes cmsPopIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; } }
.cms-popup-body { padding: 22px 22px 10px; max-height: 72vh; overflow: auto; line-height: 1.7; }
.cms-popup-body :first-child { margin-top: 0; }
.cms-popup-body img { max-width: 100%; height: auto; }
.cms-popup-linkwrap { display: block; color: inherit; text-decoration: none; }
.cms-popup-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 16px 14px; border-top: 1px solid #eef0f5; background: #fafbfe;
}
.cms-popup-today { font-size: 13px; color: #5b637e; display: flex; align-items: center; gap: 6px; cursor: pointer; -webkit-user-select: none; user-select: none; }
.cms-popup-close { background: #1c2233; color: #fff; border: 0; padding: 8px 15px; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer; }
.cms-popup-close:hover { background: #000; }
