.gallery-page { background: #f8f4ec; }
.paintings-hero { background: #ece6d9; padding-block: clamp(3rem, 7vw, 6rem); border-bottom: 1px solid #d8cfbc; }
.paintings-hero > div { max-width: 900px; margin-inline: auto; text-align: center; }
.paintings-hero h1 { font-family: Georgia, serif; font-weight: 400; font-size: clamp(3.5rem, 8vw, 6.5rem); line-height: 1.1; margin: .7rem 0 1rem; }
.paintings-hero p:last-of-type { max-width: 590px; margin-inline: auto; }
.gallery-signature { display: block; margin-top: 1.4rem; font-family: Georgia, serif; font-style: italic; color: var(--green-dark); }
.gallery-tools { max-width: 1500px; margin: auto; padding-top: 2.5rem; padding-bottom: 0; }
.gallery-toolbar { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.gallery-toolbar h2, .gallery-closing h2 { font: 400 2rem/1.2 Georgia, serif; margin: 0; }
.gallery-toolbar p, .gallery-hint { color: var(--muted); font-size: .9rem; }
.gallery-filters { display: flex; flex-wrap: wrap; gap: .6rem; margin-block: 1rem; }
.gallery-filters button { font: inherit; padding: .65rem 1rem; border: 1px solid #cfc5b2; border-radius: 4px; background: transparent; color: var(--ink); cursor: pointer; }
.gallery-filters button[aria-pressed="true"], .gallery-filters button:hover { background: var(--green-dark); color: white; border-color: var(--green-dark); }
.gallery-page .paintings-gallery { max-width: 1500px; margin: auto; padding-top: 1.3rem; gap: 2.5rem 1.6rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery-page .painting-card { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.gallery-page .painting-card[hidden], [hidden] { display: none !important; }
.gallery-page .painting-card a { display: grid; place-items: center; aspect-ratio: 1; background: #e8e1d4; overflow: hidden; }
.gallery-page .painting-card img { width: 100%; height: 100%; min-height: 0; object-fit: contain; transition: transform .25s; }
.gallery-page .painting-card a:hover img { transform: scale(1.025); }
.gallery-page .painting-card div { padding: 1rem 0 0; }
.gallery-page .painting-card h2 { font: 400 1.65rem/1.25 Georgia, serif; margin: .35rem 0 .55rem; }
.gallery-page .painting-card .eyebrow { font-size: .72rem; color: var(--green-dark); }
.gallery-page .painting-note { font-size: .83rem; }
.gallery-closing { text-align: center; border-top: 1px solid var(--line); }
.gallery-closing a { display: inline-block; margin-top: .75rem; font-weight: 600; }
.painting-viewer { width: min(1050px, calc(100% - 2rem)); max-height: 94dvh; padding: 1.2rem; border: 1px solid #d8cfbc; background: #faf6ee; color: var(--ink); overscroll-behavior: contain; }
.painting-viewer::backdrop { background: #121a18e8; }
.viewer-close { display: block; margin-left: auto; margin-bottom: .7rem; }
.painting-viewer button { min-height: 44px; padding: .5rem 1rem; border: 1px solid #bcb29f; background: transparent; color: var(--green-dark); font: inherit; cursor: pointer; }
.viewer-art { background: #e8e1d4; }
.viewer-art img { width: 100%; height: min(57dvh, 620px); object-fit: contain; }
.viewer-details { padding-block: .8rem; }
.viewer-details h2 { margin: .25rem 0; font: 400 1.8rem/1.2 Georgia, serif; }
.viewer-details p { margin: .3rem 0; }
#viewer-position, #viewer-credit { font-size: .85rem; color: var(--muted); }
.viewer-navigation { display: flex; justify-content: space-between; gap: 1rem; }
.gallery-page :focus-visible { outline: 3px solid #a64d35; outline-offset: 4px; }
@media (max-width: 1000px) { .gallery-page .paintings-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .gallery-page .paintings-gallery { grid-template-columns: 1fr; } .gallery-filters { gap: .45rem; } .gallery-filters button { font-size: .85rem; padding: .55rem .7rem; } .painting-viewer { padding: .8rem; } }
@media (prefers-reduced-motion: reduce) { .gallery-page .painting-card img { transition: none; } }

/* Match the display footprint of paintings with frames embedded in their photos.
   The supplied artwork stays intact; these frames are rendered by the page. */
.gallery-page .supplied-painting a { padding: 0; }
.gallery-page .supplied-painting img,
.viewer-art.supplied-painting img {
  box-sizing: border-box;
  width: 92%;
  height: auto;
  max-height: 92%;
  padding: clamp(14px, 1.6vw, 22px);
  background: #171715;
  border: 1px solid #aa9159;
  box-shadow: inset 0 0 0 5px #26241f, inset 0 0 0 6px #8b7547, 0 5px 12px #241f1929;
  object-fit: contain;
}
.viewer-art.supplied-painting {
  display: grid;
  place-items: center;
  height: min(57dvh, 620px);
  background: #e8e1d4;
}
.viewer-art.supplied-painting img {
  width: auto;
  max-width: 92%;
  max-height: min(calc(57dvh - 32px), 588px);
}
