/* Public website */

.preview-bar {
  position: sticky; top: 0; z-index: 30; padding: .5rem 1rem; text-align: center;
  background: var(--brass); color: #fff; font-size: .98rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.preview-bar + .site-header { top: 2.4rem; }
.header-top {
  max-width: 1080px; margin: 0 auto; padding: .4rem 1.25rem 0;
  display: flex; justify-content: flex-end; align-items: center; gap: 1.25rem; font-size: .95rem;
}
.lang-switch { display: flex; align-items: center; gap: .45rem; color: var(--ink-soft); }
.lang-switch a { color: var(--ink-soft); text-decoration: none; letter-spacing: .03em; }
.lang-switch a:hover { color: var(--ink); text-decoration: underline; }
.lang-switch a[aria-current] { color: var(--ink); font-weight: 600; }
.header-inner { max-width: 1080px; margin: 0 auto; padding: .2rem 1.25rem .8rem; display: flex; align-items: baseline; gap: .5rem 1.75rem; flex-wrap: wrap; }
.brand { font-family: var(--display); font-size: 1.6rem; color: var(--ink); text-decoration: none; margin-right: auto; line-height: 1.2; }
.site-nav { display: flex; gap: .25rem 1.6rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; padding-bottom: .1rem; }
.site-nav a:hover { border-bottom-color: var(--rule); }
.site-nav a[aria-current] { border-bottom-color: var(--brass); }
@media (max-width: 700px) {
  .header-top { justify-content: space-between; }
  .site-nav { width: 100%; gap: .25rem 1.1rem; }
  html { scroll-padding-top: 8rem; }
}

/* ---------- Shared ---------- */
.eyebrow { margin: 0 0 .5rem; font-size: .9rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brass); }
.section { max-width: 1080px; margin: 0 auto; padding: clamp(3rem, 8vw, 5rem) 1.25rem 0; }
.section-head { display: flex; align-items: baseline; gap: 1.25rem; }
.section-head h1, .section-head h2 { margin: 0; font-size: clamp(2rem, 4.5vw, 2.7rem); line-height: 1.1; }
.section-head h1 { font-size: clamp(2.4rem, 6vw, 3.4rem); }
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.section-intro { margin: .75rem 0 0; color: var(--ink-soft); max-width: 56ch; }
.more { margin: 2rem 0 0; }
.crumb { margin: 0 0 1.25rem; font-size: 1rem; }
.empty { color: var(--ink-soft); font-style: italic; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* Share buttons */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1.5rem; }
.share-label { color: var(--ink-soft); font-style: italic; margin-right: .25rem; }
.share-btn {
  display: inline-flex; align-items: center; padding: .3rem .85rem; border: 1px solid var(--rule); border-radius: 99px;
  background: transparent; color: var(--ink); font: inherit; font-size: .95rem; line-height: 1.4; text-decoration: none; cursor: pointer;
}
.share-btn:hover { border-color: var(--ink-soft); background: var(--paper-2); }
.reader-page .share { margin: 2.5rem 0 0; }

/* ---------- Home: hero ---------- */
.hero { padding: clamp(2.5rem, 7vw, 5rem) 1.25rem 0; }
.hero-inner {
  max-width: 1080px; margin: 0 auto; display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 4.5rem); align-items: center;
}
.hero-inner.no-portrait { grid-template-columns: minmax(0, 1fr); max-width: 760px; text-align: center; }
.hero h1 { margin: 0; font-size: clamp(3rem, 9vw, 5.4rem); line-height: 1; letter-spacing: -.01em; }
.hero-quote { margin: 1.75rem 0 0; padding: 0 0 0 1.25rem; border-left: 2px solid var(--brass); }
.no-portrait .hero-quote { border-left: 0; padding: 0; }
.hero-quote p { margin: 0; font-family: var(--display); font-style: italic; font-size: clamp(1.3rem, 2.6vw, 1.65rem); line-height: 1.4; max-width: 34ch; }
.no-portrait .hero-quote p { margin: 0 auto; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2rem; }
.no-portrait .hero-actions { justify-content: center; }
.hero-portrait { margin: 0; border: 1px solid var(--ink-soft); padding: 10px; box-shadow: var(--shadow); }
.hero-portrait img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

/* ---------- Home: newest book ---------- */
.featured-inner {
  display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(2rem, 6vw, 4rem); align-items: center;
  padding: clamp(1.75rem, 5vw, 3rem); background: var(--paper-2); border: 1px solid var(--rule);
}
.featured .cover-link, .featured .cover { max-width: 300px; }
.featured h2 { margin: 0; font-size: clamp(2.1rem, 5vw, 3rem); line-height: 1.08; }
.featured h2 a { color: var(--ink); text-decoration: none; }
.featured h2 a:hover { color: var(--accent); }
.featured .sub { margin: .4rem 0 0; font-style: italic; font-size: 1.2rem; color: var(--ink-soft); }
.featured .meta { margin: .6rem 0 0; color: var(--ink-soft); }
.featured .blurb { margin: 1.25rem 0 1.5rem; max-width: 58ch; }

/* ---------- Books ---------- */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2.75rem 2rem; margin-top: 2.25rem; align-items: start; }
.book { display: flex; flex-direction: column; gap: 1rem; }
.cover-link { display: block; max-width: 230px; transition: transform .2s ease; }
.cover-link:hover { transform: translateY(-4px); }
.book .cover { max-width: 230px; }
.book-text { display: flex; flex-direction: column; gap: .25rem; }
.book-text h3 { margin: 0; font-size: 1.35rem; line-height: 1.2; }
.book-text h3 a { color: var(--ink); text-decoration: none; }
.book-text h3 a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: .15em; }
.book-text p { margin: 0; }
.book-text .sub { font-style: italic; color: var(--ink-soft); }
.book-text .meta { color: var(--ink-soft); font-size: .95rem; }
.book-text .blurb { margin-top: .35rem; font-size: 1rem; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.75rem 0 0; }
.filters a {
  padding: .35rem .95rem; border: 1px solid var(--rule); border-radius: 99px;
  color: var(--ink); text-decoration: none; font-size: 1rem;
}
.filters a span { color: var(--ink-soft); font-size: .9rem; margin-left: .15rem; }
.filters a:hover { border-color: var(--ink-soft); }
.filters a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.filters a[aria-current] span { color: inherit; opacity: .8; }
.category { margin-top: clamp(2.5rem, 6vw, 4rem); }
.category .section-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.2rem); }

/* One book */
.book-page { max-width: 960px; }
.book-page h1 { margin: 0 0 .25rem; font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.06; }
.book-page-grid { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 3rem; align-items: end; }
.book-page .cover { max-width: 280px; }
.book-page .sub { margin: .25rem 0 0; font-style: italic; font-size: 1.25rem; color: var(--ink-soft); }
.book-page .meta { margin: .6rem 0 0; color: var(--ink-soft); }
.book-page-text > .btn { margin-top: 1.5rem; }
.look-inside, .book-about { margin-top: clamp(2.5rem, 6vw, 3.5rem); padding-top: 2rem; border-top: 1px solid var(--rule); }
.look-inside h2, .book-about h2 { margin: 0; font-size: 1.9rem; }
.look-inside .hint { margin: .3rem 0 0; color: var(--ink-soft); font-size: .98rem; }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.pages a { display: block; background: #fbf8ef; border: 1px solid var(--rule); padding: 6px; box-shadow: var(--shadow); transition: transform .2s ease; }
.pages a:hover { transform: translateY(-3px); }
.pages img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; }
.book-about .prose { margin-top: 1rem; }
.book-about .prose p { margin: 0 0 1.1em; max-width: 64ch; }

/* ---------- Blog cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2.25rem 2rem; margin-top: 2.25rem; }
.card { display: flex; flex-direction: column; border-top: 1px solid var(--rule); padding-top: 1.1rem; }
.card-img { display: block; margin-bottom: 1rem; overflow: hidden; }
.card-img img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .3s ease; }
.card-img:hover img { transform: scale(1.03); }
.card time { font-style: italic; color: var(--ink-soft); font-size: .98rem; }
.card h3 { margin: .2rem 0 .4rem; font-size: 1.5rem; line-height: 1.2; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: .15em; }
.card p { margin: 0; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 3rem; margin-top: 2.25rem; align-items: start; }
.portrait { border: 1px solid var(--ink-soft); padding: 8px; width: 100%; }
.portrait img { display: block; width: 100%; height: auto; }
.portrait .mono { aspect-ratio: 4 / 5; display: grid; place-items: center; background: var(--paper-2); font-family: var(--display); font-size: 4.5rem; color: var(--ink-soft); }
.bio-name { margin: 0 0 1.25rem; font-family: var(--display); font-size: 1.8rem; line-height: 1.2; }
.bio-name span { display: block; font-family: var(--text); font-style: italic; font-size: 1.1rem; color: var(--ink-soft); }
.bio p:not(.bio-name) { margin: 0 0 1.1em; max-width: 62ch; }
.bio .bio-name + p::first-letter {
  font-family: var(--display); float: left; font-size: 4.2em; line-height: .78;
  padding: .06em .1em 0 0; color: var(--accent);
}

/* Contact */
.contact { max-width: 620px; margin: 0 auto; text-align: center; }
.contact .section-head { justify-content: center; }
.contact .section-head::before { content: ""; flex: 1; height: 1px; background: var(--rule); }
.contact p { margin: 1rem 0 1.5rem; }
.contact .email { margin: .75rem 0 0; font-size: 1rem; }
.elsewhere-label { margin: 2rem 0 0 !important; color: var(--ink-soft); font-style: italic; }
.elsewhere { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.6rem; padding: 0; margin: .5rem 0 0; }

/* ---------- Blog post ---------- */
.reader-page { max-width: 760px; }
.reader-page h1 { margin: 0 0 .25rem; font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1.06; }
.reader-meta { margin: 0; font-style: italic; color: var(--ink-soft); }
.post-image { margin: 2rem 0 0; }
.post-image img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); }
.reader-body { margin-top: 2rem; font-size: 1.22rem; line-height: 1.78; }
.reader-body p { margin: 0 0 1.15em; white-space: pre-line; }
.post-photos { margin: 2rem 0; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.photos a { display: block; overflow: hidden; }
.photos img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .3s ease; }
.photos a:hover img { transform: scale(1.04); }
.reader-page .btn { margin-top: .5rem; }
.pager { display: flex; justify-content: space-between; gap: 1.5rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.pager a { display: flex; flex-direction: column; max-width: 46%; color: var(--ink); text-decoration: none; font-family: var(--display); font-size: 1.25rem; line-height: 1.25; }
.pager a span { font-family: var(--text); font-style: italic; font-size: .95rem; color: var(--ink-soft); }
.pager a:hover { color: var(--accent); }
.pager .next { text-align: right; margin-left: auto; }

/* ---------- Image viewer ---------- */
dialog.lightbox {
  width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0;
  background: rgba(12, 14, 13, .94); color: #f2ead6;
  display: none; place-items: center; padding: 3.5rem 4rem;
}
dialog.lightbox[open] { display: grid; }
dialog.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 7rem); object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lightbox button {
  position: absolute; background: none; border: 0; color: inherit; cursor: pointer;
  font: inherit; font-size: 2.6rem; line-height: 1; padding: .5rem .9rem; opacity: .8;
}
.lightbox button:hover { opacity: 1; }
.lb-close { top: .5rem; right: .75rem; }
.lb-prev { left: .5rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: .5rem; top: 50%; transform: translateY(-50%); }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }
.lb-count { position: absolute; bottom: 1rem; left: 0; right: 0; margin: 0; text-align: center; font-size: .95rem; opacity: .8; }

.notfound { text-align: center; max-width: 560px; }
.notfound .code { font-family: var(--display); font-size: 4rem; margin: 0; color: var(--brass); }

/* ---------- Footer ---------- */
.site-footer { max-width: 1080px; margin: 0 auto; padding: 5rem 1.25rem 3rem; text-align: center; color: var(--ink-soft); font-size: .98rem; }
.site-footer .orn { max-width: 14rem; margin: 0 auto 1.25rem; }
.site-footer p { margin: 0 0 .35rem; }

@media (max-width: 800px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-portrait { max-width: 340px; order: -1; }
  .featured-inner { grid-template-columns: minmax(0, 1fr); }
  .featured .cover-link, .featured .cover { max-width: 220px; }
  .about, .book-page-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .portrait { max-width: 260px; }
  .book-page .cover { max-width: 240px; }
}
@media (max-width: 520px) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.1rem; }
  .pages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dialog.lightbox { padding: 3.5rem .5rem; }
  .lb-prev, .lb-next { top: auto; bottom: .25rem; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cover-link, .pages a, .card-img img, .photos img { transition: none; }
}
