.gallery-collections { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 1.25rem; margin: 1.25rem 0 2rem; }
.gallery-collection { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--card-shadow); }
.gallery-cover { display: block; background: var(--bg-soft); }
.gallery-cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.gallery-collection-copy { padding: 1rem 1.15rem; }
.gallery-collection-copy h3 { margin: 0 0 .4rem; font-size: 1.15rem; }
.gallery-collection-copy p { margin: .5rem 0 0; }
.gallery-count, .gallery-photo-date { color: var(--muted); font-size: .9rem; }
.gallery-credit { color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.photo-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 1.25rem; margin: 1.25rem 0 2rem; }
.gallery-photo { margin: 0; min-width: 0; scroll-margin-top: 1rem; }
.gallery-photo-link { display: block; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); }
.gallery-photo-link img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; }
.gallery-photo-link:hover { outline: 2px solid var(--gold); outline-offset: 3px; }
.gallery-expand { position: absolute; bottom: .5rem; right: .5rem; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: rgba(19, 37, 58, .85); color: white; font-size: 1.3rem; }
.gallery-photo .gallery-photo-title { margin: .7rem 0 .15rem; padding: 0; border: 0; font-size: 1rem; line-height: 1.4; display: block; }
.gallery-photo-title, .photo-viewer-caption h2 { background: none; }
.gallery-photo-date { margin: .15rem 0; }
.gallery-photo-details { margin-top: .5rem; font-size: .9rem; }
.gallery-photo-details summary { cursor: pointer; color: var(--accent); }
.gallery-enhanced .gallery-photo-details { display: none; }
.gallery-footnote { color: var(--muted); font-size: .8rem; }
.photo-viewer { width: min(1100px, calc(100vw - 2rem)); max-width: none; max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); padding: 0; border: 0; border-radius: var(--radius); background: #fff; color: var(--ink); box-shadow: 0 12px 80px rgba(0, 0, 0, .4); overscroll-behavior: contain; }
.photo-viewer::backdrop { background: rgba(9, 18, 30, .88); }
body.photo-viewer-open { overflow: hidden; }
.photo-viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 1rem; background: #172b43; color: #fff; position: sticky; top: 0; z-index: 1; }
.photo-viewer button { font: inherit; cursor: pointer; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--accent); padding: .5rem .8rem; min-height: 44px; }
.photo-viewer .photo-viewer-close { color: #fff; background: transparent; border-color: transparent; }
.photo-viewer-close span { margin-left: .5rem; font-size: 1.3rem; }
.photo-viewer-counter { font-size: .9rem; }
.photo-viewer-stage { background: #101a27; min-height: 160px; display: flex; align-items: center; justify-content: center; touch-action: pan-y pinch-zoom; }
.photo-viewer-image { display: block; width: auto; height: auto; max-width: 100%; max-height: 59vh; max-height: 59dvh; object-fit: contain; }
.photo-viewer-error { color: #fff; padding: 1rem; max-width: 35rem; }
.photo-viewer-navigation { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 1.25rem 0; }
.photo-viewer-caption { padding: .75rem 1.25rem 1.25rem; }
.photo-viewer-caption h2 { display: block; font-size: 1.2rem; padding: 0; border: 0; margin: 0 0 .25rem; }
.photo-viewer-description p { margin: .6rem 0; }
.photo-viewer-links { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; font-size: .85rem; margin-top: .9rem; }
.photo-viewer-share-status { color: var(--muted); }
.photo-viewer-share-status input { display: block; width: min(100%, 32rem); font: inherit; padding: .5rem; }
.photo-viewer button:hover { background: var(--bg-soft); color: var(--navy); }
.photo-viewer :focus-visible, .photo-gallery :focus-visible, .gallery-collections :focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.photo-viewer [hidden] { display: none !important; }
@media (max-width: 560px) {
  .photo-gallery { gap: 1.25rem .75rem; }
  .gallery-photo .gallery-photo-title { font-size: .9rem; }
  .gallery-photo-date { font-size: .8rem; }
  .photo-viewer { width: calc(100vw - 1rem); max-height: calc(100vh - 1rem); max-height: calc(100dvh - 1rem); }
  .photo-viewer-image { max-height: 48vh; max-height: 48dvh; }
  .photo-viewer-caption { padding: .75rem 1rem 1rem; }
  .photo-viewer-navigation { padding: .6rem 1rem 0; }
}
@media (max-width: 360px) { .photo-gallery { grid-template-columns: 1fr; } }
