/* こころの えほん（道徳の声つき紙芝居）：shogaku.css の上に、絵本の紙の色と丸い文字を足す */
.kk {
  --paper: #fbf6ea; --paper2: #f4ead6; --kink: #3b2a1e; --ksub: #6f5a49; --kline: #e6dccb;
  --kacc: #1f9e8f; --kacc-d: #137a6e; --choice: #fff3d6;
  --round: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "BIZ UDPGothic", sans-serif;
}
body.sh.kk { background: var(--paper); }
.kk .kk-main { max-width: 860px; overflow-wrap: anywhere; }
.kk .kk-main.kk-wide { max-width: 1040px; }
.kk-tag { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; font-family: var(--round); }
.kk-tag span { font-size: .82rem; font-weight: 700; color: #fff; background: var(--kacc-d); border-radius: 999px; padding: 0 12px; line-height: 1.9; }
.kk-tag span + span { background: #b9782c; }
.kk-tag .kk-item { background: #fff; color: var(--ksub); border: 1.5px solid var(--kline); }
.kk-h1 { font-family: var(--round); font-weight: 900; font-size: clamp(1.6rem, 6vw, 2.2rem); line-height: 1.6; margin: 0 0 12px; color: var(--kink); }
.kk-h1 rt, .kk-h2 rt { font-weight: 500; }
.kk-h2 { font-family: var(--round); font-weight: 900; font-size: 1.35rem; color: var(--kink); margin: 0 0 12px; padding: 0 0 6px; border-bottom: 3px dotted var(--kline); }
.kk-h2 small { font-size: .85rem; color: var(--ksub); margin-left: .6em; font-weight: 700; }
.kk-lead { font-family: var(--round); font-weight: 700; color: var(--ksub); font-size: 1.05rem; margin: 0 0 18px; }
.kk-note, .kk-small { font-size: .85rem; color: var(--ksub); margin: 0 0 12px; }

/* 紙芝居 */
.kk-player { font-family: var(--round); background: #fff; border-radius: 18px; padding: 12px; box-shadow: 0 2px 0 var(--kline), 0 6px 18px rgba(59,42,30,.08); margin: 0 0 24px; display: flex; flex-direction: column; gap: 10px; }
.kk-stage { position: relative; border-radius: 12px; overflow: hidden; background: var(--paper2); aspect-ratio: 3 / 2; cursor: pointer; }
.kk-stage img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .3s; }
.kk-stage img.fade { opacity: 0; }
.kk-start { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(251,246,234,.78); }
.kk-start[hidden] { display: none; }
.kk-start p { margin: 0; font-weight: 700; color: var(--ksub); }
.kk-count { position: absolute; right: 8px; bottom: 8px; background: rgba(255,255,255,.85); color: var(--ksub); font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 0 10px; line-height: 1.8; }
.kk-card { background: var(--paper); border: 2px solid var(--kline); border-radius: 14px; padding: 12px 14px; min-height: 7.5em; display: flex; flex-direction: column; gap: 6px; }
.kk-hint { margin: 0; color: var(--ksub); font-weight: 700; line-height: 1.8; }
.kk-ln { font-size: 1.2rem; line-height: 1.9; font-weight: 700; color: var(--kink); margin: 0; }
.kk-ln.old { opacity: .55; font-size: 1.05rem; }
.kk-ln.narr { color: #5a4636; font-weight: 500; }
.kk-ln.narr.old { color: var(--ksub); }
.kk-who { display: inline-block; font-size: .78rem; font-weight: 900; letter-spacing: .04em; margin-right: .5em; padding: 0 9px; border-radius: 999px; color: #fff; background: var(--c, #6b5b4e); vertical-align: 3px; line-height: 1.8; }
.kk ruby rt { font-size: max(10px, .5em); }
.kk-talk { color: var(--ksub); font-weight: 700; font-size: 1rem; margin: 2px 0 0; }

.kk .kk-btn { font-family: var(--round); font-size: 1.05rem; font-weight: 900; border-radius: 12px; border: 2px solid var(--kacc); padding: 8px 16px; cursor: pointer; background: #fff; color: var(--kacc-d); min-height: 48px; line-height: 1.3; }
.kk .kk-btn.main { background: var(--kacc-d); border-color: var(--kacc-d); color: #fff; }
.kk .kk-btn.big { font-size: 1.4rem; padding: 12px 34px; }
.kk .kk-btn.sub { border-color: var(--kline); color: var(--ksub); padding: 8px 12px; }
.kk .kk-btn[aria-pressed="false"] { text-decoration: line-through; }
.kk .kk-btn:disabled { opacity: .35; cursor: default; }
.kk .kk-btn:focus-visible, .kk .kk-choice:focus-visible, .kk .kk-dot:focus-visible, .kk-book:focus-visible { outline: 3px solid var(--kink); outline-offset: 2px; }
.kk .kk-link { font-family: var(--round); background: none; border: 0; color: var(--ksub); text-decoration: underline; font-size: .95rem; font-weight: 700; cursor: pointer; padding: 6px; min-height: 40px; }
.kk-ctrl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kk-ctrl[hidden] { display: none; }
.kk-ctrl #kk-next { margin-left: auto; min-width: 9em; }
.kk-ctrl #kk-next.ready { animation: kk-pulse 1.6s ease-in-out infinite; }
@keyframes kk-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(31,158,143,.45); } 50% { box-shadow: 0 0 0 7px rgba(31,158,143,0); } }
@media (max-width: 480px) {
  .kk-player { padding: 8px; margin-left: -8px; margin-right: -8px; }
  .kk-ctrl #kk-again span, .kk-ctrl #kk-voice span { display: none; }
  .kk-ctrl #kk-next { flex: 1; }
  .kk-ln { font-size: 1.12rem; }
}

.kk-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; margin-top: 4px; }
.kk .kk-choice { font-family: var(--round); background: var(--choice); color: var(--kink); border: 2px solid #ecd9ad; border-radius: 12px; text-align: left; padding: 10px 14px; font-size: 1.1rem; font-weight: 700; cursor: pointer; min-height: 52px; line-height: 1.6; }
.kk .kk-choice:hover { border-color: var(--kacc); }
.kk-choices.weather { grid-template-columns: repeat(3, 1fr); }
.kk-choices.weather .kk-choice { text-align: center; font-size: 1.8rem; line-height: 1.3; }
.kk-choices.weather .kk-choice span { display: block; font-size: 1rem; }
.kk-scale { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; font-weight: 700; color: var(--ksub); margin-top: 4px; }
.kk-scale > span { white-space: nowrap; font-size: .95rem; }
.kk .kk-dot { width: calc(24px + var(--k) * 5px); height: calc(24px + var(--k) * 5px); flex: none; padding: 0; border-radius: 50%; background: var(--choice); border: 2px solid #ecd9ad; cursor: pointer; }
.kk .kk-dot.on { background: var(--kacc); border-color: var(--kacc-d); }
.kk-end { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.kk-end a.kk-btn { text-decoration: none; display: inline-flex; align-items: center; }
.kk-owari { font-weight: 900; color: var(--kacc-d); font-size: 1.1rem; margin: 4px 0 0; }

/* おはなしの ぶん */
.kk-text, .kk-parents { background: #fff; border-radius: 16px; padding: 18px 18px 20px; margin: 0 0 22px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.kk-text { font-family: var(--round); }
.kk-sc { padding: 8px 0; border-bottom: 1px dashed var(--kline); }
.kk-p { margin: 0; font-size: 1.08rem; line-height: 2; color: var(--kink); font-weight: 700; }
.kk-p.narr { font-weight: 500; color: #4a3828; }
.kk-p.kk-opt { color: var(--ksub); font-size: .95rem; font-weight: 700; }
.kk-branch { display: grid; gap: 12px; margin: 12px 0; }
.kk-arm { border: 2px solid var(--kline); border-radius: 14px; padding: 10px 14px; background: var(--paper); }
.kk-armh { font-size: 1.05rem; font-weight: 900; margin: 0 0 4px; color: var(--kacc-d); line-height: 1.9; }
.kk-armn { display: inline-block; background: var(--kacc-d); color: #fff; border-radius: 8px; padding: 0 8px; margin-right: 6px; font-size: .85rem; vertical-align: 2px; line-height: 1.7; }
.kk-reasons { margin: 0 0 6px; padding-left: 1.3em; font-size: .95rem; color: var(--ksub); }
.kk-merge { text-align: center; color: var(--ksub); font-size: .9rem; font-weight: 700; margin: 4px 0; }
.kk-merge:empty { display: none; }

/* おうちの方・先生へ */
.kk-parents { font-size: 1rem; line-height: 1.85; }
.kk-parents dl { margin: 0; }
.kk-parents dt { font-weight: 700; color: var(--kacc-d); margin: 14px 0 4px; }
.kk-parents dt:first-child { margin-top: 0; }
.kk-parents dd { margin: 0; }
.kk-parents ul, .kk-parents ol { margin: 4px 0; padding-left: 1.3em; }
.kk-parents li { margin: 2px 0; }
.kk-book .s { display: block; font-family: var(--body, "BIZ UDPGothic", sans-serif); font-size: .8rem; line-height: 1.6; color: var(--ksub); padding: 0 10px 12px; border-top: 1px dashed var(--kline); margin: 0 10px; padding-left: 0; padding-right: 0; padding-top: 6px; }
.kk-cat { margin: 0 0 4px; }
.kk-mext { list-style: none; padding: 10px 12px !important; background: var(--paper); border-radius: 10px; }
.kk-band { display: block; font-size: .85rem; color: var(--ksub); font-weight: 700; }
.kk-src { font-size: .82rem; color: var(--ksub); margin: 16px 0 0; }

/* 前後のリンク */
.kk-pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; margin: 0 0 22px; font-family: var(--round); }
.kk-pg { display: flex; flex-direction: column; background: #fff; border: 2px solid var(--kline); border-radius: 14px; padding: 8px 12px; text-decoration: none; color: var(--kink); font-weight: 900; line-height: 1.6; min-width: 0; }
.kk-pg small { font-size: .78rem; color: var(--ksub); font-weight: 700; }
.kk-pg.next { text-align: right; }
.kk-pg.shelf { text-align: center; justify-content: center; }
.kk-pg:hover { border-color: var(--kacc); }
@media (max-width: 560px) {
  .kk-pager { grid-template-columns: 1fr 1fr; }
  .kk-pg.shelf { grid-column: 1 / -1; order: 3; }
}

/* 本だな */
.kk-jump { list-style: none; margin: 0 0 18px; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; font-family: var(--round); }
.kk-jump a { display: inline-flex; align-items: baseline; gap: .5em; padding: 8px 16px; border-radius: 99px; border: 2px solid var(--kline); background: var(--paper2); color: var(--kink); text-decoration: none; font-weight: 900; }
.kk-jump a small { color: var(--ksub); font-weight: 700; font-size: .8rem; }
.kk-jump a:hover { border-color: var(--kacc); }
.kk-cat { margin: 0 0 22px; scroll-margin-top: 12px; }
.kk-h3 { font-family: var(--round); font-weight: 900; font-size: 1.12rem; margin: 0 0 10px; display: flex; align-items: baseline; gap: .6em; flex-wrap: wrap; padding-left: 10px; border-left: 6px solid var(--kcat, var(--kacc)); }
.kk-h3 small { font-size: .78rem; color: var(--ksub); font-weight: 700; }
.kk-cat-A { --kcat: #e0913a; } .kk-cat-B { --kcat: #d9668a; } .kk-cat-C { --kcat: #3f8fc7; } .kk-cat-D { --kcat: #4fa36a; }
.kk-shelf { margin: 0 0 26px; scroll-margin-top: 12px; }
.kk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .kk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { .kk-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kk-book { display: flex; flex-direction: column; background: #fff; border: 2px solid var(--kline); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--kink); box-shadow: 0 3px 0 var(--kline); font-family: var(--round); transition: transform .15s; }
.kk-book:hover { border-color: var(--kacc); transform: translateY(-2px); }
.kk-book img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; display: block; background: var(--paper2); }
.kk-book .t { display: block; font-size: 1.08rem; font-weight: 900; line-height: 1.5; padding: 8px 10px 2px; word-break: auto-phrase; text-wrap: pretty; }
.kk-book .n { display: block; font-size: .76rem; color: var(--ksub); font-weight: 500; padding: 0 10px 10px; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .kk-stage img, .kk-book { transition: none; } .kk-ctrl #kk-next.ready { animation: none; } }
.kk-mext li + li { margin-top: 8px; }
.kk-mext li.base { font-weight: 700; }
.kk-band b { color: #b45309; margin-left: .6em; font-size: .8rem; }

.kk-ico { width: 1.1em; height: 1.1em; vertical-align: -0.18em; }
.kk-wico { display: block; margin: 0 auto 2px; color: var(--kacc-d); }
