/* A quieter reading and image-browsing layout for the combined collection. */
.gallery-page .gallery-main {
  max-width: 1320px;
  margin-inline: auto;
  padding: 28px clamp(20px, 4vw, 56px) 64px;
}
.gallery-main [hidden] { display: none !important; }
.gallery-main > .site-breadcrumb { padding: 0; margin-bottom: 24px; }
.collection-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  align-items: end;
  gap: 32px;
  margin-bottom: 28px;
}
.gallery-page .gallery-intro { display: block; padding: 0; margin: 0; }
.gallery-page .gallery-intro h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
  margin: 0 0 12px;
}
.gallery-page .gallery-intro p { margin: 0; max-width: 54ch; line-height: 1.65; }
.gallery-page .manuscript-picker { display: block; margin: 0; }
.gallery-main label { display: block; margin-bottom: 8px; font-size: .875rem; font-weight: 600; }
.gallery-main select, .gallery-main .codex-book-form input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  padding: 12px;
  font: 1rem var(--sans);
  color: var(--museum-ink);
  background: var(--museum-paper);
  border: 1px solid #b8aa96;
  border-radius: 3px;
}
.gallery-main select:focus-visible { outline: 3px solid #8c641f; outline-offset: 3px; }
.gallery-page .collection-summary { padding: 24px 0 28px; border-color: var(--museum-line); }
.gallery-page .collection-summary h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); margin: 0 0 12px; }
.gallery-page .collection-summary > p { max-width: 82ch; margin: 0 0 24px; }
.gallery-page .collection-summary dl { gap: 24px 32px; margin: 0; }
.gallery-page .collection-summary dt { font-size: .875rem; margin: 0 0 6px; }
.gallery-page .collection-summary dd { font-size: 1rem; line-height: 1.6; }
.gallery-page .collection-replica {
  margin: 0 0 28px;
  padding: 16px 0 20px;
  border-bottom: 1px solid var(--museum-line);
  gap: 14px 24px;
}
.gallery-page .collection-replica p { font-size: .875rem; line-height: 1.6; }
.gallery-main .museum-button {
  min-height: 44px;
  padding: 12px 20px;
  font-size: .875rem;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  gap: 12px;
}
.gallery-page .p52-feature {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: start;
  gap: 32px;
  padding: 24px;
  margin: 0 0 28px;
  background: var(--museum-paper);
  border-color: var(--museum-line);
}
.gallery-page .p52-images { gap: 16px; }
.gallery-page .p52-images img { max-height: 440px; object-fit: contain; }
.gallery-page .p52-images a { display: block; }
.gallery-page .p52-images span { padding: 10px 0 0; font-size: .875rem; line-height: 1.6; }
.gallery-page .p52-simple h2 { font: 400 clamp(1.5rem, 2.5vw, 2rem)/1.25 var(--serif); margin: 0 0 16px; }
.gallery-page .p52-simple .overline { font-size: .875rem; letter-spacing: .06em; margin-bottom: 12px; }
.gallery-page .p52-simple p { margin-bottom: 16px; line-height: 1.65; }
.gallery-page .p52-simple .p52-buy-note, .gallery-page .p52-simple .image-credit { font-size: .875rem; }
.gallery-page .p52-simple .p52-buy-note { margin: 12px 0 16px; }
.gallery-page .p52-simple .image-credit { margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--museum-line); }
.collection-browse { margin: 0 0 28px; }
.browse-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  align-items: start;
  gap: 20px;
  padding: 20px;
  margin-bottom: 28px;
  background: var(--museum-paper);
  border: 1px solid var(--museum-line);
}
.gallery-page .browse-field { min-width: 0; display: block; padding: 0; margin: 0; border: 0; background: none; }
.gallery-page .passage-picker { display: block; }
.gallery-page .passage-toolbar > p { font-size: .875rem; line-height: 1.6; margin: 10px 0 0; }
.gallery-page .chapter-context { margin-top: 10px; }
.gallery-page .chapter-context summary { cursor: pointer; font-size: .875rem; line-height: 1.6; }
.gallery-page .chapter-context h3 { font-size: 1.125rem; margin: 16px 0 12px; }
.gallery-page .chapter-context p, .gallery-page .chapter-context a { font-size: .875rem; line-height: 1.65; }
.gallery-page .chapter-context .chapter-note { margin: 12px 0 0; }
.gallery-page .gallery-heading { margin-bottom: 20px; }
.gallery-page .gallery-heading h2 { font-size: 1.75rem; margin: 0; }
.gallery-page .gallery-heading .eyebrow { font-size: .875rem; line-height: 1.5; letter-spacing: .04em; margin: 0 0 6px; }
.gallery-page .scan-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 20px; }
.gallery-page .scan-card {
  padding: 12px;
  background: var(--museum-paper);
  border: 1px solid var(--museum-line);
}
.gallery-page .scan-thumbnail { background: #e6dfd2; border: 0; }
.gallery-page .scan-thumbnail img { padding: 10px; }
.gallery-page .scan-passage { font-size: 1rem; line-height: 1.5; letter-spacing: 0; margin-top: 14px; }
.gallery-page .scan-caption { font-size: .875rem; line-height: 1.6; margin-top: 8px; }
.gallery-page .scan-caption > span:first-child { display: none; }
.gallery-page .scan-caption > span:last-child { display: inline; }
.gallery-page .scan-card-number { font-size: .875rem; line-height: 1.4; }
.gallery-page .scan-label-note { font-size: .875rem; line-height: 1.6; margin: 12px 0 0; }
.source-notes { margin-top: 24px; padding-block: 16px; border-block: 1px solid var(--museum-line); }
.source-notes > summary { cursor: pointer; font-size: .875rem; font-weight: 600; line-height: 1.6; }
.gallery-page .source-notes .collection-note { margin: 16px 0 0; max-width: 85ch; }
.gallery-page .source-notes .scan-source-note { padding: 0; border: 0; margin: 16px 0 0; font-size: .875rem; }
.gallery-page .collection-guide { margin: 0; border: 0; border-top: 1px solid var(--museum-line); padding: 20px 0; }
.gallery-page .collection-guide:last-of-type { border-bottom: 1px solid var(--museum-line); }
.gallery-page .collection-guide > summary { line-height: 1.6; font-weight: 600; }
.gallery-page .collection-guide .detail-body { padding: 20px 0 0; max-width: 90ch; }
.gallery-page .collection-guide .detail-body p { font-size: 1rem; line-height: 1.75; }
.gallery-page .collection-guide .detail-links { gap: 12px 24px; }
.gallery-page .collection-guide .p52-explore { padding: 28px 0 0; }
.gallery-page .collection-guide .p52-heading h2,
.gallery-page .collection-guide .p52-questions h2,
.gallery-page .collection-guide .section-top h2 { font-size: 1.75rem; }
.gallery-page .collection-guide .p52-heading .museum-button { margin-bottom: 16px; }
.gallery-page .collection-guide .p52-passage { margin-top: 24px; padding: 24px; }
.gallery-page .collection-guide .p52-passage-head h2 { font-size: 1.5rem; }
.gallery-page .collection-guide .p52-questions { margin-top: 28px; }
.gallery-page .collection-guide .p52-questions summary { font-size: 1.125rem; }
.gallery-page .collection-guide .p52-passage-note, .gallery-page .collection-guide .p52-credit { font-size: .875rem; }
.gallery-page .collection-guide .timeline { padding: 24px 0 0; }
.gallery-page .collection-guide .section-top { margin-bottom: 24px; }
.gallery-page .sinaiticus-reader { padding: 24px; margin: 0 0 28px; background: var(--museum-paper); border: 1px solid var(--museum-line); }
.gallery-page .sinaiticus-reader h2 { font-size: 1.75rem; margin: 0 0 16px; }
.gallery-page .sinaiticus-reader .eyebrow { font-size: .875rem; line-height: 1.6; }
.gallery-page .codex-book-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, 160px) auto; gap: 8px 20px; align-items: end; }
.gallery-page .codex-book-form label[for=sinaiticus-book] { grid-column: 1; grid-row: 1; margin: 0; }
.gallery-page .codex-book-form label[for=sinaiticus-chapter] { grid-column: 2; grid-row: 1; margin: 0; }
.gallery-page #sinaiticus-book { grid-column: 1; grid-row: 2; }
.gallery-page #sinaiticus-chapter { grid-column: 2; grid-row: 2; }
.gallery-page .codex-book-form button { grid-column: 3; grid-row: 2; min-height: 48px; padding: 12px 20px; justify-content: center; }
.gallery-page .institutional-galleries { padding: 24px; margin: 0 0 28px; background: var(--museum-paper); border: 1px solid var(--museum-line); }
.gallery-page .institutional-intro { margin-bottom: 16px; }
.gallery-page .institutional-intro h2 { font-size: 1.75rem; margin: 0; }
.gallery-page .institutional-grid { display: block; }
.gallery-page .p47-examples { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; margin:20px 0; }
.gallery-page .p47-examples figure { margin:0; min-width:0; }
.gallery-page .p47-photo { display:block; height:360px; overflow:hidden; background:#25221e; border:1px solid var(--museum-line); margin:0; }
.gallery-page .p47-photo img { display:block; width:100%; height:100%; object-fit:contain; }
.gallery-page .p47-detail img { object-fit:cover; }
.gallery-page .p47-upper img { object-position:center top; }
.gallery-page .p47-lower img { object-position:center bottom; }
.gallery-page .p47-examples figcaption { padding:12px 0; font-size:.875rem; line-height:1.6; }
.gallery-page .p47-examples figcaption span { display:block; }
.gallery-page .p47-credit { font-size:.875rem; }
@media(max-width:900px) { .gallery-page .p47-examples { grid-template-columns:1fr; } .gallery-page .p47-photo { height:420px; } }
.gallery-page .institutional-card { min-height: 0; padding: 0; border: 0; background: none; }
.gallery-page .institutional-card h3 { display: none; }
.gallery-page .institutional-card p { max-width: 85ch; margin: 0; line-height: 1.65; }
.gallery-page .institutional-card a { font-size: .875rem; line-height: 1.6; margin-top: 12px; }
.gallery-page .institutional-note { font-size: .875rem; line-height: 1.6; margin: 16px 0 0; }
.gallery-page[data-current-manuscript=p52] .collection-browse,
.gallery-page[data-current-manuscript=p47] .collection-browse { max-width: 44rem; }
@media (max-width: 1100px) {
  .gallery-page .scan-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .collection-topbar { grid-template-columns: 1fr; gap: 20px; }
  .gallery-page .p52-feature { grid-template-columns: 1fr; gap: 24px; }
  .gallery-page .p52-images { width: 100%; max-width: 650px; }
}
@media (max-width: 700px) {
  .gallery-page .gallery-main { padding-top: 24px; padding-bottom: 40px; }
  .gallery-page .collection-summary dl { grid-template-columns: 1fr; gap: 16px; }
  .browse-controls { grid-template-columns: 1fr; padding: 16px; gap: 20px; }
  .gallery-page .scan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .gallery-page .scan-card { padding: 8px; }
  .gallery-page .scan-thumbnail img { padding: 6px; }
  .gallery-page .p52-feature, .gallery-page .sinaiticus-reader, .gallery-page .institutional-galleries { padding: 16px; }
  .gallery-page .p52-images { gap: 12px; }
  .gallery-page .collection-guide .p52-passage { padding: 16px; }
  .gallery-page .codex-book-form { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .gallery-page .codex-book-form :is(label[for=sinaiticus-book], label[for=sinaiticus-chapter], #sinaiticus-book, #sinaiticus-chapter, button) { grid-column: 1; grid-row: auto; }
  .gallery-page .codex-book-form label[for=sinaiticus-chapter] { margin-top: 12px; }
  .gallery-page .codex-book-form button { margin-top: 12px; }
}
@media (max-width: 400px) {
  .gallery-page .scan-grid { grid-template-columns: minmax(0, 1fr); }
}
