/* 토큰 별칭 — Simche
   값의 원본은 theme.json 하나다. 이 파일은 디자인 시스템의 이름(--color-action …)을
   WordPress가 theme.json에서 만들어 내는 변수(--wp--preset--color--action …)에 잇는 별칭만 적는다.
   값이 두 곳에 적히지 않으므로 사이트 편집기 Styles, 스타일 변형, 폰트 라이브러리가 바꾼 값을
   컴포넌트 CSS가 한 글자도 바뀌지 않고 따라간다.

   계층: 1) 원시 — 없다. theme.json의 프리셋은 역할 이름(의미 계층)이고, 컴포넌트와 페이지는 그것만 쓴다
         2) 의미 — 이 파일의 앞부분. theme.json 프리셋·custom의 별칭
         3) 컴포넌트 — 이 파일의 뒷부분. 특정 컴포넌트 전용
   이름 규칙: theme.json의 slug와 custom 키는 WordPress가 kebab-case로 바꾼다(jikjiBg → jikji-bg, h1 → h-1).
   브레이크포인트의 원본은 theme.json의 settings.viewport(WordPress 7.1): mobile 767px, tablet 1023px.
   WordPress는 그 값으로 반응형 블록 스타일과 블록 가시성의 @mobile(width <= 767px)·@tablet(767px < width <= 1023px)·
   @desktop(width > 1023px) 미디어 쿼리를 만들고, Jikji도 같은 값을 읽는다(Jikji 쪽은 누적 max-width). 미디어 쿼리에서는 변수를 쓸 수 없어
   테마 CSS는 같은 경계를 값으로 적는다 — 같은 표기(width <= 767px / width > 767px / width <= 1023px / width > 1023px). */

:root {
  /* ── 2) 의미 토큰 ─────────────────────────────── */

  /* 면: 종이(bg) / 표면 / 가라앉은 면(코드, 띠) / 찍힌 면(Jikji가 만들어 낸 것) / 잉크 면(판권면) */
  --color-bg: var(--wp--preset--color--bg);
  --color-surface: var(--wp--preset--color--surface);
  --color-surface-sunken: var(--wp--preset--color--surface-sunken);
  --color-surface-set: var(--wp--preset--color--surface-set);
  --color-surface-inverse: var(--wp--preset--color--surface-inverse);

  --color-text: var(--wp--preset--color--text);
  --color-text-muted: var(--wp--preset--color--text-muted);
  --color-text-disabled: var(--wp--preset--color--text-disabled);
  --color-text-inverse: var(--wp--preset--color--text-inverse);
  --color-text-inverse-muted: var(--wp--preset--color--text-inverse-muted);

  --color-border: var(--wp--preset--color--border);
  --color-border-strong: var(--wp--preset--color--border-strong);
  --color-border-inverse: var(--wp--preset--color--border-inverse);
  --color-border-action: var(--wp--preset--color--border-action);

  /* 별색. 쓰는 자리는 넷뿐이다: 링크, 주 버튼, 현재 위치, 코드 속의 j: 와 wp: */
  --color-brand: var(--color-action);
  --color-action: var(--wp--preset--color--action);
  --color-action-hover: var(--wp--preset--color--action-hover);
  --color-action-active: var(--wp--preset--color--action-active);
  --color-action-subtle: var(--wp--preset--color--action-subtle);
  --color-on-action: var(--wp--preset--color--on-action);
  --color-action-inverse: var(--wp--preset--color--action-inverse);
  --color-focus: var(--color-action);
  --color-focus-inverse: var(--color-action-inverse);
  /* 선택 영역, 검색어 표시, 짝 강조 — 별색의 옅은 면 */
  --color-highlight: var(--wp--preset--color--highlight);

  --color-success: var(--wp--preset--color--success);
  --color-success-bg: var(--wp--preset--color--success-bg);
  --color-warning: var(--wp--preset--color--warning);
  --color-warning-bg: var(--wp--preset--color--warning-bg);
  --color-danger: var(--wp--preset--color--danger);
  --color-danger-bg: var(--wp--preset--color--danger-bg);

  /* 코드 구문 강조: 색은 넷(보라, 녹색, 녹, 회색)과 잉크 */
  --code-bg: var(--color-surface-sunken);
  --code-text: var(--color-text);
  --code-comment: var(--wp--custom--code--comment);
  --code-string: var(--wp--custom--code--string);
  --code-number: var(--wp--custom--code--number);
  --code-variable: var(--wp--custom--code--variable);
  --code-jikji: var(--wp--custom--code--jikji);
  --code-jikji-bg: var(--wp--custom--code--jikji-bg);
  --code-pair-bg: var(--wp--custom--code--pair-bg);

  --shadow-1: var(--wp--preset--shadow--low);
  --shadow-2: var(--wp--preset--shadow--high);

  --font-body: var(--wp--preset--font-family--sans);
  --font-heading: var(--wp--preset--font-family--sans);
  --font-code: var(--wp--preset--font-family--mono);

  /* 타입 스케일: 390px → 약 1280px 사이에서 연속으로 변한다(값은 theme.json) */
  --text-display: var(--wp--preset--font-size--display);
  --text-h1: var(--wp--preset--font-size--heading-1);
  --text-h2: var(--wp--preset--font-size--heading-2);
  --text-h3: var(--wp--preset--font-size--heading-3);
  --text-body-lg: var(--wp--preset--font-size--body-lg);
  --text-body: var(--wp--preset--font-size--body);
  --text-small: var(--wp--preset--font-size--small);
  --text-label: var(--wp--preset--font-size--small);
  --text-code: var(--wp--custom--code--size--inline);        /* 문장 속 코드: 본문에 대한 비율 */
  --text-code-block: var(--wp--custom--code--size--block);

  --weight-regular: var(--wp--custom--weight--regular);
  --weight-medium: var(--wp--custom--weight--medium);
  --weight-semibold: var(--wp--custom--weight--semibold);
  --weight-display: var(--wp--custom--weight--display);
  --weight-heading: var(--wp--custom--weight--heading);

  --leading-display: var(--wp--custom--leading--display);
  --leading-heading: var(--wp--custom--leading--heading);
  --leading-body: var(--wp--custom--leading--body);
  --leading-small: var(--wp--custom--leading--small);
  --leading-label: var(--wp--custom--leading--label);
  --leading-code: var(--wp--custom--leading--code);

  --tracking-display: var(--wp--custom--tracking--display);
  --tracking-heading: var(--wp--custom--tracking--heading);
  --tracking-body: var(--wp--custom--tracking--body);

  /* 간격: 4px 기반 */
  --space-1: var(--wp--preset--spacing--1);
  --space-2: var(--wp--preset--spacing--2);
  --space-3: var(--wp--preset--spacing--3);
  --space-4: var(--wp--preset--spacing--4);
  --space-5: var(--wp--preset--spacing--5);
  --space-6: var(--wp--preset--spacing--6);
  --space-8: var(--wp--preset--spacing--8);
  --space-10: var(--wp--preset--spacing--10);
  --space-12: var(--wp--preset--spacing--12);
  --space-16: var(--wp--preset--spacing--16);

  --space-page: var(--wp--preset--spacing--page);
  --space-gutter: var(--wp--preset--spacing--gutter);
  --space-section-tight: var(--wp--preset--spacing--section-tight);
  --space-section: var(--wp--preset--spacing--section);
  --space-section-loose: var(--wp--preset--spacing--section-loose);

  /* 폭: 본문(한 줄 70자 안팎)과 와이드는 theme.json layout, 기본 폭은 custom */
  --container-prose: var(--wp--style--global--content-size);
  --container-base: var(--wp--custom--container--base);
  --container-wide: var(--wp--style--global--wide-size);

  --radius-tag: var(--wp--preset--border-radius--tag);
  --radius-control: var(--wp--preset--border-radius--control);
  --radius-surface: var(--wp--preset--border-radius--surface);
  --radius-full: var(--wp--preset--border-radius--full);

  --border-1: var(--wp--custom--border--thin);
  --border-2: var(--wp--custom--border--thick);

  --duration-instant: var(--wp--custom--duration--instant);
  --duration-fast: var(--wp--custom--duration--fast);
  --duration-base: var(--wp--custom--duration--base);
  --ease-out: var(--wp--custom--ease--out);
  --ease-in: var(--wp--custom--ease--in);
  --ease-in-out: var(--wp--custom--ease--in-out);

  --z-base: var(--wp--custom--z--base);
  --z-sticky: var(--wp--custom--z--sticky);
  --z-dropdown: var(--wp--custom--z--dropdown);
  --z-toast: var(--wp--custom--z--toast);

  --focus-ring: var(--border-2) solid var(--color-focus);
  --focus-offset: var(--wp--custom--focus--offset);

  --secno-width: var(--wp--custom--prose--secno-width); /* 절 번호가 걸리는 여백의 폭 */
  --header-height: var(--wp--custom--header-height);

  /* ── 3) 컴포넌트 토큰 ─────────────────────────── */

  --control-height-sm: var(--wp--custom--control--height--sm);
  --control-height: var(--wp--custom--control--height--base);
  --control-height-lg: var(--wp--custom--control--height--lg);

  --button-bg: var(--color-action);
  --button-bg-hover: var(--color-action-hover);
  --button-bg-active: var(--color-action-active);
  --button-text: var(--color-on-action);
  --button-radius: var(--radius-control);
  --button-weight: var(--weight-semibold);

  --field-bg: var(--color-surface);
  --field-border: var(--color-border-strong);
  --field-radius: var(--radius-control);
}

/* 다크: 범위 밖이다. 구조는 theme.json이 아니라 여기서 잡는다 — 조건부 값을 theme.json이 모르므로
   [data-theme="dark"] 안에서 --wp--preset--color--* 를 재정의하면 별칭과 컴포넌트가 그대로 따라온다.
   값은 허용 조합표와 코드 강조 색을 다시 검증한 뒤에 넣는다. */
