/* DERWeb archive — strict monochrome design system */
:root {
  --ink: #111111;
  --paper: #ffffff;
  --mid: #555555;
  --faint: #999999;
  --hairline: #e2e2e2;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 16px;
}
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { display: block; max-width: 100%; }

/* masthead */
.masthead {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 5vw; border-bottom: 1px solid var(--ink);
}
.wordmark {
  display: block; line-height: 0; flex-shrink: 0;
}
.wordmark:hover { text-decoration: none; opacity: 0.88; }
.wordmark img {
  display: block; height: 57px; width: auto; max-width: min(340px, 70vw);
}
.masthead nav a {
  margin-left: 28px; font-size: 13px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--mid);
}
.masthead nav a:hover { color: var(--ink); }

main { min-height: 70vh; }

/* hero */
.hero { padding: 12vh 5vw 8vh; max-width: 1100px; }
.hero h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 6vw, 64px);
  line-height: 1.12; letter-spacing: -0.01em;
}
.lede { margin: 28px 0; max-width: 680px; font-size: 18px; color: var(--mid); }

.btn {
  display: inline-block; border: 1px solid var(--ink); padding: 12px 28px;
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

/* category tiles */
.categories { padding: 0 5vw 12vh; }
.categories h2, .related h2 {
  font-family: var(--serif); font-weight: 400; font-size: 24px;
  border-top: 1px solid var(--ink); padding-top: 20px; margin-bottom: 32px;
}
.tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1px; background: var(--hairline); border: 1px solid var(--hairline);
}
.tile { background: var(--paper); padding: 20px; }
.tile:hover { text-decoration: none; }
.tileimg { display: block; aspect-ratio: 3/2; overflow: hidden; filter: grayscale(1); transition: filter .25s; }
.tile:hover .tileimg { filter: grayscale(0); }
.tileimg img { width: 100%; height: 100%; object-fit: cover; }
.tileplaceholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--hairline); filter: none;
}
.tileplaceholder span {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint);
}
.tilelabel { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; }
.tilelabel strong { font-family: var(--serif); font-weight: 400; font-size: 17px; }
.tilelabel em { font-style: normal; font-size: 12px; color: var(--faint); }

/* browse */
.browse { padding: 6vh 5vw 12vh; }
.browse h1, .detail h1 {
  font-family: var(--serif); font-weight: 400; font-size: 34px; margin-bottom: 28px;
}
.controls { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--hairline); padding: 24px 0; margin-bottom: 18px; }
#q {
  width: 100%; max-width: 640px; font-size: 17px; padding: 12px 0;
  border: 0; border-bottom: 1px solid var(--ink); outline: none;
  font-family: var(--sans); background: transparent;
}
.chips { margin: 18px 0 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--hairline); padding: 5px 14px; font-size: 12.5px;
  letter-spacing: 0.04em; cursor: pointer; background: var(--paper); color: var(--mid);
  font-family: var(--sans);
}
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.toggle { font-size: 13px; color: var(--mid); display: inline-flex; gap: 8px; align-items: center; }
.count { font-size: 13px; color: var(--faint); margin-bottom: 20px; }
.count.empty { max-width: 520px; line-height: 1.7; padding: 24px 0; }

.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 28px 20px;
}
.card { display: block; }
.card:hover { text-decoration: none; }
.cardimg { display: block; aspect-ratio: 3/2; background: #f4f4f4; overflow: hidden; }
.card .cap, .card .ref { display: block; }
.cardimg img { width: 100%; height: 100%; object-fit: cover; }
.card.lowres .cardimg img { image-rendering: auto; }
.card .cap {
  font-size: 12.5px; color: var(--mid); margin-top: 8px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card .ref { font-size: 11px; letter-spacing: 0.1em; color: var(--faint); margin-top: 4px; }
.card:hover .cap { color: var(--ink); }
.noimgcard {
  aspect-ratio: 3/2; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--hairline); color: var(--faint); font-size: 12px;
}

/* detail */
.detail { padding: 5vh 5vw 10vh; }
.crumb { font-size: 12.5px; letter-spacing: 0.06em; color: var(--faint); margin-bottom: 30px; text-transform: uppercase; }
.crumb a { color: var(--faint); }
.crumb a:hover { color: var(--ink); }
.detailgrid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr); gap: 48px; align-items: start; }
.detail figure img { width: 100%; border: 1px solid var(--hairline); }
.detail figure img.lowres { max-width: 320px; image-rendering: pixelated; }
.noimg {
  aspect-ratio: 3/2; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--hairline); color: var(--faint);
}
.meta h1 { margin-bottom: 16px; }
.desc { font-size: 17px; line-height: 1.65; margin-bottom: 20px; }
.note { font-size: 13px; color: var(--mid); border-left: 2px solid var(--ink); padding-left: 12px; margin-bottom: 20px; }
.meta table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 24px; }
.meta th, .meta td { text-align: left; padding: 9px 0; border-top: 1px solid var(--hairline); vertical-align: top; }
.meta th { color: var(--faint); font-weight: 400; width: 90px; padding-right: 16px; white-space: nowrap; }

.related { margin-top: 56px; }
.relstrip { display: flex; gap: 12px; flex-wrap: wrap; }
.relstrip img { height: 90px; width: 135px; object-fit: cover; border: 1px solid var(--hairline); }
.relstrip a:hover img { border-color: var(--ink); }
.textrel { display: flex; align-items: center; padding: 0 16px; border: 1px dashed var(--hairline); font-size: 12px; color: var(--mid); }

.pager { display: flex; justify-content: space-between; margin-top: 48px; border-top: 1px solid var(--hairline); padding-top: 20px; font-size: 14px; }

/* prose */
.prose { padding: 6vh 5vw 12vh; max-width: 720px; }
.prose h1 { font-family: var(--serif); font-weight: 400; font-size: 34px; margin-bottom: 24px; }
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 36px 0 12px; }
.prose p { margin-bottom: 14px; color: #222; }
.prose blockquote { border-left: 2px solid var(--ink); padding-left: 16px; color: var(--mid); margin: 16px 0; font-size: 15px; }

footer {
  border-top: 1px solid var(--ink); padding: 28px 5vw 48px;
  font-size: 12.5px; color: var(--faint);
}
footer p { margin-top: 4px; }
footer a { color: var(--faint); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 860px) {
  .detailgrid { grid-template-columns: 1fr; gap: 28px; }
  .masthead { padding: 20px 5vw; }
  .masthead nav a { margin-left: 16px; }
}
