/* ============================================================
   Electro Museum — exhibit page stylesheet
   Design language: an old instrument nameplate / datasheet.
   Serif display type for the object's name, monospace for
   measured values and labels, warm paper background, aged
   copper accent, corner-tick framing borrowed from meter dials.
   ============================================================ */

:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --ink: #1b1912;
  --ink-soft: #5b5748;
  --ink-faint: #8b8574;
  --line: #ded6c2;
  --accent: #b8712b;
  --accent-deep: #7a4718;
  --header-bg: #17150f;
  --header-ink: #f3efe4;
  --radius: 2px;
  --max-w: 560px;
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--header-bg);
  color: var(--header-ink);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
}

.site-header .bolt {
  color: var(--accent);
  flex: none;
  width: 18px;
  height: 18px;
}

.site-header .museum-name {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 14px;
  letter-spacing: 0.02em;
}

/* ---------- Hero image ---------- */

.hero {
  position: relative;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.hero-frame {
  position: relative;
  margin: 18px 20px 0;
  max-width: calc(var(--max-w) - 40px);
  margin-left: auto;
  margin-right: auto;
}

.hero-frame img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #ece7d9;
  cursor: zoom-in;
}

/* corner ticks, like a measurement frame */
.hero-frame::before,
.hero-frame::after,
.hero-frame img::before {
  content: "";
}
.corner {
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.corner.tl { top: -1px; left: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.corner.tr { top: -1px; right: -1px; border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.corner.bl { bottom: -1px; left: -1px; border-bottom: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.corner.br { bottom: -1px; right: -1px; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); }

.hero-strip {
  display: flex;
  gap: 8px;
  margin: 10px 20px 18px;
  max-width: calc(var(--max-w) - 40px);
  margin-left: auto;
  margin-right: auto;
  overflow-x: auto;
}
.hero-strip img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 1px solid var(--line);
  cursor: pointer;
  opacity: 0.6;
  flex: none;
}
.hero-strip img.active { opacity: 1; border-color: var(--accent); }

/* ---------- Title block ---------- */

.title-block {
  padding: 24px 0 8px;
}

.title-block h1 {
  font-family: "Fraunces", Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 560;
  font-size: 28px;
  line-height: 1.18;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.title-block .catalog-no {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--accent-deep);
  letter-spacing: 0.04em;
}

/* ---------- Nameplate (info) ---------- */

.nameplate {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.nameplate-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.nameplate-row:first-child { border-top: none; }

.nameplate-row .label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  flex: none;
}
.nameplate-row .label svg { width: 14px; height: 14px; color: var(--accent); flex: none; }

.nameplate-row .value {
  font-size: 14px;
  text-align: right;
  color: var(--ink);
}

/* ---------- Section heading ---------- */

.section { padding: 28px 0; border-bottom: 1px solid var(--line); }
.section:last-of-type { border-bottom: none; }

.section h2 {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin: 0 0 14px;
  font-weight: 500;
}

.description p {
  margin: 0;
  font-size: 15.5px;
  color: var(--ink);
  max-width: 62ch;
}

/* ---------- Gallery ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.gallery-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

/* ---------- Documents ---------- */

.doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
}
.doc-row + .doc-row { margin-top: 8px; }
.doc-row svg.doc-icon { width: 22px; height: 22px; color: var(--accent-deep); flex: none; }
.doc-row .doc-meta { flex: 1; min-width: 0; }
.doc-row .doc-name {
  font-size: 14px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-row .doc-size {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-faint);
}
.doc-row svg.chevron { width: 16px; height: 16px; color: var(--ink-faint); flex: none; }

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

.site-footer {
  background: var(--header-bg);
  color: var(--header-ink);
  margin-top: 32px;
}
.site-footer .wrap { padding: 26px 20px 30px; }
.site-footer .museum-name {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.site-footer p {
  margin: 0;
  font-size: 13px;
  color: #b9b4a4;
  max-width: 46ch;
}
.site-footer .copyright {
  margin-top: 14px;
  font-size: 11px;
  color: #7d7869;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 14, 10, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 85vh; object-fit: contain; }
.lightbox .close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.3);
  background: transparent;
  color: var(--header-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox .close-btn svg { width: 16px; height: 16px; }

/* ---------- Loading / error ---------- */

.state-msg {
  padding: 60px 20px;
  text-align: center;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  color: var(--ink-faint);
}

/* ---------- Desktop widening ---------- */

@media (min-width: 640px) {
  .title-block h1 { font-size: 32px; }
  .hero-frame img { aspect-ratio: 16 / 10; }
}
