/*
 * KRISHNA GAUDIYA ALL-BOOKS FOOTER CLEARANCE v1.0.0
 *
 * The working Prabhupada scripture reader keeps a 44px footer outside the
 * reading stage and then retains a further 32px pagination safety margin.
 * The Gaudiya reader keeps its footer inside the reader, so this stylesheet
 * reserves the same effective 76px clearance inside every book page.
 *
 * JavaScript refines --kl-footer-reserve from the live footer geometry.
 */
:root {
  --kl-footer-reserve: 76px;
}

html,
body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/*
 * Before the geometry helper marks the app ready, reserve the proven
 * 44px footer + 32px pagination safety margin. Once ready, reserve space
 * only while the footer is actually visible.
 */
.app:not(.kl-footer-clearance-ready):not(.title-page-active):not(.front-sheet-active) .page-viewport,
.app:not(.kl-footer-clearance-ready):not(.title-page-active):not(.front-sheet-active).toolbar-hidden .page-viewport,
.app.kl-footer-clearance-active .page-viewport,
.app.kl-footer-clearance-active.toolbar-hidden .page-viewport {
  padding-bottom: calc(var(--kl-footer-reserve, 76px) + env(safe-area-inset-bottom, 0px)) !important;
}

/* Jaiva-Dharma deliberately keeps a footer on some front sheets. */
body.jaiva-pilot .app.kl-footer-clearance-active.front-sheet-active:not(.title-page-active) .page-viewport,
body.jaiva-pilot .app.kl-footer-clearance-active.front-sheet-active:not(.title-page-active).toolbar-hidden .page-viewport {
  padding-bottom: calc(var(--kl-footer-reserve, 76px) + env(safe-area-inset-bottom, 0px)) !important;
}
