/* ============================================
   청율산후조리원 - 공통 스타일
   Common Styles & CSS Variables

   수정 가이드:
   - 색상 변경: :root 내의 --color-* 변수 수정
   - 폰트 변경: --font-* 변수 수정
   - 간격 변경: --spacing-* 변수 수정
============================================ */

/* ========== CSS Variables (디자인 토큰) ========== */
:root {
  /* 브랜드 컬러 - Brand Colors */
  --color-primary: #7C9070;        /* 메인 세이지 그린 */
  --color-primary-light: #9DB091;  /* 밝은 세이지 그린 */
  --color-primary-dark: #5A6B50;   /* 어두운 세이지 그린 */

  /* 배경 컬러 - Background Colors */
  --color-bg: #F7F6F3;             /* 메인 배경색 (따뜻한 오프화이트) */
  --color-bg-white: #FFFFFF;       /* 흰색 배경 */
  --color-bg-dark: #1A1A1A;        /* 어두운 배경 (푸터용) */

  /* 텍스트 컬러 - Text Colors */
  --color-text-dark: #2D2D2D;      /* 제목, 강조 텍스트 */
  --color-text-gray: #6B6B6B;      /* 본문 텍스트 */
  --color-text-light: #888888;     /* 보조 텍스트 */
  --color-text-white: #FFFFFF;     /* 흰색 텍스트 */

  /* 보더/라인 컬러 - Border Colors */
  --color-border: #E0E0E0;
  --color-border-light: #F0F0F0;

  /* 폰트 패밀리 - Font Families */
  --font-heading: 'Noto Serif KR', serif;           /* 제목용 */
  --font-body: 'Pretendard', 'Plus Jakarta Sans', sans-serif;  /* 본문용 */

  /* 폰트 사이즈 - Font Sizes */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 32px;
  --text-4xl: 42px;
  --text-5xl: 48px;

  /* 간격 - Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;
  --spacing-4xl: 80px;
  --spacing-5xl: 100px;

  /* 컨테이너 너비 - Container Widths */
  --container-max: 1440px;
  --container-padding: 60px;

  /* 둥근 모서리 - Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* 그림자 - Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

  /* 트랜지션 - Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* 헤더 높이 */
  --header-height: 80px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text-gray);
  background-color: var(--color-bg);
  overflow-x: hidden;
  max-width: 100vw;
}

/* ========== Typography ========== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text-dark);
  line-height: 1.3;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ========== Utility Classes ========== */

/* 컨테이너 */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* 섹션 패딩 */
.section {
  padding: var(--spacing-5xl) 0;
}

.section--white {
  background-color: var(--color-bg-white);
}

.section--gray {
  background-color: var(--color-bg);
}

/* 텍스트 정렬 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Flexbox 유틸리티 */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.gap-xl { gap: var(--spacing-xl); }

/* 그리드 유틸리티 */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* 숨김 */
.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;
}

/* ========== 반응형 - Responsive ========== */

/* 태블릿 */
@media (max-width: 1024px) {
  :root {
    --container-padding: 40px;
    --text-5xl: 40px;
    --text-4xl: 36px;
    --text-3xl: 28px;
  }

  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* 모바일 */
@media (max-width: 768px) {
  :root {
    --container-padding: 20px;
    --text-5xl: 32px;
    --text-4xl: 28px;
    --text-3xl: 24px;
    --text-2xl: 20px;
    --spacing-5xl: 60px;
    --spacing-4xl: 48px;
    --header-height: 60px;
  }

  .section {
    padding: var(--spacing-3xl) 0;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  /* 모바일에서 숨김 */
  .hide-mobile { display: none !important; }
}

/* 작은 모바일 */
@media (max-width: 375px) {
  :root {
    --text-5xl: 28px;
    --text-4xl: 24px;
  }
}
