/* Desire Lines Editions - plain, type-led, no labels. The publications bring their own look.
   Colours, fonts and sizes come from Sveltia: Settings > Design (data/design.yml), written into each page
   by layouts/partials/design.html. The values below are only the fallbacks. */
:root {
  --paper: #5f6b55;
  --ink: #090c0b;
  --dim: rgba(9,12,11,.8);
  --line: rgba(9,12,11,.22);
  --cover-bg: rgba(9,12,11,.08);
  --display: 'Gilda Display', Didot, Georgia, serif;   /* name and titles */
  --display-weight: 400;
  --ui: 'Space Mono', ui-monospace, Menlo, monospace;  /* menu, details, links, reader controls */
  --serif: 'EB Garamond', Garamond, Georgia, serif;    /* reading */
  --title-case: uppercase;
  --title-track: .04em;
  --ts: 1;   /* title size */
  --us: 1;   /* menu and details size */
  --sans: var(--display); --mono: var(--ui);           /* older names, used by the reader */
  --gutter: max(22px, 4vw);
  --wide: 1240px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { font-family: var(--ui); font-size: calc(12px * var(--us)); line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
img { max-width: 100%; display: block; }
.wordmark, .statement h1, .page-title, .book h2, .prose h2 {
  font-family: var(--display); font-weight: var(--display-weight); text-transform: var(--title-case); letter-spacing: var(--title-track); }

/* header */
.site-head { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; flex-wrap: wrap;
  padding: max(20px, env(safe-area-inset-top)) var(--gutter) 20px; border-bottom: 1px solid var(--line); }
.wordmark { font-size: calc(15px * var(--ts)); text-decoration: none; }
.site-nav { display: flex; gap: 22px; }
.site-nav a { text-decoration: none; color: var(--dim); padding: 6px 0; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); }

/* text pages */
.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.statement { padding: 14vh 0 10vh; max-width: 34em; }
.statement h1 { font-size: calc(clamp(30px, 4.2vw, 54px) * var(--ts)); line-height: 1.04; margin-bottom: .6em; }
.prose { max-width: 34em; font-family: var(--serif); font-size: 18px; line-height: 1.38; font-feature-settings: 'kern', 'liga', 'onum'; hanging-punctuation: first; }
.prose em { font-style: italic; }
.prose p, .prose ul, .prose ol { margin-bottom: 1em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose h2 { font-size: 15px; margin: 2em 0 .5em; }
.page-title { font-size: calc(clamp(24px, 2.6vw, 32px) * var(--ts)); line-height: 1.1; padding: 10vh 0 5vh; }
.placeholder { background: #fffbe0; color: #141414; outline: 1px dashed #c9b850; outline-offset: 2px; }

/* catalogue: a shelf of covers with title, author and year; the cover opens the reader (details live in its Info panel) */
.intro { margin-bottom: 6vh; }
.books { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 64px 44px; padding: 7vh 0 14vh; border-top: 1px solid var(--line); }
.book { display: block; }
.cover { aspect-ratio: 3 / 4; display: grid; place-items: center; background: var(--cover-bg); overflow: hidden; transition: aspect-ratio .3s ease; }
.cover.drawn, .cover:has(img) { background: none; }
.cover canvas, .cover img { display: block; width: 100%; height: auto; box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: transform .4s ease, opacity .4s ease; }
.cover:has(img) { aspect-ratio: auto; }
.cover canvas { opacity: 0; }
.cover canvas.ready { opacity: 1; }
a.cover:hover canvas, a.cover:hover img { transform: scale(1.02); }
.book .text { margin-top: 18px; }
.book h2 { font-size: calc(clamp(17px, 1.5vw, 20px) * var(--ts)); line-height: 1.15; margin-bottom: 4px; }
.book h2 a { text-decoration: none; }
.book h2 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.book .text > p { color: var(--dim); }
.empty { padding: 6vh 0 14vh; color: var(--dim); }
.book .excerpt { margin-top: 10px; font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.3; color: var(--ink); }
.book .meta { margin-top: 8px; }
.shelf-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); color: var(--dim); }
.shelf-head + .books { border-top: 0; padding-top: 4vh; }
.sort { display: inline-flex; align-items: center; gap: 10px; }
.sort select { font: inherit; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 30px 6px 14px; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.sort select:hover { border-color: var(--ink); }
.more { padding: 0 0 14vh; margin-top: -8vh; }

/* footer */
.site-foot { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; color: var(--dim);
  padding: 22px var(--gutter) max(22px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.site-foot a { text-decoration: none; }
.site-foot a:hover { color: var(--ink); }

@media (max-width: 760px) {
  .statement { padding: 9vh 0 6vh; }
  .site-head { flex-wrap: nowrap; gap: 16px; }
  .wordmark { font-size: calc(13px * var(--ts)); }
  .wordmark, .site-nav { white-space: nowrap; }
  .site-nav { font-size: .96em; gap: 16px; }
  .prose { font-size: 17px; }
  .books { grid-template-columns: 1fr 1fr; gap: 40px 18px; padding-top: 5vh; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
