/* Public collection pages (collection grid + artifact page).
   Patterned on national museum collection sites: serif headlines, a small
   red "From the Collection" eyebrow, generous white space, a big image, and
   a plain label/value "Object details" list. */

@font-face { font-family: "Public Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/public-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/public-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/public-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/source-serif-4-latin-700-normal.woff2") format("woff2"); }

:root {
  --navy: #0b2545;
  --navy-2: #13315c;
  --ink: #1b1d22;
  --muted: #5b616e;
  --paper: #faf8f4;
  --card: #ffffff;
  --rule: #e4dfd4;
  --well: #f1eee7;
  --gold: #b08d57;
  --gold-light: #d9c19a;
  --red: #a4262c;
  --focus: #2f6fdf;
  --sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --wrap: 1160px;
  --radius: 6px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.public {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
.public a { color: var(--navy-2); }
.public a:focus-visible, .public button:focus-visible, .public input:focus-visible, .public select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Header / footer ---- */
.pub-header { background: var(--navy); color: #fff; border-bottom: 3px solid var(--gold); }
.pub-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.public .brand { color: #fff; }
.brand svg { width: 38px; height: 38px; flex: none; }
.brand-name { font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.95rem; line-height: 1.15; }
.brand-sub { display: block; font-weight: 400; letter-spacing: 0.06em; color: var(--gold-light); font-size: 0.72rem; text-transform: uppercase; }
.pub-nav a {
  color: #fff; text-decoration: none; font-weight: 600; font-size: 0.92rem;
  padding: 8px 2px; border-bottom: 2px solid transparent;
}
.public .pub-nav a { color: #fff; }
.pub-nav a:hover { border-bottom-color: var(--gold); }

.pub-footer { background: var(--navy); color: #d7dce5; margin-top: 64px; padding: 36px 0 44px; font-size: 0.9rem; }
.pub-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 40px; justify-content: space-between; }
.pub-footer strong { color: #fff; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.85rem; }
.pub-footer p { margin: 6px 0 0; max-width: 560px; }
.public .pub-footer a { color: var(--gold-light); }

/* ---- Shared type ---- */
.eyebrow {
  display: block;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.serif-title { font-family: var(--serif); font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; margin: 0; }
.item-code { font-family: var(--sans); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; color: var(--muted); font-size: 0.9rem; }

/* ---- Collection hero ---- */
.hero { background: linear-gradient(180deg, var(--navy-2), var(--navy)); color: #fff; padding: 44px 0 40px; }
.hero .eyebrow { color: var(--gold-light); }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); margin-top: 8px; }
.hero p { margin: 12px 0 0; max-width: 640px; color: #dfe4ec; font-size: 1.05rem; }

/* ---- Search + filters ---- */
.finder { padding: 26px 0 8px; }
.search {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid #cfc8b9; border-radius: var(--radius);
  padding: 0 14px; max-width: 640px;
}
.search svg { width: 20px; height: 20px; fill: var(--muted); flex: none; }
.search input {
  flex: 1; border: 0; background: transparent; font: inherit; font-size: 1.05rem;
  padding: 14px 0; color: var(--ink); min-width: 0;
}
.search input:focus { outline: none; }
.search:focus-within { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(47, 111, 223, 0.2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.chip {
  font: inherit; font-size: 0.88rem; font-weight: 600;
  border: 1px solid #cfc8b9; background: #fff; color: var(--navy-2);
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
}
.chip:hover { border-color: var(--navy-2); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .count { font-weight: 400; opacity: 0.75; margin-left: 4px; }
.result-line { color: var(--muted); font-size: 0.92rem; margin: 18px 0 14px; min-height: 1.4em; }

/* ---- Object grid ---- */
.object-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.object-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; transition: box-shadow 0.15s, transform 0.15s; }
.public .object-card { color: inherit; }
.object-card:hover { box-shadow: 0 6px 18px rgba(11, 37, 69, 0.12); transform: translateY(-2px); }
.object-card .frame { aspect-ratio: 4 / 3; background: var(--well); display: flex; align-items: center; justify-content: center; }
.object-card .frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.object-card .frame .no-photo { color: var(--muted); font-size: 0.85rem; }
.object-card .text { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.object-card .eyebrow { font-size: 0.7rem; }
.object-card h3 { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; line-height: 1.25; margin: 2px 0 4px; }
.object-card .meta { margin-top: auto; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.object-card .price { font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.more-row { text-align: center; margin: 30px 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; font-size: 0.95rem;
  padding: 11px 20px; border-radius: var(--radius); cursor: pointer; text-decoration: none;
  border: 1px solid var(--navy); background: #fff; color: var(--navy);
}
.public .btn { color: var(--navy); }
.btn:hover { background: #eef2f6; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.empty { text-align: center; color: var(--muted); padding: 56px 16px; grid-column: 1 / -1; }

/* ---- Artifact page ---- */
.crumbs { font-size: 0.85rem; color: var(--muted); padding: 18px 0 0; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: #b3ab9b; }
.crumbs [aria-current] { color: var(--ink); }

.artifact {
  display: grid;
  gap: 22px 48px;
  grid-template-columns: 1fr;
  grid-template-areas: "head" "gallery" "body" "videos";
  padding: 18px 0 0;
}
.artifact-videos { grid-area: videos; min-width: 0; margin-top: 0; }
.artifact-head { grid-area: head; }
.artifact-gallery { grid-area: gallery; min-width: 0; }
.artifact-body { grid-area: body; min-width: 0; }
@media (min-width: 900px) {
  .artifact {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    grid-template-areas: "gallery head" "gallery body" "videos body";
    grid-template-rows: auto auto 1fr;
    padding-top: 26px;
  }
  .artifact-gallery, .artifact-videos { align-self: start; }
}
.artifact-head h1 { font-size: clamp(1.9rem, 4.2vw, 2.7rem); margin: 8px 0 10px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.share-btn { padding: 8px 14px; font-size: 0.88rem; }
.share-note { font-size: 0.85rem; color: var(--muted); margin-left: 8px; }

.stage {
  position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--rule);
  background: var(--well); border-radius: var(--radius); cursor: zoom-in; overflow: hidden;
  aspect-ratio: 4 / 3;
}
.stage img { width: 100%; height: 100%; object-fit: contain; display: block; }
.stage .zoom-hint {
  position: absolute; right: 10px; bottom: 10px; background: rgba(11, 37, 69, 0.85); color: #fff;
  font-size: 0.78rem; font-weight: 600; padding: 5px 10px; border-radius: 999px; display: flex; gap: 6px; align-items: center;
}
.stage .zoom-hint svg { width: 14px; height: 14px; fill: currentColor; }
.stage-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: default; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.thumbs button {
  flex: none; width: 76px; height: 60px; padding: 0; border: 2px solid transparent; border-radius: 4px;
  background: var(--well); cursor: pointer; overflow: hidden;
}
.thumbs button[aria-current="true"] { border-color: var(--navy); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.videos { margin-top: 16px; display: grid; gap: 12px; }
.videos video { width: 100%; max-height: 420px; background: #000; border-radius: var(--radius); }
.videos .label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.lead { font-family: var(--serif); font-size: 1.22rem; line-height: 1.6; margin: 0 0 22px; white-space: pre-line; }
.price-line { font-size: 1.05rem; margin: 0 0 18px; }
.price-line strong { font-size: 1.35rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.section-title {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy);
  border-bottom: 2px solid var(--navy); padding-bottom: 8px; margin: 26px 0 0;
}
.details { margin: 0; }
.details div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 0.97rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.notes { white-space: pre-line; margin: 12px 0 0; }

.related { margin-top: 56px; }
.related .head-row { margin-bottom: 16px; }
.related h2 { font-size: 1.6rem; }

.state { padding: 70px 0 30px; text-align: center; }
.state h1 { font-size: 2rem; margin-bottom: 10px; }
.state p { color: var(--muted); }

/* ---- Lightbox ---- */
.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(6, 12, 22, 0.96);
  display: flex; align-items: center; justify-content: center; touch-action: pan-y;
}
.lightbox img { max-width: 94vw; max-height: 84vh; object-fit: contain; }
.lb-btn {
  position: absolute; background: rgba(255, 255, 255, 0.12); color: #fff; border: 0; border-radius: 999px;
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.24); }
.lb-btn svg { width: 24px; height: 24px; fill: currentColor; }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #c9d0db; font-size: 0.9rem; }
.lb-count a { color: var(--gold-light); margin-left: 10px; }

@media (max-width: 560px) {
  body.public { font-size: 16px; }
  .pub-header .wrap { min-height: 60px; }
  .brand svg { width: 32px; height: 32px; }
  .brand-name { font-size: 0.82rem; }
  .hero { padding: 32px 0 30px; }
  .object-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .object-card .text { padding: 10px 12px 12px; }
  .object-card h3 { font-size: 1rem; }
  .details div { grid-template-columns: 8em 1fr; }
  .lb-prev, .lb-next { top: auto; bottom: 12px; transform: none; }
}

@media print {
  .pub-header, .pub-footer, .share-btn, .related, .thumbs, .zoom-hint, .crumbs { display: none !important; }
  body.public { background: #fff; }
}

/* Skip link becomes visible when focused with the keyboard */
.public a.visually-hidden:focus {
  position: fixed !important; left: 12px; top: 12px; width: auto; height: auto; margin: 0; clip: auto;
  background: #fff; color: var(--navy); padding: 10px 14px; z-index: 200; border-radius: var(--radius);
}

/* Anything marked hidden stays hidden, even if a class gives it a display. */
.public [hidden] { display: none !important; }

/* The photo counter must never block the arrow buttons. */
.lb-count { pointer-events: none; }
.lb-count a { pointer-events: auto; }
@media (max-width: 560px) {
  .lb-count { bottom: 74px; }
}

/* Photos of any shape sit inside a fixed 4:3 frame (portrait phone photos
   would otherwise stretch the frame). */
.object-card .frame, .stage { position: relative; overflow: hidden; min-height: 0; }
.object-card .frame img, .stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage .zoom-hint { z-index: 1; }

/* ---- U.S. Customs ensign ----
   Banner: a one-color watermark of the full flag (eagle and all), sitting to
   the right of the title. Footer: the flag in its true colors, small, with a
   caption. Image: Wikimedia Commons, public domain. */
.hero { position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; }
.hero::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  right: max(20px, calc((100% - var(--wrap)) / 2 + 20px));
  aspect-ratio: 8 / 5;
  background: url("/img/us-customs-ensign.svg") center / contain no-repeat;
  filter: grayscale(1) brightness(1.15);
  mix-blend-mode: screen;
  opacity: 0.16;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 22%);
  mask-image: linear-gradient(to right, transparent 0%, #000 22%);
  pointer-events: none;
}
@media (max-width: 700px) {
  .hero::before { top: 0; bottom: 0; right: -70px; opacity: 0.09; }
}

.ensign { display: flex; align-items: center; gap: 14px; margin-top: 18px; max-width: 520px; }
.ensign img { width: 72px; height: 45px; flex: none; border: 1px solid rgba(255, 255, 255, 0.35); }
.ensign p { margin: 0; font-size: 0.82rem; color: #b9c2d0; line-height: 1.45; }
