
:root {
  color-scheme: light;
  --paper: #f5f6f6;
  --surface: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.96);
  --ink: #1d2226;
  --muted: #667078;
  --line: #e5e5e5;
  --bronze: #8d6237;
  --jade: #46726a;
  --wine: #7b3341;
  --shadow: 0 12px 30px rgba(29, 34, 38, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121518;
  --surface: #1a1e21;
  --header-bg: rgba(24, 28, 31, 0.96);
  --ink: #edf1ef;
  --muted: #aeb7b7;
  --line: #394145;
  --bronze: #d4a169;
  --jade: #91c0b3;
  --wine: #db9ba6;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .brand-logo {
  filter: invert(1);
}

:root[data-theme="dark"] .category-icon,
:root[data-theme="dark"] .inline-media img {
  filter: invert(1);
  mix-blend-mode: screen;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Diatype Variable", "Inter", "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; letter-spacing: 0; }

.app-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 16px clamp(18px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: clamp(60px, 6.4vw, 92px);
  height: auto;
  flex: 0 0 auto;
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  font-size: clamp(23px, 3vw, 34px);
  font-weight: 750;
}

.brand-sub {
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--ink);
  outline: none;
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 9px;
  border-bottom: 1px solid transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 680;
  white-space: nowrap;
}

.home-link:hover,
.home-link:focus-visible {
  border-color: var(--ink);
  outline: none;
}

.chapter-links {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.chapter-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 7px;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 680;
  white-space: nowrap;
}

.chapter-link:hover,
.chapter-link:focus-visible,
.chapter-link.active {
  border-color: var(--ink);
  color: var(--ink);
  outline: none;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.language-option {
  min-width: 42px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 720;
}

.language-option.active {
  background: var(--ink);
  color: var(--surface);
}

.search {
  width: min(32vw, 360px);
  min-width: 180px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.search:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(70, 114, 106, 0.16);
}

.category-nav {
  display: flex;
  gap: clamp(16px, 2.2vw, 34px);
  overflow-x: auto;
  padding: 18px clamp(18px, 3vw, 42px) 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.category-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 4px 0 7px;
  cursor: pointer;
  font-size: 22px;
  font-weight: 720;
  line-height: 1.15;
}

.category-icon {
  width: auto;
  height: 28px;
  object-fit: contain;
}

.category-button span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.category-button.active {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--ink);
}

.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
  transition: grid-template-columns 180ms ease;
}

.layout.catalog-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
}

.side-panel {
  position: sticky;
  top: 124px;
  height: calc(100vh - 124px);
  overflow: auto;
  padding: 24px 22px 40px clamp(18px, 3vw, 42px);
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.side-title {
  margin-bottom: 16px;
  color: var(--bronze);
  font-size: 18px;
  font-weight: 750;
}

.catalog-toggle {
  appearance: none;
  position: fixed;
  z-index: 40;
  top: calc(124px + (100vh - 124px) / 2);
  left: 284px;
  width: 34px;
  height: 92px;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(29, 34, 38, 0.12);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.catalog-toggle-icon {
  font-size: 26px;
  line-height: 1;
}

.catalog-toggle:hover,
.catalog-toggle:focus-visible {
  border-color: var(--ink);
  outline: none;
}

.layout.catalog-collapsed .side-panel {
  overflow: hidden;
  padding-left: 18px;
  padding-right: 18px;
}

.layout.catalog-collapsed .side-title {
  min-height: 132px;
  margin: 0 auto;
  writing-mode: vertical-rl;
  text-align: center;
}

.layout.catalog-collapsed .catalog-toggle {
  left: 48px;
}

.layout.catalog-collapsed .catalog-list,
.layout.catalog-collapsed .contact-block {
  display: none;
}

.catalog-list {
  display: grid;
  gap: 20px;
}

.catalog-filter {
  display: grid;
  gap: 7px;
  margin-bottom: -2px;
}

.catalog-filter label,
.catalog-period-label {
  margin: 0;
  color: var(--bronze);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
}

.catalog-type-select {
  width: 100%;
  min-height: 40px;
  padding: 7px 30px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 1.25;
  cursor: pointer;
}

.catalog-type-select:hover,
.catalog-type-select:focus-visible {
  border-color: var(--ink);
  outline: none;
}

.catalog-period-label {
  margin: 2px 0 -10px;
}

.catalog-era {
  display: grid;
  gap: 6px;
}

.catalog-era-title {
  margin: 0 0 2px;
  color: var(--bronze);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
}

.catalog-link {
  display: block;
  padding: 10px 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.42;
  border-bottom: 1px solid rgba(216, 221, 216, 0.72);
}

.catalog-title-cn,
.catalog-title-en {
  display: block;
}

.catalog-title-cn {
  color: var(--ink);
  font-size: 17px;
}

.catalog-title-en {
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.catalog-link.active,
.catalog-link:hover {
  color: var(--ink);
}

.catalog-link.active .catalog-title-en,
.catalog-link:hover .catalog-title-en {
  color: var(--ink);
}

.contact-block {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.contact-block img {
  display: block;
  width: 116px;
  height: auto;
  margin-top: 10px;
  border-radius: 6px;
}

.content {
  min-width: 0;
  padding: 28px clamp(18px, 4vw, 56px) 64px;
}

.content:focus {
  outline: none;
}

.view-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.view-title {
  margin: 0;
  font-size: clamp(26px, 3vw, 46px);
  line-height: 1.05;
}

.view-count {
  color: var(--muted);
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.card {
  position: relative;
  min-width: 0;
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.masonry-column {
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
}

.card-media {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  line-height: 0;
}

.card-media img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.share-action {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.96);
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.92)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.64));
  line-height: 1;
  transition: opacity 140ms ease, color 140ms ease, transform 140ms ease;
}

.share-action svg {
  width: 18px;
  height: 18px;
}

.share-action:hover,
.share-action:focus-visible {
  color: #ffffff;
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.card-share-action {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
}

.card:hover .card-share-action,
.card:focus-within .card-share-action,
.card-share-action:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.card-title {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.card-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: clamp(24px, 4vw, 54px);
}

.detail-media {
  display: grid;
  gap: 14px;
  align-content: start;
}

.hero-image {
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: zoom-in;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}

.thumb {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}

.thumb.active {
  border-color: var(--wine);
  box-shadow: 0 0 0 2px rgba(123, 51, 65, 0.18);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-copy {
  min-width: 0;
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--jade);
  font-size: 14px;
}

.detail-title {
  margin: 0 0 12px;
  font-size: clamp(28px, 3.2vw, 52px);
  line-height: 1.08;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 24px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
}

.prose {
  display: grid;
  gap: 14px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.8;
}

.prose p {
  margin: 0;
}

.detail-object-number {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 10px;
  margin: 52px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.detail-object-number strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
}

.museum-detail {
  max-width: 1220px;
  margin: 0 auto;
}

.museum-hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.44fr) minmax(0, 0.76fr);
  gap: clamp(28px, 4vw, 72px);
  align-items: start;
  margin-bottom: clamp(38px, 6vw, 82px);
}

.museum-info {
  position: sticky;
  top: 150px;
  min-width: 0;
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.museum-kicker {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

.museum-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 2.45vw, 42px);
  font-family: "Noto Serif TC", "Songti TC", "STSong", "SimSun", Georgia, serif;
  line-height: 1.18;
  font-weight: 600;
}

.museum-title .inline-media {
  height: calc(var(--inline-height, 1.7em) * 1.08);
  max-width: 4.8em;
}

.museum-meta {
  display: grid;
  gap: 7px;
  margin: 28px 0;
}

.museum-fact {
  padding: 4px 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

.museum-fact-period {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-period-link {
  appearance: none;
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.detail-period-link:hover,
.detail-period-link:focus-visible {
  color: var(--bronze);
  text-decoration: underline;
  text-underline-offset: 4px;
  outline: none;
}

.museum-media {
  min-width: 0;
}

.museum-image-viewer {
  min-width: 0;
}

.museum-primary-image {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  min-height: min(64vh, 720px);
  margin: 0;
  line-height: 0;
}

.museum-primary-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(76vh, 820px);
  object-fit: contain;
  cursor: zoom-in;
}

.image-browse-action {
  appearance: none;
  position: absolute;
  z-index: 1;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 56px;
  padding: 0;
  border: 1px solid rgba(29, 34, 38, 0.16);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(29, 34, 38, 0.1);
  cursor: pointer;
  font-size: 31px;
  line-height: 1;
  opacity: 0;
  pointer-events: auto;
  transform: translateY(-50%);
  transition: opacity 140ms ease, border-color 140ms ease;
}

.image-browse-prev { left: 12px; }
.image-browse-next { right: 12px; }

.image-share-action {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
}

.museum-primary-image:hover .image-browse-action,
.museum-primary-image:focus-within .image-browse-action,
.image-browse-action:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.museum-primary-image:hover .image-share-action,
.museum-primary-image:focus-within .image-share-action,
.image-share-action:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (hover: none) {
  .card-share-action,
  .image-share-action {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}

.image-browse-action:hover,
.image-browse-action:focus-visible {
  border-color: var(--ink);
  outline: none;
}

.museum-thumbs-label {
  margin-top: 18px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.museum-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 8px;
}

.museum-thumb {
  width: 68px;
  height: 68px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
}

.museum-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.museum-thumb.active,
.museum-thumb:hover,
.museum-thumb:focus-visible {
  border-color: var(--ink);
  outline: none;
}

.detail-section-title {
  margin: 0 0 22px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: clamp(22px, 2vw, 34px);
  line-height: 1.15;
}

.detail-preserved {
  max-width: none;
  margin: 0;
  scroll-margin-top: 150px;
}

.detail-scroll-cue {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 42px;
  margin: 0;
  color: var(--bronze);
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
  text-decoration: none;
  animation: detail-scroll-cue 1.45s ease-in-out infinite;
}

.detail-scroll-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  align-self: center;
  margin-top: clamp(104px, 12vh, 156px);
  text-align: center;
}

.detail-scroll-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
  line-height: 1.35;
}

@media (min-width: 901px) {
  .detail-scroll-prompt {
    margin-top: clamp(190px, calc(100vh - 610px), 500px);
  }
}

.detail-scroll-cue:hover,
.detail-scroll-cue:focus-visible {
  color: var(--ink);
  outline: none;
}

.share-toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 26px;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.share-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes detail-scroll-cue {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  55% { opacity: 1; transform: translateY(7px); }
}

@media (prefers-reduced-motion: reduce) {
  .detail-scroll-cue { animation: none; }
}

.preserved-copy {
  max-width: none;
}

.cargo-content {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.78;
}

.cargo-content h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 3.2vw, 52px);
  line-height: 1.1;
}

.cargo-content b {
  font-weight: 760;
}

.cargo-content .caption {
  color: var(--muted);
  font-size: 13px;
}

.cargo-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
  gap: 2rem;
  margin: 6px 0 18px;
}

.inline-media {
  display: inline-flex;
  align-items: center;
  height: var(--inline-height, 1.25em);
  max-width: 4.2em;
  vertical-align: -0.36em;
}

.inline-media img {
  display: block;
  width: auto;
  height: 100%;
  object-fit: contain;
}

.title-glyphs {
  white-space: nowrap;
}

.cargo-media {
  display: inline-flex;
  flex-direction: column;
  width: min(var(--media-width, 100%), 100%);
  max-width: 100%;
  margin: 12px 10px 16px 0;
  vertical-align: top;
}

.cargo-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: zoom-in;
}

.cargo-media figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.cargo-gallery {
  margin: 18px 0 22px;
}

.cargo-gallery-grid,
.cargo-gallery-columnized,
.cargo-gallery-justify,
.cargo-gallery-slideshow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: start;
}

.cargo-gallery-grid .cargo-media,
.cargo-gallery-columnized .cargo-media,
.cargo-gallery-justify .cargo-media,
.cargo-gallery-slideshow .cargo-media {
  display: flex;
  width: 100%;
  margin: 0;
}

.cargo-gallery-freeform {
  position: relative;
  min-height: clamp(260px, 48vw, 620px);
}

.cargo-gallery-freeform.freeform-measured {
  min-height: 0;
  aspect-ratio: var(--freeform-aspect);
}

.cargo-gallery-freeform .cargo-media.freeform-item {
  position: absolute;
  left: var(--free-x, 0%);
  top: var(--free-y, 0%);
  z-index: var(--free-z, 1);
  width: min(var(--free-w, 30%), 100%);
  margin: 0;
}

/* Preserve the source layout while giving this compact two-view group room to read. */
.cargo-content[data-body-slug="ritual-bronze-wine-vessel-jue"] .cargo-gallery-freeform:first-of-type {
  min-height: clamp(315px, 25vw, 340px);
}

.cargo-content[data-body-slug="ritual-bronze-wine-vessel-jue"] .cargo-gallery-freeform:first-of-type .cargo-media.freeform-item {
  width: min(40%, 500px);
}

.cargo-content[data-body-slug="ritual-bronze-wine-vessel-jue"] .cargo-gallery-freeform:first-of-type .cargo-media.freeform-item:nth-of-type(1) {
  left: 6%;
}

.cargo-content[data-body-slug="ritual-bronze-wine-vessel-jue"] .cargo-gallery-freeform:first-of-type .cargo-media.freeform-item:nth-of-type(2) {
  left: 54%;
}

.cargo-content hr {
  margin: 26px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.empty {
  padding: 44px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(13, 16, 18, 0.88);
  padding: 28px;
}

.lightbox.open {
  display: flex;
}

.lightbox.open img {
  touch-action: none;
}

.lightbox img {
  max-width: min(92vw, 1400px);
  max-height: 86vh;
  object-fit: contain;
  cursor: zoom-in;
  transform-origin: center center;
  transition: transform 100ms ease-out;
  will-change: transform;
}

.lightbox.image-zoomed img {
  cursor: grab;
  user-select: none;
}

.lightbox.image-zoomed.image-panning img {
  cursor: grabbing;
  transition: none;
}

.lightbox button,
.lightbox-download {
  position: absolute;
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 8px;
  color: #fff;
  background: rgba(255,255,255,0.1);
  cursor: pointer;
}

.lightbox-download {
  top: 20px;
  right: 74px;
  height: 42px;
  min-width: 76px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 680;
}

.lightbox-close {
  top: 20px;
  right: 22px;
  width: 42px;
  height: 42px;
  font-size: 28px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  width: 46px;
  height: 58px;
  transform: translateY(-50%);
  font-size: 34px;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-caption {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 18px;
  color: rgba(255,255,255,0.78);
  text-align: center;
  font-size: 13px;
}

@media (hover: none) {
  .image-browse-action {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 900px) {
  .site-header {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }
  .header-actions {
    width: 100%;
    gap: 8px;
  }
  .home-link { padding: 0 5px; font-size: 14px; }
  .search {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
  }
  .layout {
    display: block;
  }
  .side-panel {
    position: relative;
    top: auto;
    height: auto;
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px clamp(18px, 3vw, 42px) 24px;
  }
  .layout.catalog-collapsed .side-panel {
    max-height: 62px;
    padding-left: clamp(18px, 3vw, 42px);
    padding-right: clamp(18px, 3vw, 42px);
  }
  .catalog-toggle,
  .layout.catalog-collapsed .catalog-toggle {
    position: absolute;
    top: 17px;
    right: 18px;
    left: auto;
    width: 42px;
    height: 34px;
    transform: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
  }
  .layout.catalog-collapsed .side-title {
    min-height: 0;
    writing-mode: horizontal-tb;
    text-align: left;
  }
  .detail {
    grid-template-columns: 1fr;
  }
  .museum-hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .museum-info {
    position: static;
    order: 2;
    align-self: auto;
  }
  .museum-media {
    order: 1;
  }
  .detail-scroll-prompt {
    margin-top: 44px;
    padding-bottom: 10px;
  }
  .museum-primary-image {
    min-height: 0;
  }
  .museum-primary-image img {
    max-height: 72vh;
  }
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .cargo-columns {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .cargo-media {
    width: 100%;
    margin-right: 0;
  }
  .cargo-gallery-freeform {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    min-height: 0;
  }
  .cargo-gallery-freeform.freeform-measured {
    aspect-ratio: auto;
  }
  .cargo-gallery-freeform .cargo-media.freeform-item {
    position: static;
    width: 100%;
  }
  .cargo-content[data-body-slug="ritual-bronze-wine-vessel-jue"] .cargo-gallery-freeform:first-of-type {
    min-height: 0;
  }
  .cargo-content[data-body-slug="ritual-bronze-wine-vessel-jue"] .cargo-gallery-freeform:first-of-type .cargo-media.freeform-item {
    width: 100%;
  }
  .view-head {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .content {
    padding-top: 22px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .masonry-column {
    gap: 14px;
  }
  .card-media {
    border-radius: 7px;
  }
  .card-title {
    font-size: 13px;
  }
  .museum-title {
    font-size: 30px;
  }
  .museum-thumb {
    width: 56px;
    height: 56px;
  }
  .image-browse-action {
    width: 38px;
    height: 48px;
    font-size: 27px;
  }
  .share-action {
    width: 36px;
    height: 36px;
  }
  .card-share-action,
  .image-share-action {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
  .image-share-action { top: 8px; right: 8px; }
  .image-browse-prev { left: 8px; }
  .image-browse-next { right: 8px; }
  .brand {
    justify-content: flex-start;
  }
  .brand-logo {
    width: 58px;
  }
  .brand-copy {
    gap: 8px;
  }
  .brand-sub {
    font-size: 13px;
  }
}
