/* Picolibrary — picolibrary.com
   One stylesheet. Black on white, one red, Caudex, wide margins. */

/* Caudex, self-hosted: no third-party request, and the site still looks right
   opened straight from the filesystem. OFL, see fonts/OFL.txt.
   Only the latin subsets are served; latin-ext covers accented names. */

@font-face {
  font-family: Caudex;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/caudex-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Caudex;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/caudex-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Caudex;
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/caudex-400-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Caudex;
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/caudex-400-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Caudex;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/caudex-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Caudex;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/caudex-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Caudex;
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/caudex-700-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Caudex;
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/caudex-700-italic-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink:      #111111;
  --paper:    #ffffff;
  --quiet:    #5a5a5a;
  --rule:     #d8d4cd;
  --red:      #b2261e;
  --measure:  38rem;
  --serif:    Caudex, "Iowan Old Style", "Palatino Linotype", Palatino,
              "Book Antiqua", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:   #efece6;
    --paper: #14140f;
    --quiet: #a09a90;
    --rule:  #3a3830;
    --red:   #e8695f;
  }
  /* The drawings are black line art on white; invert so they sit on dark paper. */
  img.drawing { filter: invert(1); }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0 6vw 6rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}

@media (min-width: 46rem) {
  body { padding: 0 8vw 8rem; }
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 0 1.25rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
}

.masthead__name {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: normal;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.masthead__name a { border: 0; }

/* icon.svg carries its own copy of --ink/--paper and its own
   prefers-color-scheme query, so the mark tracks the page in both themes.
   Keep the two palettes in sync. It is deliberately not a .drawing: the
   dark-mode invert would undo the work. */
.mark {
  display: inline-block;
  width: 1.6rem;
  height: 1.6rem;
  vertical-align: -0.38em;
  margin-right: 0.15rem;
  letter-spacing: 0;
}

.masthead nav {
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
}

.masthead nav a + a { margin-left: 1.25rem; }

/* ------------------------------------------------------------------- links */

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

a:hover,
a:focus {
  color: var(--red);
  border-bottom-color: var(--red);
}

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

/* ---------------------------------------------------------------- typography */

main {
  max-width: 46rem;
  margin: 0 auto;
  padding-top: 2.75rem;
}

p, ul, ol, dl { max-width: var(--measure); }

h1, h2, h3 {
  font-weight: normal;
  line-height: 1.14;
  letter-spacing: -0.01em;
}

h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(2rem, 6.5vw, 3.1rem);
}

h2 {
  margin: 3.25rem 0 0.9rem;
  font-size: 1.375rem;
  letter-spacing: 0.01em;
}

h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.0625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

p { margin: 0 0 1.15rem; }

.lede {
  font-size: 1.1875rem;
  line-height: 1.55;
}

.byline {
  margin: 0 0 1.75rem;
  font-size: 1.1875rem;
  font-style: italic;
  color: var(--quiet);
}

.quiet { color: var(--quiet); }

blockquote {
  margin: 2rem 0 2rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--red);
  max-width: var(--measure);
  font-style: italic;
}

blockquote p:last-child { margin-bottom: 0; }

blockquote cite {
  display: block;
  margin-top: 0.6rem;
  font-style: normal;
  font-size: 0.9375rem;
  color: var(--quiet);
}

/* ---------------------------------------------------------------- drawings */

img {
  max-width: 100%;
  height: auto;
}

.drawing { display: block; }

/* Home: the book entry is type only — Themerson's drawings appear on the
   book's own page and nowhere else on the site. */

.entry { margin: 3.5rem 0 0; }

.entry h2 a { border-bottom: 0; }

.entry h2 {
  margin-top: 0;
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  line-height: 1.1;
}

.entry__author {
  margin: 0.35rem 0 1.1rem;
  font-style: italic;
  color: var(--quiet);
}

/* Book page hero drawing sits to the side of the opening text. */

.hero {
  display: grid;
  gap: 1.5rem 3rem;
  margin: 0;
}

@media (min-width: 46rem) {
  .hero {
    grid-template-columns: 1fr 15rem;
    align-items: start;
  }
  .hero__figure { order: 2; margin-top: 0.5rem; }
  .hero__figure img { max-width: 15rem; }
  .hero__text   { order: 1; }
}

.hero > * { min-width: 0; }

.hero__figure { margin: 0; }

.hero__figure img { max-width: 12rem; }

.more {
  color: var(--red);
  border-bottom-color: var(--red);
}

.vignette {
  margin: 3rem 0;
  max-width: 11rem;
}

/* ------------------------------------------------------------------ edition */

.edition {
  margin: 2.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  max-width: var(--measure);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.edition dl {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 0.15rem 1rem;
  margin: 0;
  max-width: none;
}

.edition dt {
  color: var(--quiet);
  letter-spacing: 0.04em;
}

.edition dd { margin: 0; }

@media (max-width: 34rem) {
  .edition dl { grid-template-columns: 1fr; gap: 0; }
  .edition dt { margin-top: 0.7rem; }
}

/* ---------------------------------------------------------------------- buy */

.buy {
  margin: 2.5rem 0 0;
  padding: 0;
}

.buy__link {
  display: inline-block;
  font-size: 1.125rem;
  letter-spacing: 0.02em;
  color: var(--red);
  border-bottom: 1px solid var(--red);
  padding-bottom: 0.1rem;
}

.buy__link:hover,
.buy__link:focus { color: var(--red); }

.buy__pending {
  font-size: 1.125rem;
  color: var(--red);
}

.buy__note {
  margin: 0.6rem 0 0;
  font-size: 0.9375rem;
  color: var(--quiet);
}

/* ------------------------------------------------------------------- footer */

.foot {
  max-width: 46rem;
  margin: 5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--quiet);
}

.foot p { margin: 0 0 0.4rem; max-width: none; }
