/* A quiet wall of full-frame works, using the site's existing brand tokens. */
.gallery { padding-top: clamp(44px, 6vw, 88px); }
.gallery [hidden] { display: none !important; }
.gallery-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; padding-bottom: 48px; }
.gallery-header h1 { font-size: clamp(48px, 6vw, 84px); line-height: 1.04; }
.gallery-header .lede { max-width: 23em; margin: 0; font-size: 18px; }
.gallery-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 24px 0; border-top: 1px solid var(--separator); }
.gallery-catalogue, .gallery-count { margin: 0; }
.gallery-catalogue { font-size: 15px; font-weight: 600; }
.gallery-count { font-family: var(--mono); font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.gallery-filter { display: grid; gap: 5px; font-size: 12px; color: var(--ink-2); }
.gallery-filter select { color: var(--ink); background: var(--page); border: 1px solid var(--separator); border-radius: 6px; padding: 10px 32px 10px 12px; font: 500 14px/1.25 var(--body); min-width: 210px; }
.gallery-works { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 44px 24px; list-style: none; margin: 0; padding: 0; }
.gallery-work { min-width: 0; }
.gallery-open { display: block; overflow: hidden; border-radius: 4px; aspect-ratio: 9 / 16; background: #F7F5F0; box-shadow: 0 3px 16px -8px #14161b44; cursor: zoom-in; }
.gallery-open img { width: 100%; height: 100%; object-fit: contain; transition: transform .25s ease; }
.gallery-rounded { border-radius: 4.5% / 2.53%; }
.gallery-open:hover img { transform: scale(1.015); }
.gallery-caption { padding-top: 14px; }
.gallery-caption h2 { font-family: var(--body); font-size: 16px; font-weight: 600; line-height: 1.35; letter-spacing: 0; }
.gallery-caption p { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.gallery-caption .gallery-byline { margin-top: 8px; font-size: 11px; font-family: var(--mono); }
.gallery-provenance { margin: 52px 0 0; font-size: 13px; color: var(--ink-2); }
.gallery-provenance a { text-underline-offset: 3px; }
.gallery-community { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; border-top: 1px solid var(--separator); margin-top: 72px; padding: 72px 0 96px; scroll-margin-top: 90px; }
.gallery-community h2 { max-width: 8em; font-size: clamp(36px, 4.3vw, 56px); }
.gallery-community p { margin: 0; color: var(--ink-2); font-size: 18px; }
.gallery-community .gallery-community-note { font-size: 14px; margin-top: 20px; }
.gallery-submission-status { display: inline-block; border-bottom: 1px solid var(--separator); padding: 24px 0 8px; color: var(--ink); font-size: 14px; }
.nav-links [aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
.gallery-skip { position: fixed; top: -100px; left: 16px; padding: 10px 16px; color: var(--on-action); background: var(--action); z-index: 30; }
.gallery-skip:focus { top: 12px; }
.gallery a:focus-visible, .gallery select:focus-visible, .gallery-dialog :focus-visible { outline: 2px solid var(--route); outline-offset: 5px; }
.gallery-modal-open { overflow: hidden; }
.gallery-dialog { width: min(1100px, calc(100vw - 64px)); max-width: none; height: min(900px, calc(100dvh - 64px)); max-height: none; padding: 0; border: none; border-radius: 10px; color: var(--ink); background: var(--page); overflow: hidden; }
.gallery-dialog[open] { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); }
.gallery-dialog::backdrop { background: #101115cc; backdrop-filter: blur(8px); }
.gallery-dialog-art { min-height: 0; padding: 28px; background: var(--panel); display: flex; justify-content: center; align-items: center; }
.gallery-dialog-art img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-dialog-detail { align-self: center; padding: 48px 32px; min-width: 0; }
.gallery-dialog-detail h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.12; }
.gallery-dialog-detail p { color: var(--ink-2); margin: 14px 0 0; font-size: 15px; }
#gallery-dialog-source { margin: 0 0 22px; font: 11px/1.6 var(--mono); }
.gallery-dialog-links { display: grid; gap: 8px; margin-top: 32px; font-size: 13px; text-underline-offset: 4px; }
.gallery-dialog-controls { display: flex; align-items: center; gap: 18px; margin-top: 40px; }
.gallery-dialog button { cursor: pointer; border: 1px solid var(--separator); color: var(--ink); background: var(--page); width: 44px; height: 44px; padding: 10px; border-radius: 50%; display: grid; place-items: center; }
.gallery-dialog button:hover { background: var(--panel); }
.gallery-dialog button:disabled { opacity: .35; cursor: default; }
.gallery-dialog svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.gallery-dialog-close { position: absolute; top: 14px; right: 14px; z-index: 1; }
#gallery-dialog-count { font: 12px/1 var(--mono); color: var(--ink-2); }
@media (max-width: 1000px) { .gallery-works { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .gallery-header { display: block; padding-bottom: 32px; }
  .gallery-header .lede { margin-top: 18px; font-size: 17px; }
  .gallery-works { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; }
  .gallery-filter select { min-width: 0; width: 160px; font-size: 13px; }
  .gallery-catalogue { font-size: 13px; }
  .gallery-caption h2 { font-size: 14px; }
  .gallery-caption p { font-size: 12px; }
  .gallery-caption .gallery-byline { font-size: 10px; }
  .gallery-community { grid-template-columns: 1fr; gap: 24px; padding: 48px 0 64px; }
  .gallery-community h2 { max-width: 10em; }
  .gallery-dialog { width: calc(100vw - 24px); height: calc(100dvh - 24px); border-radius: 8px; overflow-y: auto; }
  .gallery-dialog[open] { display: flex; flex-direction: column; }
  .gallery-dialog-art { min-height: 0; flex: 1 0 auto; height: calc(100dvh - 270px); padding: 20px 16px; }
  .gallery-dialog-detail { align-self: stretch; padding: 20px 24px 24px; position: relative; }
  .gallery-dialog-detail h2 { font-size: 25px; padding-right: 90px; }
  #gallery-dialog-source { display: none; }
  .gallery-dialog-detail p { margin-top: 5px; font-size: 13px; }
  .gallery-dialog-links { display: flex; gap: 20px; margin-top: 14px; font-size: 12px; }
  .gallery-dialog-controls { position: absolute; right: 16px; top: 18px; gap: 8px; margin: 0; }
  .gallery-dialog-controls button { width: 36px; height: 36px; padding: 7px; }
  #gallery-dialog-count { position: absolute; top: 47px; right: 0; width: 80px; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .gallery-open img { transition: none; } }
