/* ==========================================================================
   Basler-Kopp – global styles
   Quiet "exhibition catalogue" look: warm paper, ink text, thin rules,
   one muted accent. Paintings are never cropped.
   ========================================================================== */

:root {
  --paper: #f6f3ee;
  --paper-raised: #fbf9f6;
  --mat: #ebe5db;            /* mount behind paintings */
  --ink: #2a2622;
  --ink-soft: #5c554d;
  --ink-faint: #8a8279;
  --rule: #ddd5ca;
  --rule-soft: #e9e3da;
  --accent: #8a3b2a;         /* muted oxblood */
  --accent-hover: #6b2b1e;

  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, "Times New Roman", serif;

  --measure: 68ch;           /* comfortable line length for running text */
  --page: 1040px;
  --gap: 1.5rem;

  /* mother-of-pearl ("Wenn es nicht perlmuttet, ist es nicht von mir"):
     pale tones that drift into each other like the inside of a shell */
  --pearl-rose: #e9cad9;
  --pearl-lilac: #d6caee;
  --pearl-blue: #c4dde9;
  --pearl-mint: #cbe6d6;
  --pearl-gold: #eedbb5;
  --pearl-strength: 1;       /* 0 = plain paper, 1 = full shimmer (at the page edges) */
  /* hairlines need deeper versions of the same tones to show on paper */
  --pearl-line: linear-gradient(90deg, transparent, #d8b4c4 12%, #bfb1dc 30%,
    #a6c6d6 48%, #b1d4bf 66%, #d9c393 84%, transparent);
  /* mount behind a painting while the pointer is on it */
  --pearl-mat: linear-gradient(135deg, var(--mat) 10%, #e9dfe8 35%, #e2e0ef 50%,
    #dde9ea 65%, var(--mat) 90%);
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

/* the shimmer: a fixed layer behind all content that drifts very slowly */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  opacity: var(--pearl-strength);
  /* strong at the left and right edges, plain paper in the middle.
     The layer is 150% of the window (inset -25%), so 16.7% / 83.3% are the window edges. */
  -webkit-mask-image: var(--pearl-mask);
  mask-image: var(--pearl-mask);
  --pearl-mask: linear-gradient(90deg, #000 16.7%, rgba(0, 0, 0, 0.45) 31.3%,
    transparent 42%, transparent 58%, rgba(0, 0, 0, 0.45) 68.7%, #000 83.3%);
  background:
    radial-gradient(ellipse 38% 30% at 18% 22%, var(--pearl-rose), transparent 70%),
    radial-gradient(ellipse 34% 40% at 78% 18%, var(--pearl-blue), transparent 70%),
    radial-gradient(ellipse 42% 32% at 62% 64%, var(--pearl-lilac), transparent 70%),
    radial-gradient(ellipse 30% 36% at 24% 78%, var(--pearl-mint), transparent 70%),
    radial-gradient(ellipse 36% 28% at 88% 86%, var(--pearl-gold), transparent 70%),
    /* a faint veil of all tones underneath, so the middle stays warm paper */
    conic-gradient(from 210deg at 50% 50%,
      color-mix(in srgb, var(--pearl-rose) 80%, transparent),
      color-mix(in srgb, var(--pearl-lilac) 80%, transparent),
      color-mix(in srgb, var(--pearl-blue) 80%, transparent),
      color-mix(in srgb, var(--pearl-mint) 80%, transparent),
      color-mix(in srgb, var(--pearl-gold) 80%, transparent),
      color-mix(in srgb, var(--pearl-rose) 80%, transparent));
  animation: pearl-drift 140s ease-in-out infinite alternate;
}

@keyframes pearl-drift {
  from { transform: translate(-3%, -2%) rotate(0deg) scale(1); }
  50%  { transform: translate(2%, 3%) rotate(6deg) scale(1.05); }
  to   { transform: translate(4%, -1%) rotate(-4deg) scale(1.02); }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }
}

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

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transition: color 0.15s, text-decoration-color 0.15s;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

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

p {
  margin: 0 0 1em;
}

/* ---------- Page container ---------- */

main {
  max-width: var(--page);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* ---------- Headings ---------- */

h1,
h2,
h3 {
  font-weight: normal;
  line-height: 1.2;
  color: var(--ink);
}

h1 {
  font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  margin: 0 0 2rem;
  letter-spacing: -0.005em;
}

h2 {
  font-size: 1.5rem;
  margin: 3rem 0 1rem;
}

h3 {
  font-size: 1.15rem;
  margin: 2rem 0 0.75rem;
}

.intro {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 1.5em;
}

/* a personal note signed at the end */
.signature {
  margin: 1.75em 0 0;
  text-align: right;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* the same size as the text above */
.signature-name {
  display: inline-block;
  margin-top: 0.15em;
  font-size: 1.33em;
  font-style: italic;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
}

/* break between two texts: a short mother-of-pearl line */
.section-break {
  width: 40%;
  height: 1px;
  margin: 2.75rem auto;
  border: 0;
  background: var(--pearl-line);
}

.collection-intro {
  max-width: var(--measure);
  color: var(--ink-soft);
  margin: -1rem 0 2.5rem;
}

/* ---------- Language switch ---------- */

.lang-switch {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0.9rem 1.5rem 0;
  text-align: right;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.lang-switch strong {
  font-weight: normal;
  color: var(--ink);
}

.lang-switch a {
  color: var(--ink-faint);
  text-decoration: none;
}

.lang-switch a:hover {
  color: var(--accent);
}

/* notice on English pages whose text exists only in German */
.only-german {
  max-width: var(--measure);
  margin: 0 0 2rem;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink-soft);
  background: var(--paper-raised);
  border-left: 2px solid var(--rule);
}

/* ---------- Masthead (site title) ---------- */

.masthead {
  text-align: center;
  padding: 0.75rem 1.5rem 0;
}

.site-title {
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.site-title:hover {
  color: var(--ink);
}

.site-subtitle {
  margin-top: 0.35rem;
  font-style: italic;
  color: var(--ink-soft);
}

.site-subtitle .dates {
  font-style: normal;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  margin-left: 0.6rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--rule);
}

/* ---------- Main navigation ---------- */

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 2rem;
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid;
  border-image: var(--pearl-line) 1;
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  max-width: var(--page);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2.5rem;
  border-top: 1px solid;
  border-image: var(--pearl-line) 1;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.site-footer a {
  color: var(--ink-soft);
  text-decoration: none;
  margin-left: 1.25rem;
}

.site-footer a:first-child {
  margin-left: 0;
}

.site-footer a:hover,
.site-footer a.active {
  color: var(--accent);
}

/* ---------- Simple lists ---------- */

.plain-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5em;
}

.plain-list li {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--rule-soft);
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}

.nav a:hover {
  color: var(--ink);
}

.nav a.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---------- Sub-navigation (collections) ---------- */

.subnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--rule-soft);
  background: color-mix(in srgb, var(--paper-raised) 60%, transparent);
}

.subnav a {
  color: var(--ink-faint);
  text-decoration: none;
  font-size: 0.9rem;
  font-style: italic;
}

.subnav a:hover {
  color: var(--ink);
}

.subnav a.active {
  color: var(--accent);
}

/* ---------- Text + sidebar layout ---------- */

.article-with-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  gap: 3.5rem;
  align-items: start;
}

.text {
  max-width: var(--measure);
}

.aside-box {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-soft);
  padding-left: 1.5rem;
  border-left: 1px solid var(--rule);
  position: sticky;
  top: 1.5rem;
}

.aside-box > p:first-child {
  font-style: italic;
  color: var(--ink);
}

.aside-image {
  display: block;
  width: 100%;
  margin: 0 0 1em;
}

/* ---------- Paintings: shared "mount" treatment ---------- */
/* Images sit uncropped (object-fit: contain) on a light mat. */

.card img,
.mini-card img,
.ref-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--mat);
  padding: 0.75rem;
  transition: background 0.2s;
}

/* ---------- Works grid (collection pages) ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2.5rem var(--gap);
}

.card {
  display: block;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.4;
}

.card > div {
  margin-top: 0.6rem;
}

.card:hover {
  color: var(--accent);
}

.card:hover img,
.mini-card:hover img {
  background: var(--pearl-mat);
}

/* ---------- Small linked painting in the sidebar ---------- */

.mini-card {
  display: block;
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.mini-card img {
  padding: 0.5rem;
}

.caption {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-faint);
  text-align: center;
}

/* ---------- Collections overview ---------- */

.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--gap);
}

.collection-card {
  display: block;
  padding: 1.5rem 1.5rem 1.25rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s;
}

.collection-card:hover {
  border-top-color: var(--accent);
  color: var(--ink);
}

.collection-title {
  font-size: 1.2rem;
  line-height: 1.3;
}

.collection-card:hover .collection-title {
  color: var(--accent);
}

.collection-desc {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---------- Single work page ---------- */

.work-image {
  display: block;
  max-height: 80vh;
  width: auto;
  max-width: 100%;
  margin: 0 0 1.5rem;
  background: var(--mat);
  padding: 1.25rem;
}

/* an old black-and-white photograph of the work, below its description */
.historical-photo {
  max-width: 22rem;
  margin: 2rem 0;
}

.historical-photo img {
  display: block;
  width: 100%;
  background: var(--mat);
  padding: 0.5rem;
}

.historical-photo figcaption {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-faint);
}

.work-image-link {
  display: inline-block;
  cursor: zoom-in;
}

.work-meta {
  margin: 0 0 2rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.work-meta div + div {
  margin-top: 0.15rem;
}

.work-text {
  max-width: var(--measure);
}

.work-lost {
  max-width: var(--measure);
  margin: -1rem 0 2rem;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  font-style: italic;
  color: var(--ink-soft);
}

/* ---------- Lost works listing ---------- */

.collection-card-lost {
  border-top-color: var(--accent);
  background: none;
}

.lost-group h2 {
  font-size: 1.2rem;
  margin: 2.5rem 0 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.lost-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: var(--measure);
}

.lost-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule-soft);
}

.lost-title {
  font-size: 1.05rem;
}

.lost-item .ref-meta {
  margin: 0.15rem 0 0;
}

.lost-item p {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.work-articles ul {
  padding-left: 1.2rem;
}

/* ---------- Articles list ---------- */

.articles-list {
  max-width: var(--measure);
  border-top: 1px solid var(--rule);
}

.article-item {
  display: block;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
}

.article-title {
  font-size: 1.25rem;
  line-height: 1.3;
}

.article-item:hover .article-title {
  color: var(--accent);
}

.article-desc {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.article-tag {
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  vertical-align: 0.2em;
  color: var(--ink-faint);
  border: 1px solid var(--rule);
}

/* ---------- Catalogue of works (table) ---------- */

.catalogue-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  margin: -1.5rem 0 1rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.print-button {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.3rem 0.8rem;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--rule);
  cursor: pointer;
}

.print-button:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.catalogue-jump {
  margin: 0 0 2rem;
  font-size: 0.9rem;
}

.catalogue-jump span,
.catalogue-count {
  color: var(--ink-faint);
}

.catalogue-count {
  margin-left: 0.5rem;
  font-size: 0.85rem;
}

.catalogue-section h2 {
  scroll-margin-top: 1rem;
}

/* on narrow screens the table scrolls sideways inside this box */
.catalogue-scroll {
  overflow-x: auto;
  margin: 0 0 3rem;
}

.catalogue {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  line-height: 1.45;
}

.catalogue th {
  padding: 0.5rem 0.75rem 0.5rem 0;
  text-align: left;
  font-weight: normal;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule);
}

.catalogue td {
  padding: 0.55rem 0.75rem 0.55rem 0;
  vertical-align: top;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-soft);
}

.catalogue .catalogue-title {
  min-width: 11rem;
  color: var(--ink);
}

.catalogue-nowrap {
  white-space: nowrap;
}

.catalogue-notes {
  min-width: 16rem;
  font-size: 0.82rem;
  white-space: pre-line;
}

/* ---------- Biography images ---------- */

.bio-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin: 2rem 0 2.5rem;
}

.bio-images img {
  display: block;
  width: 100%;
}

/* ---------- Inline work references inside text ---------- */

.inline-work {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  vertical-align: middle;
}

.inline-work img {
  width: 48px;
  height: 36px;
  object-fit: contain;
  background: var(--mat);
  padding: 2px;
}

/* ---------- Book reference ---------- */

.book-ref {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin: 2rem 0;
  padding: 1.25rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.book-ref img {
  width: 80px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(42, 38, 34, 0.18);
}

/* ---------- References & expositions ---------- */

.references {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2.5rem var(--gap);
}

.expositions {
  display: grid;
  gap: 2.5rem;
}

.ref-card {
  background: none;
}

.ref-body {
  padding-top: 0.9rem;
}

.ref-title {
  font-size: 1.1rem;
  line-height: 1.35;
  margin-bottom: 0.3rem;
}

.ref-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.75rem;
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.ref-meta span + span::before {
  content: "·";
  margin-right: 0.75rem;
}

.ref-body p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 0.6em;
}

.ref-link {
  font-size: 0.85rem;
}

/* ---------- Contact form ---------- */

.contact-form {
  max-width: 32rem;
}

.contact-form label {
  display: block;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.contact-form input,
.contact-form textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  letter-spacing: normal;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 0;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form textarea {
  resize: vertical;
}

.contact-form button {
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.75rem 1.75rem;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  cursor: pointer;
  transition: background 0.15s;
}

.contact-form button:hover {
  background: var(--accent);
}

/* ---------- Pages with several images (sketches, album entry) ---------- */

.work-images {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.work-images .work-image {
  margin: 0;
}

/* poems and verses */
.verse {
  font-style: italic;
  padding-left: 1.25rem;
  border-left: 1px solid var(--rule);
}

/* verse from JSON data: the text itself contains the line breaks */
.verse-lines {
  white-space: pre-line;
}

/* image floated beside running text */
.figure-aside {
  float: right;
  width: 16rem;
  max-width: 45%;
  margin: 0.4rem 0 1rem 1.75rem;
}

.figure-aside img {
  display: block;
  width: 100%;
  background: var(--mat);
  padding: 0.5rem;
}

.figure-aside figcaption {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-faint);
  text-align: center;
}

.figure-left {
  float: left;
  margin: 0.4rem 1.75rem 1rem 0;
}

/* several pictures side by side, e.g. the ones a quoted review talks about.
   They never wrap: each takes a share of the width in proportion to its aspect
   ratio (--ratio, set by ratioStyle() in src/lib/images.ts), so all pictures in
   a row have the same height and together fill the row. */
.figure-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin: 0 0 1.25rem;
}

.figure-row > * {
  flex: var(--ratio, 1) 1 0;
  min-width: 0;
  margin: 0;
}

/* a single picture does not fill the whole row */
.figure-row > :only-child {
  flex: 0 1 55%;
}

.figure-row img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--mat);
  padding: 0.5rem;
}

.figure-row a:hover img,
a.figure-row:hover img {
  background: var(--pearl-mat);
}

.figure-row figcaption {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-faint);
}

/* pictures side by side, each with a longer caption */
.figure-row-captions {
  margin: 2rem 0;
}

.figure-row-captions figcaption {
  line-height: 1.45;
}

/* footnote: the mark in the text and the note at the end of an article */
.footnote-ref {
  text-decoration: none;
  vertical-align: super;
  font-size: 0.75em;
  line-height: 0;
  padding: 0 0.1em;
}

.footnote {
  max-width: var(--measure);
  margin: 2.5rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-soft);
}

.footnote a {
  text-decoration: none;
}

/* author of an article, under its title */
.byline {
  margin: -1.25rem 0 2rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* two pictures with one caption, e.g. a drawing and a detail of it */
.figure-pair {
  max-width: 40rem;
  margin: 2.5rem 0;
}

.figure-pair .figure-row {
  text-decoration: none;
  margin-bottom: 0.6rem;
}

.figure-pair figcaption {
  max-width: var(--measure);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-faint);
}

/* quotations, e.g. contemporary reviews */
blockquote {
  margin: 0 0 1.5em;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 2px solid;
  border-image: linear-gradient(180deg, #d8b4c4, #bfb1dc, #a6c6d6, #b1d4bf, #d9c393) 1;
  color: var(--ink-soft);
}

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

.text::after {
  content: "";
  display: block;
  clear: both;
}

/* ---------- Books ---------- */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 2.5rem var(--gap);
  margin: 2.5rem 0 3.5rem;
}

.book-card {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.book-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: var(--mat);
  padding: 0.75rem;
  transition: background 0.2s;
}

.book-card:hover img {
  background: var(--pearl-mat);
}

.book-card-title {
  margin-top: 0.7rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.book-card:hover .book-card-title {
  color: var(--accent);
}

.book-card-meta {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.essay {
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.illustration {
  margin: 0;
}

/* ---------- Lightbox (book illustrations) ---------- */

.lightbox {
  max-width: min(56rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 2rem 2rem 1.5rem;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 10px 40px rgba(42, 38, 34, 0.35);
}

.lightbox::backdrop {
  background: rgba(42, 38, 34, 0.7);
}

.lightbox h2 {
  margin: 0 2rem 0.5rem 0;
  font-size: 1.3rem;
}

.lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 70vh;
  margin: 1rem 0;
  background: var(--mat);
  padding: 0.75rem;
}

.lightbox p {
  max-width: var(--measure);
  font-size: 0.95rem;
}

.lightbox .caption {
  text-align: left;
}

.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font: inherit;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--ink-soft);
  background: none;
  border: 0;
  cursor: pointer;
}

.lightbox-close:hover {
  color: var(--accent);
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  :root {
    --pearl-strength: 0.6;
  }

  body {
    font-size: 1rem;
  }

  main {
    padding: 2rem 1rem 3.5rem;
  }

  .masthead {
    padding: 0.5rem 1rem 0;
  }

  .lang-switch {
    padding: 0.75rem 1rem 0;
  }

  .site-subtitle .dates {
    display: block;
    margin: 0.2rem 0 0;
    padding: 0;
    border: 0;
  }

  .nav {
    gap: 0.25rem 1.25rem;
    padding: 1rem;
  }

  .site-footer {
    padding: 1.25rem 1rem 2rem;
  }

  .subnav {
    padding: 0.6rem 1rem;
    gap: 0.25rem 1rem;
  }

  .article-with-aside {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .aside-box {
    position: static;
    padding: 1.5rem 0 0;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }

  .bio-images {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.75rem 1rem;
  }

  .work-image {
    padding: 0.75rem;
  }

  .figure-aside,
  .figure-left {
    float: none;
    width: auto;
    max-width: 20rem;
    margin: 1rem 0 1.5rem;
  }

  .figure-row {
    gap: 0.5rem;
  }

  .figure-row img {
    padding: 0.25rem;
  }

  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.75rem 1rem;
  }

  .lightbox {
    padding: 1.75rem 1rem 1rem;
  }
}

/* ---------- Printing ---------- */
/* Any page prints as plain text on white; the catalogue of works prints as a
   list like the PDFs of the old site (browser: Print / Save as PDF). */

.print-only {
  display: none;
}

@media print {
  @page {
    size: A4;
    margin: 14mm 12mm;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 10pt;
    line-height: 1.4;
  }

  body::before,
  .lang-switch,
  .nav,
  .subnav,
  .site-footer,
  .only-german,
  .print-button,
  .catalogue-jump,
  .lightbox {
    display: none !important;
  }

  .print-only {
    display: block;
  }

  .masthead {
    padding: 0 0 4mm;
    text-align: left;
  }

  main {
    max-width: none;
    padding: 0;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  h1 {
    font-size: 18pt;
    margin-bottom: 4mm;
  }

  h2 {
    font-size: 13pt;
    break-after: avoid;
  }

  img {
    break-inside: avoid;
  }

  /* the catalogue: web address of the list under the heading */
  .print-source {
    margin: -2mm 0 3mm;
    font-size: 8.5pt;
    color: #555;
  }

  .catalogue-meta {
    margin: 0 0 4mm;
    color: #000;
  }

  .catalogue-section + .catalogue-section {
    break-before: page;
  }

  .catalogue-scroll {
    overflow: visible;
    margin: 0;
  }

  .catalogue {
    font-size: 8.5pt;
  }

  /* column headings again on every page */
  .catalogue thead {
    display: table-header-group;
  }

  .catalogue tr {
    break-inside: avoid;
  }

  .catalogue th,
  .catalogue td {
    padding: 1.2mm 2.5mm 1.2mm 0;
    color: #000;
    border-color: #bbb;
  }

  .catalogue .catalogue-title,
  .catalogue-notes {
    min-width: 0;
  }

  .catalogue-notes {
    font-size: 8pt;
  }
}
