/* Museum collections use the existing page container and brand palette. */
.wdm-gallery { margin-block: 1rem 2rem; scroll-margin-top: 165px; }
.wdm-gallery-categories { display: flex; flex-wrap: wrap; gap: .65rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--wdm-border); }
.wdm-gallery-categories a { display: inline-flex; align-items: center; min-height: 48px; padding: .65rem 1rem; border: 1px solid var(--wdm-slate); background: var(--wdm-white); color: var(--wdm-slate); text-decoration: none; line-height: 1.4; }
.wdm-gallery-categories a:hover, .wdm-gallery-categories a[aria-current] { background: var(--wdm-slate); color: var(--wdm-white); box-shadow: inset 0 -3px var(--wdm-gold); }
.wdm-gallery-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1.5rem; margin-block: 1.75rem 1rem; }
.wdm-gallery-heading h2, .wdm-gallery-heading p { margin: 0; }
.wdm-gallery-heading p { font-size: .9rem; }
.entry-content .wdm-gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; margin: 0; padding: 0; list-style: none; }
.wdm-gallery-grid li { min-width: 0; }
.wdm-gallery-photo { position: relative; display: block; background: var(--wdm-paper); }
.wdm-gallery-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; }
.wdm-gallery-enlarge { position: absolute; right: .5rem; bottom: .5rem; padding: .25rem .6rem; background: var(--wdm-slate); color: var(--wdm-white); font-size: .75rem; line-height: 1.5; }
.wdm-gallery-photo:hover .wdm-gallery-enlarge { background: var(--wdm-ink); }
.wdm-gallery-grid figcaption { margin-top: .6rem; overflow-wrap: anywhere; font-size: .9rem; }
.wdm-gallery-viewer { width: min(1100px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 4rem 1rem 1rem; border: 0; background: var(--wdm-ink); color: var(--wdm-white); overflow: auto; }
.wdm-gallery-viewer::backdrop { background: rgb(15 18 21 / .9); }
.wdm-gallery-viewer figure { margin: 0; }
.wdm-gallery-viewer img { display: block; width: 100%; height: min(70dvh, 760px); object-fit: contain; }
.wdm-gallery-viewer figcaption { margin: .75rem 0 0; text-align: center; }
.wdm-gallery-viewer-controls { position: absolute; top: .5rem; left: .75rem; right: .75rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.wdm-gallery-viewer button { min-width: 44px; min-height: 44px; padding: .4rem .75rem; border: 1px solid var(--wdm-border); background: var(--wdm-slate); color: var(--wdm-white); line-height: 1.2; }
.wdm-gallery-viewer-count { margin-right: auto; font-size: .85rem; }
.wdm-gallery-viewer-status { position: absolute; top: 45%; left: 1rem; right: 1rem; padding: .75rem; background: var(--wdm-ink); text-align: center; }
.wdm-gallery-modal-open { overflow: hidden; }
@media (max-width: 900px) { .entry-content .wdm-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; } }
@media (max-width: 600px) {
  .entry-content .wdm-gallery-grid { grid-template-columns: minmax(0, 1fr); }
  .wdm-gallery-categories { display: grid; }
  .wdm-gallery-categories a { justify-content: center; }
  .wdm-gallery-heading h2 { font-size: 1.6rem; }
  .wdm-gallery-viewer { padding-inline: .5rem; }
  .wdm-gallery-viewer button { padding-inline: .5rem; font-size: .85rem; }
  .wdm-gallery-viewer-count { font-size: .75rem; }
}
