/* Punk & Political — a catalog site.
   Tokens: newsprint, xerox ink, one spot red. Type: Anton / Abril Fatface for the ransom masthead,
   Courier Prime for body, Oswald for labels. */

:root {
  --paper: #e6ddc6;
  --paper-2: #f2ece0;
  --paper-3: #d9cfb4;
  --ink: #141210;
  --xerox: #5b5750;
  --rule: #2a2724;
  --red: #c8281e;
  --red-ink: #a61f17;
  --focus: #0a58ca;

  --f-display: "Anton", Impact, "Arial Narrow", sans-serif;
  --f-ransom-b: "Abril Fatface", Georgia, serif;
  --f-body: "Courier Prime", "Courier New", Courier, monospace;
  --f-label: "Oswald", "Arial Narrow", sans-serif;

  --measure: 64ch;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  background-image:
    radial-gradient(rgba(0,0,0,.045) 1px, transparent 1.2px),
    radial-gradient(rgba(0,0,0,.03) 1px, transparent 1.2px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 2px 3px;
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--red-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.skip {
  position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper);
  padding: 8px 12px; z-index: 100; font-family: var(--f-label);
}
.skip:focus { left: 8px; }

/* ---------- labels & stamps ---------- */
.eyebrow, .filter-label, .lb-no, .index-card dt, .count, .sub-note, .foot {
  font-family: var(--f-label);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 500;
}

.stamp {
  display: inline-block;
  font-family: var(--f-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 13px;
  line-height: 1;
  padding: 9px 12px 8px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  border-radius: 2px;
  position: relative;
  transition: transform .12s ease, color .12s ease, border-color .12s ease;
}
.stamp:hover { transform: rotate(-1.5deg); color: var(--red-ink); border-color: var(--red-ink); }
.stamp-red, .stamp[aria-pressed="true"] {
  color: var(--red);
  border-color: var(--red);
  transform: rotate(-2deg);
  /* worn-ink stamp: slightly broken edge */
  -webkit-mask-image: radial-gradient(circle at 20% 30%, transparent 0 .6px, #000 1.1px), linear-gradient(#000, #000);
  mask-image: radial-gradient(circle at 20% 30%, transparent 0 .6px, #000 1.1px), linear-gradient(#000, #000);
  -webkit-mask-size: 5px 5px, 100% 100%;
  mask-size: 5px 5px, 100% 100%;
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
.stamp[aria-pressed="true"]:hover { color: var(--red-ink); }

/* ---------- masthead ---------- */
.masthead {
  border-bottom: 3px solid var(--ink);
  padding: clamp(28px, 6vw, 72px) var(--gutter) 0;
  position: relative;
  overflow: hidden;
}
.masthead-inner { max-width: 1100px; margin: 0 auto; }
.eyebrow { margin: 0 0 18px; color: var(--xerox); }

.ransom {
  margin: 0 0 22px -6px;
  font-size: clamp(44px, 9.5vw, 132px);
  line-height: .95;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .02em .04em;
  font-weight: 400;
}
.ransom .word span {
  display: inline-block;
  padding: .02em .08em .0em;
  line-height: 1;
  transform: rotate(var(--r, 0deg)) translateY(var(--y, 0));
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: 1px 2px 0 rgba(0,0,0,.25);
  font-family: var(--f-display);
}
.ransom .word .r1 { font-family: var(--f-ransom-b); background: var(--ink); color: var(--paper); }
.ransom .word .r2 { font-family: var(--f-display); background: var(--red); color: var(--paper-2); }
.ransom .word .r3 { font-family: var(--f-display); background: var(--paper-2); color: var(--ink); }
.ransom .word .r4 { font-family: var(--f-ransom-b); background: var(--paper-3); color: var(--ink); font-style: italic; }
.ransom .word .r5 { font-family: var(--f-display); background: var(--ink); color: var(--red); }
.ransom .word .r6 { font-family: var(--f-ransom-b); background: var(--paper-2); color: var(--red); }
.ransom .word { display: inline-flex; align-items: baseline; gap: .02em .04em; white-space: nowrap; }
.ransom .word + .word { margin-left: .28em; }

.deck {
  max-width: var(--measure);
  font-size: clamp(16px, 1.6vw, 19px);
  margin: 0 0 26px;
}
.masthead-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 34px; }

.masthead-strip {
  display: flex; gap: 10px; align-items: flex-end;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter);
  overflow: hidden;
  height: 150px;
}
.masthead-strip img {
  height: 140px; width: auto; flex: 0 0 auto;
  border: 1.5px solid var(--ink);
  background: var(--paper-2);
  transform: translateY(14px) rotate(var(--tilt, 0deg));
  filter: grayscale(.15) contrast(1.05);
}
.masthead-strip img:nth-child(odd) { --tilt: -1.5deg; }
.masthead-strip img:nth-child(3n) { --tilt: 1.2deg; transform: translateY(26px) rotate(var(--tilt)); }
.masthead-strip img:nth-child(4n) { --tilt: 2.2deg; }

/* ---------- index card strip ---------- */
.card-strip { padding: 34px var(--gutter) 6px; }
.index-card {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  background: var(--paper-2);
  border: 1.5px solid var(--ink);
  background-image: repeating-linear-gradient(transparent 0 27px, rgba(200,40,30,.35) 27px 28px);
  background-position: 0 14px;
  padding: 0;
}
.index-card > div { padding: 12px 16px 10px; border-right: 1px solid rgba(0,0,0,.15); }
.index-card > div:last-child { border-right: 0; }
.index-card dt { margin: 0; color: var(--xerox); }
.index-card dd { margin: 2px 0 0; font-weight: 700; font-size: 17px; }

/* ---------- toolbar ---------- */
.catalog { padding: 22px var(--gutter) 60px; max-width: 1400px; margin: 0 auto; }
.toolbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--paper);
  border-bottom: 1.5px solid var(--ink);
  padding: 12px 0 10px;
  margin-bottom: 26px;
}
.filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 5px 0; }
.filter-label { color: var(--xerox); min-width: 48px; }
.stamps { display: flex; gap: 8px; flex-wrap: wrap; }
.stamps .stamp { font-size: 12px; padding: 7px 10px 6px; }
.stamps .stamp .num { opacity: .55; margin-left: .35em; font-weight: 400; }
.filter-row-tools { gap: 20px; }
.search, .sort { display: flex; align-items: center; gap: 10px; }
.search input, .sort select {
  font-family: var(--f-body); font-size: 15px; color: var(--ink);
  background: var(--paper-2); border: 1.5px solid var(--ink); border-radius: 0;
  padding: 7px 10px; min-width: 220px;
}
.sort select { min-width: 160px; }
.count { margin: 0 0 0 auto; color: var(--xerox); }

/* ---------- grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  grid-auto-rows: 8px;
  column-gap: 22px;
  align-items: start;
}
.item {
  display: block;
  margin: 0;
  grid-row-end: span var(--span, 40);
  background: var(--paper-2);
  border: 1.5px solid var(--ink);
  padding: 8px 8px 10px;
  color: inherit; text-decoration: none;
  transform: rotate(var(--tilt, 0deg));
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 2px 3px 0 rgba(0,0,0,.18);
}
.item:nth-child(4n+1) { --tilt: -.8deg; }
.item:nth-child(4n+3) { --tilt: .7deg; }
.item:nth-child(7n+2) { --tilt: 1.1deg; }
.item:hover, .item:focus-visible { transform: rotate(0) translateY(-2px); box-shadow: 4px 6px 0 rgba(0,0,0,.22); }
.item img {
  display: block; width: 100%; height: auto;
  background: var(--paper-3);
}
.item figcaption { padding: 8px 2px 0; }
.item .no { font-family: var(--f-label); font-size: 11px; letter-spacing: .12em; color: var(--red-ink); text-transform: uppercase; }
.item .title { display: block; font-weight: 700; font-size: 14px; line-height: 1.3; margin-top: 3px; }
.item .meta { display: block; font-size: 12px; color: var(--xerox); margin-top: 4px; }
.empty { text-align: center; padding: 60px 0; color: var(--xerox); }

/* ---------- prose ---------- */
.prose { padding: 54px var(--gutter); border-top: 3px solid var(--ink); }
.prose > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
.section-title, .lb-title {
  font-family: var(--f-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.section-title { font-size: clamp(30px, 4.6vw, 54px); line-height: 1; margin: 0 auto 24px; }
.cols { columns: 2 340px; column-gap: 44px; }
.cols p { margin: 0 0 1em; break-inside: avoid; }
.donate { background: var(--ink); color: var(--paper); }
.donate a:hover { color: #ffb3ad; }
.donate .section-title { color: var(--red); }
.sub-title { font-family: var(--f-label); text-transform: uppercase; letter-spacing: .12em; font-size: 14px; margin: 38px 0 4px; }
.sub-note { margin: 0 0 18px; color: #bdb4a0; text-transform: none; letter-spacing: .04em; font-size: 13px; }
.archives { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2px; }
.archives li { border: 1px solid #4a463f; padding: 14px 16px; }
.archives .name { display: block; font-weight: 700; }
.archives .where { font-family: var(--f-label); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #bdb4a0; }
.archives .why { display: block; font-size: 14px; margin-top: 6px; color: #e2dac8; }
.archives a { color: #ffd9d6; font-size: 13px; }
.contact-block { margin-top: 36px; font-size: 18px; }
.contact-block a { color: var(--paper-2); }
.contact-block .stamp { color: var(--red); border-color: var(--red); }
.contact-block .stamp:hover { color: #ff6a5f; border-color: #ff6a5f; }

.foot { padding: 30px var(--gutter); color: var(--xerox); text-transform: none; letter-spacing: .04em; }
.foot p { margin: 0 0 6px; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: var(--ink);
  display: grid;
  grid-template-columns: 1fr minmax(280px, 380px);
  gap: 0;
}
.lightbox[hidden] { display: none; }
.lb-figure { margin: 0; display: grid; place-items: center; padding: 48px 56px; min-height: 0; }
.lb-figure img {
  max-width: 100%; max-height: calc(100vh - 96px); width: auto; height: auto;
  border: 2px solid var(--paper-2);
  box-shadow: 0 0 0 1px var(--ink), 8px 10px 0 rgba(0,0,0,.5);
}
.lb-card {
  background: var(--paper-2);
  background-image: repeating-linear-gradient(transparent 0 27px, rgba(200,40,30,.35) 27px 28px);
  background-position: 0 92px;
  border-left: 3px solid var(--red);
  padding: 92px 26px 26px;
  overflow: auto;
}
.lb-no { color: var(--red-ink); margin: 0 0 2px; }
.lb-title { font-size: 26px; line-height: 1.05; margin: 0 0 16px; }
.lb-meta { margin: 0 0 14px; font-size: 14px; }
.lb-meta div { display: flex; gap: 10px; }
.lb-meta dt { font-family: var(--f-label); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; color: var(--xerox); min-width: 52px; padding-top: 3px; }
.lb-meta dd { margin: 0; }
.lb-note { font-size: 14px; margin: 0 0 12px; }
.lb-tags { font-family: var(--f-label); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; color: var(--xerox); margin: 0 0 18px; }
.lb-links { font-size: 13px; margin: 0; }
.lb-close, .lb-nav {
  position: absolute; z-index: 2;
  background: var(--paper-2); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 0;
  width: 44px; height: 44px; cursor: pointer;
  font: 400 28px/1 var(--f-label);
  display: grid; place-items: center;
}
.lb-close { top: 16px; right: 16px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 12px; }
.lb-next { right: calc(min(380px, 32vw) + 12px); }
.lb-close:hover, .lb-nav:hover { background: var(--red); color: var(--paper-2); border-color: var(--red); }

body.lb-open { overflow: hidden; }

@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); column-gap: 12px; }
  .item { padding: 5px 5px 8px; }
  .item .title { font-size: 12.5px; }
  .item .meta { font-size: 11px; }
  .stamps .stamp { font-size: 11px; padding: 6px 8px 5px; }
}

@media (max-width: 760px) {
  .lightbox { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .lb-figure { padding: 64px 16px 12px; }
  .lb-figure img { max-height: 58vh; }
  .lb-card { padding: 18px 18px 22px; max-height: 40vh; background-position: 0 18px; }
  .lb-next { right: 12px; }
  .lb-nav { top: 34vh; }
  .lb-title { font-size: 21px; }
  .toolbar { position: static; }
  .count { margin-left: 0; width: 100%; }
  .masthead-strip { height: 110px; }
  .masthead-strip img { height: 100px; }
}
