/* Welt Kinderbücher: Nachtstimmung, Gouache-Anmutung. Alle Regeln mit Präfix .kb-. Animationen nur transform/opacity. */
.kb {
  --kb-deep: #08112b; --kb-mid: #16295a; --kb-glow: #ffe9a0; --kb-cream: #f6ecd9; --kb-orange: #ffa348;
  --kb-muted: rgba(246, 236, 217, .78); --kb-line: rgba(246, 236, 217, .2);
  --w: 64px; --h: 300px; --d: 200px;
  background: var(--kb-deep); color: var(--kb-cream); font-family: var(--serif);
}
.kb h1, .kb h2, .kb h3 { font-weight: 400; margin: 0; line-height: 1.1; }
.kb h2 { font-size: clamp(1.9rem, 4.6vw, 3rem); font-style: italic; margin-bottom: .6rem; }
.kb h3 { font-size: 1.25rem; color: var(--kb-orange); }
.kb p { margin: 0 0 1rem; }
.kb a { color: inherit; }
.kb-wrap { position: relative; width: min(1100px, 100%); margin: 0 auto; }
.kb-narrow { width: min(760px, 100%); }
.kb-small { font-family: var(--sans); font-size: .85rem; color: var(--kb-muted); }
.kb-lead { font-size: clamp(1.1rem, 2vw, 1.4rem); max-width: 46ch; color: var(--kb-cream); }
.kb-lead2 { font-size: 1.1rem; max-width: 60ch; color: var(--kb-muted); }
.kb-subtitle { font-size: clamp(1.15rem, 2.4vw, 1.6rem); font-style: italic; color: var(--kb-glow); margin: 0 0 .4rem !important; }
.kb-by { font-family: var(--sans); font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--kb-muted); }
.kb .status { color: var(--kb-orange); }
.kb-todo { display: inline-block; background: rgba(255, 163, 72, .12); border-left: 3px solid var(--kb-orange); padding: 4px 10px; font-family: var(--sans); font-size: .9rem; color: #ffd9a8; }
.kb-flag { display: inline-block; font-family: var(--sans); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; padding: 5px 10px; border: 1px dashed var(--kb-orange); color: #ffd9a8; border-radius: 3px; }
.kb-ki { font-family: var(--sans); font-size: .85rem; color: var(--kb-muted); display: flex; gap: 10px; align-items: baseline; }
.kb-ki .ki-badge { flex: none; }

/* ---- Buttons ---- */
.kb-btn { display: inline-block; font-family: var(--sans); font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; padding: 14px 24px; border-radius: 999px; border: 1.5px solid var(--kb-orange); color: var(--kb-orange); background: transparent; cursor: pointer; transition: transform .3s var(--ease), background .3s; }
.kb-btn:hover { transform: translateY(-2px); }
.kb-btn-main, a.kb-btn.kb-btn-main { background: var(--kb-orange); color: #1a1020; }
.kb-btn-ghost { border-color: var(--kb-line); color: var(--kb-cream); }
.kb-btn[disabled] { cursor: not-allowed; border-style: dashed; border-color: var(--kb-line); color: var(--kb-muted); background: rgba(255, 255, 255, .04); transform: none; }
.kb-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.kb-buy { display: grid; gap: 10px; justify-items: start; margin-top: 8px; }
.kb-buy > .kb-btn, .kb-buy > .kb-ad { margin-right: 6px; }
.kb-ad { font-family: var(--sans); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; padding: 3px 8px; border: 1px solid currentColor; border-radius: 3px; color: #ffd9a8; }
.kb-buy .kb-small { margin: 0; max-width: 46ch; }

/* ---- Himmel: Mond und Glühwürmchen ---- */
.kb-hero { position: relative; overflow: hidden; isolation: isolate; padding: 130px var(--gutter) 70px; display: grid; gap: 40px;
  background: radial-gradient(ellipse at 70% 10%, #2a4488 0%, transparent 55%), linear-gradient(180deg, #0e1b3d 0%, #0a1431 60%, var(--kb-deep) 100%); }
.kb-hero h1 { font-size: clamp(2.8rem, 8vw, 6rem); font-style: italic; margin: .5rem 0 1rem; }
.kb-hero-small { padding-bottom: 50px; }
.kb-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
.kb-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.kb-moon { position: absolute; top: 12%; right: 10%; width: clamp(70px, 10vw, 130px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #fff7dc, #fbe9b8 60%, #ecd08e); box-shadow: 0 0 60px 14px rgba(251, 233, 184, .3), 0 0 160px 50px rgba(251, 233, 184, .1);
  animation: kb-moonfloat 14s ease-in-out infinite alternate; }
.kb-moon::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 62% 60%, rgba(180, 150, 90, .28) 0 12%, transparent 13%), radial-gradient(circle at 30% 68%, rgba(180, 150, 90, .2) 0 8%, transparent 9%); }
@keyframes kb-moonfloat { from { transform: translateY(0); } to { transform: translateY(14px); } }
.kb-fly { position: absolute; left: var(--x); top: var(--y); width: 6px; height: 6px; border-radius: 50%; background: #ffeaa8;
  box-shadow: 0 0 10px 4px rgba(255, 220, 120, .65); opacity: .7; animation: kb-fly var(--t, 9s) ease-in-out var(--dl, 0s) infinite alternate; }
@keyframes kb-fly { 0% { transform: translate(0, 0); opacity: .25; } 50% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)); opacity: .45; } }

/* ---- Regal ---- */
.kb-shelfwrap { position: relative; padding: 46px clamp(16px, 5vw, 60px) 0; border-radius: 16px 16px 0 0;
  background: linear-gradient(180deg, rgba(4, 9, 26, .55), rgba(10, 20, 50, .35)); box-shadow: inset 0 0 70px rgba(0, 0, 0, .5); }
.kb-shelf { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-end; gap: 14px; min-height: calc(var(--h) + 10px); }
.kb-board { height: 26px; margin: 0 calc(-1 * clamp(16px, 5vw, 60px)); border-radius: 3px;
  background: linear-gradient(180deg, #3b2f5a 0, #2a2148 40%, #1a1436 100%); box-shadow: 0 16px 30px -8px rgba(0, 0, 0, .6), inset 0 2px 0 rgba(255, 220, 160, .18); }
.kb-slot { perspective: 1400px; position: relative; flex: none; }
.kb-slot-real { width: var(--w); margin-right: 26px; z-index: 3; }
.kb-slot-real:hover, .kb-slot-real:focus-within { z-index: 5; }
.kb-book { display: block; width: var(--w); height: var(--h); outline: none; -webkit-tap-highlight-color: transparent; }
.kb-box { display: block; position: relative; width: var(--w); height: var(--h); transform-style: preserve-3d; transition: transform .9s var(--ease); will-change: transform; }
.kb-book:hover .kb-box, .kb-book:focus-visible .kb-box { transform: translateX(46px) translateZ(90px) rotateY(-68deg); }
.kb-book:focus-visible::after { content: ""; position: absolute; left: -8px; right: -8px; top: -8px; bottom: -8px; outline: 2px solid var(--gold-hi); border-radius: 6px; pointer-events: none; }
.kb-face { position: absolute; display: block; backface-visibility: hidden; overflow: hidden; }
.kb-spine { width: var(--w); height: var(--h); left: 0; top: 0; transform: translateZ(calc(var(--d) / 2)); border-radius: 2px 0 0 2px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .3), rgba(255, 255, 255, .08) 22%, transparent 50%, rgba(0, 0, 0, .25)), var(--bc, #2b4a8f);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 14px 0 12px; gap: 10px; }
.kb-band { display: block; width: 100%; height: 6px; background: var(--kb-orange); opacity: .9; }
.kb-spine-t { writing-mode: vertical-rl; font-style: italic; font-size: 1.12rem; letter-spacing: .02em; color: var(--kb-cream); margin-top: 6px; }
.kb-spine-a { writing-mode: vertical-rl; font-family: var(--sans); font-size: .56rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(246, 236, 217, .75); }
.kb-dot { display: block; width: 9px; height: 9px; border-radius: 50%; background: #ffeaa8; box-shadow: 0 0 12px 5px rgba(255, 220, 120, .7); animation: kb-pulse 3.4s ease-in-out infinite; }
@keyframes kb-pulse { 50% { opacity: .45; } }
.kb-cover { width: var(--d); height: var(--h); left: calc((var(--w) - var(--d)) / 2); top: 0; transform: rotateY(90deg) translateZ(calc(var(--w) / 2)); }
.kb-back { width: var(--d); height: var(--h); left: calc((var(--w) - var(--d)) / 2); top: 0; transform: rotateY(-90deg) translateZ(calc(var(--w) / 2)); background: #16295a; }
.kb-fore { width: var(--w); height: var(--h); left: 0; top: 0; transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); background: repeating-linear-gradient(90deg, #f0e6cf 0 3px, #d9cdb0 3px 4px); }
.kb-top { width: var(--w); height: var(--d); left: 0; top: calc((var(--h) - var(--d)) / 2); transform: rotateX(90deg) translateZ(calc(var(--h) / 2)); background: #e8dcc0; }
.kb-slot-ghost { width: 46px; height: calc(var(--h) * var(--hn, .8)); }
.kb-ghost { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border: 1.5px dashed rgba(246, 236, 217, .34); border-radius: 3px; background: rgba(255, 255, 255, .03); }
.kb-ghost span { writing-mode: vertical-rl; font-family: var(--sans); font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; color: rgba(246, 236, 217, .72); }
.kb-hint { font-family: var(--sans); font-size: .82rem; color: var(--kb-muted); margin: 18px 0 0; max-width: 60ch; }
.kb-foxsit { position: absolute; right: clamp(12px, 8%, 110px); bottom: 24px; width: clamp(86px, 11vw, 140px); }
.kb-foxsit .kb-fox-svg { transform-origin: 50% 100%; animation: kb-breathe 5s ease-in-out infinite; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
.kb-fox-svg .kb-tail { transform-origin: 70% 90%; animation: kb-tail 6s ease-in-out infinite; }
@keyframes kb-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.02, 1.045); } }
@keyframes kb-tail { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-4deg); } }

/* ---- Cover-Platzhalter ---- */
.kb-art { container-type: size; display: block; width: 100%; height: 100%; position: relative; overflow: hidden; text-align: center; background: radial-gradient(ellipse at 70% 12%, #35529c, #14224d 55%, #0a1330); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.kb-art-in { display: flex; flex-direction: column; align-items: center; justify-content: space-between; width: 100%; height: 100%; padding: 9cqw 8cqw 7cqw; position: relative; }
.kb-art-moon { position: absolute; top: 5cqw; right: 8cqw; width: 14cqw; aspect-ratio: 1; border-radius: 50%; background: #fbe9b8; box-shadow: 0 0 6cqw 1cqw rgba(251, 233, 184, .4); }
.kb-art-star { position: absolute; left: var(--x); top: var(--y); width: 1.6cqw; height: 1.6cqw; border-radius: 50%; background: #ffeaa8; box-shadow: 0 0 2cqw .6cqw rgba(255, 220, 120, .7); }
.kb-art-title { position: relative; font-style: italic; font-size: 9.4cqw; line-height: 1.08; color: var(--kb-cream); margin-top: 8cqw; text-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.kb-art-fox { width: 40cqw; height: auto; flex: none; }
.kb-art-sub { font-size: 4.6cqw; line-height: 1.25; color: #ffe9b8; }
.kb-art-by { font-family: var(--sans); font-size: 3.6cqw; letter-spacing: .2em; text-transform: uppercase; color: rgba(246, 236, 217, .85); }
.kb-ph { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); white-space: nowrap; font-family: var(--sans); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; padding: 3px 9px; border: 1px dashed #ffd9a8; color: #ffe2bd; background: rgba(8, 17, 43, .82); border-radius: 3px; }
.kb-art .kb-ph { top: 6cqw; bottom: auto; left: 8cqw; transform: none; font-size: 2.9cqw; padding: .6cqw 2cqw; }

/* ---- Echtes Coverbild ---- */
.kb-cover-img { display: block; position: relative; width: 100%; height: 100%; }
.kb-cover-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kb-cover-img .ki-badge, .kb-figart .ki-badge { position: absolute; top: 8px; right: 8px; z-index: 2; }

/* ---- Abschnitte ---- */
.kb-sec { background: var(--kb-deep); padding: 80px var(--gutter); }
.kb-sec-alt { background: #0c1938; }
.kb-sec-tight { padding: 40px var(--gutter) 80px; }
.kb-two { display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; align-items: center; }
.kb-cards { display: grid; gap: 16px; }
.kb-card { display: block; text-decoration: none; padding: 24px 26px; border: 1px solid var(--kb-line); border-radius: 10px; background: rgba(246, 236, 217, .045); transition: transform .4s var(--ease), border-color .3s; }
.kb-card:hover, .kb-card:focus-visible { transform: translateY(-4px); border-color: var(--kb-orange); }
.kb-card p { margin: .4rem 0 0; color: var(--kb-muted); }
.kb-pagenav { margin-top: 40px; }
.kb .pagenav a { color: var(--kb-orange); }
.kb .pagenav a[aria-current="page"] { color: var(--kb-cream); text-decoration: underline; }

/* ---- Buchseite ---- */
.kb-bookhead { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: clamp(28px, 6vw, 70px); align-items: center; }
.kb-hero-book h1 { font-size: clamp(2.2rem, 5.6vw, 4.4rem); font-style: italic; margin: .6rem 0 .8rem; }
.kb-bookcover { aspect-ratio: 2 / 3; width: 100%; border-radius: 3px 8px 8px 3px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8), -6px 0 0 rgba(0, 0, 0, .3); transform: rotate(-2deg); transition: transform .6s var(--ease); }
.kb-bookcover:hover { transform: rotate(0) translateY(-6px); }
.kb-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 18px 0 22px; padding: 0; }
.kb-facts li { font-size: 1.05rem; }
.kb-facts span { display: block; font-family: var(--sans); font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--kb-orange); }
.kb-stories { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 16px; counter-reset: s; }
.kb-story { display: grid; grid-template-columns: 56px 1fr; gap: 18px; align-items: start; padding: 22px 24px; border: 1px solid var(--kb-line); border-radius: 10px; background: rgba(246, 236, 217, .04); }
.kb-nr { font-size: 2.8rem; font-style: italic; line-height: 1; color: var(--kb-orange); }
.kb-theme { margin: .3rem 0 .6rem !important; color: var(--kb-muted); }
.kb-refrain { margin: 0 !important; font-style: italic; font-size: 1.15rem; color: var(--kb-glow); }
.kb-lab { font-family: var(--sans); font-style: normal; font-size: .64rem; letter-spacing: .2em; text-transform: uppercase; color: var(--kb-muted); margin-right: 8px; }
.kb-figs { list-style: none; padding: 0; margin: 30px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.kb-fig { display: flex; flex-direction: column; gap: 6px; }
.kb-fig p { margin: 0; color: var(--kb-muted); font-size: .98rem; }
.kb-figart { position: relative; aspect-ratio: 1; border-radius: 18px; display: grid; place-items: center; margin-bottom: 8px; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--fc) 30%, #16295a), #0e1b3d 75%); border: 1px dashed rgba(246, 236, 217, .28); }
.kb-figart:has(.kb-fig-img) { border-style: solid; }
.kb-sil { width: 58%; height: auto; }
.kb-fig-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kb-glow { animation: kb-pulse 3.4s ease-in-out infinite; }
.kb-buy-bottom { display: grid; gap: 6px; }

/* ---- Eltern ---- */
.kb-tips { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 16px; }
.kb-tips li { padding: 22px 24px; border-left: 3px solid var(--kb-orange); background: rgba(246, 236, 217, .045); border-radius: 0 10px 10px 0; }
.kb-tips p { margin: .4rem 0 0; }
.kb-tablewrap { overflow-x: auto; margin: 26px 0 20px; }
.kb-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.kb-table th, .kb-table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--kb-line); vertical-align: top; }
.kb-table thead th { font-family: var(--sans); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--kb-orange); font-weight: 500; }
.kb-table tbody th { font-weight: 400; color: var(--kb-cream); font-style: italic; }
.kb-table td:last-child { color: var(--kb-glow); font-style: italic; }

/* ---- Pause-Schalter ---- */
.kb-pause { position: absolute; right: var(--gutter); bottom: 16px; z-index: 6; font-family: var(--sans); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--kb-line); background: rgba(8, 17, 43, .6); color: var(--kb-muted); cursor: pointer; }
.kb-pause:hover { color: var(--kb-cream); border-color: var(--kb-orange); }
.js-off .kb-pause { display: none; }
.kb-still .kb *, .kb-still .kb *::before, .kb-still .kb *::after { animation: none !important; }

/* ---- Touch: Buch steht schon gekippt ---- */
@media (hover: none) { .kb-box { transform: translateX(46px) translateZ(90px) rotateY(-62deg); } }

/* ---- Mobil ---- */
@media (max-width: 800px) {
  .kb { --w: 54px; --h: 250px; --d: 167px; }
  .kb-two, .kb-bookhead { grid-template-columns: 1fr; }
  .kb-bookcover { max-width: 260px; }
  .kb-spine-t { font-size: 1.1rem; }
  .kb-slot-ghost { width: 38px; }
  .kb-slot-real { margin-right: 14px; }
  .kb-shelf { gap: 10px; }
  .kb-hero { padding-top: 110px; }
  .kb-foxsit { display: none; }
  .kb-pause { position: static; justify-self: start; }
  .kb-story { grid-template-columns: 40px 1fr; padding: 18px; }
  .kb-nr { font-size: 2.1rem; }
}

/* ---- Bewegung reduzieren: alles still ---- */
@media (prefers-reduced-motion: reduce) {
  .kb *, .kb *::before, .kb *::after { animation: none !important; transition: none !important; }
  .kb-pause { display: none; }
}

/* Regal-Rubrik (Bücher-Welt, 02.10.2026) */
.kb-shelflabel { position: absolute; top: 14px; left: clamp(16px, 5vw, 60px); margin: 0; font-family: var(--sans); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: rgba(246,236,217,.6); }

/* Fuchs am Regal: beim Drüberfahren blinzelt er oder rennt kurz weg und kommt zurück (Marcus, 02.10.2026). Steuerung in w-kinderbuecher.js */
.kb-foxsit { cursor: pointer; }
.kb-foxrun { will-change: transform, opacity; }
.kb-fox-svg .kb-eye { transform-box: fill-box; transform-origin: 50% 50%; }
.kb-foxsit.kb-blink .kb-eye { animation: kb-blink .42s ease-in-out 2; }
@keyframes kb-blink { 0%, 100% { transform: scaleY(1); } 45%, 55% { transform: scaleY(.08); } }
