.photo-gallery-section { position: relative; z-index: 2; padding: 10px 4.5vw clamp(44px, 5vw, 80px); background: #f8eddb; color: #40523b; scroll-margin-top: var(--site-header-clearance, 128px); }
.photo-gallery-grid { column-count: 4; column-gap: clamp(10px, 1vw, 18px); max-width: 1680px; margin-inline: auto; }
.photo-gallery-item { position: relative; display: block; break-inside: avoid; margin-bottom: clamp(10px, 1vw, 18px); overflow: hidden; background: #e6d8bf; outline-offset: 4px; }
.photo-gallery-item img { display: block; width: 100%; height: auto; transition: transform .65s cubic-bezier(.2,.7,.2,1); }
.photo-gallery-item:is(:hover,:focus-visible) img { transform: scale(1.025); }
.photo-gallery-item:focus-visible { outline: 3px solid #716332; }
.gallery-viewer { display: none; width: min(96vw, 1600px); max-width: 96vw; height: min(94dvh, 1100px); max-height: 94dvh; margin: auto; padding: 14px 24px 18px; border: 1px solid #ead5a650; background: #11271e; color: #fff6e5; box-shadow: 0 24px 90px #0006; overflow: hidden; }
.gallery-viewer[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; gap: 12px; }
.gallery-viewer::backdrop { background: #0a1814eb; }
.gallery-viewer-toolbar { display: flex; justify-content: space-between; align-items: center; min-width: 0; gap: 20px; }
.gallery-viewer-count { font: 400 1rem/1.4 "Segoe UI", Arial, sans-serif; font-variant-numeric: tabular-nums; }
.gallery-viewer button { min-width: 64px; min-height: 44px; padding: 8px 12px; border: 1px solid #fff6e540; border-radius: 2px; background: transparent; color: inherit; font: 400 1rem/1.4 "Segoe UI", Arial, sans-serif; cursor: pointer; }
.gallery-viewer button:is(:hover,:focus-visible) { background: #fff6e514; }
.gallery-viewer button:focus-visible { outline: 2px solid #e6c17c; outline-offset: 3px; }
.gallery-viewer .gallery-viewer-close { display: inline-flex; align-items: center; gap: 10px; border-color: transparent; }
.gallery-viewer-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.gallery-photo-stage { display: grid; place-items: center; width: 100%; height: 100%; min-width: 0; min-height: 0; margin: 0; overflow: hidden; }
.gallery-full-image { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.gallery-viewer-footer { display: grid; grid-template-columns: auto minmax(0,1fr) auto; grid-template-areas: "previous caption next"; align-items: center; gap: 24px; }
.gallery-previous { grid-area: previous; }
.gallery-next { grid-area: next; }
#gallery-photo-caption { grid-area: caption; margin: 0; font: 400 1rem/1.45 "Segoe UI", Arial, sans-serif; text-align: center; }
html.gallery-is-open { overflow: hidden !important; scrollbar-gutter: stable; }
@media (max-width: 1000px) { .photo-gallery-grid { column-count: 3; } }
@media (max-width: 540px) {
  .photo-gallery-section { padding: 8px 16px 40px; }
  .photo-gallery-grid { column-count: 2; column-gap: 10px; }
  .photo-gallery-item { margin-bottom: 10px; }
  .gallery-viewer { width: calc(100vw - 16px); max-width: calc(100vw - 16px); height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); padding: 8px 12px 12px; }
  .gallery-viewer[open] { gap: 8px; }
  .gallery-viewer-footer { grid-template-columns: 1fr 1fr; grid-template-areas: "caption caption" "previous next"; gap: 10px 18px; }
  .gallery-previous { justify-self: start; }
  .gallery-next { justify-self: end; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .gallery-viewer { padding: 4px 18px 8px; height: 96dvh; max-height: 96dvh; }
  .gallery-viewer[open] { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { .photo-gallery-item img { transition: none; } .photo-gallery-item:is(:hover,:focus-visible) img { transform: none; } }
