/* One centered canvas for every public page, including wide desktop screens. */
:root {
  --site-max-width: 1440px;
}

.site-footer .site-version { margin-top: 10px; font-size: 12px; }
.site-footer .site-version a { display: inline-flex; align-items: center; min-height: 32px; color: inherit; text-underline-offset: 4px; }
body .site-footer nav { padding-inline-end: 144px; }
@media (max-width: 600px) { body .site-footer nav { padding-inline-end: 100px; } }
.site-updates { max-width: 760px; margin-block: 36px 64px; }
.update-entry { padding-block: 28px; border-top: 1px solid #dedbe6; }
.update-entry h2 { margin: 12px 0 16px; font-size: clamp(20px, 3vw, 26px); }
.update-meta { display: flex; flex-wrap: wrap; gap: 16px; color: #7a688d; font: 12px/1.8 system-ui, sans-serif; }
.site-updates ul { padding-left: 1.4em; }
.site-updates li { margin-block: 8px; line-height: 1.9; }

/* Responsive sources fill the same framed artwork box as the original image. */
.art-space > .optimized-picture {
  width: 100%;
  height: 100%;
  min-width: 0;
}

body {
  --content-gutter: clamp(24px, 4.5vw, 64px);
  --floating-inset: 24px;
  width: 100%;
  max-width: var(--site-max-width);
  min-width: 0;
  margin-inline: auto;
}

body :is(.site-header, .site-wayfinding, .site-home-nav, .site-footer),
body main > :is(
  .hero, .section, .statement, .floor-intro, .collection,
  .h-hero, .h-index, .h-section, .h-next,
  .ai-hero, .ai-section, .book-detail, .slide-page, .pdf-reading
) {
  padding-inline: var(--content-gutter);
}

body main > .pending-home {
  margin-inline: var(--content-gutter);
}

/* Fixed backgrounds and dialogs use the same canvas as the page. */
body :is(.bg, .bg-grid, .bg-glow, .particles, .transition, .room-panel, #gyLightbox) {
  left: 0;
  right: 0;
  width: min(100%, var(--site-max-width));
  max-width: var(--site-max-width);
  margin-inline: auto;
}

body .room-panel > .panel-close {
  right: max(20px, calc((100vw - var(--site-max-width)) / 2 + 20px));
}

body[data-site="tea"] .zhanggui {
  right: max(var(--floating-inset), calc((100vw - var(--site-max-width)) / 2 + var(--floating-inset)));
}

body #gyLightbox > .panel-close {
  position: absolute;
  right: 20px;
}

@media (max-width: 640px) {
  body {
    --content-gutter: 24px;
    --floating-inset: 18px;
  }
}
