/*
 * 이솝 우화의 세로 지면(SONUB-SSOT.md 18절 "이솝 우화의 세로 지면", 만드는 법 SONUB-ENGLISH-BOOK.md) — 레슨 x-widget.learn.english.fable-lesson.
 * 알파벳 · 파닉스 · 영어 면접과 같은 세로 지면이다 — 수업 모드(.picture-book)에서는 384 × 512 조판 하나에 한 쪽이 스크롤 없이 들어가고,
 * 교실 · 교재 화면은 그 지면을 통째로 확대한다(book-frame.css). 화면 폭마다 다른 배치는 없다.
 * 쪽마다 모양이 다르다 — ① Words: 삽화 아래 요약과 낱말 카드 둘씩 ② Story: 책 본문 ③ Talk: 교훈 카드 아래 번호 질문 · 말풍선 질문.
 * 색은 data-tone 하나(--book-tone-*)에서 나온다 — 기본 · 다크 · 핑크 테마에서 저절로 맞는다. 글자는 12px 아래로 내리지 않는다.
 */
.fable-lesson { display: grid; gap: 10px; color: var(--sonub-ink); }
.fable-lesson > section { display: grid; gap: 8px; align-content: start; }
.fable-step-title { margin: 0; font-size: 20px; line-height: 1.25; }
.fable-lesson h3 { margin: 0 0 2px; font-size: 12px; font-weight: 700; line-height: 1.3; letter-spacing: .02em; color: var(--book-tone-ink); }
.fable-lesson h3 i { margin-inline-end: 2px; }
.fable-lesson .fable-label { margin: 1px 0 -4px; }

/* ① Words — 삽화(번호 · 제목) · 쉬운 영어 요약 · 낱말 넷 */
.fable-scene {
	position: relative; overflow: hidden; margin: 0; block-size: 150px; border-radius: 16px;
	border: 1px solid var(--book-tone-line); background: var(--book-tone-soft);
}
.fable-scene img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; object-position: 50% 30%; }
.fable-scene.is-emoji { display: grid; place-items: center; }
.fable-scene-emoji { font-size: 60px; line-height: 1; letter-spacing: .12em; }
.fable-scene figcaption {
	position: absolute; inset-inline-start: 8px; inset-block-end: 8px; display: flex; align-items: center; gap: 7px;
	max-inline-size: calc(100% - 16px); box-sizing: border-box; padding: 3px 12px 4px 4px; border-radius: 999px;
	background: color-mix(in srgb, var(--wa-color-surface-raised) 92%, transparent);
}
.fable-scene figcaption b {
	flex: none; display: grid; place-items: center; min-inline-size: 24px; block-size: 24px; box-sizing: border-box; padding-inline: 5px; border-radius: 999px;
	color: var(--wa-color-surface-raised); background: var(--book-tone-ink); font-size: 12px; font-variant-numeric: tabular-nums;
}
.fable-scene figcaption strong { min-inline-size: 0; font: 700 19px/1.15 Georgia, var(--wa-font-family-heading); letter-spacing: -.02em; overflow-wrap: anywhere; }
.fable-summary {
	margin: 0; padding: 7px 12px 8px; font-size: 15px; line-height: 1.38;
	border-inline-start: 3px solid var(--book-tone); border-radius: 0 12px 12px 0; background: var(--book-tone-soft);
}
.fable-words { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.fable-words > li {
	display: grid; align-content: start; gap: 1px; min-inline-size: 0; margin: 0; padding: 5px 10px 6px;
	border: 1px solid var(--wa-color-surface-border); border-block-start: 3px solid var(--book-tone-line); border-radius: 10px;
	background: var(--wa-color-surface-raised);
}
.fable-words b { font-size: 17px; line-height: 1.2; color: var(--book-tone-ink); overflow-wrap: anywhere; }
.fable-words span { font-size: 13px; line-height: 1.3; color: var(--sonub-ink); overflow-wrap: anywhere; }

/* ② Story — 책 본문. 문단 하나가 강사가 짚는 조각 하나 */
.fable-text { display: grid; gap: 4px; }
.fable-text p { margin: 0; font: 15.5px/1.34 Georgia, serif; overflow-wrap: break-word; }
.fable-text p:first-child::first-letter { font: 700 1.5em/1 Georgia, var(--wa-font-family-heading); color: var(--book-tone-ink); }
.fable-lesson mark { padding: 0 1px; border-radius: 3px; color: inherit; font-weight: 700; background: linear-gradient(transparent 58%, var(--book-tone-fill) 58%); }

/* ③ Talk — 교훈 카드 · 확인 질문(번호) · 정답(접힘) · 이야기 나누기(말풍선 줄) */
.fable-moral {
	padding: 5px 13px 7px; border: 1.5px solid var(--book-tone-line); border-radius: 14px;
	background: linear-gradient(120deg, var(--wa-color-surface-raised), var(--book-tone-soft));
}
.fable-moral p { margin: 0; font: 700 16px/1.25 Georgia, var(--wa-font-family-heading); overflow-wrap: break-word; }
.fable-asks { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; counter-reset: fable-ask; }
.fable-asks > li {
	position: relative; counter-increment: fable-ask; margin: 0; padding: 0; padding-inline-start: 25px; font-size: 14.5px; line-height: 1.25;
}
.fable-asks > li::before {
	content: counter(fable-ask); position: absolute; inset-block-start: 1px; inset-inline-start: 0;
	display: grid; place-items: center; inline-size: 17px; block-size: 17px; border-radius: 50%;
	color: var(--wa-color-surface-raised); background: var(--book-tone-ink); font-size: 12px; font-weight: 700; line-height: 1;
}
.fable-asks.is-talk > li::before { content: "?"; color: var(--book-tone-ink); background: var(--book-tone-fill); }
.fable-answers { display: grid; gap: 2px; margin: 0; font-size: 14px; line-height: 1.35; }
.fable-answers span { display: block; }
.fable-answers b { color: var(--book-tone-ink); }

/* 수업 모드의 세로 지면(384 × 512) — 쪽 이름은 위 쪽 탭이 보이므로 절 제목은 화면 읽기 프로그램에만 남긴다 */
.picture-book .fable-step-title {
	position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.picture-book .fable-lesson .lesson-note > summary { min-block-size: 26px; font-size: 13px; }
/* Words 쪽은 지면을 꼭 채운다 — 요약 · 낱말이 쓰고 남은 높이를 삽화가 갖는다(낱말 뜻이 긴 언어에서도 넘치지 않는다) */
.picture-book .textbook-widget-body:has(> .fable-lesson) { flex: 1 1 auto; display: flex; flex-direction: column; }
.picture-book .fable-lesson { flex: 1 1 auto; display: flex; flex-direction: column; }
.picture-book .fable-lesson > section { gap: 7px; }
.picture-book .fable-lesson > section[data-page='talk'] { gap: 4px; }
/* 쪽 탭 이름은 한 줄 — 두 낱말 이름(베트남어 Từ vựng)이 두 줄이 되면 머리가 높아져 지면이 넘친다 */
.picture-book [data-portrait-book='aesop'] .textbook-widget-pages button span { white-space: nowrap; }
/* 책 이름과 쪽수도 한 줄 — 긴 이름(베트남어 Truyện ngụ ngôn Aesop)이 두 줄이 되면 머리가 높아진다 */
.picture-book [data-portrait-book='aesop'] .picture-book-heading > strong { min-inline-size: 0; overflow: hidden; font-size: 21px; white-space: nowrap; text-overflow: ellipsis; }
.picture-book [data-portrait-book='aesop'] .picture-book-folio { flex: none; white-space: nowrap; }
.picture-book .fable-lesson > section[data-page='words'] { gap: 5px; flex: 1 1 auto; display: flex; flex-direction: column; }
.picture-book .fable-scene { flex: 1 1 60px; min-block-size: 60px; max-block-size: 190px; block-size: auto; }
.picture-book .fable-scene img { position: absolute; inset: 0; }
.picture-book .textbook-widget .fable-lesson .lesson-note > p { margin: 0 4px 7px; font-size: 13.5px; }

/* 이야기의 표제와 장 번호. 원문은 밝기 테마의 잉크색과 종이색을 받는다. */
.fable-running-head { display: flex; align-items: baseline; gap: 12px; padding-block-end: 6px; border-block-end: 1px solid var(--book-tone-line); }
.fable-running-head strong { flex: 1; font: 700 19px/1.12 Georgia, serif; color: var(--book-tone-ink); }
.fable-running-head span { flex: none; font: 600 13px/1.2 var(--wa-font-family-body); color: var(--sonub-muted); }
.picture-book .textbook-widget[data-portrait-book='aesop'] { gap: 7px; }
.picture-book .textbook-widget[data-portrait-book='aesop'] .textbook-widget-pages button b { font-size: 12px; }
.picture-book .fable-page:has(.lesson-note[open]) :is(.fable-discussion, .is-talk) { display: none; }

/* 번호 범위로 찾는 삽화 목차 */
.fable-catalog { display: grid; gap: 12px; min-inline-size: 0; }
.fable-cover { position: relative; isolation: isolate; display: grid; align-items: end; min-block-size: 136px; overflow: hidden; border-radius: 14px; background: var(--book-tone-soft); }
.fable-cover img { position: absolute; z-index: -1; inline-size: 100%; block-size: 100%; object-fit: cover; object-position: center 38%; }
.fable-cover > div { margin: 8px; padding: 5px 12px 7px; justify-self: start; border-inline-start: 3px solid var(--book-tone); border-radius: 6px; background: var(--wa-color-surface-raised); }
.fable-cover h1, .fable-cover p, .fable-catalog h2 { margin: 0; }
.fable-cover h1 { font: 700 22px/1.2 Georgia, var(--wa-font-family-heading); }
.fable-cover p { font-size: 13px; line-height: 1.35; }
.fable-ranges { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 4px; }
.fable-ranges a { display: grid; place-items: center; min-block-size: 32px; font-size: 13px; font-weight: 650; color: var(--book-tone-ink); background: var(--book-tone-soft); border: 1px solid var(--book-tone-line); border-radius: 6px; text-decoration: none; }
.fable-catalog h2 { display: flex; align-items: center; gap: 10px; margin-block-end: 4px; font: 700 18px/1.4 Georgia, serif; color: var(--book-tone-ink); }
.fable-catalog h2::after { content: ''; flex: 1; border-block-start: 1px solid var(--book-tone-line); }
.fable-shelf { list-style: none; margin: 0; padding: 0; }
.fable-shelf a { display: flex; align-items: center; gap: 11px; padding-block: 6px; border-block-end: 1px solid var(--page-rule); text-decoration: none; color: var(--sonub-ink); }
.fable-shelf a:is(:hover, :focus-visible) { background: var(--book-tone-soft); }
.fable-thumb { position: relative; display: grid; place-items: center; flex: none; inline-size: 64px; block-size: 48px; background: var(--book-tone-soft); border-radius: 7px; }
.fable-thumb img { inline-size: 100%; block-size: 100%; object-fit: cover; border-radius: inherit; }
.fable-thumb b { position: absolute; inset-inline-start: 2px; inset-block-end: 2px; padding-inline: 4px; border-radius: 4px; font: 700 12px/16px var(--wa-font-family-body); background: var(--wa-color-surface-raised); color: var(--book-tone-ink); }
.fable-entry { flex: 1; display: grid; gap: 2px; }
.fable-entry strong { font: 700 17px/1.12 Georgia, serif; }
.fable-entry span { color: var(--sonub-muted); font-size: 13px; line-height: 1.25; }
.fable-shelf a > i { color: var(--book-tone-ink); font-size: 12px; }
