.wiki-shell {
  align-items: stretch;
}

.wiki-band {
  width: min(1180px, 100%));
}

.wiki-book-intro {
  color: #fff;
  padding: 20px 28px 6px;
}

.wiki-book-intro h2 {
  color: #fff;
  font-size: clamp(1.6rem, 2.4vw, 2.35rem);
  margin: 0 0 8px;
}

.wiki-book-intro p {
  margin: 0;
  max-width: 760px;
  font-size: 1.08rem;
}

.wiki-kicker {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wiki-reader {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  padding: 18px 28px 32px;
}

.wiki-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  padding: 18px 28px 32px;
}

.wiki-topic-card {
  display: grid;
  grid-template-rows: 150px auto;
  min-height: 230px;
  background:
    linear-gradient(90deg, rgba(12, 26, 45, 0.04), rgba(255, 255, 255, 0) 18%),
    linear-gradient(#fffdf6, #f7f0df);
  border-left: 6px solid var(--accent);
  color: #15005d;
  text-decoration: none;
  overflow: hidden;
}

.wiki-topic-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wiki-topic-card span {
  display: flex;
  align-items: center;
  min-height: 74px;
  padding: 14px 16px;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.18;
}

.wiki-topic-card:hover,
.wiki-topic-card:focus {
  outline: 3px solid rgba(239, 158, 47, 0.45);
  outline-offset: 3px;
}

.wiki-chapter-list {
  align-self: start;
  color: #fff;
  border-left: 4px solid var(--accent);
  padding: 4px 0 4px 16px;
}

.wiki-chapter-list h3 {
  margin: 0 0 14px;
  font-size: 1.1rem;
  color: #fff;
}

.wiki-chapter-list a,
.wiki-chapter-list span {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  padding: 9px 10px;
  margin-left: -10px;
  border-radius: 8px;
  background: transparent;
  text-decoration: none;
}

.wiki-chapter-list a:visited {
  color: rgba(255, 255, 255, 0.78);
}

.wiki-chapter-list a:hover,
.wiki-chapter-list a:focus {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.wiki-chapter-list .is-active {
  color: #fff;
  font-weight: 800;
  background: rgba(239, 158, 47, 0.22);
}

.wiki-book-stage {
  min-width: 0;
}

.book {
  position: relative;
  width: min(920px, 100%);
  aspect-ratio: 16 / 10;
  margin: 0 auto;
  perspective: 2200px;
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.28));
}

.book::before {
  content: "";
  position: absolute;
  inset: -10px 50% -10px calc(50% - 1px);
  width: 2px;
  background: linear-gradient(to bottom, rgba(12, 26, 45, 0), rgba(12, 26, 45, 0.45), rgba(12, 26, 45, 0));
  z-index: 5;
  pointer-events: none;
}

.page {
  position: absolute;
  width: 50%;
  height: 100%;
  top: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(12, 26, 45, 0.06), rgba(255, 255, 255, 0) 16%),
    linear-gradient(#fffdf6, #f7f0df);
  border: 1px solid rgba(12, 26, 45, 0.18);
  color: #111;
}

.page.static.left {
  left: 0;
  border-radius: 5px 0 0 5px;
}

.page.static.right {
  right: 0;
  border-radius: 0 5px 5px 0;
}

.page.static {
  z-index: 2;
}

.page.flip {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.78s cubic-bezier(0.77, 0, 0.175, 1);
  z-index: 1;
  visibility: hidden;
  overflow: visible;
}

.page.flip .front,
.page.flip .back {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  background:
    linear-gradient(90deg, rgba(12, 26, 45, 0.06), rgba(255, 255, 255, 0) 16%),
    linear-gradient(#fffdf6, #f7f0df);
  border: 1px solid rgba(12, 26, 45, 0.18);
}

.page.flip .front {
  transform: rotateY(0deg);
}

.page.flip .back {
  transform: rotateY(180deg);
}

.page.flip.forward {
  right: 0;
  transform-origin: left center;
}

.page.flip.forward.flipping {
  transform: rotateY(-180deg) translateZ(1px);
}

.page.flip.backward {
  left: 0;
  transform-origin: right center;
}

.page.flip.backward.flipping {
  transform: rotateY(180deg) translateZ(1px);
}

.page.flip::before,
.page.static.right::before,
.page.static.left::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--shadow, 0);
  transition: opacity 0.25s ease;
  z-index: 6;
}

.page.flip::before {
  background: linear-gradient(to left, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0));
}

.page.static.right::before,
.page.static.left::before {
  opacity: var(--shadow-static, 0);
  background: linear-gradient(to right, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0));
}

.wiki-page-content {
  height: 100%;
}

.wiki-source-page {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100%;
  padding: clamp(18px, 2.4vw, 30px);
  color: #161616;
}

.wiki-page-header,
.wiki-page-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #335184;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.wiki-page-footer {
  justify-content: flex-end;
  color: rgba(51, 81, 132, 0.68);
  text-transform: none;
  letter-spacing: 0;
}

.wiki-page-body {
  align-self: center;
  color: #161616;
}

.wiki-page-body h2 {
  color: #15005d;
  font-size: clamp(1.35rem, 2.1vw, 2rem);
  line-height: 1.08;
  margin: 0 0 18px;
}

.wiki-page-body p,
.wiki-page-body li {
  color: #161616;
  font-size: clamp(1rem, 1.25vw, 1.18rem);
  line-height: 1.52;
}

.wiki-page-body p {
  margin: 0 0 14px;
}

.wiki-page-body ul,
.wiki-page-body ol {
  margin: 0;
  padding-left: 1.25em;
}

.wiki-page-body li + li {
  margin-top: 8px;
}

.wiki-lead {
  font-size: clamp(1.12rem, 1.5vw, 1.35rem) !important;
  font-weight: 700;
}

.wiki-figure {
  margin: 18px 0 0;
}

.wiki-figure img {
  display: block;
  width: 100%;
  max-height: 170px;
  object-fit: cover;
  border: 1px solid rgba(12, 26, 45, 0.18);
}

.wiki-page-type-bild .wiki-page-body {
  align-self: stretch;
}

.wiki-page-type-bild .wiki-figure {
  margin: 0;
  min-height: 0;
}

.wiki-page-type-bild .wiki-figure img {
  height: 100%;
  max-height: none;
  object-fit: cover;
}

.wiki-note,
.wiki-warning,
.wiki-solution {
  border-left: 5px solid #2f7d4c;
  background: rgba(47, 125, 76, 0.12);
  color: #161616;
  padding: 12px 14px;
  margin-top: 16px;
}

.wiki-warning {
  border-left-color: #a83a2f;
  background: rgba(168, 58, 47, 0.12);
}

.wiki-solution {
  border-left-color: var(--accent);
  background: rgba(239, 158, 47, 0.14);
}

.wiki-solution summary {
  cursor: pointer;
  font-weight: 800;
}

.wiki-checks li::marker,
.wiki-summary li::marker {
  color: #2f7d4c;
  font-weight: 800;
}

.wiki-page-type-titel .wiki-page-body h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.wiki-page-type-titel .wiki-page-body {
  border-top: 6px solid var(--accent);
  padding-top: 22px;
}

.wiki-page-type-merksatz .wiki-page-body h2,
.wiki-page-type-frage .wiki-page-body h2 {
  color: #2f4d84;
}

.book-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: min(920px, 100%);
  margin: 18px auto 0;
}

.book-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.book-controls button:hover,
.book-controls button:focus {
  background: #d6861f;
}

.wiki-nav-icon {
  display: inline-block;
  font-size: 1.35em;
  font-weight: 900;
  line-height: 0.8;
}

.book-controls button:disabled {
  cursor: default;
  opacity: 0.48;
}

.book-progress {
  color: #fff;
  text-align: center;
  font-weight: 800;
}

.wiki-reading-stack {
  display: grid;
  gap: 14px;
}

.js .wiki-reader .wiki-reading-stack {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .page.flip {
    transition: none;
  }
}

@media (max-width: 900px) {
  .wiki-reader {
    grid-template-columns: 1fr;
    padding: 12px 14px 24px;
  }

  .wiki-chapter-list {
    display: flex;
    overflow-x: auto;
    gap: 14px;
    border-left: 0;
    border-bottom: 3px solid var(--accent);
    padding: 0 0 10px;
  }

  .wiki-chapter-list h3 {
    flex: 0 0 auto;
    margin: 0;
  }

  .wiki-chapter-list a,
  .wiki-chapter-list span {
    flex: 0 0 auto;
    padding: 6px 10px;
    margin-left: 0;
  }
}

@media (max-width: 760px) {
  .wiki-book-intro {
    padding: 16px 16px 2px;
  }

  .book,
  .book-controls {
    display: none;
  }

  .js .wiki-reader .wiki-reading-stack,
  .wiki-reading-stack {
    display: grid;
  }

  .wiki-source-page {
    min-height: auto;
    background:
      linear-gradient(90deg, rgba(12, 26, 45, 0.04), rgba(255, 255, 255, 0) 18%),
      linear-gradient(#fffdf6, #f7f0df);
    border: 1px solid rgba(12, 26, 45, 0.16);
    border-left: 6px solid var(--accent);
    padding: 18px;
  }

  .wiki-figure img {
    max-height: 220px;
  }
}
