.property-photo {
  display: block;
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background: #e7e3d8;
}
.property-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.property-photo > span {
  position: absolute;
  left: 20px;
  bottom: 20px;
  padding: 12px 16px;
  background: #fffefb;
  color: var(--ink);
  font-size: 13px;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.gallery-card {
  display: block;
  background: #fffefb;
  overflow: hidden;
}
.gallery-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: #e7e3d8;
  transition: filter .2s ease;
}
.gallery-card:hover img { filter: brightness(.9); }
.gallery-card span {
  display: block;
  padding: 13px 15px;
  font-size: 13px;
}
.gallery-more { margin-top: 28px; }
.gallery-more summary {
  width: fit-content;
  cursor: pointer;
  border: 1px solid #a78b57;
  padding: 12px 16px;
  font-size: 13px;
}
.gallery-more .photo-grid { margin-top: 24px; }
.gallery-more[open] .when-closed,
.gallery-more:not([open]) .when-open { display: none; }
.gallery-video { margin: 26px 0 0; font-size: 13px; }
.photo-viewer {
  box-sizing: border-box;
  width: min(1100px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: 16px;
  border: 1px solid #a78b57;
  background: #132d27;
  color: #fffefb;
}
.photo-viewer::backdrop { background: rgb(9 19 16 / 85%); }
.photo-viewer figure { margin: 0; }
.photo-viewer img {
  display: block;
  width: 100%;
  height: min(70vh, 720px);
  object-fit: contain;
}
.photo-viewer figcaption {
  padding: 12px 4px;
  text-align: center;
  font-size: 13px;
}
.viewer-close, .viewer-controls button {
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  border: 1px solid #a78b57;
  background: #132d27;
  color: #fffefb;
  font-size: 22px;
}
.viewer-close { display: block; margin: 0 0 8px auto; }
.viewer-controls { display: flex; justify-content: center; gap: 14px; }
@media (max-width: 760px) {
  .property-photo { min-height: 300px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .gallery-card span { font-size: 12px; padding: 10px; }
  .photo-viewer img { height: auto; max-height: 65vh; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-card img { transition: none; }
}

/* Give the first two photographs room to introduce the gallery. */
.gallery-section > .photo-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.gallery-section > .photo-grid .gallery-card { grid-column: span 3; }
.gallery-section > .photo-grid .gallery-card:nth-child(-n+2) { grid-column: span 6; }
.gallery-card span { border: 1px solid #e3dacc; border-top: 0; }
.gallery-more summary { background: #fffefb; }
.gallery-more summary:hover { background: #eae0cc; }
@media (max-width: 760px) {
  .gallery-section > .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-section > .photo-grid .gallery-card,
  .gallery-section > .photo-grid .gallery-card:nth-child(-n+2) { grid-column: auto; }
}
