@font-face {
    font-family: WorkboardPlex;
    src: url('/assets/fonts/IBMPlexSansKR-SemiBold.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: WorkboardGowun;
    src: url('/assets/fonts/GowunDodum-Regular.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: WorkboardJua;
    src: url('/assets/fonts/Jua-Regular.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: WorkboardSongMyung;
    src: url('/assets/fonts/SongMyung-Regular.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: WorkboardBatang;
    src: url('/assets/fonts/GowunBatang-Bold.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: WorkboardGugi;
    src: url('/assets/fonts/Gugi-Regular.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: WorkboardSingleDay;
    src: url('/assets/fonts/SingleDay-Regular.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: WorkboardStylish;
    src: url('/assets/fonts/Stylish-Regular.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: WorkboardGamja;
    src: url('/assets/fonts/GamjaFlower-Regular.ttf') format('truetype');
    font-display: swap;
}

/* 기본값에서는 기존 화면의 글꼴 구성을 그대로 사용한다. */
html[data-font="plex"] body, html[data-font="plex"] body * {
    font-family: WorkboardPlex, 'Malgun Gothic', sans-serif;
}

html[data-font="gowun"] body, html[data-font="gowun"] body * {
    font-family: WorkboardGowun, 'Malgun Gothic', sans-serif;
}

html[data-font="jua"] body, html[data-font="jua"] body * {
    font-family: WorkboardJua, 'Malgun Gothic', sans-serif;
}

html[data-font="songmyung"] body, html[data-font="songmyung"] body * {
    font-family: WorkboardSongMyung, 'Malgun Gothic', sans-serif;
}

html[data-font="batang"] body, html[data-font="batang"] body * {
    font-family: WorkboardBatang, 'Malgun Gothic', sans-serif;
}

html[data-font="gugi"] body, html[data-font="gugi"] body * {
    font-family: WorkboardGugi, 'Malgun Gothic', sans-serif;
}

html[data-font="singleday"] body, html[data-font="singleday"] body * {
    font-family: WorkboardSingleDay, 'Malgun Gothic', sans-serif;
}

html[data-font="stylish"] body, html[data-font="stylish"] body * {
    font-family: WorkboardStylish, 'Malgun Gothic', sans-serif;
}

html[data-font="gamja"] body, html[data-font="gamja"] body * {
    font-family: WorkboardGamja, 'Malgun Gothic', sans-serif;
}

.font-palette { position: relative; }
.font-palette summary {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: #535b36;
    border-radius: 50%;
    cursor: pointer;
    list-style: none;
}
.font-palette summary::-webkit-details-marker { display: none; }
.font-palette summary:hover, .font-palette[open] summary { background: #d8ddcb; }
.font-palette summary:focus-visible { outline: 2px solid #535b36; outline-offset: 2px; }
.font-palette summary svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.font-options {
    position: absolute;
    z-index: 20;
    top: calc(100% + 10px);
    right: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: min(350px, calc(100vw - 32px));
    max-height: min(490px, calc(100vh - 100px));
    overflow-y: auto;
    margin: 0;
    padding: 14px;
    border: 1px solid #bdbba9;
    border-radius: 10px;
    background: #f7f6ef;
    box-shadow: 0 12px 32px #302f2529;
}
.font-options legend {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.font-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 50px;
    padding: 10px 11px;
    border-radius: 5px;
    color: #363c2f;
    font-size: 15px;
    line-height: 1.35;
    cursor: pointer;
}
.font-option:hover { background: #eaece0; }
.font-option:has(input:checked) { background: #dfe5d4; color: #303d26; }
.font-option:has(input:focus-visible) { outline: 2px solid #535b36; outline-offset: -2px; }
.font-option input {
    appearance: none;
    flex: none;
    width: 15px;
    height: 15px;
    margin: 0;
    border: 1px solid #9a9c88;
    border-radius: 50%;
    background: #fffdf7;
}
.font-option input:checked { border: 4px solid #535f3b; }
.font-option span { overflow-wrap: anywhere; }
/* 목록에서는 현재 선택과 관계없이 각 글꼴의 생김새를 보여준다. */
html[data-font] body .font-option[data-preview="plex"] span { font-family: WorkboardPlex, sans-serif; }
html[data-font] body .font-option[data-preview="gowun"] span { font-family: WorkboardGowun, sans-serif; }
html[data-font] body .font-option[data-preview="jua"] span { font-family: WorkboardJua, sans-serif; }
html[data-font] body .font-option[data-preview="songmyung"] span { font-family: WorkboardSongMyung, sans-serif; }
html[data-font] body .font-option[data-preview="batang"] span { font-family: WorkboardBatang, sans-serif; }
html[data-font] body .font-option[data-preview="gugi"] span { font-family: WorkboardGugi, sans-serif; }
html[data-font] body .font-option[data-preview="singleday"] span { font-family: WorkboardSingleDay, sans-serif; }
html[data-font] body .font-option[data-preview="stylish"] span { font-family: WorkboardStylish, sans-serif; }
html[data-font] body .font-option[data-preview="gamja"] span { font-family: WorkboardGamja, sans-serif; }

@media (max-width: 600px) {
    .identity { flex-wrap: wrap; }
}
