/* Finaler Layout-Hotfix: Buchaktionen und helle Abschnittskanten */
html,
body {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  border: 0 !important;
  background-color: #050b12 !important;
}

/* 2026-09-08: konsistentes Premium-Buttonsystem und Thalia-Markenauftritt */
:root {
  --thalia-green: #006f44;
  --thalia-green-dark: #005236;
}

body .btn,
body a.btn,
body button.btn {
  min-height: 56px !important;
  padding: 13px 22px !important;
  border-radius: 999px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  text-align: center !important;
  text-decoration: none !important;
  transition: transform .2s ease, border-color .2s ease, background-color .2s ease, box-shadow .2s ease !important;
}

body .btn:hover,
body a.btn:hover,
body button.btn:hover {
  transform: translateY(-2px) !important;
}

body .btn:focus-visible,
body a.btn:focus-visible,
body button.btn:focus-visible,
body a.thalia-button:focus-visible {
  outline: 3px solid #fff !important;
  outline-offset: 3px !important;
}

body .btns,
body .premium-books-actions,
body .topic-book-actions {
  display: flex !important;
  align-items: stretch !important;
  gap: 12px !important;
}

body .btns > .btn,
body .premium-books-actions > .btn,
body .topic-book-actions > .btn {
  flex: 1 1 210px !important;
}

body .book-actions,
body .book-detail-actions,
body.page-book-conversion .sample-actions {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-items: stretch !important;
  width: 100% !important;
}

body .book-actions > a,
body .book-detail-actions > a,
body.page-book-conversion .sample-actions > a {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 60px !important;
  height: 60px !important;
  margin: 0 !important;
  padding: 10px 14px !important;
  white-space: normal !important;
}

body a.thalia-button.thalia-button {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  color: var(--thalia-green-dark) !important;
  border: 2px solid var(--thalia-green) !important;
  background: #fff !important;
  box-shadow: 0 10px 26px rgba(0, 111, 68, .22) !important;
}

body a.thalia-button.thalia-button:hover {
  color: #fff !important;
  border-color: var(--thalia-green) !important;
  background: var(--thalia-green) !important;
  box-shadow: 0 15px 34px rgba(0, 111, 68, .32) !important;
}

body .thalia-button-logo,
body.page-book-conversion .sample-actions .thalia-button-logo {
  display: block !important;
  width: 86px !important;
  height: 30px !important;
  flex: 0 0 86px !important;
  object-fit: contain !important;
  border-radius: 4px !important;
}

body .thalia-button-label,
body.page-book-conversion .sample-actions .thalia-button-label {
  padding-left: 12px !important;
  border-left: 1px solid rgba(0, 111, 68, .3) !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  line-height: 1.15 !important;
}

body a.thalia-button:hover .thalia-button-label {
  border-left-color: rgba(255,255,255,.45) !important;
}

@media (max-width: 820px) {
  body .book-actions,
  body .book-detail-actions,
  body.page-book-conversion .sample-actions {
    grid-template-columns: 1fr !important;
  }

  body .book-actions > a,
  body .book-detail-actions > a,
  body.page-book-conversion .sample-actions > a {
    height: 56px !important;
    min-height: 56px !important;
  }
}

/* Red-Team v5: definitive Grundlinienkorrektur für nebeneinanderstehende Buchkarten */
html body .manipulation-grid,
html body .psychology-grid {
  display: grid !important;
  align-items: stretch !important;
}

html body .manipulation-card,
html body .psychology-card {
  align-items: stretch !important;
  align-self: stretch !important;
  min-height: 100% !important;
}

html body .manipulation-copy,
html body .psychology-card > div:last-child {
  display: flex !important;
  flex-direction: column !important;
  align-self: stretch !important;
}

html body .manipulation-copy > .book-actions,
html body .psychology-card > div:last-child > .book-actions {
  margin-top: auto !important;
}

@media (max-width: 1180px) and (min-width: 821px) {
  html body .manipulation-card,
  html body .psychology-card {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
  }

  html body .manipulation-card > .manipulation-copy,
  html body .psychology-card > div:last-child {
    flex: 1 1 auto !important;
    width: 100% !important;
  }

  html body .manipulation-card > .manipulation-cover,
  html body .psychology-card > .psychology-cover {
    flex: 0 0 auto !important;
  }
}

/* Red-Team v4: Aktionsleisten benachbarter Buchblöcke auf gleicher Grundlinie */
html body .manipulation-grid,
html body .psychology-grid,
html body .children-grid,
html body .sample-grid {
  align-items: stretch !important;
}

html body .manipulation-card,
html body .psychology-card,
html body .sample-card {
  height: 100% !important;
}

html body .manipulation-copy,
html body .psychology-card > div:last-child,
html body .sample-copy {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  height: auto !important;
  align-self: stretch !important;
}

html body .manipulation-copy > .book-actions,
html body .psychology-card > div:last-child > .book-actions,
html body .sample-copy > .sample-actions {
  margin-top: auto !important;
  padding-top: 22px !important;
}

@media (max-width: 1180px) {
  html body .manipulation-card,
  html body .psychology-card {
    grid-template-rows: auto 1fr !important;
  }
}

@media (min-width: 821px) {
  html body .child-book {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
  }

  html body .child-book > .child-book-link {
    margin-top: auto !important;
  }
}

/* Red-Team-Fix: Zweiergruppen dürfen keine leere dritte Spalte erzeugen. */
html body .book-detail-actions:has(> a:nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

@media (max-width: 820px) {
  html body .book-detail-actions:has(> a:nth-child(2):last-child) {
    grid-template-columns: 1fr !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body .btn,
  body a.thalia-button {
    transition: none !important;
  }
}

body.page-book-conversion main,
body.page-book-conversion main > header,
body.page-book-conversion main > section,
body.page-book-conversion .samples-hero,
body.page-book-conversion .samples-section,
body.page-book-conversion .sample-notice,
body.page-book-conversion .footer {
  width: 100% !important;
  max-width: 100% !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  outline: 0 !important;
}

body.page-book-conversion main::before,
body.page-book-conversion main::after,
body.page-book-conversion main > header::before,
body.page-book-conversion main > header::after,
body.page-book-conversion main > section::before,
body.page-book-conversion main > section::after,
body.page-book-conversion .footer::before,
body.page-book-conversion .footer::after {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

body.page-book-conversion .sample-grid {
  align-items: stretch !important;
}

body.page-book-conversion .sample-card {
  height: 100% !important;
  align-items: stretch !important;
}

body.page-book-conversion .sample-copy {
  display: flex !important;
  min-width: 0 !important;
  height: 100% !important;
  flex-direction: column !important;
}

body.page-book-conversion .sample-actions {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-items: stretch !important;
  width: 100% !important;
  margin: auto 0 0 !important;
  padding-top: 18px !important;
}

body.page-book-conversion .sample-actions > a,
body.page-book-conversion .sample-actions > .btn,
body.page-book-conversion .sample-actions > .thalia-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 60px !important;
  min-height: 60px !important;
  max-height: 60px !important;
  margin: 0 !important;
  padding: 8px 10px !important;
  font-size: 12px !important;
  line-height: 1.15 !important;
  text-align: center !important;
  white-space: normal !important;
}

body.page-book-conversion .sample-actions > .thalia-button {
  flex-direction: row !important;
  gap: 6px !important;
}

body.page-book-conversion .sample-actions .thalia-button-logo {
  width: 56px !important;
  height: auto !important;
  flex: 0 0 56px !important;
}

body.page-book-conversion .sample-actions .thalia-button-label {
  font-size: 10px !important;
  line-height: 1.05 !important;
}

@media (max-width: 1100px) {
  body.page-book-conversion .sample-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 720px) {
  body.page-book-conversion .sample-actions {
    grid-template-columns: 1fr !important;
  }
  body.page-book-conversion .sample-actions > a,
  body.page-book-conversion .sample-actions > .btn,
  body.page-book-conversion .sample-actions > .thalia-button {
    height: 54px !important;
    min-height: 54px !important;
    max-height: none !important;
  }
}

/* 2026-09-08 v2: finale, überlaufsichere Buchaktionsleiste */
html body .book-actions,
html body .book-detail-actions,
html body.page-book-conversion .sample-actions {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  column-gap: 12px !important;
  row-gap: 12px !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: visible !important;
}

html body .book-actions > a,
html body .book-detail-actions > a,
html body.page-book-conversion .sample-actions > a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 68px !important;
  min-height: 68px !important;
  max-height: 68px !important;
  margin: 0 !important;
  padding: 9px 12px !important;
  overflow: hidden !important;
  font-size: 13px !important;
  line-height: 1.15 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  text-wrap: balance !important;
}

html body a.thalia-button.thalia-button {
  padding: 10px 14px !important;
  overflow: hidden !important;
}

html body a.thalia-button .thalia-button-logo,
html body.page-book-conversion .sample-actions a.thalia-button .thalia-button-logo {
  display: block !important;
  width: min(118px, 86%) !important;
  height: 34px !important;
  max-width: 86% !important;
  flex: 0 1 auto !important;
  object-fit: contain !important;
  object-position: center !important;
  border-radius: 0 !important;
}

html body a.thalia-button .thalia-button-label,
html body.page-book-conversion .sample-actions a.thalia-button .thalia-button-label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 820px) {
  html body .book-actions,
  html body .book-detail-actions,
  html body.page-book-conversion .sample-actions {
    grid-template-columns: 1fr !important;
  }

  html body .book-actions > a,
  html body .book-detail-actions > a,
  html body.page-book-conversion .sample-actions > a {
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    font-size: 14px !important;
  }
}

/* Muss hinter den älteren Leseproben-Regeln stehen. */
body.page-book-conversion .sample-actions > .thalia-button {
  gap: 12px !important;
}
body.page-book-conversion .sample-actions .thalia-button-logo {
  width: 76px !important;
  height: 24px !important;
  flex: 0 0 76px !important;
}
body.page-book-conversion .sample-actions .thalia-button-label {
  font-size: 12px !important;
  line-height: 1.15 !important;
}

body .book-actions .thalia-button-logo,
body .book-detail-actions .thalia-button-logo {
  width: 76px !important;
  height: 24px !important;
  flex: 0 0 76px !important;
}
body .book-actions .thalia-button-label,
body .book-detail-actions .thalia-button-label {
  font-size: 12px !important;
}
body .book-actions > a,
body .book-detail-actions > a,
body.page-book-conversion .sample-actions > a {
  padding-inline: 10px !important;
}
body a.thalia-button.thalia-button:hover {
  color: var(--thalia-green-dark) !important;
  background: #f0f8f4 !important;
}
@media (max-width: 720px) {
  body.page-book-conversion .sample-actions > a,
  body.page-book-conversion .sample-actions > .btn,
  body.page-book-conversion .sample-actions > .thalia-button {
    height: 56px !important;
    min-height: 56px !important;
  }
}
