:root{
  --bg:#ffffff;
  --text:#111;
  --muted:#555;
  --border:#e6e6e6;
  --max: 72ch;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family: ui-sans-serif, system-ui, -apple-system, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;line-height:1.6}
a{color:inherit;text-decoration:underline;text-underline-offset:3px}
a:hover{opacity:.85}
header{
  position:sticky; top:0; z-index:10;
  background:rgba(255,255,255,.92);
  backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid var(--border);
}
.header-inner{max-width:1100px;margin:0 auto;padding:14px 18px;display:flex;gap:16px;align-items:center;justify-content:space-between}
.brand{display:flex;flex-direction:column;gap:2px;text-decoration:none}
.brand strong{font-size:15px;letter-spacing:.2px}
.brand span{font-size:12px;color:var(--muted);text-decoration:none}
nav{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
nav a{font-size:13px;text-decoration:none;padding:6px 8px;border-radius:8px}
nav a.active{background:#f2f2f2}
main{max-width:1100px;margin:0 auto;padding:28px 18px 60px}
.prose{max-width:var(--max)}
h1{font-size:34px;line-height:1.15;margin:0 0 14px}
h2{font-size:24px;line-height:1.25;margin:26px 0 12px}
h3{font-size:18px;margin:22px 0 10px}
p{margin:0 0 14px}
img{max-width:100%;height:auto;border-radius:12px}
figure{margin:0}
.hr{height:1px;background:var(--border);margin:22px 0}
.footer{border-top:1px solid var(--border);padding:26px 18px;color:var(--muted);font-size:13px}
.footer-inner{max-width:1100px;margin:0 auto;display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between}
.badge{display:inline-block;border:1px solid var(--border);padding:6px 10px;border-radius:999px;font-size:12px;color:var(--muted);text-decoration:none}
.hero{display:block}
.hero .cover{width:100%;max-width:260px}
.hero .cta{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.button{display:inline-block;text-decoration:none;border:1px solid var(--border);padding:10px 14px;border-radius:10px;font-size:14px}
.button.primary{background:#111;color:#fff;border-color:#111}

/* Home slideshow */
.slideshow{
  position: relative;
  width: 100%;
  height: 275px;          /* adjust 260–340 until it feels right */
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #f3f3f3;
  margin: 0 0 22px 0;
}
.slideshow img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit: contain;     /* was cover */
  object-position: center;
  opacity:0;
  transition: opacity 700ms ease;
  background: #f3f3f3;     /* fills any letterbox area */
}
.slideshow img.is-active{opacity:1}
@media (max-width: 720px){
  .hero{grid-template-columns: 1fr}
	.slideshow{ height: 220px; }
  h1{font-size:30px}
  nav{justify-content:flex-start}
}


/* Layout with right sidebar (matches original structure) */
main{padding:40px 20px}
.layout{
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  align-items: start;
}
.content{min-width:0}
.sidebar{position:sticky; top:24px}
.sidebar-card{
  border:1px solid var(--border);
  background:#fafafa;
  border-radius:12px;
  padding:18px;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
}
.sidebar-title{
  font-size: 20px;
  margin: 0 0 14px;
  letter-spacing:.02em;
}
.book-cover img{
  width:100%;
  height:auto;
  border-radius:10px;
  border:1px solid var(--border);
  display:block;
}
.btn{
  display:inline-flex;
  justify-content:center;
  width:100%;
  margin:14px 0 10px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  text-decoration:none;
  font-weight:600;
}
.book-name{margin:6px 0 6px}
.book-meta{margin:2px 0;color:var(--muted);font-size:14px}
.book-price{margin:10px 0 0;font-weight:600}

/* Header / nav refinements */
header{
  border-bottom:1px solid var(--border);
  background:#fff;
}
.header-inner{
  max-width: 1040px;
  margin: 0 auto;
  padding: 26px 20px 16px;
}
.brand strong{
  font-size: 42px;
  font-weight: 400;
  letter-spacing:.02em;
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
}
.brand span{
  display:block;
  color: var(--muted);
  font-size: 18px;
  margin-top: 4px;
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
}
nav{
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px 14px;
  display:flex;
  gap: 22px;
  flex-wrap: wrap;
  border-top:1px solid var(--border);
}
nav a{
  text-decoration:none;
  letter-spacing:.06em;
  font-size: 13px;
  text-transform: uppercase;
  padding: 10px 0;
  color: #222;
}
nav a:hover{opacity:.7}

/* Chapters grid refinements */
.grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.card{
  border:1px solid var(--border);
  border-radius:10px;
  overflow:hidden;
  background:#fff;
  text-decoration:none;
}
.card img{display:block;width:100%;height:auto}
.card .card-body{padding:10px 12px;text-align:center}
.card .card-title{margin:0;font-weight:600}
.card .card-sub{margin:4px 0 0;color:var(--muted);font-size:14px}

/* Responsive */
@media (max-width: 920px){
  .layout{grid-template-columns: 1fr}
  .sidebar{position:static}
  nav{gap:14px}
  .brand strong{font-size:34px}
}
@media (max-width: 640px){
  .grid{grid-template-columns: repeat(2, minmax(0, 1fr))}
}

/* --- Refinements to match original layout --- */

/* Footer: remove CTA badge space alignment */
.footer-inner { justify-content: center; }

/* Book Index: preserve line breaks like original */
.page-book-index pre.book-index{
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.8;
  margin: 1.25rem 0 0;
}

/* Chapters: 3-column cards with caption band */
.page-chapters .chapter-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 18px;
}
@media (max-width: 900px){
  .page-chapters .chapter-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px){
  .page-chapters .chapter-grid{ grid-template-columns: 1fr; }
}
.page-chapters .chapter-card{
  border: 1px solid #e6e6e6;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
  overflow: hidden;
  text-align: center;
}
.page-chapters .chapter-card img{
  display:block;
  width:100%;
  height:auto;
}
.page-chapters .chapter-card p{
  margin:0;
  padding: 12px 12px 14px;
  background: #f7f7f7;
  font-size: .98rem;
}

/* Appreciation: float portraits left like original */
.page-appreciation article.prose table td > div{
  float:left;
  width: 180px;
  margin: 0 26px 16px 0;
  text-align:center;
}
.page-appreciation article.prose table td > div img{
  display:block;
  width:100%;
  height:auto;
  border: 1px solid #e6e6e6;
  background:#fff;
}
.page-appreciation article.prose table td > div p{
  margin: 8px 0 0;
  font-size: .9rem;
}
.page-appreciation article.prose table td::after{
  content:"";
  display:block;
  clear:both;
}

/* About: float author photos left */
.page-about article.prose p > a > img,
.page-about article.prose p > img{
  float:left;
  width: 240px;
  max-width: 45%;
  margin: 0 26px 16px 0;
  border: 1px solid #e6e6e6;
  background:#fff;
}
.page-about article.prose p::after{
  content:"";
  display:block;
  clear:both;
}
