/*
 * 화면 테마 — 이전 사이트 web/src/lib/design/tokens.css 의 색·둥글기·그림자를 옮겼다(기본 · 다크 · 핑크).
 * 기본 테마는 늘 적용된다. 다크·핑크는 <html data-sonub-theme="…"> 가 고른다(레이아웃의 머리 스크립트가 localStorage "sonub-theme" 로 그리기 전에 정한다).
 * 선택자는 html:root(0,1,1) — Web Awesome 테마(:root · .wa-light, 0,1,0)보다 늘 앞선다.
 * Web Awesome 토큰을 이 팔레트로 덮으므로 컴포넌트(그림자 DOM 안까지)와 content.css 의 --sonub-* 가 함께 따라온다.
 * 🛑 content.css 의 --sonub-* 는 Web Awesome 토큰을 가리킨다 — 여기서 --sonub-* 를 쓰면 서로를 가리켜 값이 사라진다.
 *    그래서 팔레트는 --theme-* 이름으로 두고, Web Awesome 토큰만 그것을 가리킨다.
 */

/* ── 기본(따뜻한 종이 · 보라) ─────────────────────────────────── */
html:root {
	--theme-font: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Segoe UI', 'Noto Sans Devanagari', 'Noto Sans Bengali', sans-serif;
	--theme-canvas: #f5f3f0;
	--theme-surface: #fffefd;
	--theme-subtle: #eeebe7;
	--theme-border: #ded9d3;
	--theme-ink: #292737;
	--theme-muted: #666171;
	--theme-accent: #6551a8;
	--theme-accent-hover: #52418d;
	--theme-accent-soft: #eee9f6;
	--theme-accent-ink: #52418d;
	--theme-on-accent: #fffefd;
	--theme-success: #256b56;
	--theme-success-soft: #e9f2eb;
	--theme-warning: #8b5b20;
	--theme-warning-soft: #faf0de;
	--theme-danger: #b53850;
	--theme-danger-soft: #fcebf0;
	--theme-shadow-card: 0 2px 3px #29273703, 0 8px 24px -18px #29273726;
	--theme-shadow-hover: 0 4px 8px -6px #29273714, 0 16px 32px -20px #29273736;
	--theme-shadow-overlay: 0 24px 72px -24px #17203d55;

	/* Web Awesome 공개 토큰 — 컴포넌트의 그림자 DOM 안까지 닿는다 */
	--wa-font-family-body: var(--theme-font);
	--wa-font-family-heading: var(--theme-font);
	--wa-font-family-longform: var(--theme-font);
	--wa-color-surface-default: var(--theme-canvas);
	--wa-color-surface-raised: var(--theme-surface);
	--wa-color-surface-lowered: var(--theme-subtle);
	--wa-color-surface-border: var(--theme-border);
	--wa-color-text-normal: var(--theme-ink);
	--wa-color-text-quiet: var(--theme-muted);
	--wa-color-text-link: var(--theme-accent-ink);
	--wa-color-brand-fill-loud: var(--theme-accent);
	--wa-color-brand-fill-normal: var(--theme-accent-soft);
	--wa-color-brand-fill-quiet: var(--theme-accent-soft);
	--wa-color-brand-on-loud: var(--theme-on-accent);
	--wa-color-brand-on-normal: var(--theme-accent-ink);
	--wa-color-brand-on-quiet: var(--theme-accent-ink);
	--wa-color-brand-border-normal: color-mix(in srgb, var(--theme-accent) 35%, var(--theme-border));
	--wa-color-brand-border-quiet: var(--theme-border);
	--wa-color-brand-border-loud: var(--theme-accent);
	--wa-color-neutral-fill-loud: var(--theme-ink);
	--wa-color-neutral-on-loud: var(--theme-surface);
	--wa-color-neutral-fill-quiet: var(--theme-subtle);
	--wa-color-neutral-on-quiet: var(--theme-muted);
	--wa-color-success-fill-loud: var(--theme-success);
	--wa-color-success-on-loud: var(--theme-surface);
	--wa-color-success-fill-quiet: var(--theme-success-soft);
	--wa-color-success-on-quiet: var(--theme-success);
	--wa-color-warning-fill-quiet: var(--theme-warning-soft);
	--wa-color-warning-on-quiet: var(--theme-warning);
	--wa-color-warning-fill-loud: var(--theme-warning);
	--wa-color-warning-on-loud: var(--theme-surface);
	--wa-color-danger-fill-quiet: var(--theme-danger-soft);
	--wa-color-danger-on-quiet: var(--theme-danger);
	--wa-color-danger-fill-loud: var(--theme-danger);
	--wa-color-danger-on-loud: var(--theme-surface);
	--wa-color-focus: var(--theme-accent);
	--wa-border-radius-s: 0.5rem;
	--wa-border-radius-m: 0.65rem;
	--wa-border-radius-l: 1rem;
	--wa-border-radius-xl: 1.5rem;
	--wa-shadow-s: var(--theme-shadow-card);
	--wa-shadow-m: var(--theme-shadow-hover);
	--wa-shadow-l: var(--theme-shadow-overlay);
	--wa-form-control-background-color: var(--theme-surface);
	--wa-form-control-border-color: var(--theme-border);
	--wa-form-control-border-radius: var(--wa-border-radius-m);
	--wa-form-control-label-color: var(--theme-ink);
	--wa-form-control-value-color: var(--theme-ink);
	--wa-form-control-placeholder-color: var(--theme-muted);
	--wa-transition-fast: 160ms;
	--wa-transition-normal: 200ms;
	color-scheme: light;
}

/* ── 다크 ────────────────────────────────────── */
html:root[data-sonub-theme='dark'] {
	--theme-canvas: #18171e;
	--theme-surface: #22212a;
	--theme-subtle: #2c2a35;
	--theme-border: #403c4c;
	--theme-ink: #f1eef7;
	--theme-muted: #b9b2c9;
	--theme-accent: #b4a5ff;
	--theme-accent-hover: #c7bcff;
	--theme-accent-soft: #352e47;
	--theme-accent-ink: #c7bcff;
	--theme-on-accent: #231c40;
	--theme-success: #7ddabb;
	--theme-success-soft: #1e3934;
	--theme-warning: #edc37f;
	--theme-warning-soft: #3c3224;
	--theme-danger: #f5a1af;
	--theme-danger-soft: #412b38;
	--theme-shadow-card: 0 3px 15px -9px #00000060;
	--theme-shadow-hover: 0 12px 26px -16px #00000090;
	color-scheme: dark;
}

/* ── 핑크 ────────────────────────────────────── */
/* 2026-10-30 사용자 지시 "더 핑크색으로, 여자아이가 좋아할 만한 색" — 분홍 종이 · 진한 분홍(흰 글자 4.7:1) · 자두빛 글자 */
html:root[data-sonub-theme='pink'] {
	--theme-canvas: #fff1f8;
	--theme-surface: #fffafd;
	--theme-subtle: #ffe3f1;
	--theme-border: #f5c9df;
	--theme-ink: #4a2141;
	--theme-muted: #8a4f78;
	--theme-accent: #d02c7b;
	--theme-accent-hover: #b31e66;
	--theme-accent-soft: #ffdcec;
	--theme-accent-ink: #b31e66;
}

html:root:lang(ur) {
	--theme-font: 'Noto Nastaliq Urdu', 'Segoe UI', sans-serif;
}

/* ── 강사 사진 규격(테마와 무관, 사이트·관리자 공용) ──────────────────
 * 강사 사진은 가로 16 : 세로 9, 960×540 으로 저장한다(SSOT 3절 "사진", 2026-11-06 사용자 지시, config teacher.photo_width·photo_height).
 * 강사 정보를 보이는 모든 사진 칸은 이 비율을 쓰고, 옛 정사각형 사진도 얼굴이 잘리지 않게 위쪽(30%)에 맞춘다.
 * 예외 — 강사 목록 카드의 사진 칸은 정사각형이고(16:9 사진의 좌우를 잘라 얼굴·어깨를 크게), 머리 위에 칸 높이의 10% 여백을 둔다
 * (2026-11-12 사용자 지시, 값은 App\Teacher\PhotoHeadroom 의 RATIO·HEADROOM·INSET_AT 과 같게 — teacher-directory.css "카드 사진 칸"). */
:root { --teacher-photo-ratio: 16 / 9; --teacher-photo-focus: 50% 30%; }
:root { --teacher-card-photo-ratio: 1; --teacher-card-photo-headroom: 10%; --teacher-card-photo-inset: 2.5%; }

/* ── 사진 칸 기본 — x-teacher.avatar(강사·회원 사진, 없으면 사람 아이콘). app.css 에서 옮겼다: 사이트와 관리자(app.css 를 싣지 않는다 — 떠 있는 채팅 목록의 말풍선 사진, SSOT 13절)가 같이 쓴다.
   사이트는 theme.css 바로 뒤에 app.css 를 실어 순서가 그대로다 ── */
.teacher-photo { inline-size: 8rem; block-size: 8rem; object-fit: cover; border-radius: 50%; }
.teacher-avatar { display: grid; place-items: center; overflow: hidden; background: var(--wa-color-neutral-fill-quiet); color: var(--wa-color-text-quiet); font-size: calc(2.5rem * var(--wa-font-size-scale, 1)); }
.teacher-avatar > :is(img, i, .teacher-avatar-initial) { grid-area: 1 / 1; }
.teacher-avatar > img { inline-size: 100%; block-size: 100%; object-fit: cover; border-radius: inherit; }
.teacher-avatar:has(img:not([hidden])) > :is(i, .teacher-avatar-initial) { visibility: hidden; }

/*
 * 본문 글자는 한 단계(× 1.125) 크게 — 메뉴·사이드바·푸터는 그대로(SSOT 11절 "본문 글자 크기").
 * Web Awesome 크기 토큰은 :root 에서 계산되므로 본문 안에서 다시 선언해야 새 배율을 따른다(기본 16px → 18px, s 14 → 16px …).
 * 바이브의 시작·빈 화면도 읽는 본문이다. IDE 도구·편집기·사이드바에는 배율을 적용하지 않는다.
 * 관리자(app.css 를 싣지 않는다)의 떠 있는 채팅 목록 창(.floating-inbox)도 읽는 본문이라 같은 배율이다(SSOT 13절 "떠 있는 채팅 목록", 2026-11-09).
 */
.vibe-intro,
:is(.content, .site-content),
.floating-inbox {
	--wa-font-size-scale: 1.125;
	--wa-font-size-m: calc(1rem * var(--wa-font-size-scale));
	--wa-font-size-s: round(calc(var(--wa-font-size-m) / 1.125), 1px);
	--wa-font-size-xs: round(calc(var(--wa-font-size-s) / 1.125), 1px);
	--wa-font-size-2xs: round(calc(var(--wa-font-size-xs) / 1.125), 1px);
	--wa-font-size-3xs: round(calc(var(--wa-font-size-2xs) / 1.125), 1px);
	--wa-font-size-l: round(calc(var(--wa-font-size-m) * 1.125 * 1.125), 1px);
	--wa-font-size-xl: round(calc(var(--wa-font-size-l) * 1.125 * 1.125), 1px);
	--wa-font-size-2xl: round(calc(var(--wa-font-size-xl) * 1.125 * 1.125), 1px);
	--wa-font-size-3xl: round(calc(var(--wa-font-size-2xl) * 1.125 * 1.125), 1px);
	--wa-font-size-4xl: round(calc(var(--wa-font-size-3xl) * 1.125 * 1.125), 1px);
	--wa-font-size-5xl: round(calc(var(--wa-font-size-4xl) * 1.125 * 1.125), 1px);
	font-size: var(--wa-font-size-m);
}
