/* Мобильная вёрстка в первую очередь: сайт открывают с телефона по QR-коду */
:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b675f;
  --line: #e4e0d8;
  --accent: #8a3b12;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --surface: #1e1d1a;
    --text: #ecebe6;
    --muted: #a19d93;
    --line: #2f2d29;
    --accent: #e39a6c;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

/* Главная */
.hero { padding: 24px 0 8px; }
.hero h1 { font-size: clamp(30px, 7vw, 44px); margin: 0 0 6px; }
.subtitle { color: var(--muted); margin: 0 0 16px; }
.intro { margin: 0 0 24px; }

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.card img, .thumb-placeholder {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--line);
}
.card-title { font-weight: 600; padding: 10px 12px 0; line-height: 1.3; }
.card-sub { color: var(--muted); font-size: 14px; padding: 2px 12px 12px; }
.card:active { transform: scale(0.98); }

/* Страница экспоната */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}
.topbar a { text-decoration: none; font-weight: 500; }

.photo { margin: 0 -16px 16px; }
.photo img { width: 100%; max-height: 80vh; object-fit: contain; background: var(--surface); }
.photo.placeholder {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background: var(--line);
  color: var(--muted);
}
@media (min-width: 792px) {
  .photo { margin: 16px 0; border-radius: var(--radius); overflow: hidden; }
}

.exhibit h1 { font-size: clamp(26px, 6vw, 36px); margin: 8px 0 4px; }
.meta { color: var(--muted); margin: 0; font-size: 18px; }
.details { color: var(--muted); margin: 4px 0 0; font-size: 15px; }
.about { margin: 16px 0 0; }

.audio {
  margin: 24px 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.audio h2, .transcript h2 { font-size: 20px; margin: 0 0 12px; }
.audio audio { width: 100%; }

.transcript { margin-top: 24px; }
.transcript p { margin: 0 0 1em; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.pager a { text-decoration: none; max-width: 48%; }
.pager a:last-child { text-align: right; }
