/**
 * AI CineCatch — 폰트 깨짐 방지 (역할 변수 · 아이콘 분리 · font-safe-mode)
 * 디자인 위계는 font-typography.css — local() 미사용, CDN 웹폰트 별칭만 사용
 */

/* 손상된 로컬 Pretendard/Inter 충돌 방지 — AICinePickPretendard 별칭만 (내부 식별자 유지) */
@font-face {
  font-family: "AICinePickPretendard";
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/woff2/PretendardVariable.woff2") format("woff2-variations");
}

:root {
  /* 문제 PC 긴급 fallback (font-safe-mode 전용) */
  --font-safe:
    "Malgun Gothic",
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    "Segoe UI",
    Arial,
    sans-serif;

  /* 본문·설명·메타 */
  --font-body:
    "Noto Sans KR",
    "Malgun Gothic",
    "Apple SD Gothic Neo",
    "Segoe UI",
    Arial,
    sans-serif;

  /* 메뉴·버튼·카드·칩·배지 */
  --font-ui:
    "AICinePickPretendard",
    "Noto Sans KR",
    "Malgun Gothic",
    "Apple SD Gothic Neo",
    "Segoe UI",
    Arial,
    sans-serif;

  /* 히어로·대형 제목·로고 */
  --font-display:
    "AICinePickPretendard",
    "Noto Sans KR",
    "Malgun Gothic",
    "Apple SD Gothic Neo",
    "Segoe UI",
    Arial,
    sans-serif;

  /* common.css 등 레거시 호환 */
  --font-sans: var(--font-body);

  --font-mono:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    "Cascadia Code",
    monospace;

  --font-emoji:
    "Apple Color Emoji",
    "Segoe UI Emoji",
    "Noto Color Emoji",
    sans-serif;
}

html,
body {
  font-family: var(--font-body);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  color: var(--text-main, rgba(255, 255, 255, 0.92));
}

/* emoji·기호 전용 — 본문 sans와 분리 */
.emoji,
.symbol,
.chip-icon,
.sns-icon,
.mypage-btn-icon,
.mypage-accordion-lead-icon,
.submit-work-empty-guide-icon,
.submit-work-success-icon,
.library-empty-icon,
.award-item-icon {
  font-family: var(--font-emoji);
}

/* Font Awesome / Material — 아이콘 class에만 */
.material-icons,
.fa,
.fas,
.far,
.fab,
[class^="fa-"],
[class*=" fa-"] {
  font-family: var(--font-icon, "Font Awesome 6 Free", "Font Awesome 5 Free", var(--font-emoji)) !important;
}

.icon,
[class^="icon-"],
[class*=" icon-"] {
  font-family: var(--font-icon, var(--font-emoji)) !important;
}

/*
 * 긴급 fallback — body에 class="font-safe-mode" 붙일 때만 (기본 전역 강제 없음)
 */
.font-safe-mode,
.font-safe-mode button,
.font-safe-mode input,
.font-safe-mode textarea,
.font-safe-mode select,
.font-safe-mode label,
.font-safe-mode p,
.font-safe-mode span,
.font-safe-mode a,
.font-safe-mode li,
.font-safe-mode th,
.font-safe-mode td,
.font-safe-mode small,
.font-safe-mode strong,
.font-safe-mode h1,
.font-safe-mode h2,
.font-safe-mode h3,
.font-safe-mode h4,
.font-safe-mode h5,
.font-safe-mode h6 {
  font-family: var(--font-safe) !important;
}

.font-safe-mode .material-icons,
.font-safe-mode .fa,
.font-safe-mode .fas,
.font-safe-mode .far,
.font-safe-mode .fab,
.font-safe-mode .icon,
.font-safe-mode [class^="icon-"],
.font-safe-mode [class*=" icon-"] {
  font-family: var(--font-icon, var(--font-emoji)) !important;
}

.font-safe-mode .emoji,
.font-safe-mode .symbol,
.font-safe-mode .chip-icon,
.font-safe-mode .sns-icon {
  font-family: var(--font-emoji) !important;
}
