/* Share pop up*/
.modal-backdrop.fade.show {
  opacity: 0.1;
  z-index: 0;
}
/* Banner */
.case-study-cover-banner {
  position: relative;
  top: -110px;
  width: 100%;
  min-height: 586px;
  background-size: cover;
}
section.case-study-banner {
  margin: -290px auto 0;
}
/* ── Paper title bar ──────────────────────────────────────── */
.bv-titlebar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 34px;
  margin-bottom: 46px;
}

.bv-titlebar__title {
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  font-size: 24px;
  line-height: 45px;
  color: var(--secondary-color);
  text-transform: uppercase;
  margin: 0;
  flex: 1 0 0;
}

.bv-flip-overlay__front .bv-page__hdr {
  margin-bottom: 64px;
}

.bv-titlebar__actions {
  display: flex;
  align-items: center;
  gap: 0px;
  flex-shrink: 0;
  padding-top: 6px;
  padding-right: 45px;
}

.bv-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 8px;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 150ms;
  opacity: 0.6;
}
.bv-action-btn:hover {
  opacity: 1;
}
.bv-action-btn--active {
  opacity: 1;
}

.bv-action-btn i {
  color: var(--secondary-text-color);
  font-size: 20px;
  -webkit-text-stroke: 1px;
}

.bv-action-btn i.bi.bi-file-text {
  -webkit-text-stroke: 0.5px;
}

.bv-action-btn--active i {
  color: var(--primary-color);
  font-size: 20px;
}
/* ── Chapter navigator bar ────────────────────────────────── */
.bv-chapnav {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 611px;
  max-width: 100%;
  height: 77px;
  padding: 16px;
  background: var(--book-view--empty-page-color);
  -webkit-backdrop-filter: blur(12.5px);
  backdrop-filter: blur(12.5px);
  border-radius: 8px;
  margin-bottom: 27px;
  position: relative;
  z-index: 80;
}

/* Page number badge */
.bv-chapnav__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 45px;
  padding: 5px 16px;
  background: var(--book-scroll-dropdown-number-color);
  border-radius: 8px;
  flex-shrink: 0;
}
.bv-chapnav__num span {
  font-family: "Konkhmer Sleokchher", cursive;
  font-size: 14px;
  line-height: 35px;
  color: var(--secondary-color);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chapter select button */
.bv-chapnav__select-wrap {
  flex: 1 0 0;
  min-width: 0;
  position: relative;
}

.bv-chapnav__select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 45px;
  padding: 5px 16px;
  background: var(--book-view--empty-page-color);
  border-radius: 8px;
  border: none;
  cursor: pointer;
  gap: 8px;
}

.bv-chapnav__select-label {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 35px;
  color: var(--secondary-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  flex: 1;
}

.bv-chapnav__chevron {
  width: 20px;
  height: 20px;
  color: var(--secondary-color);
  flex-shrink: 0;
  transition: transform 200ms ease;
}
.bv-chapnav__select[aria-expanded="true"] .bv-chapnav__chevron {
  transform: rotate(180deg);
}

/* Chapter dropdown */
.bv-chap-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--book-scroll-dropdown-background-color);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  padding: 6px 0;
  list-style: none;
  margin: 0;
  z-index: 1000;
  animation: bvDropIn 150ms ease-out;
  max-height: min(52vh, 360px);
  overflow-y: auto;
}
.bv-chap-dropdown[hidden] {
  display: none;
}

@keyframes bvDropIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bv-chap-option {
  padding: 12px 16px;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--secondary-color);
  cursor: pointer;
  transition: background 100ms;
}
.bv-chap-option:hover {
  background: var(--secondary-bg-color);
}
.bv-chap-option--active {
  color: var(--primary-color);
  font-weight: 700;
  background: rgba(255, 125, 85, 0.06);
}

/* Navigation arrows — orange, asymmetric radius */
.bv-chapnav__arrows {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.bv-chapnav__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 10px;
  background-color: var(--primary-color);
  border-radius: 8px 8px 0 8px; /* rounded-bl-8 rounded-tr-8 rounded-tl-8 = flat br */
  border: none;
  cursor: pointer;
  transition:
    background 150ms,
    opacity 150ms;
}
.bv-chapnav__arrow--prev {
  border-radius: 8px 8px 8px 0; /* flat br becomes flat bl for prev */
}
.bv-chapnav__arrow:hover {
  box-shadow: 0px 1px 1px 0px var(--primary-bg-color);
  border-color: var(--text-color);
}
.bv-chapnav__arrow i {
  color: var(--contrast-text-color);
  font-size: 25px;
}

/* ── Book spread ──────────────────────────────────────────── */
.bv-spread {
  display: flex;
  align-items: stretch;
  box-shadow: 0px 11px 7.9px rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  overflow: visible; /* must be visible so the 3D flip isn't clipped */
  transition: box-shadow 250ms;
  position: relative;
  perspective: 2400px;
  perspective-origin: center center;
}

/* ── Page flip overlay ────────────────────────────────────── */
.bv-flip-overlay {
  position: absolute;
  transform-style: preserve-3d;
  pointer-events: none;
  z-index: 30;
  display: none;
  border-radius: 8px;
  left: 0px;
  top: 0px;
  width: 613px;
  height: 600px;
}

.bv-flip-overlay.flip-next {
  display: block;
  transform-origin: left center;
  animation: bvFlipNext 650ms cubic-bezier(0.645, 0.045, 0.355, 1) forwards;
}

.bv-flip-overlay.flip-prev {
  display: block;
  transform-origin: right center;
  animation: bvFlipPrev 650ms cubic-bezier(0.645, 0.045, 0.355, 1) forwards;
}

@keyframes bvFlipNext {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(-180deg);
  }
}

@keyframes bvFlipPrev {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(180deg);
  }
}

/* Front and back faces of the flipping page */
.bv-flip-overlay__front,
.bv-flip-overlay__back {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background: var(--primary-bg-color);
  border-radius: 8px;
  padding: 32px 40px;
  overflow: hidden;
  box-shadow: 0px 11px 7.9px rgba(0, 0, 0, 0.25);
}

.bv-flip-overlay__back {
  transform: rotateY(180deg);
  background: linear-gradient(
    to right,
    var(--book-view--empty-page-color),
    var(--secondary-bg-color)
  );
}

/* Gradient edge-shadow on the flipping page — simulates paper curl lighting */
.bv-flip-overlay__front::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 40px;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.1), transparent);
  pointer-events: none;
}

/* Shadow cast onto the stationary page */
.bv-flip-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 25;
  pointer-events: none;
  display: none;
  border-radius: 8px;
}
.bv-flip-shadow.shadow-next {
  display: block;
  left: 0;
  right: 50%;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.18), transparent 80%);
  animation: bvShadowNext 650ms cubic-bezier(0.645, 0.045, 0.355, 1) forwards;
}
.bv-flip-shadow.shadow-prev {
  display: block;
  left: 50%;
  right: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.18), transparent 80%);
  animation: bvShadowPrev 650ms cubic-bezier(0.645, 0.045, 0.355, 1) forwards;
}

@keyframes bvShadowNext {
  0% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes bvShadowPrev {
  0% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Single-page mode: simple slide instead of flip */
.bv-page--left.bv-slide-exit-left {
  animation: bvSlideExitLeft 220ms ease-in forwards;
}
.bv-page--left.bv-slide-enter-left {
  animation: bvSlideEnterLeft 220ms ease-out;
}
.bv-page--left.bv-slide-exit-right {
  animation: bvSlideExitRight 220ms ease-in forwards;
}
.bv-page--left.bv-slide-enter-right {
  animation: bvSlideEnterRight 220ms ease-out;
}

@keyframes bvSlideExitLeft {
  to {
    opacity: 0;
    transform: translateX(-28px);
  }
}
@keyframes bvSlideEnterLeft {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
}
@keyframes bvSlideExitRight {
  to {
    opacity: 0;
    transform: translateX(28px);
  }
}
@keyframes bvSlideEnterRight {
  from {
    opacity: 0;
    transform: translateX(-28px);
  }
}

/* Individual book page */
.bv-page {
  flex: 1 0 0;
  background: var(--primary-bg-color);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.bv-page--left {
  border-radius: 8px 0 0 8px;
}
.bv-page--right {
  border-radius: 0 8px 8px 0;
}
/* Gray back-cover for the empty right page on the last spread */
.bv-page--empty {
  background: var(--book-view--empty-page-color);
}
.bv-page--empty .bv-page__inner {
  visibility: hidden;
}

.bv-page__inner {
  display: flex;
  flex-direction: column;
  gap: 64px;
  padding: 32px 40px;
  height: 100%;
  min-height: 600px;
}

/* Page header row: chapter-id on left, folio (page number) on right */
.bv-page__hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 64px;
  padding: 0 24px;
  flex-shrink: 0;
}

.bv-page__chap-id {
  flex: 1 0 0;
  min-width: 0;
  font-size: 24px;
  line-height: 0;
  color: var(--secondary-color);
  margin: 0;
}
.bv-page__chap-num {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 24px;
}
.bv-page__chap-sep {
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 24px;
  line-height: 24px;
}
.bv-page__chap-title {
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 24px;
  line-height: 24px;
}

.bv-page__folio {
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-size: 13px;
  line-height: 26.25px;
  color: var(--secondary-color);
  white-space: nowrap;
  flex-shrink: 0;
  margin: 0;
  padding-top: 4px;
}

/* Page body text */
.bv-page__body {
  flex: 1 0 0;
  padding: 0 24px;
  overflow-y: auto;
  overflow-x: hidden;
}
.page-bookview.bv-mode--single .bv-page__body {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 32px;
}
.page-bookview.bv-mode--single .bv-page__body::-webkit-scrollbar {
  width: 6px;
  border-radius: 6px;
  opacity: 1;
}
.page-bookview.bv-mode--single .bv-page__body::-webkit-scrollbar-track {
  background: #ebebeb;
  border-radius: 6px;
  opacity: 1;
}
.page-bookview.bv-mode--single .bv-page__body::-webkit-scrollbar-thumb {
  background: #cbcbcb;
  border-radius: 10px;
  width: 8px;
  opacity: 1;
}
.bv-page__body p {
  font-family: "Montserrat", sans-serif !important;
  font-weight: 400;
  font-size: 13px;
  color: var(--secondary-color);
  margin: 0 0 30px;
}
.bv-page__body p:last-child {
  margin-bottom: 0;
}
.bv-page__body ul li p {
  display: inline;
}

/* Book View only: no nested scrollbars, content expands naturally */
.page-bookview:not(.bv-mode--single) .bv-spread {
  align-items: stretch;
}

.page-bookview:not(.bv-mode--single) .bv-page {
  height: auto;
}

.page-bookview:not(.bv-mode--single) .bv-page__inner {
  height: auto;
  min-height: 0;
}

.page-bookview:not(.bv-mode--single) .bv-page__body {
  flex: 0 0 auto;
  overflow: visible;
  max-height: none;
  -ms-overflow-style: none;
}

.page-bookview:not(.bv-mode--single) .bv-page__body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.page-case-study .page-detail-main-area.page-detail-card {
  background: var(--secondary-bg-color);
}
/* Scroll view: stacked chapter sections inside the body */
.bv-scroll-chapter {
  padding-bottom: 40px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--navbar-border-color);
}
.bv-scroll-chapter:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.bv-scroll-chapter__hdr {
  margin: 0 0 24px;
  padding: 0;
}

/* ── Book spine (gray strip between pages) ────────────────── */
.bv-spine {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
}
.bv-spine__right {
  width: 11px;
  background: var(--book-view--empty-page-color);
  border-right: 1px solid var(--tertiary-text-color);
}
.bv-spine__left {
  width: 11px;
  background: var(--book-view--empty-page-color);
  border-left: 1px solid var(--tertiary-text-color);
}

/* ── Single-page view mode ────────────────────────────────── */
.page-bookview.bv-mode--single .bv-page--right,
.page-bookview.bv-mode--single .bv-spine {
  display: none;
}
.page-bookview.bv-mode--single .bv-page--left {
  border-radius: 8px;
  flex: 1 0 0;
  width: 100%;
  margin: 0;
}
.page-bookview.bv-mode--single #bv-page-left > .bv-page__inner > .bv-page__hdr {
  display: none;
}
.page-bookview.bv-mode--single .bv-page__inner {
  height: clamp(420px, 68vh, 760px);
  min-height: 420px;
  gap: 0;
  padding: 0;
}
.page-bookview.bv-mode--single .bv-spread {
  justify-content: flex-start;
  box-shadow: none;
}
.scroll-to-top-wrap {
  display: flex;
  justify-content: flex-end;
  margin: 0 auto 32px;
}

.scroll-to-top-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 8px 8px 0 8px;
  background-color: var(--primary-color);
  color: var(--contrast-text-color);
  cursor: pointer;
  text-decoration: none;
  transition:
    box-shadow 150ms,
    opacity 150ms;
}

.scroll-to-top-btn:hover {
  background-color: var(--primary-hover-color);
}

.scroll-to-top-btn i {
  font-size: 28px;
  line-height: 1;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .scroll-to-top-wrap {
    justify-content: center;
    margin-bottom: 24px;
  }
}

@media (max-width: 1200px) {
  .bv-main {
    padding: 0 24px 60px;
    margin-top: -120px;
  }
  .bv-container {
    padding: 24px 32px 60px;
    border-radius: 0 80px 0 80px;
  }
  .bv-chapnav {
    width: 100%;
  }
  .bv-titlebar__title {
    font-size: 20px;
    line-height: 32px;
  }
}

@media (max-width: 900px) {
  .bv-page__body {
    padding: 0;
  }
  header.bv-page__hdr {
    gap: 0px;
    padding: 0;
    flex-shrink: 0;
  }

  .bv-page__inner {
    gap: 35px;
    padding: 32px 33px;
  }

  .bv-container {
    padding: 20px 0px 48px;
    border-radius: 0 60px 0 60px;
  }

  .bv-hero {
    height: 420px;
  }

  .bv-hero__content {
    top: 72px;
    left: 24px;
    right: 24px;
  }
  .bv-hero__title {
    font-size: 26px;
  }

  .bv-main {
    padding: 0 16px 48px;
    margin-top: -80px;
  }

  .bv-titlebar {
    flex-direction: column;
    gap: 16px;
  }

  .bv-titlebar__title {
    font-size: 18px;
    line-height: 26px;
  }

  .bv-spread {
    flex-direction: row;
  }

  .bv-spine {
    display: flex;
  }

  .bv-page--left,
  .bv-page--right {
    border-radius: 8px;
    flex: 1 0 0;
  }

  .bv-chapnav {
    height: auto;
    min-height: 77px;
  }

  .bv-chapnav__select-label {
    font-size: 16px;
  }
}
@media (max-width: 599.5px) {
  .page-case-study section.page-detail-main {
    padding: 0 !important;
  }

  .page-detail-main-area.page-detail-card {
    padding: 40px 20px 60px;
  }

  .bv-scroll-chapter__hdr {
    margin: 0 auto;
  }
}
@media (max-width: 767.98px) {
  .bv-hero {
    height: 360px;
  }
  .bv-hero__content {
    top: 64px;
    left: 16px;
    right: 16px;
  }
  .bv-hero__title {
    font-size: 22px;
  }
  .bv-breadcrumb__trail {
    gap: 6px;
  }
  .bv-breadcrumb__current {
    max-width: 120px;
    font-size: 11px;
  }
  .bv-breadcrumb__link {
    font-size: 11px;
  }
  .bv-main {
    margin-top: -60px;
    padding: 0 12px 40px;
  }
  .bv-container {
    padding: 16px 12px 40px;
    border-radius: 0 40px 0 40px;
  }
  .bv-chapnav {
    padding: 12px;
    gap: 12px;
  }
  .bv-chapnav__num,
  .bv-chapnav__arrows {
    display: none;
  }
  .bv-chapnav__select-label {
    font-size: 14px;
    line-height: 20px;
  }
  .bv-page__inner {
    padding: 20px 16px;
    gap: 32px;
    min-height: 0;
  }
  .bv-page__hdr {
    padding: 0 8px;
    gap: 16px;
  }
  .bv-page__chap-num,
  .bv-page__chap-sep,
  .bv-page__chap-title {
    font-size: 18px;
  }
  .bv-page__body {
    padding: 0 8px;
  }
  .page-bookview.bv-mode--single .bv-page__inner {
    height: clamp(360px, 62vh, 620px);
    min-height: 360px;
  }
  .page-bookview.bv-mode--single .bv-page__body {
    padding: 16px;
  }
  .bv-scroll-chapter__hdr {
    margin: 0 0 16px;
  }
  .bv-scroll-chapter {
    padding-bottom: 28px;
    margin-bottom: 24px;
  }
  .bv-chap-dropdown {
    left: 0;
    right: 0;
    max-height: 44vh;
  }
  .bv-titlebar__actions {
    gap: 4px;
  }
  #bv-btn-double,
  #bv-btn-single {
    display: none;
  }
}
@media (max-width: 1023.98px) {
  #bv-btn-double,
  #bv-btn-single {
    display: none;
  }
}
.bv-chapnav__arrow:disabled, .bv-nav-btn:disabled, button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
