/* Colours are taken from Tom's 1930s work (the "O Papagaio" magazine covers
   and Tamariz booklets); type follows his 1950s–70s covers (condensed spaced
   capitals for headings and labels, a book serif for reading). Layout stays
   plain on purpose: the colour lives in headings, navigation and accents,
   and the figure photos carry the rest. */
:root {
  --paper: #f4ecd8;        /* cream newsprint — page background */
  --surface: #fbf6ea;      /* cards, header, panels */
  --ink: #1f1e1b;          /* text */
  --muted: #6b6254;        /* secondary text */
  --rule: #d8ccb0;         /* borders and dividers */
  --tint: #efe3c6;         /* soft fills (notes, placeholders) */

  --red: #b8281c;          /* vermilion — Series 1, main accent */
  --blue: #26446e;         /* cobalt — Series 2 */
  --green: #3e7b4f;        /* parrot green — Other, "confirmed" */
  --yellow: #e8b923;       /* chrome yellow — highlights, "for sale now" */
  --ochre: #8a6512;        /* dark yellow for text on light grounds */

  --accent: var(--red);    /* per page: series pages switch this to their colour */

  --font-display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-text: "Source Serif 4", Georgia, "Times New Roman", serif;
  --tracking: 0.08em;
  --radius: 3px;
}

body[data-series="2"] { --accent: var(--blue); }
body[data-series="O"] { --accent: var(--green); }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.5 var(--font-text);
}

a { color: var(--accent); }

h1, h2, h3,
.label, .hint-label {
  font-family: var(--font-display);
}
h1, h2, h3 {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking);
  line-height: 1.1;
}

.label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.hint { color: var(--muted); font-size: 0.88rem; margin-top: 0; }

/* ---------- header and navigation ---------- */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.9rem 2rem;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
}
.brand { display: flex; align-items: baseline; gap: 0.8rem; text-decoration: none; color: var(--ink); }
.monogram {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.1rem;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--red);
}
.monogram .o {
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  margin: 0 0.04em;
  border-radius: 50%;
  background: var(--yellow);
  vertical-align: -0.02em;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 1rem;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}
.site-nav a:hover { background: var(--tint); }
.site-nav a.active { background: var(--accent); color: #fff; }
.site-nav a .count { font-weight: 500; font-size: 0.8em; color: var(--muted); }
.site-nav a.active .count { color: rgba(255, 255, 255, 0.8); }
.nav-group {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding-left: 0.7rem;
  margin-left: 0.4rem;
  border-left: 1px solid var(--rule);
}
.nav-group-label { font-size: 0.8rem; letter-spacing: 0.14em; color: var(--muted); margin-right: 0.3rem; }
.nav-group.private a { color: var(--muted); border: 1px dashed var(--rule); }
.nav-group.private a.active { color: #fff; border-color: var(--accent); }

/* ---------- home ---------- */
.home { max-width: 1180px; margin: 0 auto; padding: 0 2rem 2rem; }
.home-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.home-hero h1 { font-size: 3.4rem; margin: 0.4rem 0 1rem; }
.home-hero p { max-width: 36em; }
.home-portrait { margin: 0; justify-self: center; max-width: 340px; }
.home-portrait img { width: 100%; display: block; border: 1px solid var(--rule); }
.home-portrait figcaption { margin-top: 0.4rem; font-size: 0.8rem; line-height: 1.4; color: var(--muted); }
.home-portrait figcaption a { color: var(--muted); }
.home-entries { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: 2rem 0; }
.entry {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 1.2rem 1.1rem;
  background: var(--surface);
  border-top: 6px solid var(--c);
  color: var(--ink);
  text-decoration: none;
}
.entry:hover { background: #fff; }
.entry-1 { --c: var(--red); }
.entry-2 { --c: var(--blue); }
.entry-O { --c: var(--green); }
.entry-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  text-transform: uppercase;
  letter-spacing: var(--tracking);
  color: var(--c);
}
.entry-count { font-family: var(--font-display); font-weight: 700; font-size: 2.6rem; line-height: 1; margin-top: 0.4rem; }
/* the background story: one column of text, photos inset on the right */
.story { padding: 1rem 0 0; border-top: 1px solid var(--rule); max-width: 900px; }
.story::after { content: ""; display: block; clear: both; }
.story h2 { clear: both; font-size: 2rem; color: var(--red); margin: 2rem 0 0.8rem; }
.story p { margin: 0 0 1rem; }
.story .inset { float: right; clear: both; width: 34%; max-width: 320px; margin: 0.3rem 0 1rem 2rem; }
.plates { clear: both; display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.5rem; align-items: end; margin: 0.5rem 0 1.5rem; }
.plates-even { grid-template-columns: 1fr 1fr; }
.plates figure { margin: 0; }
.plates img { width: 100%; display: block; border: 1px solid var(--rule); background: var(--surface); }
.story .inset img { width: 100%; display: block; border: 1px solid var(--rule); background: var(--surface); }
.story figcaption { margin-top: 0.4rem; font-size: 0.82rem; line-height: 1.4; color: var(--muted); }
.story figcaption a { color: var(--muted); }
.reading { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.reading h3 { font-size: 1.15rem; margin: 0 0 0.4rem; }
.reading ul { margin: 0; padding-left: 1.1rem; }
.reading li { margin-bottom: 0.6rem; font-size: 0.95rem; }


/* ---------- series pages ---------- */
.series-intro {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  border-bottom: 1px solid var(--rule);
}
.series-intro-text h2 { margin: 0 0 0.3rem; font-size: 2.2rem; color: var(--accent); }
.series-intro-text .series-meta {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.9rem;
  color: var(--muted);
}
.series-intro-text p { margin: 0 0 0.7rem; }
.series-intro-text p:last-child { margin-bottom: 0; }
.series-leaflet { margin: 0; }
.series-leaflet img { width: 100%; display: block; border: 1px solid var(--rule); background: #fff; }
.series-leaflet figcaption { margin-top: 0.4rem; font-size: 0.8rem; color: var(--muted); text-align: center; }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 0.9rem 2rem;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 5;
}
#search {
  flex: 1 1 240px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--ink);
}
.toggle-group { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.toggle-group button {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
}
.toggle-group button.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
  padding: 1.5rem 2rem;
}
.grid-group { grid-column: 1 / -1; margin-top: 0.8rem; }
.grid-group:first-child { margin-top: 0; }
.grid-group h3 { font-size: 1.5rem; color: var(--accent); margin: 0 0 0.2rem; }
.grid-group p { margin: 0; max-width: 46em; color: var(--muted); font-size: 0.95rem; }
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-image {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--paper);
}
.card-image img { width: 100%; height: 100%; object-fit: contain; }
.card-image .placeholder {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.6rem;
  color: var(--rule);
}
.card-image .watch-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  padding: 0.1rem 0.45rem;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
}
.card-image .owned-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 0.1rem 0.45rem;
  background: var(--green);
  color: var(--surface);
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
}
.card-body { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; padding: 0.7rem 0.8rem 0.8rem; }
.card-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-transform: uppercase;
}
.card-desc { font-size: 0.95rem; line-height: 1.35; }
.card-subdesc { font-size: 0.85rem; color: var(--muted); }
.card-meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 0.45rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
}
.card-price { color: var(--ink); }
.card-sales-count { color: var(--muted); font-weight: 500; }

/* ---------- figure pop-up ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3vh 1rem;
  overflow-y: auto;
  background: rgba(31, 30, 27, 0.55);
}
.modal-backdrop.hidden { display: none; }
.modal {
  position: relative;
  width: 100%;
  max-width: 1080px;
  padding: 1.6rem 1.9rem 2rem;
  background: var(--surface);
  border-top: 6px solid var(--accent);
}
.modal .close-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.9rem;
  border: none;
  background: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--muted);
}
.modal h2 { margin: 0 2rem 0.2rem 0; font-size: 1.9rem; }
.modal h3 { display: flex; align-items: baseline; gap: 0.5rem; font-size: 1.2rem; margin: 0.6rem 0 0.4rem; }
.modal h3 .n { font-weight: 500; color: var(--muted); }
.modal .province-line {
  margin: 0 0 1.2rem;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.9rem;
  color: var(--muted);
}
.figure-description { margin: 0 0 0.9rem; }
.kbd-hint { margin: 1.4rem 0 0; font-size: 0.8rem; color: var(--muted); text-align: right; }
.kbd-hint kbd {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 0.3em;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  font: inherit;
  text-align: center;
}
/* no keyboard on touch-only devices */
@media (hover: none) and (pointer: coarse) { .kbd-hint { display: none; } }
/* hero photo on the left, stays in view while the record list scrolls */
.fig-body { display: grid; grid-template-columns: minmax(260px, 5fr) 7fr; gap: 1.8rem; align-items: start; }
.fig-hero { position: sticky; top: 1rem; }
.fig-hero-img {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--rule);
}
.fig-hero-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.fig-hero-img .empty { font-family: var(--font-display); font-weight: 700; font-size: 3rem; color: var(--rule); }
.fig-hero-caption { margin-top: 0.5rem; font-size: 0.85rem; line-height: 1.4; color: var(--muted); }
.fig-hero-caption .src {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.fig-strip { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.fig-strip button { width: 54px; height: 54px; padding: 0; border: 1px solid var(--rule); background: var(--paper); cursor: pointer; }
.fig-strip button img { width: 100%; height: 100%; object-fit: contain; display: block; }
.fig-strip button.selected { outline: 2px solid var(--accent); outline-offset: 1px; }

/* the record list: one row per record, each with its own thumbnail */
.recs { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.rec {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 0.8rem;
  align-items: start;
  padding: 0.55rem 0.5rem 0.55rem 0.6rem;
  border-bottom: 1px solid var(--rule);
  border-left: 4px solid transparent;
  cursor: pointer;
}
.rec:hover { background: var(--paper); }
.rec.selected { background: var(--tint); border-left-color: var(--accent); }
.rec-thumb { position: relative; width: 64px; height: 64px; overflow: hidden; border: 1px solid var(--rule); background: var(--paper); }
.rec-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rec-thumb.none {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.65rem;
  line-height: 1.1;
  text-align: center;
  color: var(--muted);
}
.rec-thumb .more {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 0 0.3rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.72rem;
}
.rec-main { min-width: 0; }
.rec-source { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.95rem; line-height: 1.2; }
.rec-date { font-weight: 500; letter-spacing: 0.06em; color: var(--muted); }
.rec-desc { margin-top: 0.15rem; font-size: 0.88rem; line-height: 1.35; }
.rec-desc .hint { font-size: 0.82rem; }
.rec-price { display: flex; flex-direction: column; align-items: flex-end; text-align: right; white-space: nowrap; }
.rec-price b { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; letter-spacing: 0.02em; }
.rec-price b .hint { font-family: var(--font-text); font-weight: 400; font-size: 0.78rem; }
.rec-status { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; color: var(--muted); }
.rec-price a { font-size: 0.8rem; }

.active-listing-note {
  margin: 0 0 1rem;
  padding: 0.5rem 0.8rem;
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.92rem;
}
.active-listing-note a { color: inherit; }

.owned-note {
  margin: 0 0 1rem;
  padding: 0.5rem 0.8rem;
  background: var(--green);
  color: var(--surface);
  font-size: 0.92rem;
}

.notes-box {
  margin-bottom: 1.2rem;
  padding: 0.7rem 0.9rem;
  background: var(--tint);
  border-left: 4px solid var(--accent);
  font-size: 0.92rem;
  white-space: pre-wrap;
}

.price-summary { display: flex; flex-wrap: wrap; gap: 2rem; margin-bottom: 0.8rem; }
.price-summary .stat {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  color: var(--muted);
}
.price-summary .stat strong {
  display: block;
  font-size: 1.9rem;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.defect-flag {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.1rem 0.45rem;
  background: var(--tint);
  border-left: 3px solid var(--red);
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.35;
}

/* ---------- confidence chips (review and watchlist only) ---------- */
.chip {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
}
.chip.confirmed { background: var(--green); border-color: var(--green); color: #fff; }
.chip.candidate { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.chip.rejected { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- review and watchlist ---------- */
.review-intro { padding: 2rem 2rem 0.5rem; max-width: 80ch; }
.review-intro h2 { margin: 0 0 0.4rem; font-size: 2.2rem; color: var(--red); }
.review-intro p { margin: 0; color: var(--muted); }
.review-list { padding: 0.5rem 2rem 2rem; }
.review-section { margin-top: 2rem; }
.review-section h2 { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.2rem; font-size: 1.4rem; }
.review-section-count { padding: 0 0.5rem; background: var(--ink); color: var(--paper); font-size: 0.95rem; }
.review-section .hint { margin: 0 0 0.8rem; }

.review-cards { display: flex; flex-direction: column; gap: 0.75rem; }
.review-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.review-thumb {
  flex: none;
  display: block;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.review-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.review-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  color: var(--muted);
}
.review-card-body { flex: 1; min-width: 0; }
.review-id {
  margin-bottom: 0.15rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  color: var(--muted);
}
.review-card-title { font-weight: 600; margin-bottom: 0.45rem; line-height: 1.35; }
.review-priority { margin-bottom: 0.5rem; font-style: italic; font-size: 0.88rem; color: var(--muted); }
.review-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.5rem; }
.review-link { display: flex; align-items: center; gap: 0.4rem; }
.leaflet-crop {
  flex: none;
  width: 44px;
  height: 54px;
  border: 1px solid var(--rule);
  background-color: var(--tint);
  background-repeat: no-repeat;
}
.leaflet-crop.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--muted);
}
.review-note {
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--tint);
  font-size: 0.9rem;
}
.review-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; font-size: 0.85rem; }
.review-card-meta a { color: var(--red); }

.watch-history { list-style: none; margin: 0.6rem 0 0; padding: 0; border-top: 1px solid var(--rule); }
.watch-history li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.85rem;
}
.watch-history li:last-child { border-bottom: none; }
.watch-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.watch-price { font-weight: 600; color: var(--red); }
.watch-status { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; color: var(--muted); }
.watch-note { font-style: italic; color: var(--muted); }

footer {
  padding: 1.5rem 2rem 3rem;
  border-top: 3px solid var(--ink);
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 800px) {
  .series-intro, .home-hero, .home-entries, .fig-body, .reading, .plates { grid-template-columns: 1fr; }
  .story .inset { float: none; width: 100%; max-width: none; margin: 0.5rem 0 1.2rem; }
  .fig-hero { position: static; }
  .fig-hero-img { aspect-ratio: 1; }
  .home-hero h1 { font-size: 2.6rem; }
  .nav-group { border-left: none; margin-left: 0; padding-left: 0; }
}
@media (max-width: 600px) {
  .topbar, .controls, .grid, .series-intro, .review-intro, .review-list { padding-left: 1rem; padding-right: 1rem; }
  .home { padding: 0 1rem 2rem; }
  .controls { flex-direction: column; align-items: stretch; }
  .rec { grid-template-columns: 48px 1fr; }
  .rec-thumb { width: 48px; height: 48px; }
  .rec-price { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.6rem; }
}
