.garden-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.7vw, 24px);
}

.garden-gallery-all .garden-photo-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.garden-photo {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--deep);
  position: relative;
}

.garden-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .28s ease;
}

.garden-photo:hover img { transform: scale(1.035); }
.garden-photo:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.garden-photo::after {
  content: '↗';
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  background: var(--deep);
  color: var(--cream);
  font-size: 17px;
}

.garden-gallery-all .garden-photo::after { content: none; }
.garden-gallery-more { margin-top: 24px; }
.garden-gallery-all { min-height: 100vh; background: var(--pistachio); }
.garden-gallery-all .section { padding-top: clamp(24px, 5vw, 72px); }
.garden-gallery-all .section-heading { align-items: end; }
.garden-gallery-back { margin-bottom: clamp(28px, 5vw, 56px); }
.garden-gallery-languages { display: flex; gap: 14px; }
.garden-gallery-languages [aria-current] { font-weight: bold; }

#photo-dialog {
  box-sizing: border-box;
  width: min(1120px, calc(100% - 20px));
  max-width: none;
  max-height: calc(100% - 20px);
  padding: 12px clamp(8px, 2vw, 24px);
  margin: auto;
  overflow: auto;
}

html:has(#photo-dialog[open]) { overflow: hidden; }

.gallery-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.gallery-viewer-bar output { font-size: 14px; font-variant-numeric: tabular-nums; }
.gallery-viewer-bar button {
  color: var(--cream);
  background: transparent;
  border: 1px solid #faf4e580;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  cursor: pointer;
}

.gallery-viewer-bar button:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
.gallery-viewer-step { font-size: 23px; }
.gallery-viewer-frame {
  display: grid;
  place-items: center;
  height: min(70dvh, 800px);
  margin-block: 10px;
  touch-action: pan-y pinch-zoom;
}

#photo-dialog .gallery-viewer-frame img {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

@media (max-width: 880px) {
  .garden-gallery-all .garden-photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .garden-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .garden-gallery-all .garden-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery-viewer-frame { height: 63dvh; }
}

@media (max-width: 360px) {
  .garden-gallery-all .garden-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .garden-photo img { transition: none; }
}
