/*
Theme Name: Folio & Spine
Theme URI: https://danieldaviswood.com
Author: Daniel Davis Wood
Author URI: https://danieldaviswood.com
Description: Private, custom-built modular author portfolio theme. All rights reserved.
Version: 3.9
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: Proprietary / All Rights Reserved
Text Domain: folio-and-spine
Private: true
*/

:root {
  --ink: #16202c;
  --ink-soft: #4d5f70;
  --parchment: #e4e9ee;
  --parchment-light: #f1f4f7;
  --moss: #2f5560;
  --plum: #3e3f72;
  --clay: #3b6ea5;
  --line: rgba(22,32,44,0.16);
  --line-strong: rgba(22,32,44,0.3);
  --max: 980px;
  --nav-h: 80px;
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
::selection { background: var(--clay); color: var(--parchment-light); }

/* ---------- 1. Header Navigation Bar ---------- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 30;
  background: rgba(22,32,44,0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
}

.nav-header-bar {
  width: 100%;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.nav-mark {
  font-family: var(--font-body);
  font-weight: 200;
  font-style: normal;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  color: #ffffff;
  padding: 0;
  margin: 0;
}

.nav-links-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
}

.nav-links { 
  display: flex; 
  gap: 20px; 
  list-style: none; 
  margin: 0; 
  padding: 0; 
  align-items: center; 
}

.nav-links button {
  text-decoration: none; 
  font-size: 13.5px; 
  font-weight: 400;
  color: rgba(241,244,247,0.65);
  background: none; 
  border: none; 
  cursor: pointer; 
  font-family: var(--font-body);
  padding: 0; 
  transition: color 0.15s ease;
  letter-spacing: 0.02em;
}

.nav-links button.current { 
  color: #ffffff; 
  font-weight: 400;
}

.nav-links button:hover { color: #ffffff; }

.nav-topright-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-topright-actions a, .nav-topright-actions button {
  color: rgba(241,244,247,0.8);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  transition: color 0.15s ease;
}

.nav-topright-actions a:hover, .nav-topright-actions button:hover { color: #ffffff; }
.nav-topright-actions svg { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; }

.mobile-menu-caret {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}

.mobile-nav-overlay {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0; bottom: 0;
  background: #f1f4f7;
  z-index: 25;
  display: flex;
  flex-direction: column;
  padding: 24px;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.3s ease;
}

.mobile-nav-overlay.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mobile-nav-list li { border-bottom: 1px solid var(--line-strong); }

.mobile-nav-list button {
  width: 100%;
  text-align: left;
  padding: 16px 0;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  color: #16202c;
  cursor: pointer;
}

/* ---------- Viewport Layout ---------- */
#viewport { position: absolute; top: var(--nav-h); left: 0; right: 0; bottom: 0; overflow: hidden; }
#slides { height: 100%; transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1); will-change: transform; }

.slide { 
  height: 100%; 
  width: 100%; 
  display: flex; 
  align-items: stretch; 
  justify-content: center; 
  position: relative; 
}

.slide-inner { 
  max-width: var(--max); 
  width: 100%; 
  height: calc(100vh - var(--nav-h)); 
  padding: 24px 24px 40px 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  box-sizing: border-box;
}

.section-row { display: flex; flex-direction: column; width: 100%; height: 100%; }

.section-header-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin-bottom: 24px;
  padding-right: 28px;
  flex-shrink: 0;
}

.section-header-topright {
  font-family: var(--font-body);
  font-weight: 200;
  font-size: 38px;
  letter-spacing: 0.12em;
  color: var(--ink);
  text-transform: uppercase;
  line-height: 1;
}

.section-content { 
  flex: 1; 
  min-width: 0; 
  height: 100%; 
  display: flex; 
  flex-direction: column; 
  justify-content: flex-start; 
  padding-bottom: 40px;
}

/* ---------- Dot Nav ---------- */
#dotnav { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 14px; }
#dotnav button { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; padding: 0; cursor: pointer; transition: background 0.2s ease, transform 0.2s ease; }
#dotnav button.current { background: var(--ink); transform: scale(1.3); }

.dotnav-arrow {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer; padding: 0; transition: opacity 0.15s ease;
}

.dotnav-arrow svg { width: 28px; height: 28px; stroke: var(--ink); stroke-width: 2.2; }
.dotnav-arrow:hover svg { stroke: var(--clay); }
.dotnav-arrow:disabled { opacity: 0.2; cursor: default; }
.dotnav-dots { display: flex; flex-direction: column; gap: 12px; }

/* ---------- 2. ABOUT ME Section Layout ---------- */
.about-split-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 24px;
  min-height: 0;
}

.about-top-half {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: center;
  padding: 8px 0;
  flex-shrink: 0;
}

.about-welcome-text {
  grid-column: 1 / span 2;
}

.about-welcome-text p {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 12px 0;
  max-width: 64ch;
}

/* Inline Read More Button */
.read-more-btn-inline {
  display: inline;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--clay);
  cursor: pointer;
  padding: 0;
  margin-left: 6px;
  border-bottom: 1px solid var(--clay);
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.read-more-btn-inline:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* Perfectly Square Portrait aligned with Column 3 */
.about-portrait-wrap {
  grid-column: 3;
  width: 100%;
  aspect-ratio: 1 / 1; /* PERFECT SQUARE */
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  background: var(--parchment-light);
  justify-self: end;
}

.about-portrait-wrap img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  display: block; 
}

.about-bottom-half {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.about-panel {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 18px 20px;
  background: rgba(241,244,247,0.5);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: calc(100vh - var(--nav-h) - 340px);
  overflow-y: auto;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.about-panel::-webkit-scrollbar {
  width: 5px;
}
.about-panel::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 3px;
}

.about-panel h3 {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 0 0 10px 0;
  font-weight: 600;
  flex-shrink: 0;
}

.about-panel-content { 
  font-size: 14px; 
  color: var(--ink); 
  margin: 0; 
  line-height: 1.55; 
}

/* ---------- Spotlight Sections (Fiction & Non-Fiction) ---------- */
.novels-row { display: flex; align-items: center; gap: 20px; height: min(64vh, 540px); }
.novels-thumbs { display: flex; flex-direction: column; justify-content: center; gap: 14px; flex-shrink: 0; }
.thumb-wrap { position: relative; }

.thumb-title-overlay {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  white-space: nowrap;
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--parchment-light);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 5;
}

.thumb-wrap:hover .thumb-title-overlay { opacity: 1; transform: translateY(-50%) translateX(0); }

.cover {
  background: var(--parchment-light);
  border: 1px solid var(--line-strong);
  border-radius: 0 !important;
  cursor: pointer;
  box-sizing: border-box;
  flex-shrink: 0;
}
.cover:hover { border-color: var(--clay); }
.cover.is-thumb { width: 56px; height: 84px; }
.cover.is-spotlight { height: 100%; width: auto; aspect-ratio: 2 / 3; }

.novels-spotlight { display: flex; align-items: center; gap: 28px; flex: 1; height: 100%; min-width: 0; }

.spotlight-title-block { 
  flex: 1; 
  min-width: 0; 
  transition: opacity 0.25s ease, transform 0.25s ease;
  opacity: 1;
  transform: translateY(0);
}
.spotlight-title-block.fade-out {
  opacity: 0;
  transform: translateY(4px);
}

.spotlight-title-block .st-title { font-family: var(--font-body); font-weight: 500; font-size: 26px; margin: 0 0 6px 0; }
.spotlight-title-block .st-year { font-size: 13px; color: var(--ink-soft); margin: 0 0 14px 0; }
.spotlight-title-block .st-blurb { font-size: 14.5px; color: var(--ink-soft); margin: 0 0 16px 0; line-height: 1.6; max-width: 62ch; }
.spotlight-cover-wrap { height: 100%; display: flex; align-items: center; flex-shrink: 0; }

.read-more-btn {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: none;
  font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--clay);
  cursor: pointer; padding: 0; border-bottom: 1px solid var(--clay); padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.read-more-btn:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- EDITING & SERVICES Expanding Panels ---------- */
.expanding-panels-container {
  display: flex;
  align-items: stretch;
  gap: 24px;
  width: 100%;
  max-height: calc(100vh - var(--nav-h) - 120px);
  height: min(520px, calc(100vh - var(--nav-h) - 120px));
  position: relative;
  margin-bottom: 20px;
}

.expanding-block {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 28px 28px 36px 28px;
  overflow-y: auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: flex-basis 0.55s cubic-bezier(0.65, 0, 0.35, 1), border-color 0.2s ease;
  box-sizing: border-box;
  background: rgba(241,244,247,0.4);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.expanding-block::-webkit-scrollbar {
  width: 6px;
}
.expanding-block::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 3px;
}

.expanding-block.left-panel { 
  flex-basis: calc(66.666% - 12px); 
  border-color: var(--moss); 
}

.expanding-block.right-panel { 
  flex-basis: calc(33.333% - 12px); 
}

.expanding-panels-container.expanded-right .left-panel { 
  flex-basis: calc(33.333% - 12px); 
  border-color: var(--line-strong); 
}

.expanding-panels-container.expanded-right .right-panel { 
  flex-basis: calc(66.666% - 12px); 
  border-color: var(--moss); 
}

.expanding-toggle-wrap {
  position: absolute;
  top: 50%;
  left: calc(66.666% + 12px);
  transform: translate(-50%, -50%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}

.expanding-panels-container.expanded-right .expanding-toggle-wrap {
  left: calc(33.333% - 12px);
}

.expanding-toggle-btn {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--parchment-light);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: opacity 0.2s ease, background 0.15s ease, transform 0.15s ease;
  padding: 0;
}

.expanding-toggle-btn svg { width: 16px; height: 16px; stroke: var(--ink); stroke-width: 2.2; display: block; margin: auto; }
.expanding-toggle-btn:hover { background: #fff; transform: scale(1.1); }
.expanding-toggle-btn.btn-hidden { opacity: 0; pointer-events: none; }

.expanding-toggle-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--parchment-light);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.expanding-toggle-btn:hover .expanding-toggle-tooltip { opacity: 1; }

.expanding-block .pub { font-family: var(--font-body); font-weight: 500; font-size: 22px; margin: 0 0 6px 0; color: var(--ink); }
.expanding-block .role { font-size: 13px; color: var(--ink-soft); margin: 0 0 14px 0; }

.expanding-block-body { 
  transition: opacity 0.2s ease-in-out;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  padding-bottom: 24px;
}
.expanding-block-body p { margin-top: 0; margin-bottom: 14px; }

.expanding-panels-container.fade-out .expanding-block-body { opacity: 0; }

/* ---------- PERSONAL NOTES WORKSPACE ---------- */
.personal-tabs { 
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px; 
  border-bottom: 1px solid var(--line); 
  padding-bottom: 16px; 
  margin-bottom: 20px; 
  width: 100%;
}

.ptab {
  position: relative;
  display: flex; 
  align-items: center; 
  justify-content: center;
  width: 100%;
  height: 44px; 
  padding: 0 8px;
  border-radius: 22px; 
  border: 1px solid var(--line-strong); 
  background: rgba(241,244,247,0.5); 
  cursor: pointer;
  transition: background 0.2s ease;
  overflow: hidden;
}

.ptab:hover, .ptab.active { 
  background: #ffffff; 
}

.ptab-icon-wrap {
  display: flex; 
  align-items: center; 
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.65, 0, 0.35, 1);
}

.ptab svg { width: 20px; height: 20px; flex-shrink: 0; stroke: var(--ink); }

.ptab-label-fade {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  opacity: 0;
  max-width: 0;
  white-space: nowrap;
  margin-left: 0;
  transition: opacity 0.2s ease, max-width 0.25s cubic-bezier(0.65, 0, 0.35, 1), margin-left 0.25s ease;
}

.ptab:hover .ptab-icon-wrap, .ptab.active .ptab-icon-wrap { transform: translateX(-4px); }
.ptab:hover .ptab-label-fade, .ptab.active .ptab-label-fade {
  opacity: 1;
  max-width: 90px;
  margin-left: 6px;
}

#personal-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: opacity 0.15s ease;
  overflow: visible !important;
}

.pn-intro-box {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 8px;
}
.pn-intro-box p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
  max-width: 76ch;
}

.pn-workspace-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  min-height: 380px;
  align-items: start;
  overflow: visible !important;
}

.pn-submenu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid var(--line);
  padding-right: 20px;
}

.pn-submenu-item {
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s ease, font-weight 0.15s ease;
}

.pn-submenu-item:hover { color: var(--clay); }
.pn-submenu-item.active {
  color: var(--ink);
  font-weight: 600;
}

.pn-canvas {
  padding-left: 8px;
  overflow: visible !important;
  transition: opacity 0.15s ease;
}
.pn-canvas-title {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 600;
  color: var(--moss);
  margin: 0 0 16px 0;
}
.pn-canvas-body {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink);
  overflow: visible !important;
}
.pn-canvas-body p { margin-bottom: 16px; }

/* ---------- TRANSLATION TOOLTIP HIGHLIGHTS ---------- */

mark, 
mark[data-translation] {
  position: relative !important;
  display: inline-block !important;
  background-color: rgba(59, 110, 165, 0.16) !important;
  color: var(--ink) !important;
  border-bottom: 1.5px dotted var(--clay) !important;
  padding: 0 4px !important;
  border-radius: 3px !important;
  cursor: help !important;
  line-height: 1.3 !important;
  z-index: 5;
}

mark[data-translation]:hover {
  background-color: rgba(59, 110, 165, 0.32) !important;
  border-bottom-color: var(--moss) !important;
  z-index: 50 !important;
}

mark[data-translation]::after {
  content: attr(data-translation) !important;
  position: absolute !important;
  bottom: calc(100% + 8px) !important;
  left: 50% !important;
  transform: translateX(-50%) translateY(4px) !important;
  background: #3e3f72 !important;
  color: #ffffff !important;
  font-family: var(--font-body) !important;
  font-size: 13px !important;
  font-style: italic !important;
  font-weight: 400 !important;
  padding: 6px 12px !important;
  border-radius: 4px !important;
  white-space: nowrap !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.2s ease, transform 0.2s ease !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  z-index: 9999 !important;
}

mark[data-translation]::before {
  content: '' !important;
  position: absolute !important;
  bottom: calc(100% + 3px) !important;
  left: 50% !important;
  transform: translateX(-50%) translateY(4px) !important;
  border-width: 5px 5px 0 5px !important;
  border-style: solid !important;
  border-color: #3e3f72 transparent transparent transparent !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.2s ease, transform 0.2s ease !important;
  z-index: 10000 !important;
}

mark[data-translation]:hover::after,
mark[data-translation]:hover::before,
mark[data-translation].active-touch::after,
mark[data-translation].active-touch::before {
  opacity: 1 !important;
  transform: translateX(-50%) translateY(0) !important;
}

/* ---------- CONTACT FORM ---------- */
.contact-form-container {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: max-height 0.55s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.4s ease, transform 0.55s cubic-bezier(0.65, 0, 0.35, 1);
  max-height: 600px;
  overflow: hidden;
  transform: translateY(0);
}

.contact-form.submitted {
  max-height: 0;
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

.form-group input, .form-group textarea {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-group input:focus, .form-group textarea:focus { border-color: var(--clay); }
.form-group textarea { height: 180px; resize: vertical; }

.contact-submit-btn {
  align-self: center;
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 12px 36px;
  font-family: var(--font-body);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.contact-submit-btn:hover { background: var(--ink); color: #ffffff; }

.contact-thanks-msg {
  display: none;
  text-align: center;
  padding: 40px 20px;
  font-size: 22px;
  font-weight: 300;
  color: var(--ink);
}

.contact-thanks-msg.active { display: block; }

/* ---------- OVERLAY PANEL ---------- */
.book-detail-slide {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  width: 100vw;
  height: calc(100vh - var(--nav-h));
  background: #ffffff;
  z-index: 40;
  transform: translateX(100%);
  transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
  overflow-y: auto;
  color: var(--ink);
}

.book-detail-slide.active { transform: translateX(0); }

.book-detail-close-btn {
  position: fixed;
  top: 50%;
  left: 36px;
  transform: translateY(-50%);
  z-index: 50;
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-size: 72px;
  font-weight: 200;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, color 0.15s ease, transform 0.25s cubic-bezier(0.65, 0, 0.35, 1);
  transition-delay: 0s;
  opacity: 0;
  pointer-events: none;
}

.book-detail-slide.active ~ .book-detail-close-btn,
.book-detail-close-btn.active {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.35s;
}

.book-detail-close-btn:hover {
  color: var(--clay);
  transform: translateY(-50%) scale(1.2);
  transition-delay: 0s;
}

.close-btn-tooltip {
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
  background: var(--parchment-light);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  display: flex;
  align-items: center;
  height: 32px;
}

.book-detail-close-btn:hover .close-btn-tooltip { opacity: 1; transform: translateY(-50%) translateX(0); }

.book-detail-container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px 80px 140px;
}

.book-detail-header-sticky {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  padding: 28px 0 20px 0;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
  z-index: 45;
}

.book-detail-sticky-title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 36px;
  margin: 0;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* Two-column top hero grid for cover + blurb */
.book-top-hero {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 36px;
}

.book-detail-cover-col img, 
.book-detail-cover-col .cover {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 0 !important;
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.book-detail-meta { font-size: 14px; color: var(--ink-soft); margin: 0 0 16px 0; }

.book-detail-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  line-height: 1.5;
  color: var(--plum);
  border-left: 2px solid var(--clay);
  padding-left: 16px;
  margin: 0 0 24px 0;
}

.book-detail-body { font-size: 16px; line-height: 1.7; color: var(--ink); }
.book-detail-body p { margin-bottom: 18px; }

.book-buy-btn {
  display: inline-block; margin-top: 16px; background: var(--ink); color: #fff;
  text-decoration: none; font-size: 14px; font-weight: 500; padding: 12px 22px;
  border-radius: 6px; transition: background 0.15s ease;
}
.book-buy-btn:hover { background: var(--clay); }

/* Reclaimed 100% Full-Width Bottom Section */
.book-full-content {
  width: 100%;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
}

.book-full-content h3, 
.book-full-content h4 {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 500;
  color: var(--moss);
  margin: 28px 0 16px 0;
}

.book-full-content blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  border-left: 2px solid var(--clay);
  padding-left: 20px;
  margin: 20px 0;
}

/* Responsive adjustments */
@media (max-width: 860px) {
  .nav-links-center { display: none; }
  .mobile-menu-caret { display: block; }
  .about-top-half { grid-template-columns: 1fr; }
  .about-portrait-wrap { max-width: 180px; }
  .about-bottom-half { grid-template-columns: 1fr; }
  .expanding-panels-container { flex-direction: column; gap: 16px; height: auto; max-height: none; }
  .expanding-block.left-panel, .expanding-block.right-panel { flex-basis: auto; height: 50%; margin: 0; }
  .expanding-toggle-wrap { display: none; }
  .novels-row { align-items: flex-start; height: auto; }
  .novels-thumbs { justify-content: flex-start; }
  .novels-spotlight { flex-direction: column; align-items: flex-start; height: auto; gap: 14px; }
  .cover.is-spotlight { height: 36vh; }
  #dotnav { right: 10px; }
  .personal-tabs { grid-template-columns: repeat(3, 1fr); }
  .pn-workspace-grid { grid-template-columns: 1fr; }
  .pn-submenu { border-right: none; border-bottom: 1px solid var(--line); padding-right: 0; padding-bottom: 12px; }
  .book-detail-container { padding: 0 20px 60px 80px; }
  .book-detail-close-btn { left: 12px; font-size: 56px; }
  .book-top-hero { grid-template-columns: 1fr; }
}

a:focus-visible, button:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }