.post-gallery { margin: 1rem 0; }
.photo-mosaic { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; overflow: hidden; border-radius: .35rem; background: #dce2d5; }
.photo-tile { position: relative; display: block; min-width: 0; min-height: 0; overflow: hidden; background: #dde3d9; color: white; }
.photo-mosaic > .photo-tile { grid-column: span 3; aspect-ratio: 1.35; }
.photo-mosaic[data-count="1"] > .photo-tile { grid-column: 1 / -1; aspect-ratio: 1.5; }
.photo-mosaic[data-count="3"] > .photo-tile:first-child { grid-row: span 2; aspect-ratio: auto; }
.photo-mosaic[data-count="5"] > .photo-tile:nth-child(n+3) { grid-column: span 2; aspect-ratio: 1; }
.photo-tile > img, .blog-preview .photo-tile > img { display: block; width: 100%; height: 100%; max-height: none; object-fit: cover; }
.photo-tile:hover > img { filter: brightness(.9); }
.photo-tile:focus-visible { outline: 3px solid #a3b18a; outline-offset: -3px; }
.photo-caption { position: absolute; inset: auto 0 0; padding: 1.4rem .65rem .5rem; background: linear-gradient(transparent, #10231dda); color: white; font-size: .85rem; line-height: 1.3; overflow-wrap: anywhere; }
.photo-more { position: absolute; inset: 0; display: grid; place-items: center; background: #10231d80; color: white; font: 2.5rem DynaPuff, sans-serif; }
.gallery-photo-count { margin: .5rem 0; font-size: .85rem; color: #52624f; }
.gallery-expanded > summary { cursor: pointer; padding: .6rem 0; font-weight: bold; }
.photo-all { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .4rem; }
.photo-all .photo-tile { aspect-ratio: 1; }

/* Shared album cards for the public gallery and webmaster picker. */
.gallery-albums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.archive-year .archive-year-toggle { display: flex; align-items: center; gap: .35rem; padding: .65rem; font-weight: bold; text-decoration: none; }
.archive-year-toggle[aria-expanded="true"] { background: #e0e7d8; }
.archive-year-toggle:focus-visible { outline: 2px solid var(--hunter-green); outline-offset: -2px; }
.album-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--fern); border-radius: .35rem; background: #f4f3ed; color: var(--pine-teal); text-decoration: none; box-shadow: 0 2px 5px #344e4118; }
.album-card:focus-visible { outline: 3px solid var(--hunter-green); outline-offset: 3px; }
.album-card:hover { background: #e8ebdf; }
.album-card-caption { padding: .8rem 1rem; overflow-wrap: anywhere; }
.album-card-caption h2 { margin: 0; font-size: 1rem; line-height: 1.5; }
.album-card-caption p { margin: .25rem 0 0; color: #52624f; font-size: .85rem; }
.album-card-status { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; font-size: .8rem; }
.album-empty { grid-column: 1 / -1; align-self: center; text-align: center; padding: 1rem; }
.album-thumbnail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 4px; width: 100%; aspect-ratio: 1; min-width: 0; padding: 5px; box-sizing: border-box; overflow: hidden; border-bottom: 1px solid var(--fern); background: linear-gradient(var(--dry-sage), var(--dust-grey)); }
.album-thumbnail-image { position: relative; display: block; min-width: 0; min-height: 0; overflow: hidden; border-radius: .15rem; background: var(--dry-sage); }
.album-thumbnail-image:only-child { grid-column: 1 / -1; }
.album-thumbnail-image > img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 180ms ease; }
.album-card:hover .album-thumbnail-image > img { transform: scale(1.045); }
.album-thumbnail .photo-more { font-size: clamp(1.25rem, 3vw, 2rem); background: #344e4199; }
.album-photos { display: grid; gap: 1.5rem; }
.album-photos figure { margin: 0; overflow: hidden; border: 1px solid var(--fern); border-radius: .3rem; background: #f4f3ed; }
.album-photo { display: block; cursor: zoom-in; background: var(--dry-sage); }
.album-photo img { display: block; width: 100%; height: auto; }
.album-photos figcaption { padding: 1rem; background: linear-gradient(var(--dust-grey), #f4f3ed); overflow-wrap: anywhere; }
.album-photos figcaption h2 { font-size: 1rem; line-height: 1.5; }
.album-photos figcaption p { margin-top: .4rem; white-space: pre-wrap; }
.gallery-lightbox { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: clamp(.5rem, 2vw, 1.5rem); box-sizing: border-box; border: 0; background: transparent; color: var(--pine-teal); }
.gallery-lightbox[open] { display: grid; place-items: center; }
.gallery-lightbox::backdrop { background: #1e322be8; }
.gallery-lightbox-panel { display: flex; flex-direction: column; width: min(100%, 72rem); max-height: 100%; min-height: 0; overflow: hidden; border: 1px solid var(--fern); border-radius: .5rem; background: linear-gradient(var(--dry-sage), var(--dust-grey)); box-shadow: 0 1rem 4rem #10231d66; }
.gallery-lightbox-toolbar { display: flex; align-items: center; justify-content: space-between; padding: .35rem .75rem; flex-shrink: 0; border-bottom: 1px solid var(--fern); }
.gallery-lightbox button { color: var(--pine-teal); cursor: pointer; border: 1px solid transparent; border-radius: 50%; font-family: inherit; }
.gallery-lightbox button:focus-visible { outline: 3px solid var(--hunter-green); outline-offset: -3px; }
.gallery-close { width: 44px; height: 44px; background: transparent; font-size: 2rem; line-height: 1; }
.gallery-close:hover { background: var(--dust-grey); }
.gallery-counter { font-variant-numeric: tabular-nums; padding: .4rem .75rem; background: #f4f3ed; border: 1px solid var(--fern); border-radius: 1rem; font-size: .9rem; }
/* Reserve the image area so photo dimensions and loading cannot resize the viewer. */
.gallery-stage { position: relative; display: grid; place-items: center; height: 65dvh; min-height: 5rem; flex: 0 1 auto; overflow: hidden; background: #243a30; touch-action: pan-y pinch-zoom; }
.gallery-stage > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-height: none; min-height: 0; object-fit: contain; color: var(--dust-grey); }
.gallery-arrow { position: absolute; z-index: 1; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; background: #f4f3ede8; font: 2rem/1 sans-serif !important; box-shadow: 0 2px 8px #10231d55; }
.gallery-arrow:hover { background: var(--dry-sage); }
.gallery-previous { left: .75rem; }
.gallery-next { right: .75rem; }
.gallery-lightbox-caption { padding: .65rem 1rem; max-height: 15dvh; flex-shrink: 0; overflow: auto; line-height: 1.5; overflow-wrap: anywhere; }
.gallery-lightbox-caption:empty { display: none; }
.gallery-lightbox-caption h2 { font-size: 1rem; }
.gallery-lightbox-caption p { white-space: pre-wrap; }
.gallery-dots { display: flex; justify-content: center; flex-wrap: wrap; padding: .25rem .5rem; max-height: 6rem; overflow: auto; flex-shrink: 0; border-top: 1px solid var(--fern); }
.gallery-dots button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; background: transparent; }
.gallery-dots button span { display: block; width: 8px; height: 8px; border: 1px solid var(--hunter-green); border-radius: 50%; }
.gallery-dots button[aria-current="true"] span { background: var(--hunter-green); box-shadow: 0 0 0 3px #344e4126; }
@media (max-width: 32rem) {
  .gallery-albums { gap: .65rem; }
  .album-thumbnail { padding: 3px; gap: 3px; }
  .gallery-stage { height: 60dvh; }
  .gallery-previous { left: .35rem; }
  .gallery-next { right: .35rem; }
}
@media (prefers-reduced-motion: reduce) {
  .album-thumbnail-image > img { transition: none; }
}
