/* Book detail pages — chrome, arrows, swipe */

.book-home {
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0 1rem;
  background: rgba(12, 13, 16, 0.9);
  color: #f4f2ec;
  font-family: "Syne", "Outfit", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none !important;
  border: 0;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s, color 0.3s;
}

.book-home:hover {
  transform: translateY(-2px);
  background: #0c0d10;
  color: #e8ff47;
}

.book-lang {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 50;
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(12, 13, 16, 0.2);
  background: rgba(255, 255, 255, 0.92);
}

.book-lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6b6e76;
  font-family: "Syne", "Outfit", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}

.book-lang-btn.is-active {
  background: #0c0d10;
  color: #e8ff47;
}

.book-switch {
  display: contents;
}

.book-switch-btn {
  position: fixed;
  top: 50%;
  z-index: 2000;
  display: inline-flex !important;
  align-items: center;
  gap: 0.55rem;
  max-width: min(11rem, 28vw);
  margin-top: 0;
  transform: translateY(-50%);
  padding: 0.55rem 0.75rem;
  background: rgba(244, 242, 236, 0.88);
  color: #0c0d10 !important;
  font-family: "Syne", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-transform: uppercase;
  text-decoration: none !important;
  border: 0;
  border-radius: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 8px 28px rgba(12, 13, 16, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0.92;
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.3s ease,
    box-shadow 0.3s ease;
}

.book-switch-prev { left: 0.85rem; flex-direction: row; }
.book-switch-next { right: 0.85rem; flex-direction: row; justify-content: flex-end; text-align: right; }

.book-switch-label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-switch-chevron {
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
}

.book-switch-prev .book-switch-chevron {
  transform: rotate(-135deg);
}

.book-switch-next .book-switch-chevron {
  transform: rotate(45deg);
}

.book-switch-btn:hover,
.book-switch-btn:focus-visible {
  opacity: 1;
  background: rgba(232, 255, 71, 0.92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset, 0 10px 32px rgba(12, 13, 16, 0.16);
  color: #0c0d10 !important;
  outline: none;
}

.book-switch-prev:hover,
.book-switch-prev:focus-visible {
  transform: translateY(-50%) translateX(-3px);
}

.book-switch-next:hover,
.book-switch-next:focus-visible {
  transform: translateY(-50%) translateX(3px);
}

@media (max-width: 860px) {
  .book-switch-btn {
    max-width: 2.35rem;
    padding: 0.55rem;
    opacity: 1;
    background: rgba(244, 242, 236, 0.94);
  }

  .book-switch-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .book-switch-prev { left: 0.45rem; }
  .book-switch-next { right: 0.45rem; }

  .book-switch-chevron {
    width: 0.65rem;
    height: 0.65rem;
  }
}

/* Swipe theatre */

.book-swipe-underlay {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 50%, #f4ff8a 0%, #e8ff47 45%, #c8e020 100%);
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.2s ease;
}

.book-swipe-hint {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.book-swipe-hint-prev,
.book-swipe-hint-next {
  position: absolute;
  top: 50%;
  font-family: "Syne", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(1.15rem, 4.5vw, 2.25rem);
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: #0c0d10;
  opacity: 0;
  max-width: 36vw;
  line-height: 1.05;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  will-change: transform, opacity;
}

.book-swipe-hint-prev {
  left: 1.25rem;
  text-align: left;
  transform: translate3d(-28px, -50%, 0);
}

.book-swipe-hint-next {
  right: 1.25rem;
  text-align: right;
  transform: translate3d(28px, -50%, 0);
}

body.book-leave-next .book-swipe-underlay,
body.book-leave-prev .book-swipe-underlay {
  opacity: 1;
  transition: opacity 0.35s ease;
}

body.book-page {
  overflow-x: hidden;
  touch-action: pan-y;
  --book-ink: #0c0d10;
  --book-mute: #5c6068;
  --book-lime: #e8ff47;
  --book-display: "Syne", system-ui, sans-serif;
  --book-body: "Outfit", system-ui, sans-serif;
  color: var(--book-ink);
  font-family: var(--book-body);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.7;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.book-page .container-main .block-main .content-main,
body.book-page .content-main.single-post,
body.book-page .content-main {
  border-radius: 0 !important;
  background: rgba(255, 255, 255, 0.94) !important;
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1.35rem, 3.5vw, 2.75rem) !important;
}

/* —— Title —— */
body.book-page .journal-txt {
  margin: 0 0 1rem;
}

body.book-page .journal-txt h4,
body.book-page .journal-txt h1 {
  margin: 0;
  color: var(--book-ink) !important;
  font-family: var(--book-display) !important;
  font-weight: 800 !important;
  font-size: clamp(2.15rem, 6.5vw, 3.85rem) !important;
  line-height: 0.95 !important;
  letter-spacing: -0.055em !important;
  text-transform: none;
  max-width: 14ch;
}

/* —— Meta —— */
body.book-page .post-meta {
  margin: 0 0 1.75rem;
}

body.book-page .post-meta ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.book-page .post-meta ul li {
  margin: 0 !important;
  float: none !important;
  color: var(--book-mute);
  font-family: var(--book-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.3;
}

body.book-page .post-meta ul li span {
  color: var(--book-ink);
  opacity: 0.55;
}

/* —— Body copy —— */
body.book-page .content-main p {
  margin: 0 0 1.25rem;
  color: #2a2d34;
  font-family: var(--book-body);
  font-size: clamp(1.02rem, 1.35vw, 1.125rem);
  font-weight: 400;
  line-height: 1.72;
  letter-spacing: -0.012em;
  max-width: 62ch;
}

body.book-page .content-main p.mb-30 {
  margin-bottom: 1.35rem !important;
}

body.book-page .content-main a {
  color: var(--book-ink);
  font-weight: 500;
  text-decoration: underline !important;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.25s ease;
}

body.book-page .content-main a:hover {
  color: #5a6200;
}

/* —— Quote —— */
body.book-page .content-main blockquote {
  position: relative;
  margin: 1.75rem 0 1.85rem;
  padding: 0.35rem 0 0.35rem 1.15rem;
  border: 0;
  border-left: 3px solid var(--book-ink);
  background: transparent;
  color: var(--book-ink);
  font-family: var(--book-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3.4vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
  max-width: 28ch;
}

body.book-page .content-main blockquote::before {
  content: none;
}

/* —— Footer —— */
body.book-page #footer {
  padding: 2.5rem 1.25rem 2.75rem;
  background: transparent;
}

body.book-page #footer p {
  margin: 0.85rem 0 0;
  color: rgba(12, 13, 16, 0.55);
  font-family: var(--book-body);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.5;
}

body.book-page #footer .socials-media ul li a {
  color: var(--book-ink);
  font-size: 1.15rem;
  transition: color 0.25s ease, transform 0.25s ease;
}

body.book-page #footer .socials-media ul li a:hover {
  color: #5a6200;
  transform: translateY(-2px);
}

@media (max-width: 700px) {
  body.book-page .journal-txt h4,
  body.book-page .journal-txt h1 {
    max-width: none;
  }

  body.book-page .content-main blockquote {
    max-width: none;
  }
}

body.book-page .back-to-top {
  display: none !important;
}

body.book-page .main-content {
  position: relative;
  z-index: 10;
  will-change: transform, opacity, filter;
  transform-origin: center center;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

body.book-page.is-swiping .main-content {
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.28),
    0 8px 24px rgba(0, 0, 0, 0.18);
  border-radius: 0;
  cursor: grabbing;
}

body.book-page:not(.book-enter-next):not(.book-enter-prev) .main-content {
  animation: book-sheet-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.book-enter-next .main-content {
  animation: book-in-next 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.book-enter-prev .main-content {
  animation: book-in-prev 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.book-leave-next .main-content {
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease !important;
  transform: translate3d(-110vw, 0, 0) rotate(-7deg);
  opacity: 0;
}

body.book-leave-prev .main-content {
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease !important;
  transform: translate3d(110vw, 0, 0) rotate(7deg);
  opacity: 0;
}

@keyframes book-sheet-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes book-in-next {
  from {
    opacity: 0;
    transform: translate3d(72vw, 0, 0) rotate(7deg) scale(0.94);
    filter: brightness(0.9);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes book-in-prev {
  from {
    opacity: 0;
    transform: translate3d(-72vw, 0, 0) rotate(-7deg) scale(0.94);
    filter: brightness(0.9);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@media (max-width: 860px) {
  .book-swipe-hint-prev { left: 0.75rem; max-width: 42vw; }
  .book-swipe-hint-next { right: 0.75rem; max-width: 42vw; }
}

@media (prefers-reduced-motion: reduce) {
  body.book-page .main-content,
  body.book-leave-next .main-content,
  body.book-leave-prev .main-content {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }

  .book-swipe-hint,
  .book-swipe-underlay {
    display: none;
  }
}
