/* Sudan Heart Journal HTML5 3D Flipbook Reader Stylesheet */
.sh-fb-root,
.sh-fb-root *,
.sh-fb-root *::before,
.sh-fb-root *::after {
  box-sizing: border-box;
}
.sh-fb-root {
  --fb-bg: #0c1726;
  --fb-bg-2: #12233a;
  --fb-bar: #091422;
  --fb-border: rgba(200, 160, 70, 0.28);
  --fb-gold: #c8a046;
  --fb-gold-soft: #f0dfa8;
  --fb-ink: #e2e8f0;
  --fb-muted: #94a3b8;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 580px;
  background: radial-gradient(circle at 50% 35%, var(--fb-bg-2) 0%, var(--fb-bg) 75%);
  color: var(--fb-ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  user-select: none;
}

.sh-fb-root.sh-fb-embedded {
  height: 690px;
  min-height: 560px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
}

/* Top Toolbar */
.sh-fb-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: var(--fb-bar);
  border-bottom: 1px solid var(--fb-border);
  z-index: 30;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.sh-fb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sh-fb-badge {
  background: rgba(200, 160, 70, 0.16);
  color: var(--fb-gold);
  border: 1px solid rgba(200, 160, 70, 0.45);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.sh-fb-title-group {
  min-width: 0;
}

.sh-fb-title {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}

.sh-fb-subtitle {
  font-size: 11.5px;
  color: var(--fb-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sh-fb-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sh-fb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.sh-fb-btn:hover {
  background: rgba(200, 160, 70, 0.22);
  border-color: var(--fb-gold);
  color: #fff;
}

.sh-fb-btn.active {
  background: var(--fb-gold);
  color: #091422;
  border-color: var(--fb-gold);
}

.sh-fb-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sh-fb-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 4px;
}

/* Main Stage & Desk Surface */
.sh-fb-stage-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 20px 64px;
}

.sh-fb-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 68px;
  border-radius: 10px;
  background: rgba(9, 20, 34, 0.78);
  border: 1px solid rgba(200, 160, 70, 0.35);
  color: var(--fb-gold);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  backdrop-filter: blur(6px);
  transition: transform 0.15s, background 0.15s;
}

.sh-fb-nav-arrow:hover:not(:disabled) {
  background: var(--fb-gold);
  color: #091422;
  transform: translateY(-50%) scale(1.06);
}

.sh-fb-nav-arrow:disabled {
  opacity: 0.25;
  cursor: default;
}

.sh-fb-nav-prev { left: 14px; }
.sh-fb-nav-next { right: 14px; }

/* 3D Book Perspective & Spread */
.sh-fb-book-viewport {
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  transition: transform 0.2s ease;
}

.sh-fb-book {
  position: relative;
  display: flex;
  perspective: 2400px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.65), 0 4px 16px rgba(0, 0, 0, 0.45);
  border-radius: 4px;
  background: #0a1423;
}

.sh-fb-page-slot {
  position: relative;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sh-fb-page-slot.sh-left {
  border-radius: 4px 0 0 4px;
  box-shadow: inset -14px 0 26px rgba(11, 37, 69, 0.14);
}

.sh-fb-page-slot.sh-right {
  border-radius: 0 4px 4px 0;
  box-shadow: inset 14px 0 26px rgba(11, 37, 69, 0.14);
}

.sh-fb-book.is-single .sh-fb-page-slot.sh-right {
  border-radius: 4px;
  box-shadow: none;
}

/* Spine Crease */
.sh-fb-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 24px;
  transform: translateX(-50%);
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.18) 42%,
    rgba(0, 0, 0, 0.34) 50%,
    rgba(0, 0, 0, 0.18) 58%,
    rgba(0, 0, 0, 0) 100%
  );
  pointer-events: none;
  z-index: 12;
}

.sh-fb-book.is-single .sh-fb-spine {
  display: none;
}

.sh-fb-page-content {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.sh-fb-page-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* Decorative Flyleaf for Inside Cover opposite Page 1 */
.sh-fb-flyleaf {
  width: 100%;
  height: 100%;
  background: linear-gradient(155deg, #0b2545 0%, #13315c 60%, #091930 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 30px;
  text-align: left;
  position: relative;
  border-right: 3px solid var(--fb-gold);
}

.sh-fb-flyleaf-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fb-gold);
  margin-bottom: 10px;
}

.sh-fb-flyleaf h2 {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 26px;
  line-height: 1.25;
  color: #fff;
  margin: 0 0 12px 0;
}

.sh-fb-flyleaf p {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.65;
  margin: 0 0 22px 0;
}

.sh-fb-flyleaf-tip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #0b2545;
  background: var(--fb-gold);
  padding: 8px 14px;
  border-radius: 999px;
  width: fit-content;
}

/* Virtual Typeset Book Page Fallback */
.sh-fb-virtual-page {
  width: 100%;
  height: 100%;
  padding: 28px 30px 40px;
  box-sizing: border-box;
  background: #fffdf8;
  color: #1e293b;
  overflow-y: auto;
  text-align: left;
  user-select: text;
}

.sh-fb-virtual-header {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8b1e3f;
  font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
}

.sh-fb-virtual-title {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  color: #0b2545;
  margin: 0 0 10px 0;
  line-height: 1.25;
}

.sh-fb-virtual-body {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 14.5px;
  line-height: 1.68;
  color: #334155;
}

.sh-fb-virtual-body p {
  margin: 0 0 10px 0;
}

/* Hover Corner Peel Cue */
.sh-fb-corner-hint {
  position: absolute;
  bottom: 0;
  width: 34px;
  height: 34px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, width 0.2s, height 0.2s;
  z-index: 9;
}

.sh-fb-page-slot.sh-right:hover .sh-fb-corner-hint.sh-corner-r {
  opacity: 0.9;
  width: 44px;
  height: 44px;
}

.sh-fb-corner-r {
  right: 0;
  background: linear-gradient(135deg, transparent 50%, rgba(11, 37, 69, 0.22) 52%, #e2e8f0 70%, #ffffff 100%);
  box-shadow: -2px -2px 6px rgba(0, 0, 0, 0.18);
}

.sh-fb-page-slot.sh-left:hover .sh-fb-corner-hint.sh-corner-l {
  opacity: 0.9;
  width: 44px;
  height: 44px;
}

.sh-fb-corner-l {
  left: 0;
  background: linear-gradient(225deg, transparent 50%, rgba(11, 37, 69, 0.22) 52%, #e2e8f0 70%, #ffffff 100%);
  box-shadow: 2px -2px 6px rgba(0, 0, 0, 0.18);
}

/* 3D Animated Turning Leaf */
.sh-fb-flip-leaf {
  position: absolute;
  top: 0;
  bottom: 0;
  transform-style: preserve-3d;
  z-index: 25;
  pointer-events: none;
  will-change: transform;
}

.sh-fb-flip-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: #ffffff;
  overflow: hidden;
}

.sh-fb-flip-face img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.sh-fb-flip-face > .sh-fb-flyleaf,
.sh-fb-flip-face > .sh-fb-virtual-page {
  width: 100%;
  height: 100%;
}

.sh-fb-flip-front {
  box-shadow: inset 12px 0 28px rgba(0, 0, 0, 0.14);
}

.sh-fb-flip-back {
  transform: rotateY(180deg);
  box-shadow: inset -12px 0 28px rgba(0, 0, 0, 0.16);
}

/* Footer Scrubber & Page Status */
.sh-fb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 18px;
  background: var(--fb-bar);
  border-top: 1px solid var(--fb-border);
  z-index: 30;
  flex-shrink: 0;
}

.sh-fb-scrubber-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sh-fb-range {
  flex: 1;
  accent-color: var(--fb-gold);
  cursor: pointer;
}

.sh-fb-page-indicator {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fb-gold-soft);
  white-space: nowrap;
}

/* Slide-Over Drawers (TOC, Thumbnails, Search) */
.sh-fb-drawer {
  position: absolute;
  top: 52px;
  bottom: 44px;
  right: 0;
  width: 360px;
  max-width: 92vw;
  background: #0f1d32;
  border-left: 1px solid var(--fb-border);
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.45);
  z-index: 40;
  display: none;
  flex-direction: column;
}

.sh-fb-drawer.open {
  display: flex;
}

.sh-fb-drawer-head {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--fb-gold);
}

.sh-fb-drawer-close {
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 18px;
  cursor: pointer;
}

.sh-fb-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.sh-fb-toc-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 11px 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.sh-fb-toc-item:hover,
.sh-fb-toc-item.current {
  background: rgba(200, 160, 70, 0.12);
  border-color: var(--fb-gold);
}

.sh-fb-toc-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--fb-gold);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.sh-fb-toc-title {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 6px;
}

.sh-fb-toc-authors {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}

.sh-fb-toc-author-link {
  font-size: 11px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 999px;
  text-decoration: none;
}

.sh-fb-toc-author-link:hover {
  background: var(--fb-gold);
  color: #091422;
}

.sh-fb-thumb-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.sh-fb-thumb-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  text-align: center;
}

.sh-fb-thumb-card.active {
  border-color: var(--fb-gold);
}

.sh-fb-thumb-card img {
  width: 100%;
  height: 165px;
  object-fit: cover;
  border-radius: 4px;
  background: #fff;
}

.sh-fb-thumb-num {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
}

.sh-fb-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #091422;
  color: #fff;
  font-size: 13px;
  margin-bottom: 12px;
  outline: none;
}

.sh-fb-loading {
  font-size: 13px;
  color: var(--fb-gold-soft);
  padding: 24px;
  text-align: center;
}

@media (max-width: 720px) {
  .sh-fb-toolbar {
    padding: 8px 10px;
    gap: 8px;
  }
  .sh-fb-controls {
    width: 100%;
    justify-content: space-between;
  }
  .sh-fb-btn {
    padding: 6px 9px;
    font-size: 11.5px;
    min-height: 36px;
  }
  .sh-fb-stage-wrap {
    padding: 10px 6px;
  }
  .sh-fb-nav-arrow {
    width: 34px;
    height: 48px;
    font-size: 15px;
  }
  .sh-fb-nav-prev { left: 4px; }
  .sh-fb-nav-next { right: 4px; }
  .sh-fb-title { max-width: 72vw; font-size: 15px; }
  .sh-fb-footer {
    padding: 8px 10px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .sh-fb-virtual-page {
    padding: 16px 14px 28px;
  }
  .sh-fb-flyleaf {
    padding: 20px 18px;
  }
}
