/* Reserve image space inside the flex copyright wrapper before lazy images load. */
.book-scroll-page .copyright-wrapper > .image-nomove-centre2 {
    width: 100%;
}

/* Scroll-book search */
#scroll-book-search {
    position: fixed;
    top: 40px;
    right: max(12px, calc(50% - 500px));
    width: 400px;
    max-width: calc(100% - 24px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 14px 16px;
    z-index: 110;
    background: #fff;
    color: #2d2d2d;
    border: 1px solid #d2d2d2;
    border-top: 3px solid #ff7200;
    border-radius: 6px;
    box-shadow: 0 4px 18px rgb(0 0 0 / 18%);
    font: 14px/1.4 Arial, sans-serif;
}
#scroll-book-search[hidden] {
    display: none;
}
#scroll-book-search .scroll-book-search-heading,
#scroll-book-search .scroll-book-search-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
#scroll-book-search h2 {
    flex: 1;
    margin: 0;
    padding: 0;
    font: 18px/1.4 'Gibson-SemiBold', Arial, sans-serif;
    text-align: left;
}
#scroll-book-search button {
    min-width: 32px;
    min-height: 32px;
    margin: 0;
    padding: 4px 8px;
    border: 1px solid #d2d2d2;
    border-radius: 4px;
    background: #f1f1f2;
    color: #2d2d2d;
    font: inherit;
    cursor: pointer;
}
#scroll-book-search .scroll-book-search-close {
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1;
}
#scroll-book-search button:disabled {
    opacity: 0.5;
    cursor: default;
}
#scroll-book-search label {
    display: block;
    margin: 8px 0 4px;
}
#scroll-book-search input {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0 0 10px;
    padding: 8px 10px;
    border: 1px solid #999;
    border-radius: 4px;
    background: #fff;
    color: #2d2d2d;
    font: 16px/1.4 Arial, sans-serif;
}
#scroll-book-search-status {
    flex: 1;
    font-size: 12px;
}
#scroll-book-search .scroll-book-search-controls {
    flex-wrap: wrap;
}
#scroll-book-search .scroll-book-search-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid #d2d2d2;
    border-top-color: #b34f00;
    border-radius: 50%;
    animation: scroll-book-search-spin 0.8s linear infinite;
}
#scroll-book-search .scroll-book-search-spinner[hidden] {
    display: none;
}
@keyframes scroll-book-search-spin {
    to { transform: rotate(360deg); }
}
.book-scroll-page mark.scroll-book-search-match {
    background: yellow;
    color: inherit;
}
.book-scroll-page mark.scroll-book-search-current {
    background: yellow;
    outline: 1px solid #ff7200;
    padding: 0 2px;
}
#scroll-book-search :focus-visible {
    outline: 1px solid #ff7200;
    outline-offset: 2px;
}
#scroll-book-search.scroll-book-search-compact {
    padding: 8px;
}
#scroll-book-search.scroll-book-search-compact .scroll-book-search-heading {
    position: absolute;
    top: 8px;
    right: 8px;
}
#scroll-book-search.scroll-book-search-compact h2,
#scroll-book-search.scroll-book-search-compact label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
#scroll-book-search.scroll-book-search-compact input {
    width: calc(100% - 40px);
    padding: 6px 8px;
    margin-bottom: 8px;
}
#scroll-book-search.scroll-book-search-compact .scroll-book-search-controls {
    clear: both;
}

/*-- Menu Navigation TOC --*/
.book-toc {
    font-family: arial, verdana, sans-serif;
}
.book-toc ul {
    list-style: none;
    padding: 0;
}
.toc-navigation ul > li {
    position: relative;
    line-height: 1.3;
    margin-top: 7px;
}
.book-toc ul > li a {
    font-size: 15px;
    position: relative;
}
.book-toc ul > li a > span {
    color: #2d2d2d;
    font-size: 15px;
    font-weight: 600;
}
.book-toc ul > li.toc-li-second-indent ul a > span {
    left: -28px;
    font-size: 15px;
}
.book-toc a {
    text-decoration: none;
    font-size: 16px;
}
.book-toc > ul > li ul a {
    padding: 10px 5px 10px 10px;
}
.toc-section a strong {
    font-weight: normal;
    -webkit-text-stroke: 0.2px currentColor;
}
.toc-section a strong > span {
    font-weight: 800;
    font-size: 95%;
}
@media (max-width: 500px) {
.toc-section a strong > span {
    font-weight: 900;
    font-size: 110%;
}   
}
.book-toc .toc-toggle {
    position: absolute;
    left: 5px;
    top: 0;
    border: 0;
    background: none;
    padding: 0;
    cursor: pointer;
    font-size: 35px;
    line-height: 1;
    color: inherit;
    transform: rotate(0deg);
}
.toc-section.toc-li-second-indent > .toc-toggle {
    left: -5px;
}
.book-toc .toc-toggle.open {
    transform: rotate(90deg);
}
.toc-navigation li.toc-active > a {
    border-left: 2px solid #ff7200;
    border-radius: 3px;
    background: #feead8;
    display: block;
    -webkit-text-stroke: 0.2px currentColor;
    padding: 9px;
}

/*-- Desktop TOC STYLES --*/
@media (min-width: 975px) {
.fl-post {
    margin-left: auto;
    margin-right: max(20px, calc(50% - 480px));
}
.book-toc-wrapper {
    position: fixed;
    top: 50px;
    transform: translateY(var(--book-toc-footer-offset, 0px));
    left: max(20px, calc(50% - 500px));
    width: 320px;
    z-index: 10;
    border: 1px solid #d2d2d2;
}
.book-toc-wrapper h2 {
    padding: 15px 10px 10px;
    text-align: left;
}
.book-toc-wrapper > .book-search-toggle {
    position: absolute;
    right: 8px;
    border: none;
    background: none;
    color: #333;
    top: 13px;
}
.book-toc-wrapper > .book-search-toggle svg {
    position: relative;
    top: 5px;
    width: 18px;
}
.book-toc {
    max-height: clamp(250px, calc(100vh - 160px), 400px);
    overflow-y: auto;
    padding: 0 0 0 10px;
    box-sizing: border-box;
    width: 100%;
}
.book-toc .toc-section:not(.toc-li-second-indent) {
    border-top: 1px solid #d2d2d2;
    padding: 10px 5px 0 25px;
}
.book-toc-wrapper.banner-visible {
    top: 250px;
    max-height: calc(100vh - 275px);
}
li.toc-section.toc-li-second-indent {
    padding-left: 15px;
}
/*-- TOC Scrollbar Styling --*/
/* Firefox */
.book-toc {
    scrollbar-width: thin;
    scrollbar-color: #c0c0c0 transparent;
}
/* Chrome, Safari, Edge */
.book-toc::-webkit-scrollbar {
    width: 6px;
}
.book-toc::-webkit-scrollbar-track {
    background: transparent;
}
.book-toc::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 10px;
}
.book-toc::-webkit-scrollbar-thumb:hover {
    background: #888888;
}

#mobile-toc-banner {
    display: none;
}
span.mobile-toc-close {
    display: none;
}
[id^="section"] {
    scroll-margin-top: 40px;
}
.utils-button-contents {
    display: block;
    text-align: center;
    background: #ff7200;
    padding: 7px 10px;
    color: #fff;
    font-family: 'Gibson-SemiBold';
    font-size: 14px;
    border-radius: 5px;
    margin: 10px auto 10px;
    max-width: 250px;
}
}
@media (min-width: 975px) and (max-width: 1050px) {
.book-toc-wrapper {
    left: max(10px, calc(50% - 500px));
    width: 280px;
}
}

/*-- Mobile TOC STYLES --*/
@media (max-width: 974px) {
/*-- fixed mobile banner --*/
#mobile-toc-banner {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #ff7200;
    z-index: 15;
    height: 36px;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 0 12px;
    border-top: 1px solid #fff;
    transform: translateY(-100%);
    transition: transform 0.25s ease;
}
.book-toc-wrapper:not(.banner-visible) ~ #mobile-toc-banner {
    transform: translateY(0);
}
#mobile-toc-banner button, #mobile-toc-banner a.utils-button-contents {
    color: #fff;
    background: none;
    border: none;
    font-family: 'Gibson-SemiBold';
    flex: 0 0 auto;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-align: center;
    font-size: 16px;
}
#mobile-toc-banner .book-search-toggle {
    gap: 4px;
    cursor: pointer;
}
#mobile-toc-banner .book-search-toggle svg {
    flex-shrink: 0;
    width: 17px;
    top: -2px;
    position: relative;
}

/*-- TOC Menu for Mobile --*/
.book-toc-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    background: #f1f1f2;
    max-height: 50vh;
    display: flex;
    flex-direction: column;
    border-top-right-radius: 30px;
    border-top-left-radius: 30px;
    border-top: 1px solid #d2d2d2;
    background: #fff;
}
.book-toc-wrapper.toc-open {
    transform: translateY(0);
}
.toc-drag-handle {
    width: 44px;
    height: 30px;
    background: transparent;
    margin: 0 auto -12px;
    flex-shrink: 0;
    cursor: grab;
    touch-action: none;
    position: relative;
    top: 0;
    z-index: 1;
} 
.toc-drag-handle::after {
    content: "";
    position: absolute;
    width: 44px;
    height: 6px;
    top: 8px;
    left: 0;
    background: #a9adb5;
    border-radius: 10px;
}
.book-toc-wrapper h2 {
  font-size: 17px;
  text-align: left;
  margin: 2px 0 5px 20px;
}
.book-toc-wrapper > .book-search-toggle {
    display: none;
    position: absolute;
    right: 80px;
    border: none;
    color: #333;
    top: 13px;
}
.book-toc-wrapper > .book-search-toggle svg {
    position: relative;
    top: 5px;
    width: 18px;
}
.book-toc {
  overflow-y: auto;
  min-height: 0;
  flex: 0 1 auto;
  height: max-content;
  padding: 0 15px 20px;
}
.mobile-toc-close {
  cursor: pointer;
  font-size: 14px;
  line-height: 25px;
  color: #2d2d2d;
  position: absolute;
  top: 18px;
  right: 20px;
  font-family: verdana;
}
ul.toc-ul-level-1 > li {
    border-bottom: 1px solid #d2d2d2;
    margin: 0;
    padding: 10px 0;
}
ul.toc-ul-level-1 > li:first-child { 
    padding-top: 0;
}
ul.toc-ul-level-1 > .toc-section {
    padding: 10px 0 10px 25px;
}
ul.toc-ul-level-2 > .toc-section {
    padding: 0 0 0 20px;
}
.toc-section.toc-li-second-indent > .toc-toggle {
    left: 0;
    top: 7px; /* Half the first text line */
    transform: translateY(-50%);
}
.toc-section.toc-li-second-indent > .toc-toggle.open {
    transform: translateY(-50%) rotate(90deg);
}
.toc-section.toc-li-second-indent.toc-active > .toc-toggle {
    top: 18.75px;
}
[id^="section"] {
    scroll-margin-top: 30px;
}
.book-toc-wrapper .utils-button-contents {
  display:none;
}
}
@media(max-width: 450px) {
#mobile-toc-banner button, #mobile-toc-banner a.utils-button-contents {
    font-size: 14px;
} 
}
@media (max-width: 359px) {
#mobile-toc-banner .book-search-toggle > span {
    display: none;
}
}
