.photo-grid {
  columns: 4;
  column-gap: 24px;
  padding-bottom: 40px;
}
.photo-grid figure {
  margin-bottom: 24px;
}
.photo-grid img {
  width: auto;
  max-width: min(100%, 240px);
  max-height: 240px;
  margin-inline: auto;
}
.photo-grid figcaption {
  flex-wrap: wrap;
  gap: 4px 12px;
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  .photo-grid {
    columns: 3;
  }
}
@media (max-width: 600px) {
  .photo-grid {
    columns: 2;
    column-gap: 16px;
  }
}
.photo-grid [data-photo] {
  display: block;
  cursor: zoom-in;
}
.photo-location {
  display: block;
}
.photo-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
html.photo-viewer-open {
  overflow: hidden;
}
.photo-viewer {
  width: min(1200px, calc(100% - 24px));
  height: calc(100vh - 24px);
  height: calc(100dvh - 24px);
  max-width: none;
  max-height: none;
  padding: 16px;
  border: 0;
  border-radius: 12px;
  background: #1c1b1a;
  color: #f7f4ef;
}
.photo-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
}
.photo-viewer::backdrop {
  background: rgb(0 0 0 / 82%);
}
.viewer-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.viewer-counter {
  margin-right: auto;
  font-size: 14px;
  color: #d3cec6;
}
.viewer-toolbar button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #59554f;
  border-radius: 8px;
  padding: 8px 12px;
  background: #302d29;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.viewer-toolbar button:hover {
  background: #4a423b;
}
.viewer-toolbar button:focus-visible {
  outline: 2px solid #e2c8aa;
  outline-offset: 2px;
}
.viewer-toolbar button:disabled {
  opacity: 0.35;
  cursor: default;
}
.viewer-stage {
  position: relative;
  min-height: 0;
}
.viewer-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.viewer-status {
  position: absolute;
  inset: 50% 12px auto;
  margin: 0;
  text-align: center;
  pointer-events: none;
}
.viewer-details {
  max-height: 25vh;
  overflow: auto;
  overflow-wrap: anywhere;
}
.viewer-details:empty,
.viewer-details [hidden] {
  display: none;
}
.viewer-caption {
  font-size: 18px;
  margin: 0 0 6px;
}
.viewer-meta {
  font-size: 12px;
  color: #c1bbb2;
  margin: 0;
}
.viewer-note {
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  margin: 8px 0 0;
}
@media (max-width: 600px) {
  .photo-viewer {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: 12px;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    border-radius: 0;
  }
}
