/* 쓰기 학습지 (English / Number / Korean / Japanese / Chinese Character Writing) */

/* 영어 쓰기 글꼴: Andika(SIL OFL)에서 라틴 글자만 추린 파생본 (곧은 t 포함). 라이선스: fonts/AriClassPrint-OFL.txt */
@font-face { font-family: 'AriClass Print'; src: url('../fonts/AriClassPrint-Latin.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }

/* ── 옵션 영역 ── */
/* 옵션 영역은 쓰기 노트(writing-paper)와 같은 모양: 제목과 선택지를 가운데 정렬 */
.options .option-group:first-child { display: block; border-bottom: none; padding-bottom: 0; text-align: center; }
.options .option-group { text-align: center; }
.options .option-group h2 { text-align: center; margin-bottom: 1rem; }
.options .case-options { justify-content: center; flex-wrap: wrap; }
.wsx-field { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; margin: .35rem 0; }
.wsx-field label { font-weight: 600; color: #444; }
.wsx-num { width: 5rem; padding: .45rem .5rem; border: 2px solid #E0E0E0; border-radius: 8px; font-size: 1rem; font-family: inherit; text-align: center; }
.wsx-num:focus, .wsx-textarea:focus { outline: none; border-color: #FFD700; }
.wsx-textarea { width: 100%; min-height: 96px; padding: .7rem .8rem; border: 2px solid #E0E0E0; border-radius: 10px; font-size: 1rem; font-family: inherit; box-sizing: border-box; resize: vertical; line-height: 1.5; }
.wsx-hint { color: #888; font-size: .88rem; margin: .4rem 0 0; line-height: 1.5; }
.options .option-group .wsx-check { display: flex; align-items: center; justify-content: center; gap: .6rem; cursor: pointer; font-weight: 600; color: #444; text-align: center; }
.wsx-check input { width: 18px; height: 18px; accent-color: #FFD700; }
.wsx-opt [hidden] { display: none !important; }
#wsx-status { text-align: center; color: #8a6d00; font-size: .95rem; }
#wsx-status:empty { display: none; }
/* 다른 학습지 페이지와 같은 틀 유지: 종이가 작아도 미리보기 상자가 눌려서 인쇄 버튼이 올라가지 않게 */
body[data-ws-mode] .preview-wrapper { flex-shrink: 0; }

/* ── 미리보기 (용지를 위아래로 쌓아서 보여줌) ── */
#puzzle-preview.wsx-root, #puzzle-preview.wsx-root.wsx-letter {
    width: 100% !important; height: auto !important; min-height: 0 !important;
    padding: 0 !important; margin: 0 !important; background: transparent !important;
    box-shadow: none !important; border: 0 !important; display: block !important;
    aspect-ratio: auto !important; overflow: visible !important; transform: none !important;
}
.wsx-viewport { overflow: hidden; width: 100%; outline: none; touch-action: pan-y; box-sizing: content-box; padding: 24px 0 44px; margin: -24px 0 -44px; }
.wsx-viewport:focus-visible { box-shadow: 0 0 0 3px #FFD700; border-radius: 6px; }
.wsx-scale { display: flex; gap: 160px; width: max-content; transform-origin: 0 0; transition: transform .35s ease; will-change: transform; }
.wsx-stage { position: relative; width: 100%; }
.wsx-zone { position: absolute; top: 0; bottom: 0; width: 28%; z-index: 3; display: flex; align-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wsx-zone-l { left: 0; justify-content: flex-start; padding-left: 0; }
.wsx-zone-r { right: 0; justify-content: flex-end; padding-right: 0; }
.wsx-zone.is-disabled { cursor: default; }
.wsx-zone-l .wsx-arrow { margin-left: -22px; } .wsx-zone-r .wsx-arrow { margin-right: -22px; }
@media screen and (max-width: 700px) { .wsx-zone-l .wsx-arrow { margin-left: 0; } .wsx-zone-r .wsx-arrow { margin-right: 0; } }
.wsx-arrow { width: 40px; height: 110px; border-radius: 0; border: 0; background: transparent; color: #aaa; font-size: 3rem; font-weight: 400; line-height: 1; padding: 0 0 6px; cursor: pointer; font-family: inherit; text-shadow: none; display: inline-flex; align-items: center; justify-content: center; opacity: .8; transition: opacity .15s, transform .15s; }
.wsx-zone:hover:not(.is-disabled) .wsx-arrow { opacity: 1; transform: scale(1.15); color: #FFC800; text-shadow: 0 0 1px #b8960a, 0 1px 3px rgba(0,0,0,.3); }
.wsx-zone:active:not(.is-disabled) .wsx-arrow { color: #FFC800; }
.wsx-zone.is-disabled .wsx-arrow { color: #ccc; text-shadow: none; opacity: .5; cursor: default; }
.wsx-arrow:focus-visible { outline: 3px solid #333; outline-offset: 2px; }
.wsx-count { text-align: center; font-weight: 700; color: #555; margin-top: 8px; min-height: 1.4em; }
.wsx-page {
    position: relative; box-sizing: border-box; background: #fff; margin: 0; flex: 0 0 auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1), 0 0 8px rgba(0, 0, 0, 0.06); border-radius: 4px; overflow: hidden; color: #111;
}
.wsx-page .ns-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3mm; gap: 8px; }
.wsx-page .ns-logo-wrap img { height: 10mm; width: auto; }
.wsx-page .ns-fields { display: flex; gap: 10px; align-items: center; }
.wsx-page .ns-field { font-size: 9pt; display: inline-flex; align-items: flex-end; gap: 2px; }
.wsx-page .ns-line-short { display: inline-block; width: 28mm; border-bottom: 1px solid #333; height: 14px; }
.wsx-svg { display: block; }
.wsx-empty { text-align: center; color: #888; padding: 3rem 1rem; background: #fff; border-radius: 12px; }
.wsx-credit { text-align: center; color: #999; font-size: .78rem; margin: .5rem 0 0; }

/* ── 인쇄 / PDF 저장 ── */
@media print {
    header, nav, footer, .utility-nav, .top-menu, .mobile-nav, .generator-container > h1, .input-section,
    .related-tools-section, .rating-section, .description-section, .preview-label, .preview-actions,
    .wsx-credit, #wsx-status, .ac-modal-overlay { display: none !important; }

    body, .generator-container, .generator-content, .preview-section, .preview-wrapper { margin: 0 !important; padding: 0 !important; background: #fff !important; }

    #puzzle-preview.wsx-root, #puzzle-preview.wsx-root.wsx-letter {
        width: auto !important; height: auto !important; padding: 0 !important; margin: 0 !important;
        position: static !important; display: block !important; overflow: visible !important; transform: none !important;
    }
    .wsx-zone, .wsx-count { display: none !important; }
    .wsx-viewport { padding: 0 !important; margin: 0 !important; }
    .wsx-viewport { overflow: visible !important; height: auto !important; width: auto !important; }
    .wsx-scale { display: block !important; transform: none !important; width: auto !important; height: auto !important; transition: none !important; }
    .wsx-page { margin: 0 !important; box-shadow: none !important; break-after: page; page-break-after: always; }
    .wsx-page:last-child { break-after: auto; page-break-after: auto; }
    .wsx-page, .wsx-page * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
