/* =============================================
   HANZOOM - common.css
   CSS 변수 정의 + 리셋 + 기본 스타일
   ============================================= */

/* ─── CSS Variables ─── */
:root {
  /* Brand Colors */
  --color-primary:     #0060B8;   /* 메인 블루 */
  --color-primary-dk:  #004A8F;   /* 다크 블루 */
  --color-teal:        #00B4D8;   /* 포인트 틸 */
  --color-teal-lt:     #00D4F0;   /* 밝은 틸 */
  --color-navy:        #0A1628;   /* 다크 네이비 */

  /* Text */
  --color-text:        #1A1A2E;   /* 기본 텍스트 */
  --color-text-muted:  #6B7280;   /* 서브 텍스트 */
  --color-text-light:  #9CA3AF;   /* 약한 텍스트 */

  /* Background */
  --color-bg:          #FFFFFF;
  --color-bg-light:    #F8FAFC;
  --color-bg-section:  #F1F5F9;
  --color-border:      #E2E8F0;

  /* Status */
  --color-success:     #10B981;
  --color-error:       #EF4444;

  /* Typography */
  --font-ko: 'Noto Sans KR', sans-serif;
  --font-en: 'Noto Sans', sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.7;

  /* Spacing */
  --space-xs:   0.25rem;   /* 4px */
  --space-sm:   0.5rem;    /* 8px */
  --space-md:   1rem;      /* 16px */
  --space-lg:   1.5rem;    /* 24px */
  --space-xl:   2rem;      /* 32px */
  --space-2xl:  3rem;      /* 48px */
  --space-3xl:  5rem;      /* 80px */
  --space-4xl:  7.5rem;    /* 120px */

  /* Container */
  --container-max: 1280px;
  --container-pd:  1.5rem;

  /* Border Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Shadow */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.12);
  --shadow-xl:   0 16px 48px rgba(0,0,0,0.15);

  /* Transition */
  --transition:       all 0.25s ease;
  --transition-slow:  all 0.4s ease;

  /* Header */
  --header-height: 72px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-ko);
  font-size: 1rem;
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 영어 언어일 때 영문 폰트 */
:lang(en) body,
body[lang="en"] {
  font-family: var(--font-en);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: var(--transition); }
ul, ol { list-style: none; }
button { background: none; border: none; cursor: pointer; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  outline: none;
  border: none;
  background: none;
}
svg { overflow: visible; }

/* ─── Container ─── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pd);
}

/* ─── Section 기본 ─── */
.section {
  padding: var(--space-4xl) 0;
}
.section--gray {
  background-color: var(--color-bg-section);
}
.section--dark {
  background-color: var(--color-navy);
  color: #fff;
}
.section__header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}
.section__label {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-teal);
  margin-bottom: var(--space-sm);
}
.section__title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
  margin-bottom: var(--space-md);
}
.section--dark .section__title {
  color: #fff;
}
.section__desc {
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.8;
}
.section--dark .section__desc {
  color: rgba(255,255,255,0.7);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn--primary {
  background: var(--color-primary);
  color: #fff;
}
.btn--primary:hover {
  background: var(--color-primary-dk);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn--outline {
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
}
.btn--outline:hover {
  background: var(--color-primary);
  color: #fff;
}
.btn--white {
  background: #fff;
  color: var(--color-primary);
}
.btn--white:hover {
  background: var(--color-bg-section);
}
.btn--teal {
  background: var(--color-teal);
  color: #fff;
}
.btn--teal:hover {
  background: var(--color-teal-lt);
}
.btn--lg {
  padding: 1rem 2.25rem;
  font-size: 1rem;
}
.btn--sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
}

/* ─── Page Hero (서브 페이지 공통) ─── */
.page-hero {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-primary-dk) 100%);
  padding: calc(var(--header-height) + 4rem) 0 4rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute;
  right: -10%;
  top: 50%;
  transform: translateY(-50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0,180,216,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.page-hero__breadcrumb {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: var(--space-md);
}
.page-hero__breadcrumb a {
  color: rgba(255,255,255,0.6);
}
.page-hero__breadcrumb a:hover { color: #fff; }
.page-hero__breadcrumb span { margin: 0 0.5rem; }
.page-hero__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
}
.page-hero__desc {
  font-size: 1.0625rem;
  color: rgba(255,255,255,0.75);
  max-width: 560px;
  line-height: 1.8;
}

/* ─── Badge / Tag ─── */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.badge--blue  { background: #EFF6FF; color: var(--color-primary); }
.badge--teal  { background: #E0F9FF; color: #0077AA; }
.badge--green { background: #ECFDF5; color: #065F46; }
.badge--gray  { background: var(--color-bg-section); color: var(--color-text-muted); }

/* ─── Card ─── */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.card__img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}
.card__body {
  padding: var(--space-lg);
}
.card__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}
.card__desc {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ─── Form 공통 ─── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: var(--space-lg);
}
.form-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}
.form-label .required {
  color: var(--color-error);
  margin-left: 2px;
}
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--color-text);
  background: #fff;
  transition: var(--transition);
}
.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0,96,184,0.12);
}
.form-control.is-invalid {
  border-color: var(--color-error);
}
.form-control::placeholder {
  color: var(--color-text-light);
}
textarea.form-control {
  resize: vertical;
  min-height: 140px;
}
.form-error {
  font-size: 0.8125rem;
  color: var(--color-error);
  display: none;
}
.form-error.show { display: block; }

/* ─── Divider ─── */
.divider { color: var(--color-border); margin: 0 0.375rem; }

/* ─── Utility ─── */
.text-center { text-align: center; }
.text-muted  { color: var(--color-text-muted); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-md { gap: var(--space-md); }
.fw-bold { font-weight: 700; }

/* ─── Scroll Fade 애니메이션 ─── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-up:nth-child(2) { transition-delay: 0.1s; }
.fade-up:nth-child(3) { transition-delay: 0.2s; }
.fade-up:nth-child(4) { transition-delay: 0.3s; }
.fade-up:nth-child(5) { transition-delay: 0.4s; }
.fade-up:nth-child(6) { transition-delay: 0.5s; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  :root {
    --container-pd: 1rem;
    --space-3xl:    3rem;
    --space-4xl:    4rem;
  }
  .section { padding: var(--space-3xl) 0; }
  .page-hero {
    padding: calc(var(--header-height) + 2.5rem) 0 2.5rem;
  }
}

/* ─── Sub Navigation (공통) ─── */
.sub-nav {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: var(--header-height);
  z-index: 100;
}
.sub-nav__list {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.sub-nav__list::-webkit-scrollbar { display: none; }
.sub-nav__list li a {
  display: block;
  padding: 1rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.sub-nav__list li a:hover,
.sub-nav__list li a.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
