/*
 * 옛한글 (Old Hangul) 폰트 임베드 — Source Han Serif KR (Adobe/Google OFL)
 *
 * iOS Safari/WKWebView 가 시스템 폰트로 Old Hangul jamo 합성을 못해 ?로 표시되는
 * 회귀에 대한 대응. Source Han Serif KR Regular 는 jamo 256/256 + ljmo/vjmo/tjmo
 * GSUB 합성 feature 를 모두 가져 iOS WebKit 에서도 정상 합성.
 *
 * unicode-range 로 Old Hangul jamo 블록에만 적용 — 옛한글이 없는 페이지에서는
 * 폰트가 fetch 되지 않음. 본문 디자인/성능 영향 없음.
 *
 * 파일 크기: 4.51MB woff2 (Regular 1 weight). 첫 로딩 1회만 HTTP 캐시.
 */

@font-face {
    font-family: 'Old Hangul';
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    src: url('../font/SourceHanSerifKR-Regular.woff2') format('woff2');
    unicode-range:
        U+1100-11FF,   /* Hangul Jamo */
        U+A960-A97F,   /* Hangul Jamo Extended-A */
        U+D7B0-D7FF;   /* Hangul Jamo Extended-B */
}

/*
 * AI 생성 콘텐츠가 inline style 로 옛한글 폰트명을 직접 지정하는 경우
 * (예: font-family: '나눔바른고딕 옛한글') 동일 woff2 를 해당 이름으로도 등록해서
 * 매핑되도록 함. Android 는 시스템 옛한글 폰트로 fallback 되어 보였지만 iOS 는
 * 시스템 옛한글 폰트가 없어 ?로 떨어지던 회귀 대응.
 *
 * 같은 src 를 여러 이름으로 register 해도 브라우저는 파일 1회만 fetch.
 */
@font-face {
    font-family: '나눔바른고딕 옛한글';
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    src: url('../font/SourceHanSerifKR-Regular.woff2') format('woff2');
    unicode-range:
        U+1100-11FF,
        U+A960-A97F,
        U+D7B0-D7FF;
}

@font-face {
    font-family: '함초롬바탕';
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    src: url('../font/SourceHanSerifKR-Regular.woff2') format('woff2');
    unicode-range:
        U+1100-11FF,
        U+A960-A97F,
        U+D7B0-D7FF;
}

@font-face {
    font-family: '나눔명조 옛한글';
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    src: url('../font/SourceHanSerifKR-Regular.woff2') format('woff2');
    unicode-range:
        U+1100-11FF,
        U+A960-A97F,
        U+D7B0-D7FF;
}

/*
 * iOS Safari/WKWebView 가 custom web font 에서 ljmo/vjmo/tjmo GSUB 자모 합성을
 * 일관되게 트리거하지 않는 알려진 이슈 우회.
 *
 * 전역 body 에 명시적 feature 활성화 + script override 로 합성 강제.
 * 이 feature 들은 한글 자모 codepoint 에만 영향을 주므로 다른 언어 본문에는
 * 부작용 없음.
 */
body {
    -webkit-font-feature-settings: "ljmo", "vjmo", "tjmo";
    font-feature-settings: "ljmo", "vjmo", "tjmo";
    font-language-override: "KOR";
}
