/**
 * CORE.CSS - 그랑도레 핵심 스타일 시스템
 * CSS 변수, 리셋, 타이포그래피, 기본 레이아웃
 */

/* ========== 폰트 Import ========== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

/* ========== CSS 변수 시스템 ========== */
:root {
  /* Warm Beige + Cocoa Accent */
  --color-primary: #8c5a3c;        /* cocoa */
  --color-primary-light: #b07a5c;  /* warm sand */
  --color-primary-dark: #6b3f28;   /* deep cocoa */

  --color-accent: #8c5a3c;
  --color-accent-light: #b07a5c;
  --color-accent-dark: #6b3f28;

  /* Neutral: 슬레이트 계열 */
  --color-neutral-50: #f8fafc;
  --color-neutral-100: #f1f5f9;
  --color-neutral-200: #e2e8f0;
  --color-neutral-300: #cbd5e1;
  --color-neutral-400: #94a3b8;
  --color-neutral-500: #64748b;
  --color-neutral-600: #475569;
  --color-neutral-700: #334155;
  --color-neutral-800: #1e293b;
  --color-neutral-900: #0f172a;

  /* Semantic 색상 */
  --color-success: #10b981;        /* green-500 */
  --color-warning: #f59e0b;        /* amber-500 */
  --color-error: #ef4444;          /* red-500 */

  /* 배경 색상 */
  --bg-base: #faf8f3;
  --bg-elevated: #ffffff;
  --bg-light: #f1ebe1;
  --bg-dark: #4b2f1c;

  /* 텍스트 색상 */
  --text-primary: #3d2817;
  --text-secondary: #6a4a35;
  --text-muted: #8c6f5b;
  --text-on-primary: #ffffff;

  /* 테두리 */
  --border-color: #e7ded2;
  --border-radius-sm: 0.375rem;
  --border-radius-md: 0.5rem;
  --border-radius-lg: 1rem;

  /* 타이포그래피 */
  --font-display: 'Pretendard', 'Noto Sans KR', sans-serif;
  --font-body: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  --font-weight-black: 900;  /* 극단적 대비용 */

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 3rem;
  --space-6: 5rem;

  /* Shadows: 계층화된 깊이 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-backdrop: 1040;
  --z-drawer: 1050;
  --z-modal: 1060;
  --z-tooltip: 1070;
}

/* ========== 다크모드 CSS 변수 ========== */
[data-theme="dark"] {
  /* 색상 조정 (더 밝게) */
  --color-primary: #22d3ee;        /* cyan-400 */
  --color-primary-light: #67e8f9;  /* cyan-300 */
  --color-primary-dark: #06b6d4;   /* cyan-500 */

  --color-accent: #fbbf24;         /* amber-400 */
  --color-accent-light: #fcd34d;   /* amber-300 */
  --color-accent-dark: #f59e0b;    /* amber-500 */

  /* Neutral 반전 */
  --color-neutral-50: #0f172a;
  --color-neutral-100: #1e293b;
  --color-neutral-200: #334155;
  --color-neutral-300: #475569;
  --color-neutral-400: #64748b;
  --color-neutral-500: #94a3b8;
  --color-neutral-600: #cbd5e1;
  --color-neutral-700: #e2e8f0;
  --color-neutral-800: #f1f5f9;
  --color-neutral-900: #f8fafc;

  /* 배경 */
  --bg-base: #0f172a;
  --bg-elevated: #1e293b;
  --bg-light: #1e293b;
  --bg-dark: #0f172a;

  /* 텍스트 */
  --text-primary: var(--color-neutral-900);
  --text-secondary: var(--color-neutral-700);
  --text-muted: var(--color-neutral-600);

  /* 테두리 */
  --border-color: var(--color-neutral-700);

  /* 그림자 조정 (더 진하게) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
}

/* 다크모드 이미지 필터 */
[data-theme="dark"] img:not(.no-filter) {
  filter: brightness(0.9);
}

/* ========== 리셋 ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-weight: var(--font-weight-normal);
  color: var(--text-primary);
  background-color: var(--bg-base);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 이미지 기본 설정 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 링크 기본 스타일 */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

/* ========== 타이포그래피 (극단적 대비) ========== */

/* 제목: Playfair Display + 900 weight */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: var(--font-weight-black);  /* 900 - 극단적 대비 */
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1rem;
}

/* 본문: Noto Sans KR + 400 weight (극단적 대비) */
p {
  font-family: var(--font-body);
  font-weight: var(--font-weight-normal);  /* 400 */
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* 텍스트 크기 */
.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-base {
  font-size: 1rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

/* 텍스트 굵기 */
.fw-normal {
  font-weight: var(--font-weight-normal) !important;
}

.fw-medium {
  font-weight: var(--font-weight-medium) !important;
}

.fw-bold {
  font-weight: var(--font-weight-bold) !important;
}

.fw-black {
  font-weight: var(--font-weight-black) !important;
}

/* ========== 컨테이너 ========== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.container-fluid {
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* ========== 섹션 기본 스타일 ========== */
section {
  position: relative;
  width: 100%;
}

main {
  flex: 1;
}

footer {
  margin-top: auto;
}

/* ========== 반응형 브레이크포인트 ========== */
@media (max-width: 575px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 720px;
  }
}

@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
}
