/* ══════════════════════════════════════════════
   기적 연산스쿨 — 공통 스타일 (front.css)
   토큰 / 리셋 / 사이트 공통 nav · footer · 버튼
   페이지별 전용 스타일은 front-{page}.css 로 분리
   ══════════════════════════════════════════════ */

/* ══════════ TOKENS ══════════ */
:root {
  --mint:        #1DBFB0;
  --mint-dark:   #129E91;
  --mint-mid:    #D4F2EE;
  --mint-light:  #F0FAF9;
  --coral:       #F4623A;
  --coral-dark:  #D9502C;
  --coral-light: #FDF4F2;
  --amber:       #F5A623;
  --amber-light: #FDF8F0;
  --indigo:      #5C6BC0;
  --indigo-light:#F4F4FB;
  --navy:        #1C1F33;
  --navy-2:      #2A2D45;
  --navy-3:      #111120;
  --gray-bg:     #F7F8FA;
  --gray-border: #EEF0F3;
  --gray-line:   #C8CDD6;
  --gray-text:   #6B7280;
  --white:       #FFFFFF;

  /* ── 서비스 6색 (ver4) — 메인 허브 카드/버튼 구분용 ── */
  --pink:          #FF8B8B;   /* 연산 MBTI */
  --pink-pastel:   #FFD6D6;
  --pink-light:    #FFEBEB;
  --pink-dark:     #EB0000;

  --orange:        #FFB356;   /* 연산 레벨테스트 */
  --orange-pastel: #FFE5C6;
  --orange-light:  #FFF6EB;
  --orange-dark:   #B36200;

  --yellow:        #FFD966;   /* 스마트 답지 센터 */
  --yellow-pastel: #FFF5D6;
  --yellow-light:  #FFFAEB;
  --yellow-dark:   #946F00;

  --green:         #75D06A;   /* 연산 학습가이드 */
  --green-pastel:  #C2EDBD;
  --green-light:   #F1FAEF;
  --green-dark:    #2B8820;

  --blue:          #4472C4;   /* 공부 타이머 */
  --blue-pastel:   #96B1E2;
  --blue-light:    #EFF3FA;
  --blue-dark:     #3D72D1;

  --purple:        #8456A7;   /* 선택가이드 */
  --purple-pastel: #BA9CD1;
  --purple-light:  #F5F2F8;
  --purple-dark:   #935CBC;

  /* MBTI 퀴즈 전용 */
  --pu:            #7F77DD;
  --pu-dark:       #534AB7;
  --pu-mid:        #C5C2F5;
  --pu-light:      #EEEDFE;

  /* v3 전용 */
  --cream:       #FBF8F3;
  --cream-dark:  #F5F0E8;
  --cream-border:#E8E2D9;
  --brown-text:  #7A6A57;
  --warm-shadow: rgba(100, 80, 50, 0.08);
}

/* ══════════ RESET ══════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* scrollbar-gutter: 페이지마다 세로 스크롤 유무가 달라 콘텐츠가 좌우로 밀리는 현상 방지 */
html { scroll-behavior: smooth; scrollbar-gutter: stable; }

/* sticky footer — .page-wrap이 남는 높이를 채워 푸터가 항상 화면 맨 아래 */
body {
  font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  background: var(--gray-bg);
  color: var(--navy);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-wrap { flex: 1; }

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ══════════ SITE NAV ══════════ */
.site-nav {
  background: var(--white);
  border-bottom: 1px solid var(--gray-border);
  position: sticky;
  top: 0;
  z-index: 200;   /* ver4: 전 페이지 통일 (level-test 서브헤더가 top:56px로 붙음) */
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 17px;
  font-weight: 900;
  color: var(--navy);
}
.nav-logo span { color: var(--mint); }

.nav-links {
  display: flex;
  gap: 2px;
}
.nav-links a {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-text);
  padding: 6px 12px;
  border-radius: 20px;
  transition: all 0.18s;
}
.nav-links a:hover { color: var(--navy); background: var(--gray-bg); }
.nav-links a.nav-active { color: var(--mint-dark); background: var(--mint-light); }

/* 햄버거 */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  width: 36px;
  height: 36px;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: all 0.22s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--white);
  border-top: 1px solid var(--gray-border);
  padding: 8px 16px 12px;
}
.nav-mobile-menu.open { display: flex; }
.nav-mobile-menu a {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-text);
  padding: 12px 8px;
  border-bottom: 1px solid var(--gray-border);
  transition: color 0.18s;
}
.nav-mobile-menu a:last-child { border-bottom: none; }
.nav-mobile-menu a:hover { color: var(--navy); }
.nav-mobile-menu a.nav-active { color: var(--mint-dark); }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
}

/* ══════════ FOOTER ══════════ */
.site-footer {
  background: var(--navy);
  color: var(--white);
  padding: 32px 24px;
  /* iOS 홈 인디케이터 영역 확보 */
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
  text-align: center;
}

/* ver4: 서비스 링크 행(.footer-links)은 제거됨 — nav가 sticky라 중복.
   대신 길벗스쿨 온라인 채널 안내 행을 노출 (웹마케팅팀 요청) */
.footer-channels {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 4px;
  margin-bottom: 14px;
}
.footer-channels-label {
  font-size: 13px;
  color: var(--mint);
  font-weight: 600;
  margin-right: 6px;
}
.footer-channels a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.18s;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.footer-channels a:hover { color: var(--white); }
.footer-channels a:hover .channel-icon { opacity: 1; }
.footer-channels span {
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
}
.channel-icon {
  width: 14px;
  height: 14px;
  opacity: 0.75;
  transition: opacity 0.18s;
}

.footer-copy {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
}

/* ══════════ COMMON BUTTONS ══════════ */
.btn {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 24px;
  border: none;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}
.btn-mint   { background: var(--mint);   color: var(--white); }
.btn-mint:hover   { background: var(--mint-dark); }
.btn-coral  { background: var(--coral);  color: var(--white); }
.btn-coral:hover  { background: var(--coral-dark); }
.btn-indigo { background: var(--indigo); color: var(--white); }
.btn-amber  { background: var(--amber);  color: var(--white); }
.btn-ghost  {
  background: transparent;
  color: var(--gray-text);
  border: 1px solid var(--gray-border);
}
.btn-ghost:hover { color: var(--navy); border-color: var(--gray-line); }

/* ══════════ DECO ELEMENTS (공용) ══════════ */
/* 배경 도트 패턴 — title-area::before에서 사용 */
.has-dot-pattern { position: relative; overflow: hidden; }
.has-dot-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--mint-mid) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  opacity: 0.55;
  pointer-events: none;
}

/* 떠다니는 연산 기호 장식 */
.deco {
  position: absolute;
  font-weight: 900;
  opacity: 0.13;
  color: var(--mint-dark);
  user-select: none;
  line-height: 1;
}

/* blob (페이지마다 inline 위치 지정) */
.blob {
  position: absolute;
  pointer-events: none;
}

/* ══════════ UTILITIES ══════════ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.text-center { text-align: center; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
