/* Painting gallery, using the original site's typography and sidebar. */
.gallery-tabs { display: flex; flex-wrap: wrap; gap: .25em 1.5em; margin-bottom: 2em; border-bottom: 1px solid #e6e6e6; font-size: .9em; }
.gallery-tabs [role="tab"] { appearance: none; min-height: 44px; height: auto; padding: .6em 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; box-shadow: none; background: transparent; color: #0266ad; font: inherit; line-height: 1.5; text-align: left; white-space: nowrap; cursor: pointer; }
.gallery-tabs [role="tab"]:hover { background: transparent; border-bottom-color: #bbb; }
.gallery-tabs [role="tab"][aria-selected="true"] { border-bottom-color: #0266ad; color: #000; font-weight: 700; }
.gallery-category[hidden] { display: none; }
.gallery-category-title { margin-bottom: 1em; font-size: 1.1em; font-weight: 700; }
.gallery-empty { margin: 0; color: #666; font-size: .85em; }
.gallery-help { color: #666; font-size: .85em; margin-bottom: 2em; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5em; }
.artwork { margin: 0; min-width: 0; }
.artwork-image { display: flex; position: relative; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border: 0; border-radius: .35em; background: #f5f5f5; overflow: hidden; }
.artwork-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.artwork-view { position: absolute; right: 12px; bottom: 12px; padding: 2px 10px; background: #fff; color: #0266ad; font-size: .8em; opacity: 0; }
.artwork-image:hover .artwork-view, .artwork-image:focus-visible .artwork-view { opacity: 1; }
.artwork figcaption { margin-top: 1em; }
.artwork-title { font-size: 1em; line-height: 1.5; margin-bottom: .25em; }
.artwork time { color: #666; font-size: .8em; }
.gallery-page a:focus-visible, .gallery-page button:focus-visible { outline: 2px solid #0266ad; outline-offset: 4px; }

body.viewer-open { overflow: hidden; }
.lightbox { width: min(1200px, calc(100% - 64px)); max-width: none; height: min(940px, calc(100dvh - 64px)); max-height: none; margin: auto; padding: 20px 24px; border: 0; border-radius: .35em; background: #fff; color: #000; }
.lightbox::backdrop { background: rgb(0 0 0 / 82%); }
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 16px; font-size: .9em; }
.lightbox button { min-width: 44px; min-height: 44px; padding: 4px 12px; border: 1px solid #ddd; border-radius: 4px; background: #fff; color: #0266ad; font: inherit; cursor: pointer; }
.lightbox button:hover { background: #f3f3f3; }
.viewer-close { display: flex; align-items: center; gap: 20px; }
.viewer-close span { font-size: 24px; }
.lightbox-canvas { display: flex; flex: 1; min-height: 0; align-items: center; justify-content: center; background: #f5f5f5; }
.lightbox-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.lightbox-bottom { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 24px; padding-top: 20px; }
.viewer-title { margin: 0; font-size: 1em; line-height: 1.5; }
.viewer-date { margin: 4px 0 0; color: #666; font-size: .8em; }
.viewer-navigation { display: flex; align-items: center; gap: 12px; }
.viewer-count { font-size: .8em; color: #666; font-variant-numeric: tabular-nums; }
.viewer-original { justify-self: end; font-size: .8em; }

@media (max-width: 980px) {
  .lightbox-bottom { grid-template-columns: minmax(0, 1fr) auto; gap: 12px 20px; }
  .viewer-original { justify-self: start; }
}

@media (max-width: 736px) {
  .gallery-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-items: start; gap: .25em 1em; }
  .gallery-grid { grid-template-columns: 1fr; gap: 2em; }
  .lightbox { width: 100%; height: 100dvh; margin: 0; padding: 16px; border-radius: 0; }
  .lightbox-bottom { padding-bottom: env(safe-area-inset-bottom); }
  .viewer-navigation { gap: 8px; }
}
