/* 표제한자 삽화 v2 — 대표 삽화 · 어휘 삽화 · 말풍선 (illu-v2.js 짝)
   디자인 시스템 v4: 대사 말풍선 = 유자 100 면 + 유자 600 테두리 + 모서리 12, 글자는 먹.
   그림 위에 글자를 올리지 않는다. 반투명 블러 · 100vh 쓰지 않는다. */

.yj-illu-img { display: block; width: 100%; height: auto; border-radius: var(--yj-r-sm, 8px); }
.yj-illu-fig { margin: 0; }

/* 말풍선 — 위로 향한 꼬리(그림을 가리킴) */
.yj-illu-bub {
    position: relative;
    margin: 14px 0 0;
    padding: 10px 16px;
    background: var(--yj-yuja-100, #FDF1C8);
    border: 1px solid var(--yj-yuja-600, #DDB400);
    border-radius: var(--yj-r-lg, 12px);
    color: var(--yj-ink, #16181A);
    font-size: 18px;
    line-height: 1.5;
    text-align: left;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.yj-illu-bub::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 28px;
    width: 14px;
    height: 14px;
    background: inherit;
    border-left: 1px solid var(--yj-yuja-600, #DDB400);
    border-top: 1px solid var(--yj-yuja-600, #DDB400);
    transform: rotate(45deg);
}
.yj-illu-bub b { font-weight: 800; }

/* 썸네일 단추 */
.yj-illu-thumb {
    flex: none;
    display: inline-flex;
    padding: 0;
    margin-right: 8px;
    border: 1px solid var(--yj-line, #E5E1D6);
    border-radius: var(--yj-r-sm, 8px);
    background: var(--yj-card, #FFFDF7);
    overflow: hidden;
    box-shadow: var(--yj-sh-1, 0 1px 2px rgba(0, 0, 0, .06));
    cursor: pointer;
    transition: outline-color var(--yj-m-fast, 120ms);
}
.yj-illu-thumb .yj-illu-img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.yj-illu-thumb:hover, .yj-illu-thumb:focus-visible { outline: 2px solid var(--yj-yuja-600, #DDB400); outline-offset: 1px; }
.yj-illu-thumb--hover { width: 64px; height: 56px; cursor: default; }
/* 한자 상세 — 썸네일은 아이콘과 비슷한 크기(28px)로 보이고, 누르는 자리는 44px */
.yj-illu-thumb--modal {
    width: 44px; height: 44px;
    padding: 8px;
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: var(--yj-r-full, 999px);
    align-items: center; justify-content: center;
}
.yj-illu-thumb--modal .yj-illu-img {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: 1px solid var(--yj-line-strong, #D3CDBE);
}
.yj-illu-thumb--modal:hover { background: rgba(22, 24, 26, .06); outline: 0; }
.yj-illu-thumb--modal:focus-visible { outline: 2px solid var(--yj-yuja-600, #DDB400); outline-offset: 0; }
/* 단추 셋(삽화 · 웹툰 · 점 셋) — 같은 44px 누름 자리, 휴대폰은 간격을 더 벌린다 */
.yj-illu-actions { gap: 4px; }
.yj-illu-actions > .yj-illu-thumb { order: -1; }
.yj-illu-actions > .yj-illu-thumb,
.yj-illu-actions > .vocab-webtoon-inline,
.yj-illu-actions > .vocab-actions-toggle {
    min-width: 44px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    margin: 0;
}
.yj-illu-actions > .vocab-actions-toggle { margin-right: -8px; }
@media (max-width: 767px) { .yj-illu-actions { gap: 12px; } }

/* PPT 미리보기 — 올렸을 때만, 누르기 없음(막이 마우스를 가로채지 않는다) */
.yj-illu-peek {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(22, 24, 26, .18);
    pointer-events: none;
}
.yj-illu-peek__box {
    width: min(72vw, calc((92dvh - 150px) * 1.12), 1180px);
    padding: clamp(14px, 1.4vw, 24px);
    background: var(--yj-card-hi, #fff);
    border-radius: var(--yj-r-lg, 12px);
    box-shadow: var(--yj-sh-3, 0 12px 32px rgba(0, 0, 0, .18));
}
.yj-illu-peek__box .yj-illu-bub {
    margin-top: clamp(14px, 1.4vw, 22px);
    padding: clamp(10px, 1vw, 18px) clamp(16px, 1.6vw, 28px);
    font-size: clamp(28px, 2.6vw, 46px);
    line-height: 1.4;
}

/* 한자 상세 — 웹툰 모달과 같은 틀 */
.yj-illu-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 40px 0;
    background: rgba(0, 0, 0, .75);
}
.yj-illu-modal__card {
    position: relative;
    width: 100%;
    max-width: 32rem;
    margin: auto 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-radius: var(--yj-r-lg, 12px);
    box-shadow: var(--yj-sh-3, 0 12px 32px rgba(0, 0, 0, .25));
}
.yj-illu-modal__body { padding: 16px; }
.yj-illu-modal__body .yj-illu-bub { font-size: 19px; }
.yj-illu-modal__close {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-top: 1px solid var(--yj-line, #E5E7EB);
    background: #fff;
    color: var(--yj-ink, #374151);
    font: inherit;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    transition: background var(--yj-m-fast, 120ms);
}
.yj-illu-modal__close:hover { background: var(--yj-yuja-50, #FEF7E0); }
.yj-illu-modal__close svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ── PPT 표지 (slide.html) — 왼쪽: 배지 · 대표 삽화 · 말풍선 / 오른쪽: 훈음(크게) · 한자 · 시작 단추 ── */
.slide-content-main .yj-cover-bub { display: none; }
body.slide-page .slide-content-main.yj-has-hero.yj-cover-v2 {
    --yj-hero-h: min(54dvh, 33vw * 0.9);
    grid-template-rows: 1fr auto auto auto 1fr;
    row-gap: 0;
}
body.slide-page .slide-content-main.yj-has-hero.yj-cover-v2 .main-cover-badge {
    grid-column: 1; grid-row: 2;
    justify-self: start;
    align-self: end;
    margin: 0 0 clamp(12px, 1.4vw, 22px);
}
body.slide-page .slide-content-main.yj-has-hero.yj-cover-v2 .yj-cover-hero { grid-row: 3; }
body.slide-page .slide-content-main.yj-has-hero.yj-cover-v2 .yj-cover-bub:not([hidden]) {
    display: block;
    grid-column: 1; grid-row: 4;
    align-self: start;
    justify-self: stretch;
    margin: clamp(14px, 1.4vw, 22px) 0 0;
    padding: clamp(10px, 1vw, 18px) clamp(16px, 1.5vw, 26px);
    font-size: clamp(24px, 2.3vw, 42px);
    line-height: 1.45;
}
/* 오른쪽 — 훈음(아주 크게) + 한자(작게) 한 줄, 시작 단추는 그 묶음 아래 가운데 (2026-11-11 작가 지시) */
body.slide-page .slide-content-main.yj-has-hero.yj-cover-v2 { grid-template-columns: auto auto; }
body.slide-page .slide-content-main.yj-has-hero.yj-cover-v2 .slide-cover-columns {
    grid-row: 3;                     /* 대표 삽화와 같은 줄 = 화면 가운데 높이 */
    align-self: center;
    justify-self: center;
    flex-direction: row;
    align-items: center;
    gap: 0;
}
/* 훈음 | 한자 — 연한 세로 구분선 */
body.slide-page .slide-content-main.yj-has-hero.yj-cover-v2 .slide-cover-right::before { display: none; }
body.slide-page .slide-content-main.yj-has-hero.yj-cover-v2 .slide-cover-right {
    display: flex;
    align-items: center;
    align-self: stretch;
    margin-left: clamp(1.25rem, 2.4vw, 3rem);
    padding-left: clamp(1.25rem, 2.4vw, 3rem);
    border-left: 2px solid var(--yj-line-strong, #D3CDBE);
}
body.slide-page .slide-content-main.yj-has-hero.yj-cover-v2 .huneum { font-size: clamp(7rem, 14vw, 17rem); line-height: 1.05; white-space: nowrap; }
body.slide-page .slide-content-main.yj-has-hero.yj-cover-v2 .huneum br { display: none; }
body.slide-page .slide-content-main.yj-has-hero.yj-cover-v2 .hanja { font-size: clamp(3rem, 4.6vw, 6rem); line-height: 1; }
body.slide-page .slide-content-main.yj-has-hero.yj-cover-v2 #start-slideshow-btn {
    grid-row: 4;
    align-self: start;
    justify-self: center;
    margin-top: clamp(1.5rem, 2.4vw, 2.5rem);
}
@media (max-width: 768px), (orientation: portrait) {
    body.slide-page .slide-content-main.yj-has-hero.yj-cover-v2 .main-cover-badge { order: -2; align-self: center; margin: 0 0 1rem; }
    body.slide-page .slide-content-main.yj-has-hero.yj-cover-v2 .yj-cover-bub:not([hidden]) { order: -1; align-self: stretch; margin: -0.5rem 0 1.25rem; font-size: clamp(18px, 4.4vw, 26px); }
    body.slide-page .slide-content-main.yj-has-hero.yj-cover-v2 .huneum { font-size: clamp(3.5rem, 14vw, 6.5rem); }
}

/* ── 매일학습 (daily-run.html) ── */
.yj-dr-illu { margin: 0 0 var(--yj-s4, 16px); }
#step-intro .lead.yj-illu-on { padding-top: var(--yj-s3, 12px); }
#step-intro .lead.yj-illu-on #lead-huneum,
#step-intro .lead.yj-illu-on #lead-hanja { display: none; }
#step-intro .lead.yj-illu-on > .mt-8 { margin-top: 4px; }
/* 3쪽 — 대표 삽화는 조금 낮게, 뜻 1~3 을 촘촘하게 아래로 */
#step-meanings.yj-illu-on .yj-dr-illu { margin-bottom: 12px; }
#step-meanings.yj-illu-on .yj-dr-illu .yj-illu-img { width: auto; max-width: 100%; max-height: 30dvh; margin: 0 auto; }
#step-meanings.yj-illu-on .yj-dr-illu .yj-illu-bub { margin-top: 12px; padding: 8px 14px; font-size: 17px; }
#step-meanings.yj-illu-on .vlist { gap: 0; }
#step-meanings.yj-illu-on #meanings-list > div { padding: 10px 14px; margin-bottom: 8px; }
#step-meanings.yj-illu-on #meanings-list h3 { margin-bottom: 0; }
#step-meanings.yj-illu-on #meanings-list p { margin-bottom: 4px; }
#step-meanings.yj-illu-on #meanings-list p + p { padding: 6px 10px; margin-bottom: 0; }
/* 낱말 장 — 낱말 밑 삽화. 화살표를 누르면 감춘다(.hidden) */
.yj-dr-vfig { padding: 14px 20px 4px; border-bottom: 1px solid var(--yj-line, #E8E7E4); }
.yj-dr-vfig .yj-illu-bub { margin-bottom: 12px; }
.yj-dr-vfig.hidden { display: none; }

/* ── 한자 상세 (hanja-detail.html) 해설 — 왼쪽 1 : 오른쪽 3, 말풍선 윗선 = 뜻 1~3 윗선 ── */
.yj-illu-split.yj-illu-on {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
    column-gap: 24px;
    row-gap: 14px;
    align-items: start;
}
.yj-illu-split.yj-illu-on > .yj-illu-fig { display: contents; }
.yj-illu-split.yj-illu-on > .yj-illu-fig > .yj-illu-img { grid-column: 1; grid-row: 1; }
.yj-illu-split.yj-illu-on > .yj-illu-fig > .yj-illu-bub { grid-column: 1; grid-row: 2; margin: 0; }
.yj-illu-split.yj-illu-on > #meaning-explanation-box { grid-column: 2; grid-row: 1; }
.yj-illu-split.yj-illu-on > #meanings-list { grid-column: 2; grid-row: 2; }
@media (max-width: 767px) {
    .yj-illu-split.yj-illu-on { grid-template-columns: minmax(0, 1fr); }
    .yj-illu-split.yj-illu-on > .yj-illu-fig > .yj-illu-img { grid-row: auto; }
    .yj-illu-split.yj-illu-on > .yj-illu-fig > .yj-illu-bub { grid-row: auto; margin: 0 0 6px; }
    .yj-illu-split.yj-illu-on > #meaning-explanation-box,
    .yj-illu-split.yj-illu-on > #meanings-list { grid-column: 1; grid-row: auto; }
}

/* ── PPT 표지 테마 (2026-11-11 작가 결정) ──────────────────────────────
   기본 = forest(밤의 숲). 나머지는 설정 화면이 생기면 고를 수 있게 남겨 둔 선택지다.
   고르는 법: <html data-ppt-cover="forest|plain|gallery|split"> — illu-v2.js 가
   localStorage 'yj.pptCoverTheme' 또는 주소 ?cover= 를 읽어 붙인다(값이 없거나 모르는 값이면 forest).
     plain   = 테마 없는 기본(유자 캔버스 · 연한 세로선) — 이 파일 위쪽 규칙 그대로
     gallery = 미술관 액자 — 넓은 매트 · 깊은 그림자 · 테두리 없는 머리글
     split   = 투톤 분할 — 왼쪽 절반 유자빛 판 · 흰 매트
     forest  = 밤의 숲 — 깊은 숲빛 바탕 · 미색 큰 글자 · 유자빛 한자(교실 TV 대비)
   표지(.slide-content-main)에만 걸린다. 다른 장은 그대로다. */

/* forest — 삽화가 없는 옛 표지에도 같이 건다(권마다 표지 색이 달라지지 않게) */
html[data-ppt-cover="forest"] body.slide-page .slide-content-main::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--yj-forest, #142814);
    z-index: -1;
    pointer-events: none;
}
html[data-ppt-cover="forest"] body.slide-page .slide-content-main .huneum { color: var(--yj-cream, #FFFDF7); }
html[data-ppt-cover="forest"] body.slide-page .slide-content-main .hanja { color: var(--yj-yuja-300, #F9D75E); }
html[data-ppt-cover="forest"] body.slide-page .slide-content-main .slide-cover-right { border-left-color: rgba(255, 253, 247, .22); }
html[data-ppt-cover="forest"] body.slide-page .slide-content-main .main-cover-badge {
    background: rgba(255, 253, 247, .08);
    border-color: rgba(255, 253, 247, .18);
    box-shadow: none;
}
html[data-ppt-cover="forest"] body.slide-page .slide-content-main .main-cover-badge .badge-leaf,
html[data-ppt-cover="forest"] body.slide-page .slide-content-main .main-cover-badge .badge-series { color: var(--yj-yuja-300, #F9D75E); }
html[data-ppt-cover="forest"] body.slide-page .slide-content-main .main-cover-badge .badge-vol,
html[data-ppt-cover="forest"] body.slide-page .slide-content-main .main-cover-badge .badge-sep { color: var(--yj-cream, #FFFDF7); }
html[data-ppt-cover="forest"] body.slide-page .slide-content-main .main-cover-badge .badge-serial { color: rgba(255, 253, 247, .7); }
html[data-ppt-cover="forest"] body.slide-page .slide-content-main.yj-has-hero .yj-cover-hero {
    background: var(--yj-cream, #FFFDF7);
    border-color: transparent;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .45);
}

/* gallery */
html[data-ppt-cover="gallery"] body.slide-page .slide-content-main.yj-has-hero .yj-cover-hero {
    padding: clamp(14px, 1.4vw, 22px);
    border: 0;
    border-radius: var(--yj-r-xs, 4px);
    box-shadow: 0 2px 4px rgba(22, 24, 26, .06), 0 18px 40px rgba(22, 24, 26, .14);
}
html[data-ppt-cover="gallery"] body.slide-page .slide-content-main.yj-has-hero .main-cover-badge { background: none; border: 0; box-shadow: none; padding: 0; gap: .6rem; letter-spacing: .08em; }
html[data-ppt-cover="gallery"] body.slide-page .slide-content-main.yj-has-hero .main-cover-badge .badge-leaf { display: none; }
html[data-ppt-cover="gallery"] body.slide-page .slide-content-main.yj-has-hero .main-cover-badge::before { content: ""; width: 36px; height: 3px; border-radius: 2px; background: var(--yj-yuja-500, #F5C800); margin-right: .4rem; }
html[data-ppt-cover="gallery"] body.slide-page .slide-content-main.yj-has-hero .main-cover-badge .badge-series { color: var(--yj-sub, #66655F); font-weight: 600; }
html[data-ppt-cover="gallery"] body.slide-page .slide-content-main.yj-has-hero .huneum { font-weight: 900; letter-spacing: -.045em; }
html[data-ppt-cover="gallery"] body.slide-page .slide-content-main.yj-has-hero .slide-cover-right { border-left-width: 1px; }
html[data-ppt-cover="gallery"] body.slide-page .slide-content-main.yj-has-hero .hanja { color: var(--yj-yuja-ink, #7D6500); }
html[data-ppt-cover="gallery"] body.slide-page .slide-content-main.yj-has-hero .yj-cover-bub { border-radius: var(--yj-r-xs, 4px) var(--yj-r-lg, 12px) var(--yj-r-lg, 12px) var(--yj-r-lg, 12px); }

/* split */
html[data-ppt-cover="split"] body.slide-page .slide-content-main.yj-has-hero::before {
    content: "";
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 44vw;
    background: var(--yj-yuja-100, #FDF1C8);
    z-index: -1;
    pointer-events: none;
}
html[data-ppt-cover="split"] body.slide-page .slide-content-main.yj-has-hero .yj-cover-hero { background: #fff; border: 0; box-shadow: 0 16px 36px rgba(125, 101, 0, .18); }
html[data-ppt-cover="split"] body.slide-page .slide-content-main.yj-has-hero .main-cover-badge { background: #fff; border-color: transparent; }
html[data-ppt-cover="split"] body.slide-page .slide-content-main.yj-has-hero .yj-cover-bub { background: #fff; }
html[data-ppt-cover="split"] body.slide-page .slide-content-main.yj-has-hero .huneum { color: var(--yj-ink-deep, #0F1112); letter-spacing: -.03em; }
html[data-ppt-cover="split"] body.slide-page .slide-content-main.yj-has-hero .hanja { color: var(--yj-yuja-ink, #7D6500); }
html[data-ppt-cover="split"] body.slide-page .slide-content-main.yj-has-hero .slide-cover-right { border-left-color: var(--yj-yuja-300, #F9D75E); }
@media (max-width: 768px), (orientation: portrait) {
    html[data-ppt-cover="split"] body.slide-page .slide-content-main.yj-has-hero::before { width: 100vw; bottom: auto; height: 46dvh; }
}

/* ── 대문(index.html) 매일학습 · 하루 어휘 박스 — 대표 삽화 「스며드는 그림」 (2026-11-11 작가 결정 · 시안 C) ──
   액자 없이 박스 오른쪽 위에서 초록 속으로 옅어진다. 글자 쪽(왼쪽 · 아래)으로 갈수록 투명해져 읽기를 방해하지 않는다.
   그림이 있을 때만 .yj-home-art-on 이 붙고, 그때만 글자 줄 오른쪽을 비운다. */
.yj-home-art {
    position: absolute;
    top: 0;
    right: 0;
    width: 46%;
    height: 56%;
    border-top-right-radius: inherit;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    -webkit-mask-image: linear-gradient(to left, #000 45%, transparent 100%);
    mask-image: linear-gradient(to left, #000 45%, transparent 100%);
}
.yj-home-art[hidden] { display: none; }
.yj-home-art .yj-illu-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    -webkit-mask-image: linear-gradient(to top, transparent 0, #000 32%);
    mask-image: linear-gradient(to top, transparent 0, #000 32%);
    opacity: .95;
}
#home-hero-teacher .yj-home-art { height: 64%; }
.yj-home-art-on > :not(.yj-home-art) { position: relative; z-index: 1; }
/* 제목은 그림의 옅은 쪽 위에 써도 읽힌다(비우지 않음) — 어휘 줄만 비운다 */
.yj-home-art-on #hero-words,
.yj-home-art-on #morning-words { padding-right: 34%; }
.yj-home-art-on #hero-words { margin: 6px 0 14px; }

/* 그림이 다 보이게 (2026-11-17 작가 요청) — 삽화는 거의 정사각(655×593)인데 칸이 가로로 긴 띠라
   위아래 60% 가 잘려 내용이 전달되지 않았다. 칸을 그림 비율로 줄여 이름표(오른쪽 위) 아래 ·
   「시작하기」 단추 위에 두고, 그림은 잘라 내지 않고(contain) 가장자리만 얇게 흐린다 → 95% 이상 보임.
   위 규칙은 지우지 않고 여기서 덮는다(가산). */
.yj-home-art {
    top: 30px;
    right: var(--yj-s4, 16px);
    width: 132px;
    height: 120px;
    border-radius: var(--yj-r-md, 8px);
    -webkit-mask-image: linear-gradient(to left, #000 88%, transparent 100%);
    mask-image: linear-gradient(to left, #000 88%, transparent 100%);
}
#home-hero-teacher .yj-home-art { height: 120px; }
.yj-home-art .yj-illu-img {
    object-fit: contain;
    object-position: right center;
    -webkit-mask-image: linear-gradient(to top, transparent 0, #000 8%);
    mask-image: linear-gradient(to top, transparent 0, #000 8%);
}
/* 어휘 줄과 학생 진도 막대는 그림 폭만큼 비운다 */
.yj-home-art-on #hero-words,
.yj-home-art-on #morning-words { padding-right: 148px; }
.yj-home-art-on > .hero__bar { margin-right: 148px; }
/* 좁은 휴대폰 — 교사 모드 권·번 고르기 줄과 겹치지 않게 조금 줄인다 */
@media (max-width: 480px) {
    .yj-home-art, #home-hero-teacher .yj-home-art { width: 108px; height: 98px; }
    .yj-home-art-on #hero-words,
    .yj-home-art-on #morning-words { padding-right: 122px; }
    .yj-home-art-on > .hero__bar { margin-right: 122px; }
}
